mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
2e6f17ed0f
Custom IfcOpeningElement voids (e.g. an IfcPolygonalFaceSet / tessellation) were lost - reset to a default extrusion - on bim.duplicate_type, project append, and type switching, because the void lived only on occurrences and nothing carried it to a new type. Anchor the shared opening body on the filling type as a 'Reference' representation map (per IfcShapeRepresentation, 'Reference' is geometry "not part of the Body representation", used for opening geometries excluded from an implicit Boolean operation). bim.duplicate_type and append copy a type's RepresentationMaps, so the template survives; generate_opening_from_filling consults it before falling back to a generated extrusion. - map_type_representations: skip 'Reference' maps so occurrences don't receive the opening shape as their own Body geometry. - opening.py: get_/set_type_opening_representation, promote_opening_to_type, update_type_template_from_opening; pre/post type.assign_type listeners (anchor the old type's void before a switch; regenerate to the assigned type's void afterwards, replacing the previous "preserve custom" guard). - DuplicateType promotes the void before copy; AppendLibraryElement harvests the template cross-file from a library instance. - Write-back on void edit, hooked at both commit paths (UpdateRepresentation and OverrideModeSetObject). - reimport_element_representations renders the requested representation, so switching a type to its Reference row shows the void rather than the body. - Representations panel shows RepresentationIdentifier plus column headers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>