# Point list in sequence

Hi,
Could anyone advise how to make the points in sequence so that closed curve can be drawn.?
Thank you so much.

Could you show us preview for `"PolyCurve.ByPoints"` node.

There isn’t necessarily a standard way to do this. depends on specific conditions.

Looking at your image, seems like you have two rows/columns of points.
You could try sorting them by their X coordinate values (round off the value to ignore minor variations) and then the Y coordinates (or vice versa)

1 Like

There have been several discussions on the forum regarding sorting of points based on location.

Have a look and have a go. If you do crack it, please remember to post your solution to aid others.

2 Likes

Ok, feeling generous.

Part of an upcoming package.

Node Description:
Takes a list of unsorted points and orders them (clockwise/anti-clockwise around a centroid) to create a Perimeter. Useful for Polycurves and Surfaces.

5 Likes

@thethtarzaw
It would be a good exercise to try to solve your own issue with some support from the forum, especially since there are already other related discussions such as this one:

@Ewan_Opie
I can not wait to see information about your upcoming package posted in the Share category

1 Like

@Ewan_Opie
It’s cool!.
Thank you for the node and it comes in handy.

1 Like

@Yna_Db Thanks for sharing.
I will take note on this.

Hi,
I have similar problem, little bit more complicated. I’m trying to number points on edges of non-rectangular contour. Main task is to get red lines - the spaces between walls and yellow lines - upper walls edges. Both types will be changed to beams. So, I figured out, that it is possible to build sequence of lines by all these points (organised) on edges and then compare list of lines to another list that contains lines from walls.
In simpe cases, clockwise order done by angle between center and n-point will work, but if the contour is irregular, some point are in the wrong order.

Have You got any idea how to fix these places? Or, maybe, change whole method…?

It looks like you could just make a single poly curve from all the points that you have then split it by the points. You would then need to check what lines are over a wall. Maybe just grab the mid-point move it down a bit and check to see if it’s in a walls bounding box.

Hi @Steven,
It was my first idea. Polycurve seems to be a solution but it’s not if points are not in proper order. After exlploding it (polycurve to curves or geometry explode) I get curves with wrong length.
These polycurves looks the same, but sequence of points alters how it’s build.

Take a look at the links Ewan posted above. One of them is mine and I address this problem.

Edit:
You can also look at creating a surface from the points and then grabbing the perimeter curve.

1 Like

Hi @Steven ,

Node Points.SortPointsAlongCurve from Lunchbox is no longer available.

" ** Note that we have discontinued the Dynamo versions of this tool. Current and future versions of LunchBox are built for Grasshopper. The source code for the Dynamo version can be found here under the GNU license.*"

Can You copy-paste python script for that or send *.dyf file?

@Edit:
Is it possible to get surface “inside” area using points only? Surface by curves depends proper sequence too.

@Edit2:

Maybe I could add another condition - sort by length. Script will check not only vector’s angle from points to center but moreover their lenght. If vector v.n+1 wouldn’t fit to v.n and v.n+2 sequence, it would be pushed to another list and somehow added in the next step.

Sorry pressed for time so need to keep this short.
https://dictionary.dynamobim.com/#/Geometry/Surface/Create/ByPerimeterPoints

You should also still be able to download the old lunchbox package at least last I checked.

Its nodes do not even appear in Revit 2022 Dynamo’s Library when installed. New thread at:

I’m looking for a replacement.