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:
Karim Jerbi committed 2026-10-12 04:35:19 +01:00
1 parent a456367b26
commit 5dfa41c032
17 files changed
+1447 -19

No files matched your search

+6 -1
View File
@@ -250,7 +250,12 @@ pub fn set_insert_clip(
let Some(codec::EntityType::Insert(ins)) = doc.get_entity(insert) else {
return false;
};
let t = ins.get_transform().matrix.m;
// The stored inverse is the inverse of the transform every consumer
// composes the boundary back with — the base-point-aware instance
// transform the render path uses. Storing the codec's base-ignoring
// inverse would displace the ring by exactly -base on the next render.
let forward = crate::scene::render_graph::insert_transform(doc, ins);
let t = forward.matrix.m;
let forward = glam::DMat4::from_cols_array_2d(&[
[t[0][0], t[1][0], t[2][0], t[3][0]],
[t[0][1], t[1][1], t[2][1], t[3][1]],