fix(blocks): hide invisible sub-entities in block definitions
A dynamic block with a visibility-state parameter stores the geometry for every state in one anonymous block and marks all but the active state's entities invisible. The block-cache builder tessellated every sub-entity regardless, so a visibility block rendered all variants stacked on top of each other instead of the one selected profile. Skip invisible sub-entities in both the render pass and the precision- offset centroid pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
28a30de15d
commit
f366aae33c
1 changed files with 14 additions and 0 deletions
|
|
@ -292,6 +292,12 @@ fn build_defn(
|
||||||
) {
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// Invisible sub-entities never render (see pass 2), so keep them out
|
||||||
|
// of the offset centroid too — otherwise a dynamic block's hidden
|
||||||
|
// states would drag the precision origin off the visible geometry.
|
||||||
|
if entity.common().invisible {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// For Inserts, take the insertion_point itself (acadrust's
|
// For Inserts, take the insertion_point itself (acadrust's
|
||||||
// `Insert::bounding_box` returns just that). One level deep is
|
// `Insert::bounding_box` returns just that). One level deep is
|
||||||
// enough for an offset-picker — nested Inserts inside that block
|
// enough for an offset-picker — nested Inserts inside that block
|
||||||
|
|
@ -346,6 +352,14 @@ fn build_defn(
|
||||||
let Some(entity) = doc.get_entity(eh) else {
|
let Some(entity) = doc.get_entity(eh) else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
// Skip entities flagged invisible. Dynamic blocks (e.g. a visibility-
|
||||||
|
// state parametric block) keep the geometry for every state in one
|
||||||
|
// anonymous block and mark all but the active state's entities
|
||||||
|
// invisible — honouring the flag is what shows a single profile
|
||||||
|
// instead of every variant stacked on top of each other.
|
||||||
|
if entity.common().invisible {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
match entity {
|
match entity {
|
||||||
EntityType::Block(_)
|
EntityType::Block(_)
|
||||||
| EntityType::BlockEnd(_)
|
| EntityType::BlockEnd(_)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue