Sorting Points

As follow-up to a previous post, Plant Connector Detail Lines via Dynamo, a reader suggested that the plantings could be sorted a few different ways, including by x and y coordinate values and by distance from another point. I thought these were both good ideas, so I went ahead and made a few nodes that can do just that.

Today’s Landform update has a few new nodes, including Points.SortByDistance and Points.SortByXY:

nodes

Starting out, here is a set of trees that I connect prior to sorting.

01_unsorted

And the same trees connected with XthenY sorting:

02_sortXY

And YthenX…

03_sortYX

And then sorted by distance (using the min xy as the base point).04_sortdistancePNG

In concept, sorting by distance is ideal with a radial configuration:

04_sortdistance_b

Though linear configurations will also sort neatly. The SortByDistance node has the ability to sort sublists as well, so you can connect multiple sets of different planting types:

04_sortdistance_group

Unfortunately, I was not able to get the XY node to sort sublists correctly, but it will still work fine with a single set.

And here is the entire definition for connecting multiple planting types at once.

def_comp.PNG

Advertisements

One thought on “Sorting Points

  1. Very, very, VERY helpful. Huge time saver as I’d been doing this with copy/pasted nodes over and over and over and over again. Thanks a bunch.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s