I am providing you the solution, not a workaround.
Mesh.CreateFromCurveExtrusion is not what you need. Honestly, this probably should not have been exposed in RhinoCommon, as it was designed for use when projecting a curve onto a mesh. That is, it was not designed to work as the mesh equivalent to Surface.CreateExtrusion.
As Rhino SDK does not have a function that extrudes a curve into a mesh, the solution today is to use Surface.CreateExtrusion and Mesh.CreateFromSurface. Iāve logged an issue to remind us to come up with something ābetter.ā
I tried to use the script you posted before, but it is doing this. I have tried a bunch of different MeshingParameters settings, but none of them give me what Iām seeing in your file (the simple single quads for each side of the extrusion). Any idea why this is?
I have found FillHoles() quite slower than CreateFromClosedPolyline(), especially if you already have the Polylines (in this case is just the input and the translation of the input). If you have to find the naked edges then maybe it is different. I think FillHoles() is checking a bunch of other stuff for more kinds of cases, could be wrongā¦
Actually, @dale 's method (modified to use extrusion) is fasterāthe mesh extrusion component is at the end of both of these clusters and itās the only difference. I also tested it in many different conditions, recomputed, etc. and every time itās faster. But I have already learned so much in this process, so thanks for laying all of that out in a way that can be easily understood. I will surely use some of this for future scripts. Iām starting to really enjoy working with meshes.
Iām curious what exactly was fixed here? Was it just the documentation that was added to explain why this method shouldnāt be used for what is being discussed in this thread, or something related to creating a new method that allows what is being discussed in this thread?
@dale OK, hereās the function Iād love to have, letās call it MeshExtrusionFromPolyline:
Inputs: closed polyline, vector, [optional] length, [optional] closed/open
(could potentially use a closed or open polyline, but I donāt know what differences would be required to do this with an open polylineāfrom my perspective, I would only use this with close polylines)
Output: Closed/Open mesh extrusion with simple quads for all sides, and simply meshed top and bottom (could even check if it has three/four segments in polyline, and then create tri/quad for top/bottom). By simply meshed top and bottom I mean the same as Rhino command ā_MeshPolyline.ā
The way I see it, this function would be stable and fast. The reason why Iām using this is to easily generate a lot of extrusions, with the option later on that this geometry can be easily 3D-printed.