Expand description
Project solid edges into a sketch as fixed construction references.
Projected polylines become lines, circles, arcs, or line-chain fallbacks. Ground constraints pin the generated points. Edge names identify persisted references, so picking an edge again updates its coordinates in place.
The sketch feature’s projectedEdges list is the ONE record of which edges
a sketch links: an edge picked inside the editor is written into that list
on Finish, and an edge put into the list from the feature dialog is
materialized here on the next enter, through the same classifier. The
persistentData.externalRefs entries only remember which points and
geometry each listed edge became. When a listed edge stops resolving (its
feature was deleted, or a regeneration lost the edge) the link is RELEASED:
the geometry stays in the sketch as ordinary fixed construction geometry
(release_ref), the entry and the list item go.
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.
Constants§
- LINKS_
LISTED_ KEY - The
persistentDatakey a unified commit stamps: once it is set, theprojectedEdgeslist and theexternalRefsentries describe the SAME set of edges, so an entry whose edge the dialog no longer lists was removed by the user. A document without it predates the unification: its entries were never listed, so they are adopted into the list, never released.
Functions§
- add_
copied_ edge - Materialize an
EdgeLinkas PLAIN sketch geometry, a copy that nothing keeps up to date: free points (not fixed, construction or external), no grounds, and each geometry carryingnote. A copied end that lands on a plain point already in the sketch (within1e-6·extent) reuses it, so the edges of one loop, copied one by one, join into a closed profile. Returns the geometry ids. - 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: - ensure_
origin_ point - Ensure the sketch carries the PART ORIGIN reference point: world
(0, 0, 0)projected ontoplane, under the reserved idbrep_kernel::SKETCH_ORIGIN_POINT_ID, flagged fixed + construction + external reference, with one⏚ground (reserved id too). Adds it when missing and re-projects it when the plane moved. It is something to constrain to inside the sketch only — the kernel never publishes it. Returns whether the doc changed. - is_
origin_ id - Whether
idnames the reserved part-origin point (or its ground). - link_
or_ update - Link (or update) a picked scene edge into the sketch as an external reference.
- listed_
edge_ names - The
projectedEdgeslist a Finish writes: every name the feature listed before, in its order, minus the ones whose link the session dropped (deleted in the editor, or released), plus every live link the list did not name yet.kept_unlinkedare listed names that had nothing to materialize at enter (the edge did not resolve in the backdrop) — they stay listed for the kernel to report. - 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. - prune_
dead_ refs - Drop every external-reference entry whose materialized entities no longer resolve
in
doc— i.e. the linked edge’s points / geometry were deleted. A dropped entry frees itsedge_nameso the SAME edge can be RE-LINKED: without this, the stale entry (keyed byedge_name, holding now-danglingpoint_ids) makeslink_or_update’s dedup take the “structure matches” branch, find every point missing (doc.point_mut→None), and returnfalse— permanently blocking the re-link. Called both after a delete AND on sketch-enter (to heal docs already poisoned by that pre-fix delete). Returns whether any entry was pruned. - release_
ref - Release a linked edge whose source edge is gone: its materialized points stay
where they are,
fixedand grounded (⏚), but stop being external references, so the line / arc / circle becomes an ordinary sketch entity the user owns. It stays CONSTRUCTION: flipping that on a feature deletion would add profile edges and change what a downstream extrude builds. Returns whether any point changed (falsewhen the entry’s points are all gone). - release_
ref_ json release_refon the persisted JSON doc (persistentData.sketch), for the regenerate-time fold that cannot go through the editor: every point the entry materialized losesexternalReferenceand keeps (or regains)fixed; nothing else in the doc is touched, so the fold is lossless. Returns whether any point changed.