Samo Jerom
Samo Jerom

Reputation: 2381

How to get the volume of a 3D concave shape?

I am wondering if anyone knows how to get the volume of a 3D concave shape? The Matlab build-in function can only calculate the volume of a convex shape. For example,

[K, V] = convhulln(shape.vertices); 

V is the volume. Here the shape is defined by a mesh with vertices and faces.

Thanks very much.

Best, A

Upvotes: 3

Views: 1568

Answers (1)

High Performance Mark
High Performance Mark

Reputation: 78344

If your shape isn't too complicated you can compute the volume of its convex hull and subtract the volumes of all the convex hulls of its concavities.

Otherwise, decompose your concave shape into a set of disjoint convex shapes and sum their volumes.

Upvotes: 3

Related Questions