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
As Rhino SDK does not have a function that extrudes a curve into a mesh, the solution today is to use
Mesh.CreateFromSurface. I’ve logged an issue to remind us to come up with something “better.”
Hope this helps.
Ok, I understand.
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?
test_extrude_curve_to_mesh_q.gh (83.4 KB)
EDIT: I fixed this by using
extrusion.create(curve, amount, cap) and then meshed that.
This should work for you and be very fast, just building a simple mesh directly. Hope it helps!
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…
Sweat! that’s what I meant.
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.
Ah yes because he is using extrusion type, it is a very light geo type. Anyway, good to know how to construct meshes for your reference.
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?
Looks like you’re right. This issue is resolved by pointing people in another direction.
Any chance we can get another opened to handle what’s asked for in this and my original thread?
What is it you are looking for? Do you want us to add a function to RhinoCommon that does this?
public Mesh MeshCreateExtrusion(Curve curve, Vector3d dir)
Mesh rc = null;
if (null != curve && dir.IsValid)
var surface = Surface.CreateExtrusion(curve, dir);
if (null != surface)
rc = Mesh.CreateFromSurface(surface);
Or are you looking for something in Grasshopper? Or something else?
@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.
I believe what you are describing is this:
MeshFromPolylineExtrusion.gh (6.6 KB)
Is there something I am missing?