mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
Bonsai: stop merged cut linework leaking classes onto disjoint pieces
In merge_linework_and_add_metadata every closed subpath of an element group was queued with a reference to the same class set, so when one subpath was unioned with a neighbouring element the in-place polygon_classes.update() also rewrote the classes of that element's other, geometrically unrelated subpaths. A wall split by an opening could therefore emit a piece carrying a neighbour's GlobalId, status and metadata classes, styling it from the wrong CSS rules. Queue a copy of the class set per polygon so each merged polygon owns its own classes. Generated with the assistance of an AI coding tool.
This commit is contained in:
@@ -1708,7 +1708,7 @@ class CreateDrawing(bpy.types.Operator):
|
||||
coords.append(coords[0])
|
||||
if len(coords) > 2 and coords[0] == coords[-1]:
|
||||
is_closed_polygon = True
|
||||
queue.append((shapely.Polygon(coords), classes))
|
||||
queue.append((shapely.Polygon(coords), set(classes)))
|
||||
if is_closed_polygon:
|
||||
el.getparent().remove(el)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user