mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fix #2416.
This commit is contained in:
@@ -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)),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user