Rhino.Collections.Point3dList vs. python list of Point3d objects

Just a quick question for my general knowledge base… Is there a speed (or other) advantage to be gained by working with a Point3dList instead of a ‘normal’ list of Point3d’s with large numbers of points?

Thx, --Mitch

I haven’t used this list very much (only recently discovered it) so I may miss some points (pun intended) but some methods seems useful. Among them seems to be

ClosestIndex Finds the index of the point that is closest to a test point in this list.
ClosestIndexInList Finds the index of the point in a list of points that is closest to a test point.
ClosestPointInList

and

SetAllX, same for Y and Z.

Also the entire list can be transformed using list.Transform(…) in one go, which is another benefit over having to do a item-for-item transform in your own loop, etc.

Someone with more experience than me of the list probably have more to say.

// Rolf

1 Like

Hi Mitch,

The Point3dList is a helper class that wraps an internal point array (e.g ON_3dPointArray). As many SDK functions require this kind of array, we’ve made the (wrapper) class available.

Unless otherwise required, I’d stick with you call the ‘normal’ array.

– Dale

This list (well, array) seems very useful. Good choice.

// Rolf

I’ve been using it for a long time, exactly for things like @RIL points out. It’s also worth noting that the Polyline class inherits directly from Rhino.Collections.Point3dList, adding even more useful methods. In fact, I think Polyline might be the most unsung hero of RhinoCommon (at least for a lot of the stuff I’ve been doing the past couple of years) :raised_hands:

1 Like