Sorts a list of 3-D points so they will be connected in "reasonable" polyline order.
rhinoscriptsyntax.SortPointList (points, tolerance=None)
rhinoscript.utility.SortPointList (points, tolerance=None)
points |
Required. List. A list of 3-D points. |
tolerance |
Optional. Number. The minimum distance between points. Points that fall within this tolerance will be discarded. If omitted, Rhino's internal zero tolerance is used. |
List |
A list of sorted 3-D points if successful. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
points = rs.GetPointCoordinates()
if points:
sorted = rs.SortPointList(points)
rs.AddPolyline(sorted)