Difference between Rhino's VolumeCentroid vs Rhinocommon Centroid?

When I compute AreaMassProperties on a brep, the Centroid seems to be different from Rhino’s VolumeCentroid command. Can anybody explain to me why that is or what the difference is?

You can try with this C# script in scripteditor:

using System;
using Rhino;
using Rhino.Input.Custom;
using Rhino.Geometry;

var go = new GetObject();

go.Get();

var brep = go.Object(0).Brep();

var amp = AreaMassProperties.Compute(brep);

Rhino.RhinoDoc.ActiveDoc.Objects.AddPoint(amp.Centroid);

Using pythonscriptsyntax’ SurfaceVolumeCentroid seems to give the same result as the Rhino command.

231221 VolumeCentroid.3dm (69.0 KB)

For volume centroid, use VolumeMassProperties.

You are calculating the centroid as if your brep was hollow, made out of paper…

2 Likes

Of course. So obvious when you point it out. :man_facepalming:

1 Like