Auspicious Patterns and 3D Models Applied in the Creation of Personalized Products

Auspicious patterns are an important manifestation of traditional crafts aesthetics for Chinese culture, and it not only exhibits the clever tricks of folk art, showing more personality and characteristics of Chinese culture in the humanities and arts aesthetic concerns. It shows the traditional aesthetics, based on the harmonious and success, constructed by intelligence and humbleness, shaped by symmetry and balance. This thesis contains two topics: they are the 2D image materialization and the 3D model flattening. First is analyzing the image of the auspicious pattern, and transformed the 2D image into a solid model. The second is through the mathematical operation skills of the geometric model, the existing auspicious 3D model of the triangular mesh is scaled, appropriately rotated and divided to form a flattening model of different visual effects. Finally, these models by means of other modeling software were combined into a new 3D model, then through the 3D printer to quickly print out part of the unique personalized products, to promote the natural beauty of traditional Chinese culture.


Introduction
The auspicious pattern is a form of literary and artistic expression in Chinese historical and cultural traditions, and it is closely related to people's lives, customs and cultural background. Its origin can be traced to the tribal totems of primitive society and the decorative patterns on some utensils at that time. People in primitive society are full of enthusiasm for life and survival, but they are also afraid of certain phenomena produced in nature, so there were sacrificial ceremonies and divination, these activities are mainly active to ask for good for-tune. The production of auspicious patterns is directly related to the observation method of the ancient ancestors who viewed objects and images, as well as the recognition of patterns in the divination. Therefore, it is a kind of cultural heritage worth keeping.
Since the rapid prototyping technology was proposed in the late 1980s, it immediately received widespread attention and quickly became a research topic in the manufacturing field. With the continuous expansion of the application field of rapid prototyping technology, it has become an important part of advanced manufacturing technology. There is no doubt that the emergence of rapid prototyping technology represents another breakthrough in production engineering. The file format used in rapid prototyping systems is generally a triangular mesh data format file (STL file). Almost all developers of rapid prototyping systems have adopted this data format. In fact, all major CAD/CAM software systems have functional modules for generating STL files. The STL file format is a file format first proposed by 3D System in the United States. It is a model file obtained after triangular meshing of a 3D solid model file. It has become a data exchange standard between CAD systems and RPM system. This file format discretizes the CAD surface into a triangular mesh, and different precision will have different number of triangle mesh divisions. In the STL file, each triangle mesh has four data items, namely the coordinates of the three vertices of the triangle and the normal vector of the triangle mesh. The STL file is a collection of multiple triangle meshes. The STL file format was originally used in the Stereolithography (SLA) technology. Since STL has nothing to do with CAD systems, it quickly developed into a standard for data exchange between CAD systems and rapid prototyping machines in the rapid prototyping field. However, due to the STL format file has its own shortcomings, many scholars have proposed new data formats or amendments over the years. For example, the Delaunay triangulated mesh was proposed by the Russian mathematician Boris Delaunay in 1934, but it has the shortcomings that the boundary disappears and new nodes cannot be interpolated. In view of the shortcomings of the former, Chew proposed the Constrained Delaunay Triangulation (CDT) to improve and modify [1]. For the latter shortcoming, Edelsbrunner and Tan proposed a 2D interpolation node algorithm, which complements this function by inserting Steiner Points [2]. And Alper developed a new theory of Steiner Points insertion, called Off-Centers, by inserting this new type of Steiner Points, in addition to the optimization of the mesh quality and size, the problem of too many new Steiner Points is improved, at the same time, the number of inserted Steiner Points and the number of triangle meshes generated is reduced, thus reducing the time required for meshing [3].
It can be seen from the above that almost all scholars are focusing on researching the generation efficiency and quality of triangular meshes. The application of triangular meshes has also been widely used in 3D printing equipment. However, the deformation application of the triangle mesh of the object rarely appears in the existing literature.
Digital image processing generally refers to the use of computers to process images, the image refers to a 2D function f(x, y), where x and y are spatial coordinates, and the size of f is called the intensity or grayscale of the image at that point. It can also be imagined that the image is divided into m * n equal parts and each unit cell contains its specific brightness, position and other information. This unit cell is called an image element or pixel. Therefore, a grayscale digital image can also be regarded as a matrix, the row and column determine a point, and the corresponding matrix element is regarded as the gray level of the point. After the image is digitized, it can be analyzed and processed by image processing software, so that the image can be transformed into the information we need for subsequent applications [4].
Digital images contain three basic properties: resolution, number of layers and number of planes. The resolution refers to the number of pixels in an image, which is often expressed as the product of row and column pixels; the layer level is the discrete value of the light intensity distribution of the digital image, usually n-bits to represent the 2n degree value that each pixel can present, for example, an 8-bit digital image has a range of 28 = 0 -255; the number of planes refers to how many pixel matrices are composed of a digital image. For example, the grayscale image is composed of a plane, while the color image is a digital image composed of three planes of red, blue and green [5].
Before the original image is processed, there must be a certain degree of noise or interference caused by the environment, and all external interference will destroy the quality of the image and cause a lot of trouble in analysis or processing. Therefore, in order to reduce the image noise, filtering and smoothing methods are used to eliminate the noise. Generally speaking, filtering and smoothing methods can be divided into frequency domain filtering and spatial domain filtering. The so-called frequency domain is to regard the original signal as composed of different orthogonal signals. The common method is to express by Fourier transform, and transform the original image to the frequency domain by discrete Fourier transform. Each point represents a basic frequency, and then, according to the method of frequency represents to do the processing. The spatial domain directly represents the characteristics of the image. It is a 2D function f(x, y). The gray level of each point's coordinates (x, y) represents the physical characteristics of the image at this point. The characteristics of each point can also be modified with the surrounding gray value, and this research uses this method-Gaussian smoothing filter method to eliminate the noise in the image.
The purpose of edge enhancement is to mark the points with obvious brightness changes in the image, because the points with larger brightness changes can be regarded as the shape or outline of the feature, and because the points with large brightness changes mostly occur at the edge, it can also be called edge detection processing. After the image data is processed by edge detection, not only the amount of data can be greatly reduced, but also irrelevant information can be eliminated, and the important structural attributes of the image can be retained. The commonly used edge detection filter methods include Sobel opera-tor, Laplace operator and Canny filter method [6]. In this study, the Sobel operator is used to enhance the edges in the image.
As for the application of processed images, most of them are currently used in the field of object shape or face recognition. The application of materialization it is rarely seen. Therefore, this research is based on the existing traditional auspicious image model, and reconstructs the characteristic contour appearance through image processing techniques. Then use 3D modeling software (Rhinoceros) to create a 3D physical model, and quickly print out personalized and unique products with a 3D printer to promote the inherent cultural tradition.

