Expand description
External-reference edges (S6b-2) — link a picked 3D solid edge into the sketch as a construction reference.
The pickEdges tool projects a scene edge’s world-space polyline into the active
sketch plane, classifies the projected shape (straight → line, a fitted
circle → circle/arc, else a faithful line-chain fallback), and materializes
it as external-reference geometry: {fixed, construction, externalReference}
points, a ⏚ GROUND constraint per point (so the solver pins them), and the
construction geometry referencing them. A per-session ExternalRef mapping
(keyed by edge name) dedups a re-pick — the SAME edge UPDATES its points’
coordinates instead of duplicating — and round-trips through
persistentData.externalRefs.
This mirrors #ensureExternalRefForEdge/#projectWorldToUV,
extended to also emit the reference GEOMETRY (the previous version stored only the two
endpoints) so the linked edge is visible and constrainable in the sketch.
Structs§
- External
Ref - A per-session external-reference mapping: the linked scene edge (by name + owning
solid) and the sketch entities materialized for it. Persisted to / loaded from
persistentData.externalRefsso a linked edge round-trips a commit + re-enter.
Enums§
- Edge
Link - The classification of a projected edge polyline, in plane
(u, v)coordinates.
Functions§
- add_
external_ ref - Materialize an
EdgeLinkinto the doc: push external-ref points (fixed,construction,externalReference) with a⏚ground each, then the construction geometry referencing them. Returns(point_ids, geom_ids). - classify_
uv - Classify a projected polyline (in plane
(u, v)) as a straight line, a circle / arc, or a polyline fallback. Tolerances are RELATIVE to the polyline’s extent so the same thresholds work at any sketch scale: - link_
or_ update - Link (or update) a picked scene edge into the sketch as an external reference.
- project_
polyline - Project a world-space polyline into the plane’s
(u, v)frame (orthogonal projection; the off-plane component is dropped). Mirrors the previous world→UV projection applied per vertex.