Extract the center of multiple planar closed curves as points

Hi everyone, thanks for reading, I was wondering if someone can help me with Extracting the center of “multiple” planar closed curves as points in a single python script. after some digging, I found this script
CurveCentroid.py (2.0 KB)
provided by the great Helvetosaur, but I can’t make it select multiple curves, so if you can modify the script and help me, it would be great, and thanks!

and I found some issue here as well, the script is not taking into account the exact shape of the curve, it’s simplify it, so it wont create accurate representation of the real center, any solutions?

If there is a solution that the center would be something like this: (as a volume for example)


so that it stays away from the edges…
again thanks for help

Hi,
Perhaps areacentroid comand if your object is planar or curve
VolumeCentroid if it’s a solid.
RM

The area centroid of a closed curve is not necessarily going to be inside the object nor guaranteed to be far away from the edges. What you are looking for is not a centroid.

Rhino does have an AreaCentroid command.

This script does multiple.

CurveAreaCentroid.py (949 Bytes)

– Dale

1 Like

thanks, well that will do, but only for one object at a time, Dale Fugier has posted the solution, thanks again

thanks a lot, well I understand you well, but is their anything you know close to what I’m looking for? so I can search for it online?

thank you so much Dale Fugier, that will do for now, I’m looking into something similar to my 2nd comment, if you know anything that is close, so I can try and search for it please let me know.
thanks

My feeling is you might some sort of iterative process with successive offsets of the curve to the inside until it converges on one point. Some curves might end up with multiple points or a line… Maybe someone in the Grasshopper group has a solution. Or maybe @DanielPiker ?

Yes, if you don’t mind going to grasshopper you could use this:

1 Like