ExplodeCurves - question

Hi there,

I would like to explode a polyline and I have a question for the ExplodeCurve method. Is the sequence of exploded lines are in an ordered list all the time or we need a custom code to organize them to be next to each other. I mean the segments of the polyline are placed next to each other as it was a polyline before explode.

Hi,

rhinoscriptcontext.ExplodeCurves uses the RhinoCommon Method “DuplicateSegments”

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Curve_DuplicateSegments.htm

on the link above you can see that:

Polylines will be exploded into line segments. ExplodeCurves will return the curves in topological order.

I suspect Polylines to be also exploded in topological order, yet the wording is not explicit on that.
@dale are you able to clear this up?

-Willem

Thanks Willem. It seems it is a good alternative to ExplodePolyline. But what topological order means? I think it is what I am looking for.

You could also call Polyline.GetSegments() directly:

https://developer.rhino3d.com/5/api/RhinoCommonWin/html/M_Rhino_Geometry_Polyline_GetSegments.htm

It means the order they are connected in. So you indeed need a list of segments in topological order.
I am almost certain curve segments are returned in topological order, for all explode operations.

-Willem

@Willem,

Since a Polyline is just an array of points, I expect the function which explodes them will simply iterate the list of points, make line segments, add them to an output array, and then return the array.

– Dale

1 Like