How do I find the overlapping volume of multiple 3D rectangles?
Show older comments
Hi! I am currently trying to calculate the overlapping region between 2 3D rectanges. I have created 2 3D rectangles (via convhulln of 8 different vertices each) and am attempting to identify and calculate the overlapping volume between these 2 rectangles (Lets say they're rectangles A and B and you could say their axes are parallel to each other; none of the rectangles are tilted with respect to each other). Imagine if the 2 rectangles below are in 3-dimensional space and that they are 3D

1) Right now, I am only able to identify if vertices from either A or B lie in the other polyhedron via the function inhull (3D version of inpolygon), which outputs a logical array, with no idea of carrying on to identify the volume of the intersected region.
2) Furthermore, I have to subtract the 'overlapping region' from lets say the green 3D rectangle, and compare this green 3D rectangle to other rectangles and carry out the same process of volume identification and volume/region 'subtraction'. What I wish to end up with is a green rectangle region that has no intersection with all the other triangles that I have compared it against, and calculate its remaining volume. I will then subtract the original volume of this green 3D rectangle (obtained from convhulln) with this 'remainder' volume, to obtain the total volume that all the overlapped regions have occupied in a sense. Would there be any efficient method to this? As I have thousands of 3D rectangles to compare against the 'template' 3D green rectangle. Thank you!!
2 Comments
darova
on 30 Apr 2020
- I have created 2 3D rectangles (via convhulln of 8 different vertices each)
But i only see 4 vertices each rectangle. Can you make a skech in 3D?
Jeng Sze Anselm Ng
on 1 May 2020
Edited: Jeng Sze Anselm Ng
on 1 May 2020
Accepted Answer
More Answers (0)
Categories
Find more on Particle & Nuclear Physics 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!








