mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
Fix #3554. Support editing IfcIndexedPolyCurve profiles where IfcLineIndex has >2 indices.
This commit is contained in:
@@ -358,7 +358,7 @@ class Model(blenderbim.core.tool.Model):
|
|||||||
is_closed = False
|
is_closed = False
|
||||||
if curve.Segments:
|
if curve.Segments:
|
||||||
for segment in curve.Segments:
|
for segment in curve.Segments:
|
||||||
if len(segment[0]) == 3: # IfcArcIndex
|
if segment.is_a("IfcArcIndex"):
|
||||||
is_arc = True
|
is_arc = True
|
||||||
local_point = cls.convert_unit_to_si(curve.Points.CoordList[segment[0][0] - 1])
|
local_point = cls.convert_unit_to_si(curve.Points.CoordList[segment[0][0] - 1])
|
||||||
global_point = position @ Vector(local_point).to_3d()
|
global_point = position @ Vector(local_point).to_3d()
|
||||||
@@ -368,12 +368,13 @@ class Model(blenderbim.core.tool.Model):
|
|||||||
cls.vertices.append(global_point)
|
cls.vertices.append(global_point)
|
||||||
cls.arcs.append([len(cls.vertices) - 2, len(cls.vertices) - 1])
|
cls.arcs.append([len(cls.vertices) - 2, len(cls.vertices) - 1])
|
||||||
else:
|
else:
|
||||||
local_point = cls.convert_unit_to_si(curve.Points.CoordList[segment[0][0] - 1])
|
for segment_index in segment[0][0:-1]:
|
||||||
global_point = position @ Vector(local_point).to_3d()
|
local_point = cls.convert_unit_to_si(curve.Points.CoordList[segment_index - 1])
|
||||||
cls.vertices.append(global_point)
|
global_point = position @ Vector(local_point).to_3d()
|
||||||
if is_arc:
|
cls.vertices.append(global_point)
|
||||||
cls.arcs[-1].append(len(cls.vertices) - 1)
|
if is_arc:
|
||||||
is_arc = False
|
cls.arcs[-1].append(len(cls.vertices) - 1)
|
||||||
|
is_arc = False
|
||||||
|
|
||||||
if curve.Segments[0][0][0] == curve.Segments[-1][0][-1]:
|
if curve.Segments[0][0][0] == curve.Segments[-1][0][-1]:
|
||||||
is_closed = True
|
is_closed = True
|
||||||
|
|||||||
Reference in New Issue
Block a user