ScaleMap wz = new ScaleMap(bmin.z, bmax.z, 1, volume.resZ - 2);
ScaleMap gx = new ScaleMap(1, volume.resX - 2, bmin.x, bmax.x);
ScaleMap gy = new ScaleMap(1, volume.resY - 2, bmin.y, bmax.y);
ScaleMap gz = new ScaleMap(1, volume.resZ - 2, bmin.z, bmax.z);
volume.setScale(box.getExtent().scale(2f));
Triangle3D tri = new Triangle3D();
AABB voxel = new AABB(new Vec3D(), volume.voxelSize.scale(0.5f));
for (Face f : mesh.getFaces()) {
tri.a = f.a;
tri.b = f.b;
tri.c = f.c;
AABB bounds = tri.getBoundingBox();
Vec3D min = bounds.getMin();
Vec3D max = bounds.getMax();
min = new Vec3D((int) wx.getClippedValueFor(min.x),
(int) wy.getClippedValueFor(min.y),
(int) wz.getClippedValueFor(min.z));