Fillets and chamfers keep their edges through upstream edits: each picked edge remembers its direction and its body's bounding box when picked (Feature.edge_refs, set by the commands and by timeline.edit); a reference point that is off every edge after an edit is carried to the same place in the body as it is now and kept when an edge running the same way is there (QA s06: a fillet on the right top edge follows the edge when the sketch widens); otherwise the nearest edge with a warning as before
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
5b9749aad6
commit
99385b1e31
7 files changed
+113
-8
No files matched your search
@@ -182,6 +182,15 @@ fn edit_feature(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
{
|
||||
return Err(bad(cmd, "edit sketch geometry with the sketch commands"));
|
||||
}
|
||||
// New edges for a blend: remember where they sit now (in the model before the feature).
|
||||
if let (
|
||||
FeatureKind::Fillet { edges: a, body, .. } | FeatureKind::Chamfer { edges: a, body, .. },
|
||||
FeatureKind::Fillet { edges: b, .. } | FeatureKind::Chamfer { edges: b, .. },
|
||||
) = (&nf.kind, &f.kind)
|
||||
&& a != b
|
||||
{
|
||||
nf.edge_refs = solvecraft_doc::edge_refs(&s.model.state_before(id), body, a);
|
||||
}
|
||||
if let Some(slot) = s.doc_mut().feature_mut(id) {
|
||||
*slot = nf;
|
||||
}
|
||||
|
||||
@@ -243,7 +243,19 @@ pub(super) fn add_feature(s: &mut Session, p: &Value, kind: FeatureKind) -> Resu
|
||||
// Commands speak world coordinates; the feature is authored in the active component.
|
||||
let mut kind = kind;
|
||||
super::component::to_active_frame(s, &mut kind);
|
||||
// Blends remember where their edges sat, to find them again after upstream edits.
|
||||
let refs = match &kind {
|
||||
FeatureKind::Fillet { edges, body, .. } | FeatureKind::Chamfer { edges, body, .. } => {
|
||||
solvecraft_doc::edge_refs(&s.model.state(), body, edges)
|
||||
}
|
||||
_ => Vec::new(),
|
||||
};
|
||||
let id = s.doc_mut().add_feature(kind, name)?;
|
||||
if !refs.is_empty()
|
||||
&& let Some(f) = s.doc_mut().feature_mut(id)
|
||||
{
|
||||
f.edge_refs = refs;
|
||||
}
|
||||
s.doc_mut().name_feature_inputs(id);
|
||||
let comp = s.active_component;
|
||||
if comp != 0
|
||||
|
||||
Reference in new issue
Block a user