I am currently working on a project where i use a Rhino PolylineCurve to make an Extrusion, to be able to generate objects with the same profile but different lengths. These objects i want to then use in honeybee to make an Irradiance Analysis.
There is also a module from honeybee to directly convert an Extrusion to a Honeybee Model, but i have the Problem that the Extrusion.GetMesh() function returns None.
As i understand it correctly this is because the Extrusion Object was not loaded in Rhino and set the Display Mode to Shaded. Is there a way to set the Display Mode in python or to get the object meshed otherwise? I saw some examples where a Mesh was created manually and then added to the object (Link), but i have a rather complex geometry (looks like an extruded metal profile).
When i added the Extrusion to the model and saved it as 3dm file, i can open it in Rhino and set the Display Mode to shaded and i can use it in Honeybee. But i want to avoid that, as i want to generate the models for the Irradiance Analysis automatically.
My Code to generate the Extrusion and add it to the model.
import rhino3dm as rhino
model = rhino.File3dm.Read('test.3dm')
for object in model.Objects:
if isinstance(object.Geometry, rhino.Curve):
polyCurve = object.Geometry
extrusion = rhino.Extrusion.Create(polyCurve, 10.0, True)
model.Objects.AddExtrusion(extrusion)
model.Write('extrusion.3dm', 8)
The module rhino3dm does not contain meshing functionality. It can only provide meshes that are saved in the 3dm file. Typically this means saving a 3dm with a viewport in Shaded or Rendered mode in Rhino.
So your only option is to do exactly that. (Or write your own mesher).