Forum Allplan

[Domanda] Distribution of points within polygon with most optimal distance


Hello everyone,
I was wondering if anyone could give me directions on how to make a specific script. I don’t expect to give me the exact node, but rather the logic that I should use.

Question:
How to distribute a number of points within a shape with the longest possible distance between them (or equal)?

Scenario:
Make a script that will calculate the best possible locations of buildings on the site keeping them as far as possible one from another. In most cases, I guess, it would put them at the periphery of the polygon, but in some cases it should be able to generate points within the site.

The logic/method that I have so far used:
Input a random polygon -> Generate a number of points (with equal distance) along each side of the polygon (these will determine the accuracy of the script -> Generate centroid point of the polygon -> Generate a line using ALL POINTS (calculates every possible distance between the points)
I am stuck here. I don’t know how to process this data. How can I make it calculate the biggest (and with most equal sides) N-sided-polygon using those points? I guess it should start with a single point and connect it to another and so on.

I hope I managed to explain it properly. The image is just for visual help of the so far logic (its possible to be completely wrong, I'm still at planning stage)

Thank You in advance,
Dobromir

Allegati (1)

Type: image/jpeg
42 scaricato
Size: 129,82 KiB

Show most helpful answer Hide most helpful answer

You can sort the points on all edges by the distance to the centroid point and take the first N points to generate the polygon. The node ListSort will be helpful here.
But I'm not very sure, if your approach will generate the polygon to fulfill the requirement in your question.

Product Owner API, Allplan GmbH

You can sort the points on all edges by the distance to the centroid point and take the first N points to generate the polygon. The node ListSort will be helpful here.
But I'm not very sure, if your approach will generate the polygon to fulfill the requirement in your question.

Product Owner API, Allplan GmbH