This commit is contained in:
Dion Moult
2022-09-17 14:51:50 +10:00
parent 0cb3c0a907
commit 6d0fdb32c6
2 changed files with 7 additions and 5 deletions
@@ -77,7 +77,7 @@ class Usecase:
)
def convert_si_to_unit(self, co):
if isinstance(co, tuple):
if isinstance(co, (tuple, list)):
return [self.convert_si_to_unit(o) for o in co]
if self.settings["coordinate_offset"]:
return (co / self.settings["unit_scale"]) + self.settings["coordinate_offset"]
@@ -44,11 +44,13 @@ class Usecase:
)
def create_item(self):
length = self.convert_si_to_unit(self.settings["length"])
thickness = self.convert_si_to_unit(self.settings["thickness"])
points = (
(0.0, 0.0, 0.0),
(0.0, self.settings["thickness"], 0.0),
(self.settings["length"], self.settings["thickness"], 0.0),
(self.settings["length"], 0.0, 0.0),
(0.0, thickness, 0.0),
(length, thickness, 0.0),
(length, 0.0, 0.0),
(0.0, 0.0, 0.0),
)
if self.file.schema == "IFC2X3":
@@ -58,7 +60,7 @@ class Usecase:
extrusion = self.file.createIfcExtrudedAreaSolid(
self.file.createIfcArbitraryClosedProfileDef("AREA", None, curve),
self.file.createIfcAxis2Placement3D(
self.file.createIfcCartesianPoint((0.0, self.settings["offset"], 0.0)),
self.file.createIfcCartesianPoint((0.0, self.convert_si_to_unit(self.settings["offset"]), 0.0)),
self.file.createIfcDirection((0.0, 0.0, 1.0)),
self.file.createIfcDirection((1.0, 0.0, 0.0)),
),