Hi,
Is it somehow possible to create a Brep surface from a planar mesh including several holes/openings?
I am using the python rhino3dm package (version 7.14.1) and started to create a mesh and convert it with rhino3dm.Brep.CreateFromMesh() into a brep. This resulting brep has still the mesh faces structure.
As the mesh is planar, I would like to eliminate the interior edges in the brep to get only the outside boundary and holes. Is there a function for this or is there even a manual way? Maybe my approach to get a brep with holes through a mesh is also wrong…
Here is a small example:
import rhino3dm
# init model
model = rhino3dm.File3dm()
# create and add layer
layer = rhino3dm.Layer()
layer.Color = (255, 255, 0, 255)
layer.Name = 'example'
model.Layers.Add(layer)
# create mesh
mesh = rhino3dm.Mesh()
# create list of points
points = [[0, 0, 0], [1, 1, 0], [2, 1, 0], [3, 0, 0], [3, 3, 0], [2, 2, 0], [1, 2, 0], [0, 3, 0]]
for p in points:
mesh.Vertices.Add(p[0], p[1], p[2])
# add faces from point list
mesh.Faces.AddFace(0, 1, 6, 7)
mesh.Faces.AddFace(6, 5, 4, 7)
mesh.Faces.AddFace(2, 3, 4, 5)
mesh.Faces.AddFace(0, 3, 2, 1)
# create brep
brp = rhino3dm.Brep.CreateFromMesh(mesh, True)
# add brep to model
model.Objects.AddBrep(brp)
# save to file
model.Write('example.3dm')
Thanks in advance for your support,
Jay