Table of Contents

Property Centroid

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

Centroid

Gets the centroid of the solid, ignoring the openings.

public GeoPoint3 Centroid { get; }

Property Value

GeoPoint3

Remarks

Each surface triangle is taken with the world origin as the apex of a tetrahedron, exactly as GetSignedVolume() does, and the centroids of those tetrahedra are averaged by signed volume. The parts reaching outside the body carry negative volume and cancel, so the answer does not depend on where the origin is. A body with no volume has no centroid to average, and the centroid of its vertices comes back instead.