mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-31 17:06:29 +00:00
Fix #1645. Fix bug where you could accidentally have a layer set with zero thickness which caused object creation to fail.
This commit is contained in:
@@ -249,7 +249,7 @@ class DumbSlabGenerator:
|
|||||||
if material.is_a("IfcMaterialLayerSet"):
|
if material.is_a("IfcMaterialLayerSet"):
|
||||||
thicknesses = [l.LayerThickness for l in material.MaterialLayers]
|
thicknesses = [l.LayerThickness for l in material.MaterialLayers]
|
||||||
break
|
break
|
||||||
if not thicknesses:
|
if not sum(thicknesses):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.collection = bpy.context.view_layer.active_layer_collection.collection
|
self.collection = bpy.context.view_layer.active_layer_collection.collection
|
||||||
|
|||||||
@@ -643,7 +643,7 @@ class DumbWallGenerator:
|
|||||||
if material.is_a("IfcMaterialLayerSet"):
|
if material.is_a("IfcMaterialLayerSet"):
|
||||||
thicknesses = [l.LayerThickness for l in material.MaterialLayers]
|
thicknesses = [l.LayerThickness for l in material.MaterialLayers]
|
||||||
break
|
break
|
||||||
if not thicknesses:
|
if not sum(thicknesses):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.collection = bpy.context.view_layer.active_layer_collection.collection
|
self.collection = bpy.context.view_layer.active_layer_collection.collection
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Usecase:
|
|||||||
layers = list(self.settings["layer_set"].MaterialLayers or [])
|
layers = list(self.settings["layer_set"].MaterialLayers or [])
|
||||||
layer = self.file.create_entity("IfcMaterialLayer", **{
|
layer = self.file.create_entity("IfcMaterialLayer", **{
|
||||||
"Material": self.settings["material"],
|
"Material": self.settings["material"],
|
||||||
"LayerThickness": 0.
|
"LayerThickness": 1.
|
||||||
})
|
})
|
||||||
layers.append(layer)
|
layers.append(layer)
|
||||||
self.settings["layer_set"].MaterialLayers = layers
|
self.settings["layer_set"].MaterialLayers = layers
|
||||||
|
|||||||
Reference in New Issue
Block a user