Volume of 3D polyhedron
35 views (last 30 days)
Show older comments
slaiyer on 24 Aug 2014
Commented: Iila on 25 Feb 2016
Given a set of 3D coordinates, how can one find the volume of the polyhedron that is not necessarily convex?
Iila on 25 Feb 2016
Thank you. But it doesn't. My polyhedra are concave. I also want to calculate the self intersecting volume, if any.
Mike Garrity on 24 Feb 2016
One option you might look at is alphaShape. It's similar to convhull, but more general. It will create non-convex shapes.
You use it like this. First I need a simple cloud of points.
npts = 75;
pts = randn(npts,3);
Then I create my alphaShape, and plot it.
shp = alphaShape(pts);
h = plot(shp);
But the reason this might be useful for you, is that it has a method that will return the volume of the shape:
And another method which will tell you whether other points are inside the shape.
testpts = randn(150,3);
inmask = inShape(shp,testpts);
h.FaceColor = [.75 .75 .75];
h.FaceAlpha = .25;
More Answers (0)
Find more on Bounding Regions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!