A method and apparatus for slice processing of multi-color three-dimensional printing
Patent Information
- Application Number
- CN202611309021.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-03
AI Technical Summary
In existing 3D printing technologies, the color regions of multi-color co-extrusion filaments are oriented randomly, resulting in blurred color features and misaligned color boundaries on the surface of 3D printed entities. Furthermore, the response delay of mechanical transmission components causes color changes to lag, leading to color overlap and miscolor defects.
By acquiring 3D model data and surface color requirement information, a directional control mapping relationship is established, synchronous printing control data is generated, and projection mapping algorithm and angle inverse calculation are used to compensate for material conduction and mechanism response delay, ensuring the consistency between the target color area of the multi-color co-extrusion consumable and the surface color requirement of the 3D model.
It improves the color orientation consistency in multicolor 3D printing, reduces color boundary misalignment, reduces mechanical wear, and improves print quality.
Smart Images

Figure CN123025489A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D printing technology, specifically to a slicing method and apparatus for multi-color 3D printing. Background Technology
[0002] In molten material extrusion 3D printing, thermoplastic filaments are typically fed into a heating module, melted, and then extruded. Multicolor 3D printing often uses multicolor co-extrusion filaments, which contain at least two independent color regions within the cross-section of a single material.
[0003] Some existing 3D printing slicing solutions primarily plan relative motion path data and material extrusion data, typically failing to establish a directional correspondence between the target color orientation of the model surface and the color region distribution of the multi-color co-extrusion filament. The slicing data lacks synchronous control commands to drive the directional extrusion printhead to deflect and rotate, resulting in disordered orientation of independent color regions within the multi-color co-extrusion filament cross-section during material extrusion. This disordered orientation causes the 3D printed solid surface to fail to reproduce the appearance and color characteristics defined in the 3D model file.
[0004] The multi-color co-extrusion filament enters the directional extrusion printhead in a high-temperature molten state. Within the micro-cavity, the molten fluid experiences hydrostatic pressure and viscous resistance. A time lag exists between the mechanical transmission component's response and the actual material flow. Existing data processing methods directly bind the position movement code and hardware control code to the same spatial coordinate node. This direct binding mechanism ignores the time lag, causing the color change of the co-extruded filament to lag behind the spatial position change when the directional extrusion printhead reaches the geometric color boundary. This misalignment results in blurred color boundaries and overlapping color defects on the outer surface of the 3D printed entity.
[0005] The outer surface of the 3D model has a complex geometric contour, corresponding to continuously changing surface normal directions. Constrained by the circular range of the polar coordinate system, when the surface normal direction crosses the numerical boundary of the circle, the angle calculation module calculates the angle deflection data of abrupt numerical discontinuities. After the control data, which has not been optimized for angle range constraints, is sent to the 3D printer hardware, it drives the controlled rotating component to perform large-span reversal movements between adjacent discrete data nodes. The dense coordinate sampling point mesh simultaneously induces a large number of subtle redundant angle correction commands, which trigger high-frequency mechanical vibrations, exacerbating the mechanical wear of the controlled rotating component. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a slicing method and apparatus for multi-color 3D printing, aiming to improve the orientation consistency between the target color area of the multi-color co-extrusion consumable and the color requirements of the 3D model surface, and reduce color boundary misalignment caused by response delay.
[0007] To achieve the above objectives, the first aspect of the present invention provides a slicing method for multicolor 3D printing, comprising the following steps: Acquire 3D model data containing surface geometry and surface color requirements, and generate multiple printing path units according to the predetermined forming direction; Obtain the local direction information corresponding to the printing path unit, and obtain the reference direction of the target color area in the cross section of the multicolor co-extruded consumable, as well as the calibration parameters used to characterize assembly deviation or dynamic deviation; Based on local orientation information, surface color requirement information, reference orientation and calibration parameters, the orientation adjustment control parameters used to adjust the spatial orientation of the target color region are determined using the orientation control mapping relationship. Obtain printing process parameters or measured response information, determine the response delay parameters of the material transmission or actuator, and compensate for the triggering time or triggering position of the direction adjustment control parameters based on the response delay parameters and the relative motion parameters between the print head and the forming area. Synchronize relative motion control data, material extrusion control data, and orientation adjustment control data according to a common time reference, event reference, or phase reference, and generate or output synchronized printing control data.
[0008] It receives the coordinate information of the three-dimensional surface mesh and the required surface color value, and performs dimensionality reduction projection calculation and inverse calculation of multi-degree-of-freedom motion parameters in combination with the angle setting information. It integrates the calculation results of the software to generate a slice code file containing synchronous control instructions for the moving spindle, extrusion axis and rotation axis, and completes the integration of multi-dimensional discrete data information and feedforward compensation intervention calculation.
[0009] The projection mapping algorithm is used to convert the 3D surface mesh coordinate information and surface color requirement values contained in the 3D model source file into a related coordinate sequence, which improves the synchronization consistency of multi-dimensional commands, compensates for the directional deviation introduced by the material filling and feeding process, and reduces the color boundary misalignment caused by material conduction or mechanism response delay.
[0010] Preferably, the process before and during the extraction of the outer surface mesh sequence includes: Extract the surface color requirement values and establish the correspondence between polygonal patches, texture coordinates, spatial locations or path sampling points and surface color requirement information; A closure check is performed on the 3D polygon mesh data, and mesh repair is performed based on the boundary loop formed by the open boundary. The mesh repair adopts at least one of the following: constrained Delaunay triangulation, advancing front filling, boundary loop triangulation or surface fitting filling, and the surface normal information of the repaired area is recalculated. Use at least one of ray intersection analysis, visibility analysis, or normal consistency analysis to identify polygonal patches facing the external space and corresponding to the appearance region; The identified polygonal patches are merged to generate an outer surface mesh sequence, and a correspondence is established between the polygonal patches and the surface color requirement information.
[0011] Preferably, the process of generating print path cells includes: The contour or forming path obtained according to the predetermined forming direction is discretized. The discretization process adopts at least one of line segment discretization, polyline discretization, circular arc discretization, spline discretization or point series discretization, and the boundary points are densified or the boundary points are supplemented at the boundary where the color requirements change. The path data between adjacent dividing points and the corresponding surface color requirement information are encapsulated into printing path units.
[0012] Preferably, the process of determining local orientation information employs at least one of the following methods: Path sampling points are generated in the printing path unit, the normal vectors of the corresponding model surfaces are extracted, and the normal vectors are projected onto the effective adjustment plane of the orientation adjustment mechanism to obtain the azimuth angle or orientation vector. A local coordinate system can be established based on the tangent vector of the printing path unit, the predetermined forming direction, and the outward reference direction of the model surface, or the local coordinate system can be represented as an attitude angle or a quaternion to obtain local orientation information.
[0013] Preferably, the process of determining the direction adjustment control parameters includes: The allowable direction range is determined based on the effective angular width of the target color region; when the direction adjustment control parameter is a periodic angle parameter, multiple candidate parameters representing the same spatial orientation within different circumferential periods are generated, and the difference between each candidate parameter and the historical reference parameter is normalized to the predetermined circumferential range; When the historical reference parameter is within the allowable direction range, the historical reference parameter is maintained; when the historical reference parameter is outside the allowable direction range, the candidate parameter or the range boundary with the smallest absolute value of the normalized difference is selected as the direction adjustment control parameter.
[0014] Preferably, the process of compensating for the triggering time or triggering position of the direction adjustment control parameters includes: The signed path compensation distance can be calculated based on the response delay parameter and the relative motion velocity, or the phase compensation amount can be calculated based on the response delay parameter and the angular velocity of the direction change. The trigger position is moved upstream or downstream of the printing path based on the sign of the path compensation distance, or the trigger phase is adjusted based on the phase compensation amount; the response delay parameter is dynamically determined based on at least one of the following: feed rate, extrusion amount, material temperature, consumable type, mechanism response time, or color detection result.
[0015] Preferably, after determining the direction adjustment control parameters, the method further includes: Calculate the effective component magnitude or directional confidence of local directional information and compare it with a preset directional validity threshold. When the magnitude or directional confidence of the effective component does not meet the preset directional validity threshold, at least one of the following can be used to generate an alternative directional adjustment control parameter: the directional adjustment control parameter of the target area main color direction, the tangential direction of the printing path, the directional adjustment control parameter of the adjacent effective printing path unit, or the additional coverage path direction.
[0016] Preferably, the process further includes generating or outputting synchronized print control data before: Calculate the feed rate or feed acceleration of the relative motion and the angular velocity or angular acceleration of the direction adjustment mechanism, and compare them with the corresponding safety thresholds respectively; When any calculated value exceeds the corresponding safety threshold, at least one of the following measures is taken to bring the calculated value back to the corresponding safety threshold range: reducing the feed rate, extending the time interval between adjacent control nodes, limiting the direction adjustment speed, or inserting a control section that stops extrusion and performs direction adjustment.
[0017] A second aspect of the present invention provides a computer-readable storage medium storing a computer program or instructions, which, when executed by a processor, implement the slicing method for multicolor three-dimensional printing described above.
[0018] A third aspect of the present invention provides a slicing processing device for multi-color 3D printing, comprising a processor and a memory, wherein the memory stores a computer program or instructions, and the computer program or instructions are executed by the processor to implement the above-mentioned slicing processing method for multi-color 3D printing; the computer program or instructions are functionally divided into a model data acquisition module, a path generation module, a local direction acquisition module, a direction adjustment control parameter determination module, a time delay compensation module, a synchronization control module, and a control data output module.
[0019] This invention provides a slicing method and apparatus for multi-color 3D printing. It has the following beneficial effects: 1. This invention extracts the reference angle, calibration compensation angle and projection normal azimuth angle generated by the surface mesh of the multi-color co-extrusion consumable, establishes a spatial angle inverse mapping model, converts the projection normal azimuth angle into the original rotation angle value for rotation axis deflection control, and controls the directional extrusion print head to deflect and rotate according to the color requirements of the three-dimensional model surface, so that the target color area in the multi-color co-extrusion consumable faces the outer surface of the three-dimensional printed entity.
[0020] 2. This invention calculates the fluid response lag time by extracting the values of the moving spindle feed speed and the consumable feeding distance, calculates the path compensation distance according to the fluid response lag time, performs reverse tracing retrieval along the two-dimensional path micro-short line segment in the opposite direction of the feed direction, performs feedforward displacement offset on the trigger position of the target rotation angle data on the two-dimensional path micro-short line segment, and performs translation operation on the spatial coordinate sequence of the rotation axis deflection command, thereby offsetting the conduction delay time generated when the multi-color co-extrusion consumable is in a molten state inside the directional extrusion printhead, and eliminating the color misalignment phenomenon of multi-color 3D printed entities at color change boundaries.
[0021] 3. The present invention determines the allowable direction range based on the effective angular width occupied by a single color region in the cross-section of the multi-color co-extruded consumable; when the historical reference parameter is within the allowable direction range, the original direction is maintained; when it is outside the range, the equivalent candidate parameters within the circumferential period are normalized, and candidate parameters or range boundaries with smaller absolute values of angle differences and mechanical limit are selected to reduce the repeated back-and-forth and cumulative rotation of the direction adjustment mechanism between adjacent path sampling points. Attached Figure Description
[0022] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a block diagram of the hardware topology and module architecture of the present invention; Figure 3 This is a block diagram of the normal dimension reduction and vector angle mapping logic of the present invention; Figure 4 This is the logic tree for optimizing the target rotation angle and determining the interval relaxation in this invention; Figure 5 This is a schematic diagram of the dynamic feedforward path compensation data shifting of the present invention; Figure 6 This is a logic diagram of the extreme time and space constraints and code timing arrangement of the present invention. Detailed Implementation
[0023] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The embodiments are used to illustrate the present invention, and are not intended to limit the scope of protection of the claims.
[0024] See attached document Figure 1 and attached Figure 2This invention provides a slicing method for multi-color 3D printing, and also provides a slicing device for multi-color 3D printing, including a processor and a storage medium. The storage medium stores a computer program or instructions, which, when executed by the processor, implement the slicing method for multi-color 3D printing. This invention also provides a computer-readable storage medium storing a computer program or instructions, which, when executed by the processor, implement the slicing method for multi-color 3D printing. The slicing device for multi-color 3D printing specifically includes a communication bus, a storage medium, and a processor, and is deployed in a terminal computing device with data processing capabilities.
[0025] The terminal computing device is a personal computer terminal or cloud server node with data processing capabilities; the two ends of the communication bus are connected to the storage medium and the processor to establish a bidirectional data flow channel, and the storage medium persistently saves the 3D model source file, feature parameter file and computer-readable executable instruction set containing slicing processing methods.
[0026] The processor reads the 3D model source file, feature parameter file, and computer-readable executable instruction set stored in the storage medium, divides the memory space of the terminal computing device into an independent computing area, receives the 3D surface mesh coordinate information and surface color requirement values, and combines the angle setting information to perform dimensionality reduction projection calculation and motion parameter calculation through the processor.
[0027] The processor integrates the software calculation results to complete the entire control chain, including model analysis, path generation, direction control, extrusion control, timing alignment, and command output. It generates a slice code file containing synchronous control commands for the moving spindle, extrusion axis, and rotation axis. The terminal computing device is equipped with a data communication interface. After the processor completes the file compilation, it calls the communication interface to output the slice code file to an external storage device or send it to an external 3D printer. This completes the integration of multi-dimensional discrete data information and feedforward compensation intervention calculations. The printing control data can be saved as a file, sent to the printing controller, or output as a real-time control stream by the control device connected to the 3D printing equipment.
[0028] The processor establishes a global variable definition dictionary in the memory space of the terminal computing device and enters the size and material characteristic data of the multi-color co-extrusion consumable into the global variable definition dictionary. The cross-section of the multi-color co-extrusion consumable has at least two independent color regions. The processor establishes a cross-sectional reference direction in the global variable definition dictionary. Each color region has a color region center direction radiating from the geometric center of the cross-section to the outer boundary. The plane deflection angle of the color region center direction relative to the cross-sectional reference direction is defined as the reference angle. As a preferred embodiment, the reference angle can be set to a set of preset angles such as 0 degrees, 45 degrees, and 90 degrees. A single color region is distributed in a fan-shaped outline in the cross-section. The span of the central angle occupied is defined as the effective angle width. As a preferred embodiment, the effective angle width can be set to a fixed range according to different nozzle specifications or consumable materials. The processor extracts the reference angle and effective angle width values corresponding to different color regions, converts them into static constants, and writes them into the global variable definition dictionary.
[0029] The terminal computing device's memory space establishes a 3D printing hardware mapping model for the hardware side. The hardware side includes a directional extrusion printhead with an internal miniaturized cavity and a rotating body mounted on the directional extrusion printhead. The 3D printing hardware mapping model includes virtual printhead parameter nodes corresponding to the directional extrusion printhead and controlled rotation component parameter nodes corresponding to the rotating body. The controlled rotation component parameter nodes record a fixed mechanical origin coordinate vector. The mechanical origin coordinate vector is converted to a 3D spatial orientation angle in the 3D reference coordinate system and defined as the nozzle zero position.
[0030] The terminal computing device provides a calibration input interface to receive assembly deviation data and dynamic measured deviation data. The assembly deviation data represents the initial angular deviation between the center direction of the desired target color area and the zero position of the nozzle when the multi-color co-extrusion consumable is loaded into the directional extrusion printhead. The dynamic measured deviation data comes from the color boundary detection results of the camera or color sensor at the hardware end of the 3D printer. The initial angular deviation and dynamic measured deviation data are converted into digital form through the calibration input interface and entered into the global variable definition dictionary. As a specific calibration parameter representing the assembly deviation or dynamic deviation, it is defined as a calibration compensation angle that includes static constants and time-varying variables. It should be noted that the calibration compensation angle is not limited to a single fixed constant. As a preferred embodiment, it can be derived from preset calibration values, lookup table values, interpolated values, or model fitting values, thereby more accurately eliminating the random deflection error introduced in the consumable loading stage and the time-varying torsional tolerance in the consumable feeding stage.
[0031] The terminal computing device establishes a three-dimensional reference coordinate system in the computing area, including the moving spindle, the extrusion axis, and the rotation axis. The moving spindle controls the hardware to perform linear interpolation translational motion and decomposes it into the X-axis, Y-axis, and Z-axis. The extrusion axis controls the feed length and speed, and the rotation axis controls the deflection azimuth angle. The processor reads the reference angle, effective angular width, nozzle zero position, and calibration compensation angle, and uses a projection mapping algorithm to convert the three-dimensional surface mesh coordinate information and surface color requirement values contained in the three-dimensional model source file into a related coordinate sequence, ensuring that multi-dimensional instructions are synchronized and consistent.
[0032] The processor constructs a core computing module within its computing region, comprising a data preprocessing module, a normal reduction module, an angle calculation module, a dynamic compensation module, and a compilation output module. These specific computing modules serve as the execution entities, respectively implementing functions such as model data acquisition and path generation, local direction acquisition, direction adjustment control parameter determination, time delay compensation, and synchronous control and control data output. A communication bus establishes directed data paths between the computing modules. The data preprocessing module reads the 3D model source file, performs mesh topology analysis and layer cutting operations to extract the outer surface mesh sequence, and discretizes the outer surface mesh sequence into two-dimensional path micro-short line segments, which are then sent to the normal reduction module.
[0033] The normal reduction module receives short line segments of a two-dimensional path, extracts the corresponding three-dimensional surface normals based on the position information, performs a dimensionality reduction projection operation to strip the vector components of the three-dimensional surface normals parallel to the extrusion axis, and generates the projection normal azimuth angle, which is then passed to the angle calculation module. The angle calculation module extracts the projection normal azimuth angle, calls the reference angle, effective angle width, and calibration compensation angle values from the global variable definition dictionary, and uses the vector angle inverse mapping formula to convert the projection normal azimuth angle into the original rotation angle value for the corresponding rotation axis deflection control. This original rotation angle value and the target rotation angle data generated by subsequent optimization together constitute the direction adjustment control parameters used to adjust the spatial orientation of the target color region.
[0034] The dynamic compensation module receives discrete data sequences, extracts the feed speed of the moving spindle and the feed amount of the extrusion axis, applies feedforward compensation displacement parameters to the trigger positions of the original rotation angle values on the two-dimensional path micro-short line segments, and introduces moving spindle deceleration constraint parameters for curvature over-limit regions to output a compensation correction coordinate set; the compilation output module receives the compensation correction coordinate set, performs time base alignment calculations on the moving spindle, extrusion axis and rotation axis according to a unified timestamp, merges the aligned multi-dimensional spatiotemporal node data to complete the code text encapsulation and generate a control instruction file; the control instruction file is returned to the storage medium for saving or sent to the communication interface for output along the communication bus.
[0035] See attached document Figure 1 The present invention provides a slicing method for multi-color 3D printing, which specifically includes the following steps: S1, the data preprocessing module acquires three-dimensional model data containing surface geometry information and surface color requirement information, and generates multiple printing path units according to the predetermined forming direction; as a specific embodiment, planar layering is performed along the Z-axis and the two-dimensional contour is discretized into two-dimensional path micro-short line segments.
[0036] S2, the local direction acquisition module determines the local direction information corresponding to the printing path unit, and acquires the reference direction and calibration parameters of the target color area in the cross section of the multicolor co-extrusion consumable; as a specific embodiment, the three-dimensional surface normal is calculated by reverse tracing based on the two-dimensional path micro-short line segments, the component parallel to the extrusion axis direction is stripped and the projection normal azimuth angle is generated.
[0037] S3, the orientation adjustment control parameter determination module determines the orientation adjustment control parameters based on local orientation information, surface color requirement information, reference orientation and calibration parameters, using the orientation control mapping relationship; as a specific embodiment, the projection normal azimuth angle, reference angle and calibration compensation angle are substituted into the vector angle inverse mapping formula to obtain the original rotation angle, and the difference between the multi-cycle candidate angle and the historical reference angle is normalized, and the target rotation angle with the smaller absolute value of the difference is selected.
[0038] S4, the delay compensation module determines the response delay parameters of the material conduction or actuator based on the printing process parameters or measured response information, and compensates for the triggering time or triggering position of the direction adjustment control parameters based on the response delay parameters and relative motion parameters; as a specific embodiment, the rotation control command is moved upstream of the printing path based on the fluid response lag time.
[0039] S5, the synchronization control module synchronizes the relative motion control data, material extrusion control data and direction adjustment control data according to a common time reference, event reference or phase reference, and generates or outputs synchronized printing control data; as a specific embodiment, multi-axis data interpolation is completed using a unified timestamp, and spline trajectory and rotation axis control data are encapsulated into a control instruction file.
[0040] Regarding alternative implementations of printing path units, the first method is to perform planar layering along the predetermined forming direction and discretize the contour into line segments or polylines; the second method is to retain the arc parameters of the arc region to form arc path units; the third method is to use spline curves or non-planar layering to form spline path units for continuous curved surfaces; and the fourth method is to generate point-series path units with position, speed, and color labels according to the control cycle. All of the above path units contain at least spatial positional relationships and corresponding surface color requirement information, and can be processed by subsequent modules using the same data interface.
[0041] Regarding alternative implementations of local orientation information, the first method is to extract the normal vector of the model surface and project it onto the effective adjustment plane of the orientation adjustment mechanism, outputting the azimuth angle or two-dimensional orientation vector; the second method is to use the tangent vector of the printing path as the first basis vector, the predetermined forming direction as the second reference vector, and combine it with the outward reference direction of the model surface to establish a local coordinate system, using the lateral basis vector of the local coordinate system to represent the outward direction of the target color area; the third method is to combine the print head axis, path tangent, and target color orientation into an attitude angle; the fourth method is to encode the attitude relationship into a quaternion so that the multi-degree-of-freedom attitude adjustment mechanism can directly solve the control quantities of each execution axis.
[0042] Regarding alternative implementations of the directional control mapping relationship, the first method is to establish a lookup table based on consumable type, nozzle specification, target color number, and local directional information to obtain the directional adjustment angle; the second method is to divide the local directional interval into multiple segments and calculate the control quantity using the corresponding linear or nonlinear functions of each segment; the third method is to use multiple sets of calibration samples and perform linear interpolation, spline interpolation, or multidimensional interpolation between adjacent samples; the fourth method is to establish a calibration model or data fitting model that includes assembly deviation, wire feeding torsion, and mechanism transmission error, and output at least one directional adjustment control parameter among angle, directional vector, attitude parameter, quaternion, or actuator displacement.
[0043] Regarding alternative implementations of time delay compensation, the first method is to obtain the forward movement distance based on the product of relative motion speed and response delay parameter, and move the direction adjustment command upstream of the printing path; the second method is to use a signed response time difference, and move the trigger position downstream when the measured response is earlier than the predicted response; the third method is to obtain the phase compensation amount based on the product of the angular velocity of the direction change and the response delay parameter for periodic direction changes; the fourth method is to take at least one of the following as input: feed speed, extrusion amount, material temperature, consumable type, mechanism response time, and color sensor detection results, and update the variable time delay parameter in real time through table lookup, interpolation, or model calculation.
[0044] Regarding alternative implementations of the orientation adjustment mechanism and synchronous output, the orientation adjustment mechanism can be a rotating mechanism of the printhead or internal extrusion channel, a filament steering or twisting mechanism, a multi-degree-of-freedom printhead attitude mechanism, or a guiding mechanism that changes the material outlet orientation; the synchronization method can be a common timestamp, an event trigger identifier, or a phase reference; the synchronous printing control data can be encapsulated as G-code, machine control file, or encrypted control file, or it can be sent to the print controller as a real-time control stream without forming a file.
[0045] In stage S1, the data preprocessing module reads the 3D polygon mesh data contained in the 3D model source file. The 3D polygon mesh data consists of spatial vertex coordinates and topological edges connecting the spatial vertex coordinates. The data preprocessing module simultaneously extracts the surface color requirement values. The surface color requirement values come from an independent data format, including vertex color allocation data written in the spatial vertex coordinate file, externally imported 2D texture mapping data, material numbers from the attached material library, user-inputted color area label data from the 3D model interactive interface, externally imported vector pattern projection mapping data, and regular color data constructed according to coordinate functions. The data preprocessing module establishes a one-to-one hash mapping table between individual polygon patches and surface color requirement values. This hash mapping table serves as a mapping relationship. It should be noted that the correspondence can use at least one of the following: index table, hash table, texture sampling, piecewise function, interpolation model, or calibration model, to obtain the surface color requirement information corresponding to the path position.
[0046] After the hash map is constructed, the data preprocessing module performs a closure check on the 3D polygonal mesh data, traverses spatial vertices and topological edges, identifies and deletes isolated vertices, and detects and processes polygonal faces that cause spatial interference. For non-manifold open boundary edges that connect only one polygonal face, the boundary loops that connect end to end are first extracted, and then at least one of the following methods is used to generate filled faces to close geometric holes: constrained Delaunay triangulation, advancing front filling, boundary loop triangulation, or surface fitting filling. After the repair is completed, the normal vectors of the filled faces and adjacent faces are recalculated and their outward orientation is unified. Ray projection is not used as a hole-filling method, but is used for subsequent outer surface identification.
[0047] The repaired 3D polygon mesh data contains internal filling areas, invisible internal wall components, and supporting components, which do not meet the requirements for the appearance of multi-color 3D printing. The data preprocessing module calls the ray intersection judgment algorithm to extract the outer surface mesh sequence, selects the geometric center point of the polygon facet as the emission source, and emits judgment rays into the external space along the direction indicated by the basic normal vector. The total number of spatial intersections between the judgment rays and the 3D polygon mesh data is counted. When the total number of spatial intersections is equal to zero, the corresponding polygon facet is judged as the outermost exposed facet. When the total number of spatial intersections is greater than zero, the corresponding polygon facet is judged to belong to the internal filling area, invisible internal wall component, or supporting component. The data preprocessing module peels off the polygon facets belonging to the internal filling area, invisible internal wall component, or supporting component, and merges the remaining outermost exposed facets to generate the outer surface mesh sequence, which is stored in the memory area of the terminal computing device.
[0048] The data preprocessing module extracts the preset slice height values and generates multiple sets of parallel intersecting planes along the Z-axis direction in the three-dimensional reference coordinate system based on the slice height values. The intersecting planes are used to cut the outer surface mesh sequence. The intersecting planes and polygonal patches generate spatial geometric intersection lines. The data preprocessing module connects the spatial geometric intersection lines at the same Z-axis height end to end to generate a two-dimensional contour line.
[0049] The data preprocessing module converts continuous two-dimensional contour lines into exterior wall path data and performs discretization segmentation. It extracts the basic sampling interval values and evenly distributes regular breakpoints on the exterior wall path data according to the basic sampling interval values. The regular breakpoints perform basic equidistant segmentation along the extension direction of the exterior wall path data. After the basic equidistant segmentation is completed, the data preprocessing module traverses the coordinate nodes, extracts the surface color requirement values bound to adjacent coordinate nodes in the hash mapping table, and compares them. When there is a difference in the surface color requirement values of adjacent coordinate nodes, it is determined that the corresponding coordinate node belongs to the position of color boundary change.
[0050] The data preprocessing module performs boundary processing, which uses boundary point encryption or boundary supplementation to insert additional segmentation points at the abrupt change locations of color boundaries. It extracts the coordinates of the invisible filling path inside the spatial model to generate hidden transition seam paths and sets the overlap feed amount and pre-rotation parameters. The additional segmentation points ensure that the line segment regions divided at both ends have uniform surface color requirements.
[0051] The conventional breakpoints and additional segmentation points together constitute a breakpoint sequence; the data preprocessing module cuts the external wall path data along the breakpoint sequence to generate independent two-dimensional path micro-short segments, that is, the path discretization of this invention adopts line segment discretization. It should be noted that the path discretization in this invention can adopt at least one of line segment discretization, polyline discretization, spline discretization, and point series discretization; the velocity constraint of the high curvature feature position is left to be uniformly processed by the underlying compilation output module; the two-dimensional path micro-short segments do not contain geometric corners and color change attributes; the data preprocessing module packages the two-dimensional path micro-short segments together with the corresponding surface color requirement values into a discrete path dataset, and sends it to the memory address segment of the normal dimension reduction module via the communication bus, thus ending the task of stage S1.
[0052] The normal reduction module receives a discrete path dataset, reads two-dimensional path micro-short segments, extracts sampling density values, and performs linear interpolation calculations in the geometric space of the two-dimensional path micro-short segments based on the sampling density values to generate path sampling points; the normal reduction module simultaneously reads the bound surface color requirement values and assigns them to the path sampling points.
[0053] After the path sampling point receives the surface color requirement value, the normal dimension reduction module sends a data query command to the memory space of the terminal computing device to access the global variable definition dictionary, extracts the surface color requirement value and converts it into a query index key value; the query index key value is sent to the global variable definition dictionary, and the global variable definition dictionary performs a numerical matching check and outputs the corresponding target color area feature parameters. The target color area feature parameters include the reference angle and effective angular width of the pre-entered target color area.
[0054] The normal dimensionality reduction module allocates independent storage fields in the underlying data model of the path sampling points and writes the reference angle and effective angle width into the independent storage fields. After writing, the spatial coordinates of the path sampling points, the surface color requirement values, and the target color area feature parameters are established and bound by hash mapping, establishing that the path sampling points in the three-dimensional reference coordinate system have the target color deflection angle limit reference. After the normal dimensionality reduction module completes the hash mapping binding of all path sampling points, it temporarily stores the set of path sampling points carrying the reference angle and effective angle width values in the memory buffer area to wait for reverse tracing calculation.
[0055] The normal reduction module reads the set of path sampling points temporarily stored in the memory buffer area, and retrieves the outer surface mesh sequence in reverse based on the spatial coordinate information to locate the polygonal facets that overlap with the spatial position of the path sampling points.
[0056] The polygonal facet has at least three non-collinear 3D vertices. The normal dimensionality reduction module extracts the coordinate values of the three non-collinear 3D vertices and uses the coordinate values to construct two spatial vectors that are connected end to end. The two spatial vectors are fed into the cross product operation unit to output the base surface normal vector that is perpendicular to the plane of the polygonal facet.
[0057] The spatial bends in the outer surface mesh sequence cause abrupt changes in the angle of the base surface normal vectors between adjacent polygonal faces. The normal dimensionality reduction module performs smooth correction on the base surface normal vectors, traverses the three-dimensional vertices to find adjacent polygonal faces with shared coordinate data and extracts the corresponding base surface normal vectors.
[0058] The normal reduction module simultaneously calculates the surface area of adjacent polygon faces, the spatial angle between their respective planes and the plane of the current polygon face, and the geometric distance to the 3D vertices. It then selects weight parameters and introduces a weighted smoothing calculation formula to solve for the smoothed and corrected normal results. The normalized weighted smoothed normal vector is determined based on at least one of the areas, included angles, or vertex distances of adjacent faces; it is calculated according to the following formula: ; Within the formula, Represents the weighted smoothed normal vector; This represents the total number of adjacent polygon faces that share coordinate data with the current 3D vertex. Indicates the traversal index of adjacent polygon faces; Indicates the first The surface area of an adjacent polygonal facet; Indicates the first The base surface normal vectors corresponding to each adjacent polygon patch; This indicates that the magnitude calculation operation is performed on the accumulated composite vector.
[0059] The normal dimension reduction module outputs a normalized weighted smooth normal vector to eliminate abrupt angle changes; the normal dimension reduction module assigns the weighted smooth normal vector to the corresponding path sampling point, covering the blank spatial orientation attribute within the path sampling point; the path sampling point obtains continuous surface normal vector data in the three-dimensional reference coordinate system, waiting for dimension reduction projection calculation.
[0060] The control command file drives the rotary axis to deflect in the mechanical two-dimensional plane; the normal reduction module extracts the extrusion axis direction in the three-dimensional reference coordinate system, constructs a vertical plane based on the extrusion axis direction, and the normal vector of the vertical plane is parallel to the extrusion axis direction; the weighted smoothed normal vector assigned to the path sampling point is read and orthogonally projected onto the effective adjustment plane to remove vector components that are parallel to the extrusion axis direction or exceed the adjustable degrees of freedom of the mechanism; the weighted smoothed normal vector generates the projected normal vector in the vertical plane.
[0061] See attached document Figure 3 The normal dimension reduction module sets the origin and reference coordinate axes in the vertical plane, extracts the orthogonal numerical components of the projection normal vector in the vertical plane, and substitutes them into the inverse trigonometric function operation unit to output a two-dimensional included angle. The two-dimensional included angle is established as the projection normal azimuth angle, that is, the direction representation of this invention adopts the azimuth angle. It should be noted that the direction representation in this invention can adopt at least one of the following: normal vector, azimuth angle, attitude angle, and quaternion. The normal dimension reduction module calls the projection normal azimuth angle calculation formula to solve for the two-dimensional included angle. The projection normal azimuth angle calculation formula is expressed as: ; Within the formula, Indicates the azimuth angle of the projection normal; This represents a bivariate arctangent function; the vertical plane is defined as a plane perpendicular to the extrusion axis. This represents the numerical component of the three-dimensional weighted smooth normal vector along the orthogonal basis of the Y-axis coordinate in the vertical plane after the extrusion axis direction component has been removed; This represents the numerical component of the three-dimensional weighted smooth normal vector after stripping the extrusion axis component, along the orthogonal basis of the X-axis coordinate in the vertical plane.
[0062] The normal dimension reduction module completes the formula solution calculation and outputs the projection normal azimuth angle, and writes the projection normal azimuth angle into the independent storage field of the corresponding path sampling point. After the data writing is completed, the path sampling point is assigned the projection normal azimuth angle and the reference angle and effective angle width generated by the pre-hash mapping. The normal dimension reduction module performs package compilation on the path sampling point sequence containing data labels, and the path sampling point sequence is transmitted to the memory address segment of the angle calculation module via the communication bus.
[0063] The angle calculation module receives the path sampling point sequence, extracts the projection normal azimuth and reference angle, and simultaneously initiates a data call request to the global variable definition dictionary to read the calibration compensation angle. The projection normal azimuth represents the orientation of the spatial target that needs to present its appearance color in space, the reference angle represents the internal relative deflection state of the target color area in the cross section relative to the reference direction of the cross section, and the calibration compensation angle represents the assembly deviation generated when the consumable is filled into the directional extrusion printhead.
[0064] To ensure that the center direction of the target color area is aligned with the azimuth angle of the projection normal, the angle calculation module establishes a spatial angle inverse mapping model. This model converts the projection normal azimuth angle, reference angle, and calibration compensation angle to the polar coordinate system of the rotation axis and performs algebraic difference calculations, separating the internal relative deflection state from the initial assembly deviation. The angle calculation module then calculates the original rotation angle using the following formula: ; Within the formula, Indicates the original rotation angle; This represents a wrap function that maps angles to the range from negative to positive pi. Indicates the azimuth angle of the projection normal; Indicates the reference angle; This indicates the calibration compensation angle.
[0065] The original rotation angle represents the reference target angle at which the rotating body needs to deflect relative to the housing of the directional extrusion printhead; the angle calculation module completes the algebraic difference calculation and outputs the original rotation angle value, which is written into the independent storage field of the path sampling point; the path sampling point obtains the data reference for controlling the deflection of the rotation axis, providing data support for optimization control.
[0066] The angle calculation module reads the original rotation angle value corresponding to the current path sampling point, initiates a data retrieval request to the memory buffer area to extract the solidified target rotation angle data corresponding to the previous historical path sampling point, and the solidified target rotation angle data is defined as the historical reference benchmark.
[0067] The angle calculation module establishes a multi-period unfolded array in memory space to store the circumferential period offset parameters, which include zero offset parameters, positive circumferential offset parameters, and negative circumferential offset parameters. The angle calculation module performs addition operations on the original rotation angle value with the zero offset parameter, positive circumferential offset parameter, and negative circumferential offset parameter, respectively. After the addition operation is completed, the rotation angle candidate value is output. The rotation angle candidate value is mapped to the same spatial deflection orientation in the polar coordinate system of the rotation axis and belongs to different circumferential period intervals at the algebraic numerical level.
[0068] See attached document Figure 4 The angle calculation module extracts historical reference benchmarks and iterates through candidate rotation angle values. It normalizes the difference between each candidate rotation angle value and the historical reference benchmark to the range of negative half-circular period to positive half-circular period. The normalized signed difference represents the rotation direction, and its absolute value represents the amount of mechanical rotation required to complete the corresponding deflection.
[0069] The absolute values of each normalized difference are sent to the numerical comparison unit for optimization and sorting. The candidate value of the rotation angle with the smallest absolute value is selected as the target rotation angle data of the current path sampling point. When there are multiple identical minimum values, the selection is made according to the preset rotation direction, mechanical limit margin, or cumulative rotation amount, so as to obtain a deflection path with a small mechanical rotation amount that does not trigger the mechanical limit.
[0070] The target rotation angle data is written into the independent storage field of the current path sampling point, overwriting the original recorded rotation angle value; multi-cycle expansion and optimization sorting operations are performed on the path sampling point sequence in chronological order to generate a discrete data sequence composed of continuous target rotation angle data; the target rotation angle data maintains the spatial orientation of the target color area, limiting the mechanical rotation amount to within half a circumference; after the replacement writing is completed, the path sampling point sequence is sent to the dynamic compensation module.
[0071] After completing multi-cycle unfolding and optimization sorting operations, the angle calculation module triggers the allowable angle interval relaxation optimization operation, and reads the effective angle width value attached to the current path sampling point. The effective angle width value represents the central angle span value occupied by a single color area in the cross section. The angle calculation module extracts the target rotation angle data corresponding to the current path sampling point, divides the effective angle width value by two to generate the one-sided deviation tolerance value, and adds and subtracts the one-sided deviation tolerance value to the target rotation angle data to establish the upper limit angle boundary and the lower limit angle boundary. The upper limit angle boundary and the lower limit angle boundary jointly define a continuous allowable angle interval in the memory space. The allowable angle interval represents the deflection range that does not affect the color rendering quality of the surface of the multi-color model.
[0072] The angle calculation module extracts the historical reference benchmark corresponding to the solidified state of the previous historical path sampling point and sends it to the numerical interval determination unit. The numerical interval determination unit compares the positional relationship between the historical reference benchmark and the allowable angle interval. When the historical reference benchmark value is between the lower limit angle boundary and the upper limit angle boundary, it outputs a compliance signal within the interval. The angle calculation module receives the compliance signal within the interval, determines that the surface color requirement can be met by maintaining the original stationary state of the rotating body, assigns the historical reference benchmark to the current path sampling point to generate updated target rotation angle data. The numerical difference between the updated target rotation angle data and the historical reference benchmark is equal to zero, eliminating redundant deflection of the rotation axis within the allowable angle interval.
[0073] When the historical reference value is less than the lower limit angle boundary or greater than the upper limit angle boundary, the value interval determination unit outputs an outside deviation signal; the angle calculation module receives the outside deviation signal and calculates the positive difference between the historical reference value and the lower limit angle boundary and the upper limit angle boundary respectively. The boundary value that produces a small positive difference is extracted and assigned to the current path sampling point to generate updated target rotation angle data, and the shortest rotation path is selected to reach the edge boundary of the rotating body.
[0074] The angle calculation module writes the updated target rotation angle data into the independent storage field of the current path sampling point to complete the global relaxation optimization of the discrete data sequence. It traverses the path sampling point sequence in chronological order and repeatedly executes the conditional branch assignment operation of the allowed angle interval generation and numerical interval determination unit. The globally relaxed and optimized discrete data sequence is sent to the dynamic compensation module via the communication bus. The data compensation and time synchronization tasks of multi-dimensional actions are executed by the dynamic compensation module.
[0075] The dynamic compensation module receives a path sampling point sequence containing discrete data sequences from the communication bus, triggering the data processing task in stage S4.
[0076] The multi-color co-extrusion consumable is in a molten fluid state inside the directional extrusion printhead, forming hydrostatic pressure and viscous resistance inside the micro-cavity. The hydrostatic pressure and viscous resistance cause a time difference between the deflection action and the material extrusion. To eliminate the misalignment caused by the time difference, the dynamic compensation module performs feedforward path compensation calculations on the discrete data sequence.
[0077] The dynamic compensation module extracts the feed speed of the moving spindle bound to the current path sampling point. The feed speed of the moving spindle represents the speed at which the directional extrusion printhead performs linear displacement. The dynamic compensation module accesses the delay mapping database and sends at least one of the following to the delay mapping database or response model: relative motion speed, material extrusion amount, material temperature, consumable type, flow channel size, mechanism response time, or color detection result. The delay mapping database performs interpolation matching based on the nonlinear mapping table and outputs the corresponding expected delay time. This expected delay time is used as the response delay parameter of the material conduction or actuator, representing the delay value required for the internal transmission of the pressure wave.
[0078] After the dynamic compensation module extracts the expected delay time, it calls the calculation formula to calculate the distance displacement value required for compensation. The calculation formula for the expected delay time and the path compensation distance is expressed as follows: ; Within the formula, Indicates the path compensation distance; Indicates the feed rate of the moving spindle; Indicates the expected delay time.
[0079] The dynamic compensation module outputs the path compensation distance value, extracts the spatial coordinate data of the current path sampling point on the two-dimensional path micro-short line segment and the feed direction vector of the moving main axis, measures the line segment interval with a length equal to the path compensation distance value on the two-dimensional path micro-short line segment along the reverse extension direction of the feed direction vector of the moving main axis, and translates the target rotation angle data attached to the current path sampling point from the original spatial coordinate data to the reverse endpoint coordinate of the line segment interval.
[0080] The coordinate translation operation spatially offsets the trigger position of the target rotation angle data. The time difference between the actual response time of the material or mechanism and the target response time is defined as the signed response time difference, and the product of the relative motion velocity and the signed response time difference is defined as the signed path compensation distance. When the signed path compensation distance points upstream of the printing path, forward compensation is performed; when it points downstream of the printing path, backward compensation is performed. For periodic directional changes, the product of the directional change angular velocity and the response delay parameter is used as the phase compensation amount to adjust the trigger phase of the directional adjustment command. As a specific embodiment, this invention uses forward compensation to trigger the deflection command before the directional extrusion printhead reaches the design color change boundary; the generated fluid pressure fluctuation completes internal transmission within the expected delay time, causing the target color area to align with the appearance color boundary line.
[0081] See attached document Figure 5The dynamic compensation module extracts the path compensation distance value associated with the current path sampling point and the spatial topology connection table of the two-dimensional path micro-short line segments. The spatial topology connection table records multiple continuous two-dimensional path micro-short line segments that are connected end to end. The dynamic compensation module reads the starting point coordinates of the two-dimensional path micro-short line segment where the current path sampling point is located and initiates a reverse source tracing search in the upstream feed direction of the two-dimensional path micro-short line segment.
[0082] The dynamic compensation module extracts adjacent two-dimensional path micro-short segments, calculates the geometric length of a single segment, inputs it into the accumulation register to generate a historical cumulative length value, and calls a comparator to perform a difference comparison between the historical cumulative length value and the path compensation distance value. When the historical cumulative length value is less than the path compensation distance value, it continuously performs reverse tracing retrieval to the upstream two-dimensional path micro-short segments and synchronously accumulates and updates the historical cumulative length value.
[0083] When the comparator outputs a judgment signal that the historical cumulative length value is greater than or equal to the path compensation distance value, the reverse tracing search stops, the last traversed two-dimensional path micro-short line segment is locked, and marked as the feedforward compensation insertion interval; the remaining length value in the interval is output by subtracting the path compensation distance value from the historical cumulative length value, and the line segment with the remaining length value in the interval is intercepted along the upstream node to the downstream node of the feedforward compensation insertion interval, and the endpoint coordinates of the line segment are collected to generate the offset compensation spatial coordinate point.
[0084] Create independent compensation data nodes in the path sampling point sequence, write the offset compensation spatial coordinate points and the target rotation angle data carried by the current path sampling point into the independent compensation data nodes, and translate and insert the independent compensation data nodes into the corresponding sorting positions according to the spatial coordinate position relationship; after writing, delete the trigger events that have been transferred in the current path sampling point, or mark the trigger events as executed and suppress duplicate output.
[0085] The dynamic compensation module uses reverse tracing and coordinate interpolation to spatially shift the rotation axis deflection command within the multi-dimensional control data sequence, thus canceling out the conduction delay of the molten fluid inside the miniature cavity. The compensation data nodes cover the command nodes that are time-displaced, ensuring that the output command sequence presents the set color change boundary on the continuous spatial extrusion trajectory. After completing the translation and insertion operation of a closed-loop contour of an outer surface mesh sequence, the dynamic compensation module temporarily stores the updated path sampling point sequence in a persistent storage medium to await constraint calculation.
[0086] The dynamic compensation module reads the updated path sampling point sequence from the persistent storage medium; the three-dimensional polygonal mesh data contains a top closed surface and a bottom supporting surface, and the weighted smoothed normal vectors corresponding to the top closed surface and the bottom supporting surface are parallel to the Z-axis direction in the three-dimensional reference coordinate system; the projected normal vector generated after the weighted smoothed normal vector is orthogonally projected onto the vertical plane produces a spatial state with a value close to zero.
[0087] The dynamic compensation module extracts the projection normal vector and performs a die length calculation to output the projection normal die length value. It reads the geometric diameter value of the cross-section and the flattening size ratio of the nozzle, calculates the minimum effective extrusion exposed area based on the geometric diameter value of the cross-section and the flattening size ratio of the nozzle, and converts the normal projection die length value corresponding to the minimum effective extrusion exposed area into a preset die length safety threshold. The dynamic compensation module extracts the converted die length safety threshold and sends the projection normal die length value and the die length safety threshold into the numerical comparison unit to perform a difference comparison.
[0088] When the magnitude of the projection normal is greater than or equal to the magnitude safety threshold, the numerical comparison unit outputs a magnitude compliance signal; the dynamic compensation module receives the magnitude compliance signal to maintain the target rotation angle data from being tampered with.
[0089] When the magnitude of the projection normal is less than the safe threshold, the numerical comparison unit outputs a magnitude over-limit warning signal; the dynamic compensation module receives the magnitude over-limit warning signal and determines that the corresponding polygonal patch belongs to a micro-extreme mesh surface; the magnitude of the projection normal approaching zero causes the inverse trigonometric function operation unit to output disordered deflection angles. In order to eliminate the rotation command caused by the disordered deflection angles, the dynamic compensation module triggers the cut-off substitution processing operation.
[0090] The dynamic compensation module aborts the angle transformation and inverse trigonometric function calculation tasks within the current path sampling point, clearing the recorded target rotation angle data and 2D included angle data. After the clearing action is completed, alternative deflection data is generated according to the preset top and bottom surface strategy. The preset top and bottom surface strategy selects one of the following three processing routes to execute: the first branch extracts the angle setting information corresponding to the main color area with the largest cross-sectional area as the alternative deflection data; the second branch extracts the path tangent vector of the 2D path micro-short line segment and converts it into polar coordinate azimuth angle to establish the alternative deflection data; the third branch generates additional top-level directional coverage intersection path nodes and sets the normal orientation corresponding to the covered path as the alternative deflection data. The dynamic compensation module writes the alternative deflection data generated by the selected branch into the independent storage field of the current path sampling point. The alternative deflection data replaces the original target rotation angle data in the underlying data structure.
[0091] The main color fill code establishes that the rotating body stops rotating and deflects within the spatial coordinate region corresponding to the tiny extreme value grid surface; the main color with the widest distribution area within the consumable cross section is directly output to perform material extrusion and closed surface filling; the dynamic compensation module traverses the data nodes in chronological order and performs modulus safety threshold filtering and cutting replacement processing operations; after the abnormal node completes code replacement, the multi-dimensional control data compensation and extreme value constraint tasks are completed, and the dynamic compensation module sends the finalized path sampling point sequence to the underlying compilation output module.
[0092] The compilation output module receives the finalized path sampling point sequence, extracts the first and second path sampling points in the path sampling point sequence in chronological order, and reads the corresponding target rotation angle data and three-dimensional space coordinate data.
[0093] The three-dimensional spatial coordinate data of the sampling points of the first path and the sampling points of the second path are sent to the distance calculation unit to calculate and output the spatial linear displacement values between adjacent data nodes. The difference in the target rotation angle data is calculated simultaneously to output the deflection angle variable value. The recorded feed speed of the moving spindle is extracted. The spatial linear displacement value and the feed speed of the moving spindle are sent to the quotient calculation unit to output the estimated running time value. The quotient calculation unit performs an algebraic division operation on the deflection angle variable value and the estimated running time value to output the pre-simulated angular velocity value. The pre-simulated angular acceleration value is calculated and output by combining the angular velocity change of adjacent path segments.
[0094] Send a data retrieval command to the persistent storage medium, read the pre-written limit angular velocity safety threshold, limit angular acceleration safety threshold and extreme deflection angle threshold, compare the pre-simulated angular velocity value with the limit angular velocity safety threshold, and compare the pre-simulated angular acceleration value with the limit angular acceleration safety threshold.
[0095] See attached document Figure 6 When the pre-simulated angular velocity value exceeds the limit angular velocity safety threshold or the pre-simulated angular acceleration value exceeds the limit angular acceleration safety threshold, the compilation output module determines that the direction adjustment requirement between adjacent path sampling points exceeds the current motion constraints; high curvature sharp corner feature regions require the rotation axis to complete the change of target rotation angle data within a small range of spatial linear displacement values; trigger joint speed limit calculation, recalculate the limit angular velocity safety threshold and the limit angular acceleration safety threshold as the constraint boundary conditions for reverse solution, and output the reduced safe feed rate value that meets the constraint boundary conditions; write the reduced safe feed rate value into an independent storage field to overwrite and replace the original moving spindle feed rate.
[0096] The deflection angle variable value is compared with the extreme deflection angle threshold. When the deflection angle variable value is greater than the extreme deflection angle threshold, the directional extrusion printhead will experience a pause exceeding the upper limit of the melt residence time due to the downward adjustment of the safe feed rate value, thus triggering the hang time timing planning operation.
[0097] A timing sequence of code is inserted between the first path sampling point and the second path sampling point, including a consumable retraction command, a non-extrusion rotation waiting code, and a consumable compensation extrusion command. The consumable retraction command is mapped and bound to the three-dimensional spatial coordinates of the first path sampling point. The consumable retraction command drives the extruder to perform reverse retraction rotation of the consumable to cut off the extrusion stress of the molten fluid. The non-extrusion rotation waiting code requires the directional extrusion printhead to remain stationary in its current three-dimensional spatial coordinates, and only drives the rotation axis to perform rotation deflection according to the limit angular velocity safety threshold until the current rotation angle reaches the target rotation angle data corresponding to the second path sampling point. The consumable compensation extrusion command is executed after the rotation axis deflection is completed and restores the consumable to the forward extrusion flow state.
[0098] After completing the insertion of timing arrangement code sequences and covering the lowered safe feed speed values, the motor step loss and material overflow phenomena caused by high curvature sharp corner feature areas are eliminated. The data nodes are traversed and the limit parameter verification, speed limit calculation and timing code insertion tasks are completed in sequence. The completion of data node processing marks the preparation for the generation of control instruction files.
[0099] The compilation output module reads the path sampling point sequence after completing the limit parameter verification, speed limit calculation, and timing code insertion tasks. The sequence contains spatial main axis data, extrusion axis data, and rotation axis target data. Because the dynamic compensation module performs feedforward path compensation and translation insertion operations on the two-dimensional path's micro-short segments, the spatial trigger coordinates of the rotation axis target data deviate from the original discrete distribution nodes, breaking the synchronization reference of the multi-axis linkage mechanism. A unified timestamp sequence is established in memory space to trigger spatiotemporal reference alignment operations. It should be noted that the timing alignment method in this invention is not limited to a unified timestamp sequence; it can employ at least one of common time reference, event-triggered alignment, and phase-locked alignment. The total feed time value is extracted and divided into equidistant time slices according to a preset interpolation sampling frequency. A continuously arranged reference time node is generated within the unified timestamp sequence, and each reference time node is traversed in chronological order.
[0100] For a single reference time node, the multi-axis interpolation calculation unit is invoked to initiate interpolation calculations on adjacent data intervals within the spatial main axis data, extrusion axis data, and rotation axis target data based on the reference time value, and simultaneously outputs the aligned interpolated three-dimensional spatial coordinates, interpolated extrusion length value, and interpolated target rotation angle.
[0101] Independent synchronization data fields are allocated within the memory buffer area. Interpolated data is written together and encapsulated to generate synchronization control data packets, establishing the associated spatial position, filament extrusion volume, and rotational orientation of the multicolor 3D printer at any discrete time point. After completing the interpolation calculation and encapsulation of all reference time points, a queue of continuously arranged synchronization control data packets is output. Within a unified timestamp sequence dimension, the discrete control nodes of the spatial principal axis, extrusion axis, and rotation axis are realigned, eliminating node misalignment anomalies and providing a standardized data stream for generating executable synchronization printing instructions.
[0102] The compilation output module reads the synchronization control data packet queue. The densely packed interpolated 3D spatial coordinate sequence within the queue forms multiple discrete micro-segments. Spatial bends at the connection points of adjacent instructions cause sharp acceleration / deceleration transitions in the actuator. The interpolated 3D spatial coordinate sequence is fed into the interpolation operation unit, which calls the non-uniform rational B-spline algorithm to perform spline trajectory fitting operations on the discrete node coordinate sequence, generating geometric spline curves with continuous first and second derivatives. These curves replace the polygonal path contour formed by splicing discrete micro-segments within the 3D reference coordinate system.
[0103] The compilation output module extracts the associated unified timestamp sequence and sends the geometric spline curve and the unified timestamp sequence together into the time parameterization smoothing processing unit. The time parameterization smoothing processing unit performs first-order and second-order time derivative operations on the geometric spline curve according to the reference time value in the unified timestamp sequence. The first-order time derivative operation outputs instantaneous feed velocity data along the tangent direction of the geometric spline curve, and the second-order time derivative operation outputs instantaneous feed acceleration data.
[0104] The time-parameterized smoothing processing unit sends a read command to the persistent storage medium, extracts the preset limit feed rate threshold, limit feed acceleration safety threshold, limit angular velocity safety threshold, and limit angular acceleration safety threshold, and compares the calculated relative motion speed, relative motion acceleration, orientation adjustment angular velocity, and orientation adjustment angular acceleration with the corresponding thresholds. When any calculated value exceeds the corresponding threshold, at least one of the following methods can be used: reduce the relative motion speed between the print head and the forming area; extend the time interval between adjacent control nodes; limit the angular velocity or angular acceleration of the orientation adjustment mechanism; insert a control segment to stop extrusion, perform orientation adjustment, and resume extrusion. When using time interval adjustment, the reference time interval corresponding to the over-limit segment is proportionally lengthened until the recalculated motion parameters are within the corresponding safety threshold range.
[0105] After the time parameterization smoothing processing unit completes the time weight redistribution calculation, it outputs the time parameterization smoothing curve. The compilation output module maps the coordinate point sequence on the time parameterization smoothing curve with the updated timestamp and writes it into the synchronization control data packet queue. The spatial main axis data and time attributes inside the synchronization control data packet queue complete the underlying reconstruction. The underlying reconstruction eliminates the acceleration, deceleration and turning phenomena, ensuring that the multi-axis linkage mechanism drives the rotating body to complete the spatial deflection and material extrusion actions according to the smooth command sequence.
[0106] The compilation output module reads the reconstructed synchronization control data packet queue from the memory buffer area. The synchronization control data packet queue contains multiple discrete data units arranged in chronological order of the reference time nodes. The compilation output module parses a single discrete data unit and extracts the interpolated three-dimensional spatial coordinate sequence, the interpolated extrusion length value, and the interpolated target rotation angle. The interpolated three-dimensional spatial coordinate sequence corresponds to the first direction linear displacement axis, the second direction linear displacement axis, and the vertical direction linear displacement axis. The compilation output module maps the interpolated three-dimensional spatial coordinate sequence to the corresponding displacement axis data fields, and the interpolated extrusion length value and the interpolated target rotation angle are pressed into the extrusion axis data field and the rotation axis data field, respectively.
[0107] A unified instruction compilation unit is established in memory space to read data fields from the displacement axis, extrusion axis, and rotary axis. Floating-point values are converted into hardware-recognizable control character combinations according to syntax rules. Control character combinations belonging to the same reference time node are encapsulated into single-line instruction sequences, enabling the linear displacement motor, extrusion motor, and rotary motor to trigger start-stop actions at the same timestamp. All discrete data units are traversed, and multiple single-line instruction sequences are generated in chronological order, concatenating them to form a globally synchronized control code stream. At the beginning, a device initialization code segment containing temperature setting and coordinate zeroing instructions is compiled; at the end, a reset and shutdown code segment containing instructions to cut off the heating component's level is appended and compiled.
[0108] The complete global synchronous control code stream is encapsulated and output. When the first output branch condition is triggered, it is saved as standard control text in an unencrypted, visible character encoding format. When the second output branch condition is triggered, the control data is encoded, compressed, signed, or encrypted according to transmission or access control requirements. The generated standard control text or encrypted file constitutes the control instruction file, which is then sent as the final synchronous printing control data. In a preferred embodiment, the control instruction file can be in the form of at least one of G-code, machine control file, or real-time control stream, and is sent to the control motherboard via a transmission bus. The control motherboard parses the text and drives the multi-color co-extrusion consumable to perform multi-axis linkage deflection and material extrusion molding on the platform. At this point, the data compilation, fusion, and output of the multi-dimensional control instructions are all completed.
Claims
1. A slicing method for multi-color 3D printing, characterized in that, Includes the following steps: Acquire 3D model data containing surface geometry and surface color requirements, and generate multiple printing path units according to the predetermined forming direction; The local orientation information corresponding to the printing path unit is obtained, and the reference orientation of the target color region in the cross section of the multicolor co-extruded consumable is obtained, wherein the local orientation information is determined based on at least one of the model surface geometry, printing path orientation, or local coordinate relationship. Based on the local orientation information, the surface color requirement information, and the reference orientation, the orientation adjustment control parameters for adjusting the spatial orientation of the target color region are determined using the orientation control mapping relationship.
2. The slicing method for multi-color 3D printing according to claim 1, characterized in that, The preprocessing process for the 3D model data includes: Extract surface color requirement information and establish a correspondence between polygonal patches, texture coordinates, spatial positions or path sampling points and the surface color requirement information; A closure check is performed on the three-dimensional polygonal mesh data, and mesh repair is performed based on the boundary loop formed by the open boundary. The mesh repair adopts at least one of constrained Delaunay triangulation, advancing front filling, boundary loop triangulation or surface fitting filling, and the surface normal information of the repaired area is recalculated. Use at least one of ray intersection analysis, visibility analysis, or normal consistency analysis to identify polygonal patches facing the external space and corresponding to the appearance region; The identified polygonal patches are merged to generate an outer surface mesh sequence, and a correspondence is established between the polygonal patches and the surface color requirement information.
3. The slicing method for multi-color 3D printing according to claim 2, characterized in that, The process of generating the print path unit includes: The contour or forming path obtained according to the predetermined forming direction is discretized. The discretization process adopts at least one of line segment discretization, polyline discretization, circular arc discretization, spline discretization or point series discretization, and the boundary points are densified or the boundary points are supplemented at the boundary where the color requirements change. The path data between adjacent dividing points and the corresponding surface color requirement information are encapsulated into the printing path unit.
4. The slicing method for multi-color three-dimensional printing according to claim 1, characterized in that, The process of determining the local orientation information employs at least one of the following methods: Path sampling points are generated in the printing path unit, the normal vectors of the corresponding model surfaces are extracted, and the normal vectors are projected onto the effective adjustment plane of the direction adjustment mechanism to obtain the azimuth angle or direction vector. A local coordinate system is established based on the tangent vector of the printing path unit, the predetermined forming direction, and the outward reference direction of the model surface, or the local coordinate system is represented as an attitude angle or a quaternion to obtain the local direction information.
5. The slicing method for multi-color three-dimensional printing according to claim 4, characterized in that, The process of determining the direction adjustment control parameters includes: The allowable direction range is determined based on the effective angular width occupied by the target color region in the cross-section of the multicolor co-extruded consumable; when the direction adjustment control parameter is a periodic angle parameter, multiple candidate parameters representing the same spatial orientation in different circumferential periods are generated, and the difference between each candidate parameter and the historical reference parameter is normalized to the predetermined circumferential range; When the historical reference parameter is within the allowed direction range, the historical reference parameter is maintained; when the historical reference parameter is outside the allowed direction range, the direction adjustment control parameter of the current printing path unit is determined from the candidate parameter or the allowed direction range based on a cost function that includes at least the amount of angle change. When multiple candidate parameters are the same, the selection is based on the preset rotation direction, mechanical limit, or cumulative rotation amount.
6. The slicing method for multi-color 3D printing according to claim 1, characterized in that, The response delay parameter is determined based on the printing process parameters or measured response information, and compensation is performed on at least one of the direction adjustment control data, relative motion control data, or material extrusion control data based on the response delay parameter. The compensation process includes: The signed path compensation distance is calculated based on the response delay parameter and the relative motion speed, or the phase compensation amount is calculated based on the response delay parameter and the angular velocity of the direction change. Based on the path compensation distance or phase compensation amount, adjust the trigger position, trigger time or trigger phase of at least one of the direction adjustment control data, relative motion control data or material extrusion control data; The response delay parameter is dynamically determined based on at least one of the following: feed rate, extrusion amount, material temperature, consumable type, mechanism response time, or color detection result.
7. The slicing method for multi-color three-dimensional printing according to claim 4, characterized in that, After determining the direction adjustment control parameters, the method further includes: Calculate the effective component magnitude or direction confidence of the local direction information and compare it with a preset direction validity threshold; When the magnitude or direction confidence of the effective component does not meet the preset direction validity threshold, at least one of the following is used to generate an alternative direction adjustment control parameter: the main color direction of the target area, the tangential direction of the printing path, the direction adjustment control parameter of the adjacent effective printing path unit, or the additional coverage path direction.
8. The slicing method for multi-color 3D printing according to claim 1, characterized in that, It also includes associating relative motion control data, material extrusion control data, and orientation adjustment control data with the same deposition location or deposition event based on a common time reference, print path location reference, event reference, or phase reference, and generating control instruction files or real-time control streams; Before generating or outputting the synchronous print control data, the following is also included: Calculate the feed rate or feed acceleration of the relative motion and the angular velocity or angular acceleration of the direction adjustment mechanism, and compare them with the corresponding safety thresholds respectively; When any calculated value exceeds the corresponding safety threshold, at least one of the following measures is taken to bring the calculated value back to the corresponding safety threshold range: reducing the feed rate, extending the time interval between adjacent control nodes, limiting the direction adjustment speed, or inserting a control section that stops extrusion and performs direction adjustment.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions, which, when executed by a processor, implement the slicing method for multicolor 3D printing as described in any one of claims 1-8.
10. A slicing processing device for multi-color three-dimensional printing, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program or instructions, and when the computer program or instructions are executed by the processor, they implement the slicing processing method for multicolor three-dimensional printing as described in any one of claims 1-8.
