forked from 1b-agent/opencadstudio-upstream
fix(blocks): one base point convention for creation, redefine, insert, explode, XCLIP and REFEDIT
world = insert_point + Rot * Scale * (P - base_point). Attribute placement, EXPLODE, XCLIP storage, REFEDIT's working copy, the UCS reframe of attributes and the dynamic-block visibility grip ignored the base point and were offset by Rot*Scale*base. They now share insert_transform_with_base. Creation stores a ZERO base and redefine resets it; a no-op redefine moves nothing; the Block Definition dialog prefills the base from the definition. XCLIP filters stored by older builds keep their old displacement.
This commit is contained in:
1 parent
a456367b26
commit
5dfa41c032
17 files changed
+1447
-19
No files matched your search
@@ -5017,9 +5017,16 @@ impl OpenCADStudio {
|
||||
}
|
||||
Message::BlockDefNameSelect(chosen) => {
|
||||
if let Some(state) = self.block_definition.as_mut() {
|
||||
state.name = chosen;
|
||||
state.name = chosen.clone();
|
||||
state.error_message = None;
|
||||
state.confirm_redefine = None;
|
||||
// Redefining an existing block starts from the base point
|
||||
// that definition already has (0.0000 for a new block).
|
||||
let base = crate::scene::render_graph::block_base_point(
|
||||
&self.tabs[self.active_tab].scene.document,
|
||||
&chosen,
|
||||
);
|
||||
state.set_base_point(glam::DVec3::new(base.x, base.y, base.z));
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user