How to calculate the contact area of ​​one rectangular cuboid with its adjacent cuboids

I am trying to arrange rectangular cuboids of different sizes next to each other, so that the contact area between them is maximized.

In rough form, I am looking for a possible position for everyone to be placed in a space that does not intersect with any other cuboids. I realized this using the Java 3D BoundingBox class , where you can check whether a given box intersects with a given set of other boxes. Now I have a lot of possible places, from which I need to choose the one with the highest contact area with other drawers.

My problem is that I do not know how to efficiently calculate this area. A small example ...

Box 1: bottom left point x = 0, y = 0, z = 0; upper right point x = 10, y = 10, z = 10

Box 2: lower left point x = 10, y = 0, z = 0; upper right point x = 15, y = 5, z = 5

Box 3 has the same dimensions as box 1 and should be located with a maximum contact area

In this example, all points at which one side of box 3 matches any other than the right side of box 1 (where Box 2) are optimal solutions.

I would be very happy if someone had an idea or even a solution. I am also pleased with the free libraries if they are not too large.

Thank!

+3
source share
1 answer

Consider each potential pair of tangent faces in turn.

2 1. . , , , , . . .

, , , . , , , .

, , .

, .

, , .

5 .

+1

Source: https://habr.com/ru/post/1781563/


All Articles