Sketch: an included 3D edge keeps its exact curve from the moment it is linked

Linking a reference (sketch.include_3d, project, intersect) stored the link's wires as points
only: add_link_unless_present called add_link_with_wires and dropped the resolution's exact
curves, which only the next refresh of the sketch filled in (doc::project, since 7952516eb).
So an included box edge had no exact line until any edit refreshed it, and the wire changed
under an unrelated sketch edit. The exact curves are now set with the wires when the link is
made, as a refresh sets them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jyviko
2026-10-28 22:22:03 -04:00
committed by Irakli Kourtis
parent 7b984936a9
commit a312721948
+3
View File
@@ -270,6 +270,9 @@ fn add_link_unless_present(
// The link is the edge that was picked, not whichever is nearest the picked point later.
let edge_name = solidcraft_doc::project::resolved_edge_name(&st, &r);
let link = sk.add_link_with_wires(kind, r.source, &r.geom, &r.wires)?;
// The wires' exact curves, as a refresh of the link gives them (an included edge's record
// curve): a link made now is the one its sketch would resolve.
sk.set_link_wire_curves(&link, &r.exact)?;
if let Some(l) = sk.links.iter_mut().find(|l| l.id == link) {
l.face_name = name;
l.edge_name = edge_name;