Techniques for Turning 2d Image into Materialization
In the process of turning 2D images into 3D solid model, the first step is to appropriately process the image. In this thesis, the preliminary image processing part focuses on the noise filtering and edge enhancement of the digital image. The method is explained as follows:

Filtering and Smoothing of Digital Images
This thesis uses Gaussian smoothing filter to smooth digital images. Gaussian smoothing filter method is usually called low-frequency filtering. It is mainly used to eliminate the high-frequency changes in the image, strengthen the low-frequency part, and make the changes in the image more uniform, it can produce a fuzzy image and reduce the sharper image part. It is usually used to reduce image noise and reduce the level of detail. The Gaussian smoothing mask is shown in Table 1.
From a mathematical point of view, the Gaussian blur process of an image is the convolution product of the image and the normal distribution. Since the normal distribution is also called the Gaussian distribution, this process is also called Gaussian blur. The value of each pixel is the weighted average of surrounding neighboring pixels and the value of the original pixel has the largest Gaussian distribution value, so it has the largest weight value. As the neighboring pixels are farther from the original pixel, the weight value is smaller. Figure  1 is the comparison diagram before and after image filtering.

Edge Enhancement of Digital Images
The meaning of the magnitude of the image gradient is the speed at which the brightness of the image changes. For the edge of the image, where the grayscale value changes greatly, the gradient value is also greater. Conversely, for the smoother part of the image, the grayscale value changes less, and the corresponding Table 1. Gaussian smoothing mask.
Total gradient strength: ( )  Figure 2 is the comparison diagram before and after image edge enhancement.

Techniques for 3d Model Flattening
This thesis is based on the mathematical operation skills of the geometric model, and the existing auspicious 3D model of the triangular mesh is scaled, appropriately rotated and divided to form another model of different visual effects. Therefore, the key points of this part are as follows.

Data Acquisition of Auspicious 3D Model of Triangular Mesh
At present, all 3D printers can accept STL format, which is a triangular mesh format. The so-called STL format is an approximate triangular mesh to represent the surface or solid entities of the object. In the STL file, each triangle mesh has four data items, namely the coordinates of the three vertices of the triangle and the normal vector of the triangle mesh. The STL file is a collection of multiple triangle meshes. The output form of STL can be divided into ASCII and Binary.  The ASCII STL file is just for the user to see its format and further edit, but it occupies a large space, the Binary format is a more reasonable choice.  Figure 3 is the auspicious 3D model of triangular mesh.

3D Model Scaling Processing
In this study, we use a column matrix A, to represent the position vector of each end point in the triangular meshed of 3D model. Therefore, the transformation of the scale or deformation of this model in space can be expressed as AT = B, Where T can be regarded as a geometric operator, Therefore, the meaning of the above formula is that a set of points represented by the position vector in the matrix A is geometrically transformed to obtain a new form. In order to solve the problem that the 3D model can be converted based on any position in the 3D space, it must be expressed in homogeneous coordinates. Therefore, the point [x y z] in the three-dimensional space can be determined by the four-dimensional is some transformation matrix. Therefore, the generalized 4 × 4 transformation matrix for three-dimensional homogeneous coordinates is: In the above formula, the upper left 3 × 3 submatrix [ ] Figure 4 is the comparison diagram of the 3D model before and after it is reduced by 0.5 times.

