I try to create an ‘extrude polyline to point’ equivalent in python to output meshes. The vanilla node gives breps and gets too slow with too many input.
It sort of works, but the mesh is invalid. Any pointers would be appreciated? I gues it has to do with
for i in range(len(base)):
next_i = (i + 1) % len(base)
face = rg.MeshFace(i, next_i, apex_index)
mesh.Faces.AddFace(face)
From my testing, CPython 3 that implements RhinoCommon will be slower than IronPython, and IronPython is in turn slower than GHPython:
In some tests drastically, so if you’re going for Python + RhinoCommon + speed I’d recommend sticking with GHPython for now. And as always, following a few simple tricks can affect performance by a lot:
Also, in this case a performance bottleneck is calling Mesh.Append many times within the loop. If we do that just once, or alternatively wrap the pyramid meshes in the Grasshopper mesh type, the compute time drops quite severely:
Thanks for your insightful feedback. I did notice some of the aspects you’ve mention, and figured it was just me as it didn’t make sense to me why not have a type hint would be faster (same for list/no list)
Shaved a bit more off with threading, but generally speaking you’d gain more through simpler means by dropping down to C# once you start getting into 10000+ loops: