mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
See #4240. Fix bug where 2D arbitrary profiles were invalid IFC (used 3D point lists not 2D)
This commit is contained in:
@@ -58,7 +58,12 @@ class Usecase:
|
||||
if self.file.schema == "IFC2X3":
|
||||
curve = self.file.createIfcPolyline([self.file.createIfcCartesianPoint(p) for p in points])
|
||||
else:
|
||||
curve = self.file.createIfcIndexedPolyCurve(self.file.createIfcCartesianPointList3D(points))
|
||||
dimensions = len(points[0])
|
||||
if dimensions == 2:
|
||||
ifc_points = self.file.createIfcCartesianPointList2D(points)
|
||||
elif dimensions == 3:
|
||||
ifc_points = self.file.createIfcCartesianPointList3D(points)
|
||||
curve = self.file.createIfcIndexedPolyCurve(ifc_points)
|
||||
return self.file.createIfcArbitraryClosedProfileDef("AREA", self.settings["name"], curve)
|
||||
|
||||
def convert_si_to_unit(self, co):
|
||||
|
||||
+6
-1
@@ -74,7 +74,12 @@ class Usecase:
|
||||
outer_curve = self.file.createIfcIndexedPolyCurve(self.file.createIfcCartesianPointList3D(outer_points))
|
||||
inner_curves = []
|
||||
for inner_point in inner_points:
|
||||
inner_curves.append(self.file.createIfcIndexedPolyCurve(self.file.createIfcCartesianPointList3D(inner_point)))
|
||||
dimensions = len(inner_point[0])
|
||||
if dimensions == 2:
|
||||
ifc_points = self.file.createIfcCartesianPointList2D(inner_point)
|
||||
elif dimensions == 3:
|
||||
ifc_points = self.file.createIfcCartesianPointList3D(inner_point)
|
||||
inner_curves.append(self.file.createIfcIndexedPolyCurve(ifc_points))
|
||||
return self.file.createIfcArbitraryProfileDefWithVoids("AREA", self.settings["name"], outer_curve, inner_curves)
|
||||
|
||||
def convert_si_to_unit(self, co):
|
||||
|
||||
Reference in New Issue
Block a user