# Research on the Parametric Design and Application of Ceramic Modeling Based on Python
## 3 Parametric Design Practice
### Python Code Control Manufacturing Generation  
The key parameters identified through ErgoLAB experiments (Section 3.1) were mapped into the Python code as input variables. For example, the \"number of segments\" (determined from gaze duration analysis) controls the subdivision level of NURBS curves, while the \"starting/ending angles\" (derived from EEG-based cognitive load assessment) are encoded as rotational constraints. These parameters are dynamically linked to Grasshopper components, enabling real-time shape adjustments based on user-centric data. In the field of parametric design and manufacturing, Python code serves as a powerful programming tool whose role in the ceramic modeling generation process is indispensable, especially in the two core aspects of curve rotation and forming, as well as the creation of wall thickness and blended surfaces. Adopting Python code plays a crucial controlling role in these two key steps, facilitating subsequent 3D model generation. The primary task of the Python code is to receive the rotation parameters transmitted by the Grasshopper plugin, including the direction vector of the rotation axis, starting and ending angles, and the coordinates of the 2D contour control points, among other core information. Subsequently, the code needs to preprocess these input parameters, such as verifying the legality of the parameters, converting angles to radians (if necessary), and calculating the rotation matrix, etc. Based on the principles of ceramic engineering and 3D printing technology, the rationality of parameters is verified. The geometric parameters required include the radius parameters (R\({}_{\text{start}}\) and R\({}_{\text{end}}\)), 10 mm \(\leq\) R \(\leq\) 250 mm (constrained by kiln size), and the thickness of the ceramic bottle (1 mm \(\leq\) t \(\leq\) 10 mm; t represents the thickness of the ceramic bottle), etc. The limitations for each parameter should be set based on the specific requirements of the actual production process and the actual environment. Based on the user-defined rotation axis and angle, the Python code employs linear algebra theory of rotation matrices to accurately construct a 3D matrix describing the curves rotation. This matrix will be used to spatially rotate each control point of the 2D contour curve. Using the rotation matrix, the Python code performs spatial coordinate transformations on each control point to achieve 3D rotation of the curve. Subsequently, using these rotated control points, combined with Rhinos API functions (such as AddRevSurface or AddNurbsSurface), an accurate 3D surface model is constructed. During this process, to ensure the smoothness and continuity of the surface, the code also needs to appropriately adjust and refine the control points to meet design requirements. Thereafter, the Python code receives the wall thickness value set by the user, which directly determines the spatial distance between the inner and outer surfaces of the ceramic shape. The code must ensure that this parameter is within a reasonable range and perform necessary verification and conversion. Based on the outer surface (i.e., the curved  
Figure 6: Battery pack display. (**a**) Control the size of the cup; (**b**) smoothness of the control model; (**c**) extract a certain part of the model; (**d**) control the model height; (**e**) overall control model scaling; (**f**) control the thickness of the model and the smoothness of the chamfer at the rim of the cup. surface generated by rotation) and wall thickness parameters, the Python code uses offset algorithms (such as Offset Surface) to generate the inner surface. This process requires the precise calculation of the offset amount for each curved surface point and ensuring that the geometric properties of the inner surface are consistent with those of the outer surface. Subsequently, the code must also perform necessary optimization processing on the inner surface, such as adjusting control points and increasing the number of subdivision segments to improve smoothness, to meet design requirements.