Mesh Extrusion Bug?

Maybe you can retrieve the point array out of the given polyline, duplicate the array and move it along the z-axis, then construct quad mesh from the pair of point arrays?

FillHoles() will fill any holes detected in the mesh regardless of size - they do not even need to be planar, just have naked edges that form one or more continuous loops. Like the native Rhino command. I do not know if there is a difference in calc time between that and getting the meshes naked edges, then trying to mesh those and join the result to the original.

Yes, you’re right, using FillHoles() is probably going to fix my issues. Although the use of a bbox and vector for that mesh extrusion function are wacky to me, I am willing to jump through those hoops if it means I can use that function.

Right. That might be okay. But As I am trying to keep the consistency of input and output data, I am just trying not to create any unexpected geometries. I hate coding…

Hi @devin_jernigan,

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.”

Hope this helps.

– Dale

1 Like

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? (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! (7.1 KB)

1 Like

See here: Mesh Extrusion Bug?scr - #23 by Michael_Pryor

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.

Thank you @Michael_Pryor !

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.

1 Like

RH-68211 is fixed in Rhino 7 Service Release 18

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?

Hi @devin_jernigan,

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);
    return rc;

Or are you looking for something in Grasshopper? Or something else?


– Dale

@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.”

Like this:

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.

Hi @devin_jernigan,

I believe what you are describing is this: (6.6 KB)

Is there something I am missing?

– Dale