Hello,
I’m a grad student and I’m using Rhino/Grasshopper for parametric modeling of vortex generators that might reduce drag on boats. I’m in the process of setting up a closed loop optimization process, where I use Rhino.Compute to generate meshes that get evaluated in a fluid dynamics simulation, the results of which inform the next generation of (hopefully more effective) models.
Currently I’m running a local compute server, and interacting with it via compute_rhino3d in Python 3.8. Loading the Grasshopper model and generating a brep works great – which is very exciting to me in its own right. But to feed the model to the hydrodynamics solver I’ll need a mesh, and I’m struggling to get a good mesh from the brep.
Issue 1: I think I’m getting one mesh per face of the brep. I’ve verified that my brep is closed and manifold, and I’ve tried many different settings via MeshingParameters. Is there a way to get a single watertight mesh, as I can by exporting an STL from within Rhino?
Issue 2: I’m struggling to investigate the returned meshes further since I can’t loop over their vertices and faces successfully. The first mesh, for example, claims to have 1 face and 3 vertices (using len(mesh.Faces) and len(mesh.Vertices)), but when I iterate over its vertices there are only two, and when I iterate over its faces I see hundreds before the program silently crashes. I realize this may be a rhino3dm issue, so I can make a separate issue elsewhere if that’s more appropriate.
Code and an example model are attached. Any pointers would be much appreciated!
generate_3dm.py (1.4 KB)
vortex_generators.3dm (156.7 KB)
Thanks,
Erik