Construct: plane through an axis and a point (#10178) (#10472)

* claim: #10178

* feat: add plane through axis and point (#10178)
This commit is contained in:
PapaEcho
2026-11-01 09:15:25 +00:00
committed by GitHub
parent f25a8e6abc
commit ce72abacf9
24 changed files with 361 additions and 16 deletions
+15 -1
View File
@@ -404,7 +404,7 @@ impl Nested {
});
if outer {
let inner = if id == "timeline.redefine" { None } else { Some(id) };
MAPPED.with(|m| m.set(inner.is_none_or(|i| !table(i).is_empty())));
MAPPED.with(|m| m.set(inner.is_none_or(|i| !table(i).is_empty() || i == "construct.plane.axis_point")));
}
(Nested, outer)
}
@@ -487,6 +487,20 @@ pub fn to_local(s: &Session, id: &str, params: &Value) -> Option<Value> {
{
return None;
}
if id == "construct.plane.axis_point" && placed(s) {
// Construction references include tagged saved forms as well as pick wrappers.
// Map the parsed definition once at the boundary, including a nested Edit Feature.
// The constructor can then name local model picks and retain their exact references.
let mut kind = crate::cmd::plane_axis_point_kind(s, params).ok()?;
kind.transform_geometry(&mat_inverse(&s.active_component_frame())?);
let solidcraft_doc::FeatureKind::ConstructionPlane { plane: solidcraft_doc::PlaneRef::AxisPoint { axis, point } } = kind else {
return None;
};
let mut out = params.clone();
out["axis"] = serde_json::to_value(axis).ok()?;
out["point"] = serde_json::to_value(point).ok()?;
return Some(out);
}
let keys = table(id);
if keys.is_empty() || !placed(s) {
return None;