Skip to content

Commit b06fb8c

Browse files
committed
traversal_voxel_filler_inverse volume test
1 parent c03e60d commit b06fb8c

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

tests/test_volume.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,28 @@ TEST(Voxelizer, TraversalVolumeTripleSeparate) {
144144

145145
delete surface;
146146
delete volume;
147-
}
147+
}
148+
149+
TEST(Voxelizer, TraversalVolumeTripleInverted) {
150+
auto surface = new chunked_voxel_storage<bit_t>(0., 0., 0., 0.1, 300, 100, 100, 32);
151+
152+
for (int i = 0; i < 3; ++i) {
153+
BRepPrimAPI_MakeBox mb(gp_Pnt(i * 10. + 1., 1., 1.), 8., 8., 8.);
154+
auto vox = voxelizer(mb.Solid(), surface);
155+
vox.Convert();
156+
}
157+
158+
// Traversal is done on external and then inverted
159+
traversal_voxel_filler_inverse filler;
160+
auto volume = filler(surface);
161+
auto A = surface->count();
162+
auto B = volume->count();
163+
164+
ASSERT_EQ(A, 3 * (81 * 81 * 2 + 81 * 79 * 2 + 79 * 79 * 2));
165+
ASSERT_EQ(B, 3 * (79 * 79 * 79));
166+
ASSERT_EQ(A + B, 3 * (81 * 81 * 81));
167+
168+
delete surface;
169+
delete volume;
170+
}
171+

0 commit comments

Comments
 (0)