Reorgenizing points of a changing-shape polygon

Hi,

I hope someone could help me to solve my problem. I got stuck with my project because of the problem with reorganizing points of changing-shape polygon.

Below, I will try to explain the problem and my goals:

I have 3 polygons (Figure 1 ) and I can change their shape if I change variables (moving points or area as shown in Figure 2).

My polygon is composed of multiple curves (Figure 3). My goal is to have only one line between vertices. I achieved it by grouping vectors and setting differences. The output was a list with vertices. The problem is that in doing so, the order of points in the list is mixed up.
To solve this, I decided to set a new position for point [0] (bottom left corner) and then I sorted points by Point.X to get clockwise order. In certain setups of variables it works (Figure 6), but in some cases does not (Figure 5 and Figure 7). It does not work, for example, when a point, which is supposed to be the last point in the list, has a minor X value as its successor point.

I wonder if someone with more experience than I has any idea how I could approach this problem and get ordered points, independently from the variables setup.

I need to have points in the correct order to create a polygon and afterwards offset its curves.

Many thanks!!!

Best regards,

Julia

Hola Amiga @Julia_Ratajczak buenas. I hope this gives you some ideas, I’m not sure I understand if this is what you are looking for?
Vertex of a surface.dyn (25.2 KB)

1 Like

Hola Amigo:)
Thank you very much for your time and idea!
Unfortunately, it does not work for me. If I apply Topology.Vertices with my initial polygon (trimmed geometry), it gives me vertices of each curve, because it is composed of many curves (Figure 3). My goal was to reduce the number of vertices by grouping curves by vector and I set differences (Figure 4). In this part, I was using curves so I couldn’t use Topology.Vertices node. I would need to reorder points that I obtained after the reduction (Figure 5).

Best regards,

Julia

@Julia_Ratajczak - Do you need to work with vertices? You could try the Polycurve.ByGroupedCurves node :slight_smile: This will take a set of random curves, and if they are touching, or within a tolerance, join them and correctly order them.

1 Like

Hola de nuevo, I think I did not explain well, what I wanted to propose was to create a large surface, and then trim the surface to get more smaller surfaces and now ask for the vertices of that new surface, did you try it like this?

2 Likes

Hello,
look at the Green group of Mr. Jacob’s work, he reorders the points

cordially
christian.stan

2 Likes

Hi Christian,

thank you for your suggestion.
I tried the same approach as Jacob Small, but it doesn’t work.
I still obtain mixed order of points…
Do you have any idea what I could improve?

Picture131

Many thanks!

Julia

1 Like

Hola:) Yes, I tried by it doesn’t work for me. I think the approach suggested by Christian in the post below could work, but it still gives me some errors…

Have a nice day!

Hello, it’s weird that it doesn’t work, I’m attaching this variant hoping for a result


script:
03 octobre forum anglais.dyn (38.4 KB)

cordially
christian.stan

2 Likes

Hi Christian,

thank you very much for this example. I always learn something new:)

The approach is good to get ordered lines and points in the list, however considering my shape it meets some issues.

Based on your example, I was testing different options and finally, I found PolyCurve.Vertices node from Ampersand package, which allows me to get a list with lines in the clockwise order at the end:)

Many thanks for your help! It was helpful for me to find the solution:)

Have a nice day!

Julia

3 Likes