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.


rhinoscriptcontext.ExplodeCurves uses the RhinoCommon Method “DuplicateSegments”


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?


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:


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.



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