Skip to content

Commit f8cef1c

Browse files
committed
fix(planarize): Catch the case of 2-degree curves in curvature analysis
1 parent ba520a3 commit f8cef1c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ladybug_rhino/planarize.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@ def planar_face_curved_edge_vertices(b_face, count, meshing_parameters):
5555
loop_verts.append(_point3d(seg.PointAtStart))
5656
else:
5757
# perform curvature analysis to see if it is just a line
58-
max_curve = seg.MaxCurvaturePoints()
59-
if max_curve is None: # it is just a line-like curve
60-
loop_verts.append(_point3d(seg.PointAtStart))
61-
continue
62-
max_par = seg.ClosestPoint(max_curve[0])[1]
58+
if seg.Degree != 2:
59+
max_curve = seg.MaxCurvaturePoints()
60+
if max_curve is None: # it is just a line-like curve
61+
loop_verts.append(_point3d(seg.PointAtStart))
62+
continue
63+
max_par = seg.ClosestPoint(max_curve[0])[1]
64+
else: # arcs have the same curvature everywhere
65+
max_par = 0
6366
if seg.CurvatureAt(max_par).Length < 0.001: # it is a line-like curve
6467
loop_verts.append(_point3d(seg.PointAtStart))
6568
continue

0 commit comments

Comments
 (0)