Triangle Extraction. Under the assumption that the space of a small 3D cube could always be divided into two sides, we can classify its 8 vertices into 2 categories, i.e., inside or outside the surface. Accordingly, we can extract the triangles using the lookup table of Marching Cube [1]}. Specifically, let \(o_i\in \lbrace 0,~1\rbrace \)  be the occupancy of the \(i\) -th (\(i=1,2,...,8\) ) vertex, and \(b_{ij}\in \lbrace 0,~1\rbrace \)  the intersection detection result on the connection between vertices \(i\)  and \(j\) . For each condition in the lookup table, we define its cost function as
\(\mathcal {L}=\sum _{1\le i<j\le 8}\texttt {XOR}\left(c_{ij},\texttt {XOR}\left(o_i,o_j\right)\right),\) 
