• 沒有找到結果。

Soldify shell-only voxelized 3D model

Translate correspondingly

Algorithm 2 Soldify shell-only voxelized 3D model

Require: A voxelized 3D model V m with no holes on the shell surface.

. (i.e., a fully enclosed 3D model) for all V m(x, y, z) = 0 (empty void voxels) do

hitcount ← 0

for all rays shooting toward 6 direction do if the ray hit an occupied voxel

+ + hitcount end for

if hitcount = 6 V m(x, y, z) ← 1 end for

empty void voxels , hitting nothing but continuing travels. While the interior empty void voxels, with the enclosure assumption, will make hitcount reaches six. The results are shown in the Figure 3.11.

After we obtain solidified voxel representation, V Msolidbox, we use it to perform re-pairing procedure 2. As previous section mentioned, V Mboxis often thicker than V Mray, while V Mray often produces the artifacts like Figure 3.8. This observation strongly sug-gests that we should devise a heuristic voxel connectivity repairing algorithm using a thicker reference V Msolidboxin attempt to eliminate the disconnecting artifacts in V Mray. The method is described in the algorithm pseudocode 3. Basically, it will utilize the previously described voxel connected component algorithm to detect if there is a voxel at V Msolidbox(x, y, z) and adding it to V Mray(x, y, z) cause the voxel connectivity of nearby 3x3x3 space dropping, then we add it. Otherwise we reject this adding.

Algorithm 3 Voxel connectivity repair using a thicker reference V Msolidbox for all V Mray(x, y, z) = 0 (empty void voxels) do

V M3x3x3 ← extract nearby 3x3x3 of V Mray at (x, y, z) oldConnectivity ← VOXEL CONN COMP(V M3x3x3) V Mray(x, y, z) ← 1

V M3x3x3 ← extract nearby 3x3x3 of V Mray at (x, y, z) newConnectivity ← VOXEL CONN COMP(V M3x3x3) if newConnectivity ≥ oldConnectivity

V Mray(x, y, z) ← 0 . reject the adding.

end for

We use a reference voxelization V Msolidboxbecause simply adding voxels for

connec-(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 3.11: Solidify a voxelized 3D model. The resolutions of these models are the same as Figure 3.7. The bunny has a failure voxel inside, it is because the model has bottom holes which violate the assumption of our procedure.

tivity will not respect to the visual similarity. And we use V Msolidboxinstead of V Mbox because there are extreme cases that the shell of V Mboxdoes not intersect with the shell of V Mray. These cases may occur if the intersection of triangle is very close to the boundary of a voxel.

The results are shown in Figure 3.12. The algorithm often successfully repairs the voxelized model with long parts. These models are often humanoid characters, biped animals, and so on. Models with smoother surface often do not need such connectivity repairing. Because we only apply the connectivity repairing within 3x3x3 cube space (that is, it checks the Definition 1 and diagonal voxels). It cannot actually connect the case shown in Figure 3.9 (c), since their 3x3x3 space do not include each other.

The repairing procedure 3 also takes the advantage of the observation that V Mray is thicker than V Msolidbox. It could happen that V Mray will be entirely included by V Msolidbox, and the we can use the solid interior of V Msolidboxto repair surface and inte-rior holes of V Mray. The algorithm 4 implements this procedure.

Algorithm 4 Repair surface/interior holes of V Mray using a thicker reference V Msolidbox for all V Mray(x, y, z) = 0 (empty void voxels) do

surroundingCount ← 0

(check if (x, y, z) is surrounded by V Msolidbox = 1 in six directions):

if V Msolidbox(x − 1, y, z) = 1 + + surroundingCount

In fact, we not only check V Msolidboxbut also check V Mray for surrounding. This is just for some subtle cases that the V Msolidboxis not successfully solidified. The algorithm successfully applied to different resolutions of the bottle model. At this step, our attempt to repair a voxelization result with artifacts is basically finished. The following prepro-cessing steps are focused on providing a better initial solution for placement optimization.

(a) Dinosaur (b) 4 connected components (c) entire fully connected

(d) Child (e) 3 connected components (f) 2 connected components

(g) Bunny (h) 5 connected components (i) entire fully connected Figure 3.12: Repair the connectivity of V Mray. Left column is the original triangu-lar mesh models. Middle column is the voxelized models before connectivity repairing.

Right column is the voxelized models after connectivity repairing. (a), (b), (c): Dinosaur, resolution = (x: 18, y: 25, z: 26). (d), (e), (f): Child, resolution = (x: 25, y: 37, z: 12).

(g), (h), (i): Bunny, resolution = (x: 15, y: 15, z: 12). In the child model case, the yellow voxel in (e) cannot be rescued due to 3x3x3 cube space constraint.

(a) (x: 16, y: 25, z: 8) (b) (x: 23, y: 38, z: 12) (c) (x: 31, y: 50, z: 16)

(d) (e) (f)

Figure 3.13: Repair surface and interior holes of V Mray. First row shows the broken part of the “Bottle” model. The captions in (a), (b), and (c) are their voxelization resolution.

Second row shows the repaired results.

3.3 Preprocessing

Although there are previous voxel repairing efforts, still we are unable to fully repair all kinds of artifacts in these voxelized models. The remaining isolated voxels, as shown in Figure 3.10, will never connect to the main trunk of LEGO sculpture. If we do not get rid of these voxels, we cannot clearly determine our legolized results are valid or not in the later placement optimization step. In addition, albeit we change the cost optimality goal into quantity constraint goal, it is still worth making our voxelized model as hollow as possible. Especially for large LEGO construction projects, removing interior voxels can effectively minimize time and money spent on these projects.

The above two factors lead to the design of the following two operations.

1. Remove isolated voxels automatically.

2. Remove the interior voxels of the combined result, thus making it hollow.

The preprocessing step 1 is basically removal of smaller isolated connected compo-nents. As our VOXEL CONN COMP algorithm will find the major connected

com-ponent with most number of voxels, this step is as easy as reuse of the VOXEL CONN COMP algorithm. After cleaning fragmented voxels, we eliminate one of reasons that could fail

the placement optimization.

The preprocessing step 2, removing the interior voxels to make the voxelized model hollow, is the inverse operation of making model solid. However, the algorithm is quite different. Instead of traversing all empty void voxels, we use ray-tracing like algorithm to traverse voxels. Similar to the voxelization algorithm by ray-triangle intersection test, we also use parity counting to determine the interior, but with a higher counter bound for classifying interior between shell. The ray-tracing way provides the flexibility to adjust the thickness of the hollow voxelized model for every side, since we perform six sides ray-tracing to determine the interior. The algorithm requires one assumption, that is, the input voxelized model must be fully solidified (i.e., no holes inside the model). The procedure is implemented in Algorithm 5.

相關文件