Number elements along a line


#1

I want to number/renumber elements along a line.

Each element finds the shortest distance to the spline (perpendicular). This point on the line is the sorting order. Is there a function in Dynamo for this?

I have made such this program in Grasshopper and there the function was called “Curve Closest Point”

 

Overview

[video width=“1812” height=“764” mp4=“http://dynamobim.com/wp-content/uploads/forum-assets/rune-hauglandnorconsult-com/04/11/2015-04-10_14-40-10.mp4”][/video]

 

 

 

 

 

 

 

 

Step by step:

  1. Draw a spline

  2. Select objects

  3. The objects are renumbered in the order of the spline.
     

 


#2

Hi Rune,

i don’t know if this is optimal but it seems to work.

you still need to compare the ordered points to the not ordered points to get a keylist so you can sort the “points near curve” in the right order

curve closest to


#3

Here’s how you could sort your elements by the normalized curve parameters of the closest points:

SortByProximityToCurve


#4

Andreas,

 

Out of curiosity. How would you sort those lists without the clockwork node with “stock” dynamo nodes?


#5

Martin, you would have to create a custom node that acts as the key projector for the built-in SortByKey node. In this example, the custom node would have to consist of three nodes (encircled with the red line):

CustomKeyProjector


#6

Is there a way to get better pictures of these? I cant see anything on these and if I download them. the resolution makes it impossible to read. thanks.


#7

See: