I ran into a problem a while ago where I needed area centroids of irregular planar shapes. Since I couldn't find an appropriate SketchUp plugin, I used Rhino that time. The attached plugin adds this functionality to SketchUp.

Contrary to some plugins that I found, which use the centroid of the bounding box (and then add a construction point there), this one calculates the actual centroid accurately for any polygon (hence any shape in SketchUp). It also provides the area (more for reference since SketchUp spits this out anyways) and the area moments Ix, Iy, Ixy.

Please give this a try and let me know if you run into any usability, calculation or proper plugin programming issues.

Some limitations: Shapes must be drawn on the ground (x-y plane) and calculation accuracy is limited by polygon accuracy.

Perhaps you and TIG could get together and combine your scripts so that the C-of-G and moments of inertia of a complex shape could be calculated. TIG's script (VolumeCalculator, viewtopic.php?f=180&t=1532&hilit=+Plugin)calculates the volume by slicing up the shape into wafers parallel to the X-Y plane. The script could be extended to include a look-up table of the densities of typical building materials to yield the mass of the shape (concrete slab, say). If the table of densities could be edited by the user to add/remove materials then that would be even better.

I needed this functionality because I got my students to design and make mobiles as a fun example of small "structures". It might be useful for designing cross sections for structural analysis or for finding load resultant locations, too.

I'll check where I got the formulas from. It was some structural reference book. I actually re-used some old Pascal code here.

I bet there's a generalized 3d variant of this calculation approach. Haven't looked into it yet. I would think, though, that vertice ordering would be a major issue there.

alexschreyer wrote:I ran into a problem a while ago where I needed area centroids of irregular planar shapes. Since I couldn't find an appropriate SketchUp plugin, I used Rhino that time. The attached plugin adds this functionality to SketchUp.

Contrary to some plugins that I found, which use the centroid of the bounding box (and then add a construction point there), this one calculates the actual centroid accurately for any polygon (hence any shape in SketchUp). It also provides the area (more for reference since SketchUp spits this out anyways) and the area moments Ix, Iy, Ixy.

Please give this a try and let me know if you run into any usability, calculation or proper plugin programming issues.

Some limitations: Shapes must be drawn on the ground (x-y plane) and calculation accuracy is limited by polygon accuracy.