## 1 Introduction  
Direct-ink-writing (DIW) is an additive manufacturing technology that is widely employed in diverse fields, ranging from sensors [1; 2; 3; 4; 5], soft robotics [6; 7; 8], wearable electronics [9; 10], tissue engineering [11; 12; 13], stretchable electronics [14; 15; 16], to microfluidics [17; 18]. This technology offers the possibility of rapid printing of complex 3D structures using various inks, including conductive pastes [14; 16], elastomers [8; 19; 20; 21], and hydrogels [22; 23; 24; 25; 26]. In the realm of rheological materials, inks that possess self-leveling properties, such as conductive inks, hydrogels, and PDMS, are highly printable and versatile, which demonstrate immense potential for a wide range of electronic applications [15; 16].  
Compared to traditional manufacturing methods, DIW is constrained by the shaping process from lines to layer. Additionally, the printing process involves a complex array of parameters, making it difficult to rapidly optimize these parameters to achieve controlled layer thickness, high flatness, and precision printing. Regarding this particular issue, [PERSON] and [PERSON] [27] built a phase diagram of printing parameters, which can guide the printing of viscoelastic ink fibers of different shapes, and break through the limitation of line resolution to print fibers finer than the diameter of the nozzle. Their main contribution inspired this paper on how to construct a geometric model describing the layer surface and control key parameters to achieve high-precision printing of ink layers.  
At present, there are few studies on the flatness of the DIW printing surface. [PERSON] et al. [28] used different nozzle diameters to print ceramic materials and found that large nozzle diameters lead to a lower dimensional accuracy. [PERSON] et al. [29] studied the effect of printing parameters on the dimensional error and the surface roughness of the ceramic part. In our previous study [3], we provided an optimized set of process parameters for achieving high surface smoothness in self-leveling ink printing based on the observed effects of changes in needle inner diameter and line spacing. However, experimental observations and measurements typically only yield descriptive and phenomenological laws, whose applicability is usually limited to the same type of material.  
In addition, there are many studies on optimizing surface flatness for fused deposition modeling (FDM) [30; 31; 32]. Although the line-to-plane forming process of DIW is similar to FDM, the surface morphology of DIW is significantly different from that of FDM, especially the self-leveling inks is used for DIW. For the FDM materials, the section of the printed line almost keeps a circle shape after welding. The roughness of the FDM printed surface is mainly determined by the rising height (related to line width) [30]. For the DIW-printed self-leveling inks studied in this work, the extrusion-formed surface before curing tends to reach high flatness but finally forms a rippling morphology induced by the evaporation speed gradient. The different mechanisms of material forming behaviors between the FDM and DIW lead to different mathematical models. Therefore, the generality of the proposed model is not expected to be compatible with the FDM surface flatness optimization.  
To investigate the influence mechanism of crucial parameters on the flatness of printing layers, we carefully observed the microstructure evolution process from line to plane of the self-leveling printing ink and identified the critical parameters that effect the flatness. A quantitative parameter for flatness characterization was proposedly based on the microstructure geometric features. On this basis, a mathematical model for flatness with printing parameters was established. Using the proposed model, the printing process parameters for achieving high flatness can be directly determined, avoiding the high cost of extensive experimental exploration.