Is there any method in python what would work like:
mesh - From Closed Polyline
( Polyline is not flat )
rhinoscriptsyntax.MeshPolyline()
seems to not work
Is there any method in python what would work like:
mesh - From Closed Polyline
( Polyline is not flat )
rhinoscriptsyntax.MeshPolyline()
seems to not work
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
Yes that is option.
Is there any other way to triangulate polyline in case it is concave.
I see the problems that Mitch pointed out and am working on a solution.
Thanks,
-Steve
Ok, the MeshPolyline function should work in the next V5 beta on non-planar polylines.
Thanks,
-Steve
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