feat(block-editor): wire Rotation, Alignment and Flip parameter placement

Enable the existing palette rows and BPARAMETER choices. Rotation accepts a
center, picked or numeric radius, and picked or numeric default angle.
Alignment places a tangent direction from its base point. Flip places a
reflection line and state label, with native grip and state expressions.

Extend shared graph append/capacity checks for Flip's additional state node
while preserving existing subgraphs. Keep Polar/Rotation angle labels unique
in either placement order. Add editor graphics, extents and definition
reframing through the existing overlay/history/save paths.

This milestone implements native parameter placement and persistence.
Rotate/Flip action association, reference alignment/grip editing, parameter
property editing and parameter sets remain separate work.

Validation covers command and palette placement, cancellation, local/parent
undo, save/discard, native DWG/DXF objects, existing graph preservation and
the 17 research fixtures. Broader block/dock regressions and editor renders
are also checked.
This commit is contained in:
Karim Jerbi committed 2026-10-15 16:50:47 +01:00
1 parent 6dab5a7229
commit 72c762e944
19 files changed
+1483 -25

No files matched your search

+26 -3
View File
@@ -1083,7 +1083,26 @@ bg={bg_ms:.1}ms n={view_count}"
session.br_handle,
)
.iter()
.filter_map(|parameter| {
.map(|p| {
(
crate::scene::block_distance_parameter::graphic(p),
p.native.definition_base_point,
)
})
.chain(
crate::scene::block_orientation_parameter::parameters(
&tab.scene.document,
session.br_handle,
)
.iter()
.map(|p| {
(
crate::scene::block_orientation_parameter::graphic(p),
crate::scene::block_orientation_parameter::marker_tail(p),
)
}),
)
.filter_map(|(graphic, marker_tail)| {
let project = |p: codec::types::Vector3| {
let p = tab
.scene
@@ -1093,7 +1112,6 @@ bg={bg_ms:.1}ms n={view_count}"
(p.x.is_finite() && p.y.is_finite())
.then_some(iced::Point::new(vp_bounds.x + p.x, vp_bounds.y + p.y))
};
let graphic = crate::scene::block_distance_parameter::graphic(parameter);
let lines = graphic
.lines
.into_iter()
@@ -1111,7 +1129,7 @@ bg={bg_ms:.1}ms n={view_count}"
Some((
project(point)?,
if oriented {
Some(project(parameter.native.definition_base_point)?)
Some(project(marker_tail)?)
} else {
None
},
@@ -1120,6 +1138,11 @@ bg={bg_ms:.1}ms n={view_count}"
.collect::<Option<Vec<_>>>()?;
Some(crate::ui::overlay::AuthoringDimension {
lines,
round_grips: graphic
.round_grips
.into_iter()
.map(project)
.collect::<Option<Vec<_>>>()?,
dimensions: graphic
.dimensions
.into_iter()