Add persistent sketch-constraint system (ocs_gcs port) and named-parameters handoff docs

Ports FreeCAD's planegcs 2D geometric constraint solver to Rust as a new
crates/ocs_gcs workspace member, and wires it into the document/scene model
as a persistent SketchConstraintSet: Coincident, Horizontal/Vertical,
Parallel/Perpendicular, Equal, Tangent, Distance, Angle and Radius
constraints that re-solve live (including mid-drag, not just on release),
render glyphs and a DOF badge, flag conflicts with a one-click resolver
pill, and round-trip through save/load via an XRecord blob.

Also includes docs/command_reference.md (a statically generated reference
of every registered command and its prompt sequence) and
docs/named_parameters_design.md + docs/backlog.md, which hand off the next
queued feature (a named-parameter/expression table) and consolidate every
deliberate scope-down and open gap found along the way, so a fresh session
has a complete starting point.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Felix RiestraandClaude Sonnet 5 committed 2026-09-08 22:19:23 +02:00
1 parent a39c7b8f71
commit 63a74b19a9
63 files changed
+12193 -49

No files matched your search

+29
View File
@@ -1317,6 +1317,35 @@ pub enum CmdResult {
ReplaceMany(Vec<(Handle, Vec<EntityType>)>, Vec<EntityType>),
/// Replace several entities as one undo step while keeping the command active.
ReplaceManyContinue(Vec<(Handle, Vec<EntityType>)>),
/// Add a persistent parametric constraint (`docs/parametric_system_design.md`
/// §6.1) to the current scope's `SketchConstraintSet` and trigger its
/// first solve; end the command. Unlike `ReplaceMany`/`CommitEntity`,
/// nothing here is geometry to add or replace directly — the host adds
/// the constraint record, then re-solves through `Scene::bump_entities`'s
/// existing chain (`refresh_sketch_constraints`) the same way any later
/// edit to these entities will.
AddSketchConstraint {
kind: crate::scene::sketch_constraints::ConstraintKind,
refs: Vec<crate::scene::sketch_constraints::SketchRef>,
/// The typed target for a dimensional kind (Distance/Angle/Radius);
/// `None` for a purely geometric one.
driving_param: Option<f64>,
/// Undo-history label, e.g. `"Horizontal constraint"`.
label: &'static str,
},
/// Add a persistent Coincident constraint between whatever sub-entity
/// point resolves nearest each picked point (design doc §6.1/§6.2's
/// manual Coincident UI — `CoincidentConstraintCommand`,
/// `src/modules/draw/constrain/coincident.rs`). Like
/// `ReassociateCenterMark`, a `CadCommand` has no document access to
/// resolve a marker itself, so it hands the two raw points back for the
/// host to resolve (`sketch_constraints::nearest_sketch_point`) and, if
/// both land near a real point, build an `AddSketchConstraint` from.
AddCoincidentConstraint {
point_a: DVec3,
point_b: DVec3,
label: &'static str,
},
/// Attach one smart centre mark to a newly selected circular source.
ReassociateCenterMark {
target: Handle,