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
+7
-2
@@ -506,7 +506,11 @@ impl Scene {
|
||||
|
||||
// ATTRIBs live inline on each INSERT in that reference's owner space.
|
||||
// Conjugate the block-local reframe through the INSERT transform:
|
||||
// owner' = M · local_from_old · M⁻¹ · owner.
|
||||
// owner' = M · local_from_old · M⁻¹ · owner. M is the block-local →
|
||||
// world map the render path uses (`insert_transform`), because that is
|
||||
// the map the attribute positions on the INSERT were placed through;
|
||||
// the codec's base-ignoring transform would conjugate them through a
|
||||
// displaced frame whenever the definition has a non-zero base point.
|
||||
let references: Vec<(Handle, codec::types::Transform)> = self
|
||||
.document
|
||||
.entities()
|
||||
@@ -516,7 +520,8 @@ impl Scene {
|
||||
&& !reference.attributes.is_empty()
|
||||
&& !owned.contains(&reference.common.handle) =>
|
||||
{
|
||||
let insertion = reference.get_transform();
|
||||
let insertion =
|
||||
crate::scene::render_graph::insert_transform(&self.document, reference);
|
||||
let inverse = inverse_affine(&insertion)?;
|
||||
Some((
|
||||
reference.common.handle,
|
||||
|
||||
Reference in new issue
Block a user