Skip to content

Commit 0bc5a3f

Browse files
committed
WIP-FIX brep to mesh
1 parent 42b4bad commit 0bc5a3f

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/gh/diffCheck/diffCheck/df_geometries.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,24 +242,21 @@ def to_mesh(self):
242242
"""
243243
Convert the beam to a Rhino Mesh object
244244
"""
245-
245+
rhino_brep_faces = [f.to_brep_face() for f in self.faces]
246246
# mesh = rg.Mesh()
247-
o_side_faces = [f.to_brep_face() for f in self.side_faces]
248-
o_joint_faces = [f.to_brep_face() for f in self.joint_faces]
249-
rhino_brep_faces = o_side_faces + o_joint_faces
247+
#o_side_faces = [f.to_brep_face() for f in self.side_faces]
248+
#o_joint_faces = [f.to_brep_face() for f in self.joint_faces]
249+
#rhino_brep_faces = o_side_faces + o_joint_faces
250250

251251
new_faces = []
252252
mesh = rg.Mesh()
253253

254-
for f in rhino_brep_faces:
255-
new_faces.append(f.DuplicateFace())
254+
new_faces = [f.DuplicateFace(True) for f in rhino_brep_faces] # .DuplicateFace bypasses the problem of untrimmed faces that appear in f.to_brep_face
256255

257256
for f in new_faces:
258-
#from dfbeam face to mesh
259-
#brep.Faces.Add(f)
260-
mesh_part = rg.Mesh.CreateFromBrep(f, rg.MeshingParameters.Coarse)
257+
mesh_part = rg.Mesh.CreateFromBrep(f, rg.MeshingParameters.Coarse)[0] #returns a list of meshes with one element
261258
mesh.Append(mesh_part)
262-
mesh.Compact()
259+
mesh.Compact()
263260

264261
return mesh
265262

0 commit comments

Comments
 (0)