3D Model Display Orientation Control Processing
When the model is rotated multiple times in space, that is, the model will perform translation and rotation of each axis relative to the center of rotation. Therefore, the coordinates of each point of the model will change accordingly.
Assuming that if an arbitrary axis passing through the point (x 0 , y 0 , z 0 ) in space,  its direction cosine is (c x , c y , c z ), the rotation angle δ of this axis can be completed by the following steps: Step 1: Translate so that the point (x 0 , y 0 , z 0 ) is at the origin of the coordinate system.
Step 2: Perform proper rotation to make the rotation axis coincides with the Z axis.
Step 3: Rotate about the Z axis by angle δ.
Step 4: Perform the inverse matrix operation of the combined rotation transformation.
Step 5: Perform the inverse matrix operation of translation.
Generally speaking, in order to make any axis passing through the origin coincide with any axis, it is necessary to rotate the other two coordinate axes twice. To make any rotation axis coincide with the Z axis, first rotate the X axis, and then rotate the Y axis. To determine the rotation angle α to the X axis (where α is used to place any axis on the xy plane), must project the unit vector along the coordinate axis on the yz plane, and the y and z components of the projection vector are c y and c z , respectively, they are the direction cosine of the unit vector along any axis. So we can get; After rotating the X axis to the xz plane, the z component of the unit vector is d, and the x component is the direction cosine c x in the x direction. Because the length of the unit vector is 1, the rotation angle β used to make any axis coincide with the Z axis is; where the required translation matrix is; H The transformation matrix for rotation about the X axis [ ] And about the Y axis Finally, the rotation angle of arbitrary axis can be obtained by the Z axis rotation matrix, and its value is; [ ] Although the terms of the rotation matrix [R x ] and [R y ] in Equation (6) can be obtained from Equation (8) and Equation (9). But in fact, the angles α and β are difficult to calculate directly. Therefore, if the direction cosine of arbitrary axis cannot be known, but it is known that the axis passes through the second point (x 1 , y 1 , z 1 ), after normalizing the vector from the first point to the second point, the direction cosine of the axis can be obtained as follows : In this way, we can get the orientation of the model after rotating arbitrary axis in space. Figure 5 shows the original model rotated around the Z axis by 110 degrees counterclockwise.

3D Model Flattening Processing
When the 3D model is rotated to an appropriate angle, then the flatting operation can be performed. The main principle is to use a plane parallel to the visual direction as the cutting plane and find the unit normal direction of the cutting plane, then adjust the depth of this cutting plane appropriately to cut the 3D model, and set the height of the 3D model after flatting. Finally, the front model after cutting is projected along the normal direction of the cutting plane and scaled to complete the flatting operation.
H.-C. Chang Generally used to represent the coordinate system of a 3D model, the plane parallel to the ground is often set as the XY plane. According to the right-hand rule, the plane parallel to the screen is the XZ plane. Assuming that the position coordinates of the vertices of the triangle meshes of the front model after cutting are ( ) Journal of Computer and Communications Step 2: Load the image file, and create the contour path of the image through image processing techniques.
Step 3: Load this contour path into the 3D modeling software.
Step 4: Through the node adjustment in the 3D modeling software, complete the complete contour path of the image.
Step 5: According to the characteristics of this auspicious image, construct 3D models of different heights from the closed contour paths of each area, to complete the 2D image materialization processing.
The entire flow chart is shown in Figure 7, and the Figure 8 is the auspicious products of 2D image materialization results.

3D Model Flattening Processing
Step 1: Load the STL file of the auspicious 3D model.
Step 2: Adjust the scale of 3D model appropriately.
Step 3: Adjust the display orientation of 3D model appropriately.
Step 4: Using the display orientation of 3D model as the depth normal direction, and flattening the STL data of the auspicious 3D model according to the assigned depth.
Step 5: Use 3D modeling software to make matching pendants and combine them into models of unique products.
The entire flow chart is shown in Figure 9, and Figure 10 is the auspicious products of 3D model flattening results.

Conclusion
Since ancient times, people have been in awe of nature, and they are full of longing and hope in the face of an unpredictable future. The auspicious pattern is also a presentation of people's hope for the future. The auspicious patterns are suitable for the past and the present. They can be viewed and used, which are inseparable from people. In this thesis, the 3D model was created from two methods of 2D image materialization and the 3D model flattening, and then these     models by means of other modeling software were combined into a new 3D model, through the 3D printer to quickly print out part of the unique and auspicious products to promote the inherent cultural tradition.