i have diffrent shapes that i want to label. but i want the text to be inside the shape.
1) method that i used
so my first thought was to use the area component but in many cases the centroid came outside the shape itself. hence that doesnt work. below you can see there are many points that are outside the shape.
2) 2nd method best result but very slow (need something faster)
second method.gh (15.3 KB)
my next attempt was to populate the shape with points. this made everything run really slow cause i have around 1000s of shapes (but it had the best result)
and then select the points that is farthest away from the edges of the shape.
3) 3rd method (just a little bit faster than the earlier method)
i first used dispatch to seperate the shapes that had holes in them. then i seperated the cnvex and the concave shapes.
for the concave shape i used the area component to find the center for the lable
for the convex shapes and the shapes that had holes in them i used the face boundary component to divide it into faces them found the centers of those faces and then found the center that was furthest away from the edges of the shape.
centers.gh (22.3 KB)
is there a method that is better than this or atleast faster that this.
after finding the center i will use the 3d text tag component to label them