Fusing millions of cubiodal voxels

What's an efficient way to fuse millions of voxels together.

1. Voxels are all cubiodal.
2. Voxels may share boundaries but they never intersect.

DKGH's picture

Also:
3. Voxels have the same lengths (X) and widths (Y) edges but variable heights (Z) edges.

Mikhail Sazonov's picture

Look at the glue option of the class BRepAlgoAPI_BuilderAlgo.

DKGH's picture

Thanks Mikhail.

Tested so far with the below in 2D (f0, f1, and f2 are TopoDS_Face with glue-able edges)

TopTools_ListOfShape faces;
faces.Append(f0);
faces.Append(f1);
faces.Append(f2);

BRepAlgoAPI_BuilderAlgo aFuse;
aFuse.SetArguments(faces);
aFuse.SetRunParallel(true);
aFuse.SetNonDestructive(true);
aFuse.SetGlue(BOPAlgo_GlueFull);

aFuse.Build();
aFuse.SimplifyResult();
DKGH's picture

This isn't giving me any perceptible performance gain however. I tested by increasing the number of faces to ~5000;

Kirill Gavrilov's picture

It doesn't look like a general-purpose Boolean algorithm intended for complex B-Rep geometry definition is a good fit for a task working with voxels-alike structures. Knowledge about model-specific structure could bring enormous difference in performance (voxels are much more simpler and uniform structures compared to B-Rep).