@dale i see you moved this to GH but it’s a RhinoCommon bug that I’m struggling with even so in a Rhino plugin.
The Extrusion has following issues:
ex.GetMesh() => null
ex.WallSurface(new ComponentIndex(ComponentIndexType.ExtrusionWallSurface, 0)) => null
ex.WallSurface(new ComponentIndex(ComponentIndexType.ExtrusionCapSurface, 0)) => null
ex.WallSurface(new ComponentIndex(ComponentIndexType.ExtrusionCapSurface, 1)) => null
ex.ToBrep() //works fine but kind of eliminates my purpose of using a lightweight class.
Mesh.CreateFromBrep(ex.ToBerep()) //works fine but is a stupid overhead.
I just tested this again in Rhino8 and problem persists.
Also, Extrusion.GetMesh fails because your newly created extrusion does not contain any cached meshes. There are added when you add the extrusion to the document. So, just use Mesh.CreateFromExtrusion.
Thanks for the example and clarifying the mesh part, @dale.
Forgive me for asking (again), but whats the reason for having an ComponentIndexType.ExtrusionCapSurface if it’s not working on a capped extrusion? Or was I using it in an unintended way?