+ Reply to Thread
Results 1 to 6 of 6

Thread: Mesh from closed polyline

  1. #1

    Mesh from closed polyline

    Is there any method in python what would work like:
    mesh - From Closed Polyline
    ( Polyline is not flat )

    rhinoscriptsyntax.MeshPolyline()
    seems to not work

  2. #2
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    286
    Yes, there is an error - actually several errors in this method. It's not all that simple to fix.

    First, the rs.MeshPolyline method is calling the RhinoCommon method Geometry.Mesh.CreateFromPlanarBoundary() which takes two arguments - the curve to mesh and some meshing parameters. Unfortunately, the way the method is currently written, only one argument is supplied to this method (the curve), the meshing parameters are not supplied so it errors out there. I don't know which mesh parameters this needs, one could supply it with Default I guess...

    But the other problem is that Mesh.CreateFromPlanarBoundary() is really not the correct method to be called by MeshPolyline, as this would limit it to planar polylines. The Rhino function is not so limited.

    So, for the moment, I think the best workaround is to script the Rhino command:
    python Code:
      rs.Command("_MeshPolyline", False)
      if rs.LastCommandResult() == 0:
          LCO=rs.LastCreatedObjects()
          if LCO: mesh=LCO[0]

    --Mitch

  3. #3
    Yes that is option.
    Is there any other way to triangulate polyline in case it is concave.

  4. #4
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,464
    Blog Entries
    19
    I see the problems that Mitch pointed out and am working on a solution.
    Thanks,
    -Steve

  5. #5
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,464
    Blog Entries
    19
    Ok, the MeshPolyline function should work in the next V5 beta on non-planar polylines.
    Thanks,
    -Steve

  6. #6
    Hi,
    Rhino build 11-Jul-2012 solved problem.
    I would like to ask what type of triangulation is used here?
    It seems different from Rhino built-in MeshPolyline command.
    thx,
    Raul

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts