# 3D Shape Generation via Variational Autoencoder with
## 3 Proposed 3D-VAE-SDFRaGAN
### 2D Image and 3D SDF Dataset Generation  
ShapeNet [1] was used as the dataset in the experiments. The dataset comprises 55 common objects, consisting of 51,300 3D models. Furthermore, the 2D dataset utilized images from [PERSON] et al. [30], which contain rendered images of ShapeNet 3D models from 23 different views. Information about 2D images used in our experiment is described in Table 3.  
To preprocess the 3D signed distance function (SDF) field, SDFs were first derived from the 3D meshes [43]. Motivated by [36; 37], the network output took the form of SDF. An SDF is a subset of implicit functions that assigns a 3D point to a real value, expressing the structural relationship and distance to the 3D surface, rather than a likelihood. The SDF data representation, which is a 3D representation that uses signed values to represent a mesh object's inside-outside characteristics, has become popular for mesh generation with deep convolutional neural networks, as its presentation is not limited by fixed topology, unlike meshes and point clouds. Additionally, the SDF representation has a higher resolution compared to the voxel resolution.  
Given a spatial point \(p\in R^{3}\), the sign distance function \(k(p)\in R\) encodes the point's distance to its closest surface point, where \(p\) lies inside (\(-\)) or (\(+\)) of the object. In mathematical terms, given a set of points in a 3D Euclidean space, \(\Omega\), where \(\Omega\) is a non-zero volume open set with a smooth enclosed boundary, \(\delta\Omega\), the signed distance function, \(k\), is defined as  
\[k(x)=\left\{\begin{array}{ll}\mathrm{dis}(x,\delta\Omega),&\text{ if }x\in \Omega\\ 0,&\text{ if }x\in\delta\Omega\\ -\mathrm{dis}(x,\delta\Omega),&\text{ if }x\in\Omega^{c}\end{array}\right. \tag{1}\]  
where \(\delta\Omega\) denotes the boundary of \(\Omega\). The distance from a point \(x\), where \(x\) belongs to 3D Euclidean space to the boundary \(\delta\Omega\) is defined as the infimum of the distances from the point \(x\) to all points on the boundary:  
\[dis(x,\delta\Omega)=\inf_{y\in\delta\Omega}dis(x,y) \tag{2}\]  
The sign of a point \(x\) with respect to the boundary, \(\delta\Omega\), is defined as follows:  
\[sign(x,\delta\Omega)=\left\{\begin{array}{ll}1,&\text{ if }x\in\Omega\\ 0,&\text{ if }x\in\delta\Omega\\ -1,&\text{ if }x\in\Omega^{c}\end{array}\right. \tag{3}\]  
The signed distance functions in (1), which is the product of (2) and (3) can also be written as  
\[k(x)=dis(x,\delta\Omega)\cdot sign(x,\delta\Omega) \tag{4}\]  
To convert a triangular mesh into an SDF, the triangular mesh is first centered and normalized. Next, a 3D unit grid of resolution \(64^{3}\) is established around the geometry. The calculation of point-to-mesh distance is performed using an axis-aligned bounding box (AABB) tree, and the winding number of each point is computed to determine the sign of each point in the grid. Figure 1 illustrates examples of the transformation of 3D meshes into SDFs and 2D images. In the first row, 2D images of the car, table, sofa, and cabinet are shown. The chair and table meshes with their SDF views from different angles are shown in the second and third rows. The distance between each point and the surface is depicted in an SDF colormap. The colors in this colormap range from dark blue (inside) to yellow (outside).  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Categories** & **Size (Pixel)** \\ \hline Chair, Table, Car, Lamb, Sofa, Cabinet & \(64\times 64\) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Information about 2D images used in our experiment.