Skip to content

Commit

Permalink
fix(planarize): Add an extra check to not convert bezier spans
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Feb 13, 2025
1 parent 719d8e9 commit c546e6d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ladybug_rhino/planarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ def planar_face_curved_edge_vertices(b_face, count, meshing_parameters):
if seg.Degree == 1:
loop_verts.append(_point3d(seg.PointAtStart))
else:
# Ensure curve subdivisions align with adjacent curved faces
seg_mesh = rg.Mesh.CreateFromSurface(
rg.Surface.CreateExtrusion(seg, f_norm),
meshing_parameters)
for i in xrange(seg_mesh.Vertices.Count / 2 - 1):
loop_verts.append(_point3d(seg_mesh.Vertices[i]))
if not seg.HasBezierSpans or seg.Degree == 2:
# Ensure curve subdivisions align with adjacent curved faces
seg_mesh = rg.Mesh.CreateFromSurface(
rg.Surface.CreateExtrusion(seg, f_norm),
meshing_parameters)
for i in xrange(seg_mesh.Vertices.Count / 2 - 1):
loop_verts.append(_point3d(seg_mesh.Vertices[i]))
else: # typically not a curve that is worth keeping
loop_verts.append(_point3d(seg.PointAtStart))
return loop_verts


Expand Down

0 comments on commit c546e6d

Please sign in to comment.