Fix #2947. Embarrassing bug where slabs didn't consider the total thickness.

This commit is contained in:
Dion Moult
2023-04-11 16:24:39 +10:00
parent 176cbf9861
commit c6223520e0
2 changed files with 4 additions and 3 deletions
@@ -95,13 +95,14 @@ class SvgWriter:
if not resource_path:
self.resource_paths[resource] = None
continue
resource_path = tool.Ifc.resolve_uri(resource_path)
os.makedirs(os.path.dirname(resource_path), exist_ok=True)
if not os.path.exists(resource_path):
resource_basename = os.path.basename(resource_path)
ootb_resource = os.path.join(bpy.context.scene.BIMProperties.data_dir, "assets", resource_basename)
if os.path.exists(ootb_resource):
shutil.copy(ootb_resource, resource_path)
self.resource_paths[resource] = tool.Ifc.resolve_uri(resource_path)
self.resource_paths[resource] = resource_path
def define_boilerplate(self):
self.add_stylesheet()
@@ -238,11 +238,11 @@ class DumbSlabPlaner:
if not rel.is_a("IfcRelAssociatesMaterial"):
continue
for element in rel.RelatedObjects:
self.change_thickness(element, thickness)
self.change_thickness(element, total_thickness)
else:
for rel in inverse.AssociatedTo:
for element in rel.RelatedObjects:
self.change_thickness(element, thickness)
self.change_thickness(element, total_thickness)
def regenerate_from_type(self, usecase_path, ifc_file, settings):
obj = tool.Ifc.get_object(settings["related_object"])