Mesh Extrusion Bug?

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.ā€

https://mcneel.myjetbrains.com/youtrack/issue/RH-68211

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?

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!


ExtrMsh.gh (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?

Thanks,

ā€“ 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:

MeshFromPolylineExtrusion.gh (6.6 KB)

Is there something I am missing?

ā€“ Dale

RH-68211 is fixed in the latest WIP