Skip to content

Commit

Permalink
fix(fromgeometry): Ensure Face3D translation doesn't throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Sep 10, 2021
1 parent 5d0a1a9 commit 4a75610
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ladybug_rhino/fromgeometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ def from_face3d(face):
brep = rg.Brep.CreatePlanarBreps(segs, tolerance)[0]
except TypeError: # not planar in Rhino model tolerance; maybe from another model
print('Brep not planar in Rhino model tolerance. Ignoring tolerance.')
brep = rg.Brep.CreatePlanarBreps(segs, 1e6)[0]
try:
brep = rg.Brep.CreatePlanarBreps(segs, 1e6)[0]
except TypeError: # it must be a zero-area geometry
return None
if face.has_holes:
for hole in face.hole_segments:
trim_crvs = [from_linesegment3d(seg) for seg in hole]
Expand Down Expand Up @@ -242,7 +245,7 @@ def from_face3ds_to_colored_mesh(faces, color):
try:
joined_mesh.Append(rg.Mesh.CreateFromBrep(
from_face3d(face), rg.MeshingParameters.Default)[0])
except TypeError:
except Exception:
pass # failed to create a Rhino Mesh from the Face3D
joined_mesh.VertexColors.CreateMonotoneMesh(color_to_color(color))
return joined_mesh
Expand Down

0 comments on commit 4a75610

Please sign in to comment.