mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-18 14:32:36 +00:00
Adds CadFeatureType::Mirror: reflect a target body about a plane using gp_Trsf::SetMirror + BRepBuilderAPI_Transform. BooleanMode::New keeps the mirrored copy as its own body (mirror_keep_original decides whether the source survives); BooleanMode::Add fuses it back into the source, so an overlapping mirror does not double-count volume. Serialization: mirror_keep_original is appended at the very end of both CadFeature::save and load (append-only contract). The mirror plane reuses the existing `plane` member and the body selector reuses `target_body`, as Cut already does. Golden fixture regenerated at the current SNAPORCA_CAD_RECIPE_VERSION = 2; the existing field-value assertions all still pass unchanged, and the reorder tripwire was re-verified after regeneration (swapping draft_face/draft_angle in `load` alone still fails the golden test). Tests assert analytic values: mirrored volumes equal (8000 each) with the reflected centroid, Add on a non-overlapping asymmetric body gives exactly 2x volume, Add across an intersecting plane gives strictly less than 2x, and an invalid body index fails cleanly with a non-empty error. MCP: `mirror` method registered in describe_tools(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVzKmX6Y1aEteit1HTXG4Q