mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
d0ebdd53c9
Adds tooling to surface and normalize representations that live on an occurrence but not its type, aligning with the convention that typed occurrences share the type's representations (per maintainer feedback on #8788). - Promote to Type (bim.promote_representation_to_type): slot-based, "type wins". Copies the promoted rep onto the type as a RepresentationMap, then for every occurrence of the type removes ANY existing rep in the same slot -- context (context/subcontext/target view) + RepresentationIdentifier + resolved RepresentationType -- and assigns the type's mapped rep in its place; occurrences with none inherit it. Covers both local reps and reps inherited from a floating IfcRepresentationMap not anchored to the type (Revit exports), so no duplicate is left; removes the type's existing slot map first so promoting is idempotent. Geometry is not compared, so independently-meshed / mirrored / rotated instances are consolidated too. Adds tool.Geometry copy_representation_deep and add_type_representation_map. - Representations panel: group rows under Type (mapped/inherited) vs Occurrence (local) headers so occurrence-local reps are surfaced. Adds is_mapped / element_is_type / element_has_type to RepresentationsData; drops the old "*" suffix. Copy and add-representation behaviour is unchanged from base. Design note at docs/dev-notes/occurrence-representations.md. Issue: #8788 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>