Visual Center for Rooms

Hi everyone,

I’m trying to get the visual center of rooms for centering them. The scripts I have found are based on the solids.centroid function but this doesn’t work for L-shaped or U-shaped rooms.

Has anyone already found a way to it in Dynamo (a little bit as described here in the mapbox blog https://blog.mapbox.com/a-new-algorithm-for-finding-a-visual-center-of-a-polygon-7c77e6492fbc

Thank you

Hi @amadeumagalhaes

Is this what you need?

Hi @Kulkul

I’m looking for the visual center and not the centroid…
It would be something like this…

I just found some documentation on a “inner centroid”

And more notably information on SHAPELY, a BSD-licensed Python package for manipulation and analysis of planar geometric objects.

I’m a noob in Python but anyone thinks that it would be possible to use their object.representative_point in dynamo ?

https://shapely.readthedocs.io/en/latest/manual.html#object.representative_point

Thanks !!!

Hi Amadeu,

Indeed, the centroids can be outside the polygon:

But the Polylabel algorithm can be used with Revit :


And it’s a good way to tag items :

7 Likes

Merci @Alban_de_Chasteigner !!!