Calculate Smart Group of boxes with min max points

Viewed 68

I have List of boundary boxes with min max point for example:

    public class BoundaryVolume {
    
        public Point3D min;
        public Point3D max;
    }

BoundaryVolume  Box1 = new BoundaryVolume ( new Point3D (5,10,15), new Point3D (30,50,100));
BoundaryVolume  Box2 = new BoundaryVolume ( new Point3D (-30,-10,-15), new Point3D (30,50,100));
BoundaryVolume  Box3 = new BoundaryVolume ( new Point3D (225,-50, -15), new Point3D (1000,0 , 0));
BoundaryVolume  Box4 = new BoundaryVolume ( new Point3D (0,0,0), new Point3D (1,1,1));
List<BoundaryVolume> = new List<BoundaryVolume>().add(Box1).add(Box2).add(Box3).add(Box4)

I want to group recursively this boxes to group of groups in a smart way calculation

Geometries geos2 = new Geometries(A, B, C);
Geometries geos3 = new Geometries(D, E);
Geometries geos1 = new Geometries(geos2, F, geos3);

Box that nearby another box make them in same box. How can I do it

What I need is to get list of Boxes and to make a List of lists. demo of my need is in attach image.

enter image description here

0 Answers
Related