algorithmic modeling for Rhino
I think you need to create a VolumeMassProperies Class from the Brep.
You should be able to get the centroid from that.
http://4.rhino3d.com/5/rhinocommon/html/T_Rhino_Geometry_VolumeMass...
Hi Mat,
Thanks for quick reply!
Took me a while to figure this out- I kept on referencing a null overload for Centroid. Is it because it's a property and not a method?
P.S.
Here's a reference for rookies like me:
private void RunScript(Brep brep, ref object A)
{
VolumeMassProperties vmp = VolumeMassProperties.Compute(brep);
Point3d pt = vmp.Centroid;
A = pt;
}
Correct. As 'Centroid' is a property of the VolumeMassProperties Object and doesn't require any parameters it is accessed using the dot notation you've shown above.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by