mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
See #3582. Fix bug where switching representations didn't handle curves in a body / model_view.
This means that if you created a curve body, you couldn't switch to it, or if you deleted everything, you ended up with an empty object. If you then tried to switch to that, it would "sync" the empty object and leave you with an empty cartesian point list. E.g: 1. Create cube and assign IFC element. 2. Remove all faces only (leaving edges and verts). Save changes. 3. Switch to representation (bug!) 4. Delete everything (no verts, edges, or faces). Attempt to save. 5. "Revert" switch will fail, leading to empty mesh. 6. Manually try to switch. Empty mesh will sync, creating an empty point list.
This commit is contained in:
@@ -434,10 +434,17 @@ class Geometry(blenderbim.core.tool.Geometry):
|
||||
|
||||
context = representation.ContextOfItems
|
||||
if context.ContextIdentifier == "Body" and context.TargetView == "MODEL_VIEW":
|
||||
if element.is_a("IfcTypeProduct") or not apply_openings:
|
||||
shape = ifcopenshell.geom.create_shape(settings, representation)
|
||||
else:
|
||||
shape = ifcopenshell.geom.create_shape(settings, element)
|
||||
try:
|
||||
if element.is_a("IfcTypeProduct") or not apply_openings:
|
||||
shape = ifcopenshell.geom.create_shape(settings, representation)
|
||||
else:
|
||||
shape = ifcopenshell.geom.create_shape(settings, element)
|
||||
except:
|
||||
settings.set(settings.INCLUDE_CURVES, True)
|
||||
if element.is_a("IfcTypeProduct") or not apply_openings:
|
||||
shape = ifcopenshell.geom.create_shape(settings, representation)
|
||||
else:
|
||||
shape = ifcopenshell.geom.create_shape(settings, element)
|
||||
else:
|
||||
settings.set(settings.INCLUDE_CURVES, True)
|
||||
shape = ifcopenshell.geom.create_shape(settings, representation)
|
||||
|
||||
Reference in New Issue
Block a user