Hi,
I have a seemingly simple problem, but could not find any solution yet:
Using the python rhino3dm package (version 7.14.1), I want to create a Brep face by a planar 3D polygon (from a Curve-Object). For this the function CreateTrimmedPlane() from Brep was used. As a result I get a Brep-Object which also contains BrepFaces/Surfaces, but when loading into Rhino, it is still only the Polygon without the filling surface.
Here is an example code of what I was trying to do:
import rhino3dm
# init model
model = rhino3dm.File3dm()
# create and add layer
layer = rhino3dm.Layer()
layer.Color = (255, 0, 0, 127)
layer.Name = 'example'
model.Layers.Add(layer)
# create curve from list of points
points = [[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0], [0, 0, 0]]
points = list(map(lambda p: rhino3dm.Point3d(p[0], p[1], p[2]), points))
crv = rhino3dm.Curve.CreateControlPointCurve(points, 1)
# create brep from plane and curve
pln = rhino3dm.Plane(rhino3dm.Point3d(0, 0, 0), rhino3dm.Vector3d(0, 0, 1))
brp = rhino3dm.Brep.CreateTrimmedPlane(pln, crv)
# add brep to model
model.Objects.AddBrep(brp)
# save to file
model.Write('example.3dm')
The screenshot contains the result of the code and an example for a Brep face how I want it to be like (modelled manually in Rhino).
What am I missing?
Thanks in advance for your support,
Jay