@@ -63,7 +63,7 @@ def check_planarity(brep, tolerance):
63
63
Bool. True if planar. Otherwise False.
64
64
"""
65
65
is_planar = [brep .Surfaces [i ].IsPlanar (tolerance )
66
- for i in range (len (brep .Surfaces ))]
66
+ for i in range (len (brep .Surfaces ))]
67
67
68
68
return all (is_planar )
69
69
@@ -215,7 +215,7 @@ def brep_to_face3d(brep, tolerance, obj):
215
215
end_pt = to_point3d (brep .Edges [i ].PointAtEnd )
216
216
line = LineSegment3D .from_end_points (start_pt , end_pt )
217
217
lines .append (line )
218
-
218
+
219
219
# Create Ladybug Polylines from the lines
220
220
polylines = Polyline3D .join_segments (lines , tolerance )
221
221
@@ -243,7 +243,7 @@ def brep_to_face3d(brep, tolerance, obj):
243
243
polyline_area_dict = dict (zip (polylines , polyline_areas ))
244
244
245
245
sorted_dict = sorted (polyline_area_dict .items (),
246
- key = lambda x : x [1 ], reverse = True )
246
+ key = lambda x : x [1 ], reverse = True )
247
247
sorted_polylines = [item [0 ] for item in sorted_dict ]
248
248
249
249
# Points on boundary
@@ -252,20 +252,20 @@ def brep_to_face3d(brep, tolerance, obj):
252
252
253
253
hole_pts = [remove_dup_vertices (polyline .vertices , tolerance )
254
254
for polyline in sorted_polylines [1 :]]
255
-
255
+
256
256
# Points on holes
257
257
total_hole_pts = [
258
258
pts for pts_lst in hole_pts for pts in pts_lst ]
259
-
259
+
260
260
hole_pts_on_boundary = [
261
261
pts for pts in total_hole_pts if pts in boundary_pts ]
262
262
263
263
# If any of the hole is touching the boundary of the face, mesh it
264
264
if len (hole_pts_on_boundary ) > 0 :
265
265
warnings .warn (
266
- f'Object with id: { obj .Attributes .Id } has holes that touch the'
266
+ f'Object with id: { obj .Attributes .Id } has holes that touch the'
267
267
' boundary of the object. This object will be meshed.'
268
- )
268
+ )
269
269
return brep_to_mesh_to_face3d (brep )
270
270
# else create a face3d with holes
271
271
else :
@@ -363,13 +363,13 @@ def to_face3d(obj, tolerance, *, raise_exception=False):
363
363
# If it's a mesh
364
364
elif isinstance (rh_geo , rhino3dm .Mesh ):
365
365
lb_face = mesh_to_face3d (rh_geo )
366
-
366
+
367
367
else :
368
368
if raise_exception :
369
369
raise ValueError (f'Unsupported object type: { rh_geo .ObjectType } ' )
370
370
warnings .warn (
371
371
f'Unsupported object type: { rh_geo .ObjectType } is ignored'
372
- )
372
+ )
373
373
lb_face = []
374
374
375
375
return lb_face
0 commit comments