Bug - MeshFromLines, Mesh.CreateFromLines

What’s wrong here?

mesh_from_lines_c.gh (30.4 KB)

1 Like

dear @martinsiegrist Martin
for the old - script “c#”
set edges Type hint to Curve instead of Line

for the new script “S”
cast to list first

  private void RunScript(IEnumerable<Curve> edges, int val, double tol, out object A)
  {
    if (edges is List<Curve> myList)
    {
        Curve[] array = myList.ToArray();
        A = Rhino.Geometry.Mesh.CreateFromLines(array, val, tol);
    } else 
    {
        A = null;
    }
  }

hope this does the job ?
kind regards from Zürich to Liestal - Tom

Thanks Tom, the script component does something but it doesn’t return the same result as in Rhino 7

Rhino 7:

4 is the maximum number of edges for a mesh face.

In Rhino 8, with val set to 3, the script returns one mesh face built of 3 edges. val set to 4 or a larger number raises an error.

mesh_from_lines_c_7.gh (5.0 KB)
mesh_from_lines_c_8.gh (16.3 KB)

Looks like a bug in Rhino V8 regarding
MeshFromLines
also the Rhino-Command fails in V8 Mac, working in V7
but does not perform any splitting.
I always thought the concept is more like a “(precise) Wireframe to Mesh”.
Never used it with the trimming / splitting job to be done by the command / Method.

this works in V7 but not in V8 (native Rhino command meshFromLines)

Maybe change the topic to “Bug - MeshFromLines, Mesh.CreateFromLines”
not 100% sure who is working on the new mesh stuff.
maybe @piac - thanks for having a look or addressing the right person.

2 Likes

FWIW this example appears to work in Rhino 8. Both using GHPython and the new script editor:


230930_LinesToMeshBoundaries_00.gh (15.1 KB)

Edit: But same issue with your inputs @martinsiegrist. So this probably doesn’t add much useful information.

2 Likes

I’m in a workshop in Stuttgart for AAG2023, but will look at this when I’m back.
I filed RH-77495.

Thanks,

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

1 Like

Hi @martinsiegrist

this should be fixed in the next Rhino 8 BETA release.

2 Likes

Hi @piac,

Any idea why in Rhino 8 “MeshFromLines” underperform?
For example see picture attached.

The lines were created automatically through a script.
If I suspect correctly, there is a bug with regards to how Rhino8 derives the “direction” of the line.
Because if I remove the lines of the “empty” face and redraw a polyline (and then explode it) it works correctly.

Have you already understood why “MeshFromLines” do not work in Rhino8, but the performance in Rhino7 is (almost) OK?

(edit: I attached the file with the lines)
example_meshFromLines underperform.3dm (80.3 KB)