mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-18 22:42:37 +00:00
Adds CadFeatureType::Axis and ::CoordSys — reference geometry that produces no solid, modelled on the existing Plane datum feature. Axis construction methods (AxisType): TwoPoints, FaceNormal, CylinderCenterline, PlaneIntersection, AlongEdge. The centreline case is the useful one: it gives a real axis through an existing hole or boss. Coordinate systems (CoordSysType): PointWorld and FaceAndDirection. The latter Gram-Schmidts the picked references, so the stored frame is orthonormal even when the user's X hint is not perpendicular to the face normal; the third axis is derived by cross product rather than stored, so it cannot drift out of sync. Revolve and pattern are deliberately NOT rewired to consume these — this commit adds the reference geometry only and changes no existing behaviour. Serialization: all axis_*/coordsys_* fields appended at the very end of both CadFeature::save and load, identical order, after mirror_keep_original. SNAPORCA_CAD_RECIPE_VERSION stays 2; Axis and CoordSys are appended to the end of CadFeatureType so existing type ordinals are unchanged. Golden fixture regenerated with distinctive non-default literals and field-value assertions for every new field; all pre-existing assertions pass unchanged. Tests assert analytic values: two-point axis direction exactly +Z with unit length, cylinder centreline collinear with Z and on the true axis, parallel planes fail cleanly, and the Gram-Schmidt frame is orthonormal to 1e-9 with X x Y == Z. Degenerate input (identical points) fails with a non-empty error rather than producing NaNs. MCP: `axis` and `coordsys` methods registered in describe_tools(). Ported from snaporca 242d4efecb. The golden fixture is copied rather than regenerated because this fork cannot be compiled locally (Eigen 5.0.1 vs the build image's 3.3); make_golden_doc_v1() is byte-identical across both forks, so the two fixtures are provably the same blob. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVzKmX6Y1aEteit1HTXG4Q