CSG Operations with Voxelized Solids3.3 Advanced CSG OperationPV1V2QRAP1P2BFigure 3.7: Classification of the region T A in subregions P, Q <strong>and</strong> RIn the second step we add the missing information about the surface B to voxel V . Wedistinguish two cases:• If there are at least in one direction two nearest voxels to V in T B , we use information fromthese voxels. For instance, if we want to evaluate density <strong>and</strong> gradient in voxel V i, j,k <strong>and</strong>we know density <strong>and</strong> gradient in voxels V i+1, j,k , V i+2, j,k , we set:d i, j,k = 2d i+1, j,k − d i+2, j,k⃗n i, j,k = 2⃗n i+1, j,k − ⃗n i+2, j,k . (3.11)If we can do this estimation for pairs of voxels in more than one direction, the final valueswill be calculated as an average of these estimations.• If there is no such pair of voxels in the neighbourhood of V , we use the information determinedin the first step for point P. The gradient of the point P is calculated in the sameway as its density. We evaluate the difference x of the densities in points V , P from theknown vectors ⃗n, ⃗u = −→ PV . Then voxel V has values:d V = d P + x⃗n V = ⃗n P . (3.12)As we can see in Figures 3.1, 3.2 third column, sharp edges are now without artifacts. Theyare visibly smoothed, but it is the only way to represent them in a grid with the given resolutionif the representability criterion is to be fulfilled. Similarly, in the union of two almost touchingspheres, the thin gap between them is not representable, <strong>and</strong> therefore is filled.We have not used any antialiasing method, so some artifacts can occur in pictures aroundobject contours. It is not a problem of the representation but the rendering technique <strong>and</strong> can beeasy solved <strong>by</strong> exploiting common routines.We successfully solved the problem of representability of CSG solids <strong>by</strong> rounding sharpedges <strong>and</strong> small details, which would otherwise result in reconstruction artifacts. Such rounding38
CSG Operations with Voxelized Solids3.3 Advanced CSG OperationV(a)nnuxVP(b)Figure 3.8: Addition of missing information for voxel in the critical area(a) using neighbouring voxels, (b) using point P calculated previously.39