generative modeling for Rhino
I am trying to convert a geometry input of Breps or surfaces into Meshes in a custom component. The Brep conversion goes fine:
If (TypeOf in_geo(j) Is Brep) Then
Dim msh_geo() As Mesh = Rhino.Geometry.Mesh.CreateFromBrep(in_geo(j))
But the Surface conversion loses the trim information if I first convert to Brep then to mesh:
If (TypeOf in_geo(j) Is NurbsSurface) Then
Dim SrfBrp As Brep = Rhino.Geometry.Brep.TryConvertBrep(in_geo(j))
Dim msh_geo() As Mesh = Rhino.Geometry.Mesh.CreateFromBrep(SrfBrp)
It looks like the surface is handled as a brep with its trim information intact automatically in the VB script component, but is handled differently in the custom component.
How do retain the trim information when converting any surface to a mesh inside a custom component?
you can't, Surfaces in Rhino do not support trims. You'll always need to use Breps, and in case of surfaces just use breps with a single face.