Path texture driven 3D surface machining trajectory generation method and device thereof
By using a path texture-driven method, combined with harmonic potential field parameterization and image path mapping, a continuous, twist-free robot trajectory suitable for STL models is generated. This solves the problem of path planning in STL models, achieves high-precision and high-degree-of-freedom trajectory generation, and is applicable to a variety of industrial processing tasks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies struggle to generate continuous, distortion-free, and well-defined robot executable trajectories on STL models, especially when dealing with user-defined patterned paths and unstructured or freeform surface models, where effective path planning methods are lacking.
A path texture-driven approach is employed to generate 3D trajectories by fusing harmonic potential field parameterization, image path mapping, trajectory smoothing optimization, and attitude calculation. Specific steps include STL model preprocessing, geometric parameterization, image path mapping, trajectory smoothing optimization, and attitude calculation, outputting various industrial control formats.
It achieves high degree of freedom and high precision trajectory generation, suitable for industrial grinding and other scenarios. It solves the path definition and mapping problem of STL model, improves processing stability and accuracy, supports user-defined path design, and is compatible with a variety of industrial control platforms.
Smart Images

Figure CN120953481B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of machining trajectory generation, and particularly relates to a path texture driven 3D surface machining trajectory generation method and device. BACKGROUND
[0002] With the continuous evolution of industrial manufacturing towards high precision, flexibility and intelligence, robots are increasingly widely used in the field of surface treatment, especially in processes such as polishing, deburring, precision engraving and customized texture of workpieces such as metal, composite materials and 3D printed parts. The requirements for path planning are continuously increasing. Traditional path planning methods mainly rely on entity CAD models, rule-based feature extraction, manual teaching or rule-based grid parameterization. These methods have strong dependence on the geometric topology of the input model, and are difficult to adapt to unstructured or free-form surface models, especially STL format scans or reverse modeling data.
[0003] STL models express three-dimensional shapes in the form of a collection of triangular facets, without explicit parametric information. This data format is widely used in industrial 3D scanning, simulation, printing, rapid reverse design and other scenarios. However, when planning paths based on STL grids, the following technical obstacles are often encountered: a. Lack of surface parameter domain, traditional UV mapping cannot be directly used; b. Discontinuity between facets leads to path jumps, affecting trajectory continuity and machining stability; c. Unable to directly express patterns, textures or path lines [1]. Existing technologies mostly use geodesic paths, shortest distance lines, principal curvature directions and other methods to generate paths. For example, some documents extract tool paths based on equidistant geodesic paths; some schemes use vector fields or anisotropic tensor fields to control trajectory direction. However, these methods usually cannot handle user-defined pattern paths, and are not suitable for path inputs from two-dimensional texture images or sketch designs, limiting the personalization and freedom of design.
[0004] In recent years, computer graphics has developed various methods for mapping image textures to surfaces, but most of them serve the visual field of texture rendering, UV mapping, etc., rather than industrial trajectory generation. In addition, there are challenges such as dimensional inconsistency, inaccurate barycentric interpolation, poor smoothness between image path extraction and three-dimensional surface mapping, and there is still a lack of engineering systems for accurately converting image lines into machining trajectories. Therefore, there is an urgent need for a method that starts from "path texture image + STL model" to automatically generate continuous, non-distorted, clear posture and robot executable three-dimensional trajectories, which can take advantage of the design flexibility expressed by images, and overcome the challenges of irregular STL surface modeling. SUMMARY
[0005] The purpose of the present application is to provide a path texture driven 3D surface machining trajectory generation method and device thereof, which takes path texture image and STL model as input and generates continuous trajectory for precision machining tasks such as industrial grinding.
[0006] The present application is proposed to solve this technical requirement, and its innovation lies in: integrating harmonic potential field parameterization, image path mapping, trajectory smoothing optimization and posture solving, etc. to form a complete, universal and applicable trajectory generation method for industrial grinding system.
[0007] A path texture driven 3D surface machining trajectory generation method, the process of which is based on the method of geometric parameterization and image path integration, has high universality and engineering practicability. As shown in Figure 1 , the method comprises the following steps:
[0008] Step 1, analysis and geometric preprocessing of STL model to obtain 3 vertex coordinates of each triangular patch, first-order adjacency table of each vertex i
[0009] The input three-dimensional model adopts STL format, denoted as triangular mesh surface
[0010] Where each triangular patch T I =(v1,v2,v3), vertex i is the number of vertices. I is the number of triangular patches.
[0011] As shown in Figure 2 , it is a meshed surface model, i.e. triangular mesh surface
[0012] The system performs the following preprocessing steps:
[0013] Step 1A, normal correction to ensure that all patch normal vectors are consistent outward.
[0014] By traversing the triangular patches, the patch normal vector n I =(v2-v1)×(v3-v1) is calculated, and the reverse face is adjusted by using topological inspection.
[0015] Step 1B, mesh smoothing.
[0016] Taubin Smoothing or Laplacian Smoothing algorithm is adopted to reduce high-frequency noise and enhance surface parameterization stability.
[0017] Step 1C, adjacency construction.
[0018] Constructing the first-order adjacency list of vertices for the subsequent propagation field Forming a sparse adjacency graph structure.
[0019] Step 2, based on the vertex coordinates obtained in step 1, construct the mapping φ(p) of the curved path to the two-dimensional image path.
[0020] Where p is any point on the STL model.
[0021] In order to map the two-dimensional path texture image to the three-dimensional curved surface , a two-dimensional parameter coordinate system needs to be established on the curved surface, that is, the mapping φ(p).
[0022] For this purpose, two mutually orthogonal smooth potential fields are introduced. 2 Essentially, any point p on the STL model is assigned a parameter coordinate (u, v), so that the curved surface is mapped to the parameter domain [0, 1] Figure 3 .
[0023] Where the number 2 in [0, 1] 2 represents a two-dimensional space. [0, 1] represents the image domain of the u coordinate and the image domain of the v coordinate.
[0024] Any point p on the STL model refers to any point on the boundary of the triangular patch within the three-dimensional mesh formed by the triangular patch.
[0025] The process of solving the mapping φ is as follows:
[0026] Potential field construction → solution of linear equations → gradient orthogonality → parameter mapping
[0027] The specific steps include:
[0028] Step 2A, construct the harmonic potential field u(p), v(p).
[0029] Step 2A0, construct a sparse linear system as follows:
[0030] L·u=b
[0031] Where:
[0032] u=(u1,u2,…,u n ) T is the set of unknown scalar values (harmonic potential field values) for each vertex;
[0033] n is the number of vertices on the STL model; u i is an element in u;
[0034] The vertices on the STL model include both internal vertices and boundary points.
[0035] When the surface is closed, the boundary points do not exist, as shown in Figure 2 .
[0036] Otherwise, the boundary points are the vertices on the outer edges of the surface, as shown in Figure 3 .
[0037] is the symmetric positive definite sparse matrix of the discrete Laplace-Beltrami operator;
[0038] is the right-hand side, determined by the boundary conditions.
[0039] The process of solving u(p) is as follows:
[0040] Step 2A1, Laplace-Beltrami discretization of internal vertices.
[0041] For each internal vertex i, define as follows:
[0042]
[0043] where:
[0044] α ij ,β ij : are the two triangles corresponding to the edge (i,j) opposite, as shown in Figure 11 .
[0045] L ii : the sum of cotangent weights, used to measure the coupling strength of internal vertex i with internal vertex i in the mesh;
[0046] L ij : the inverse of the cotangent weight;
[0047] The first-order adjacency point set of internal vertex i;
[0048] w ij : cotangent weight, used to measure the coupling strength of internal vertex i with internal vertex j in the mesh.
[0049] Step 2A2, introduce boundary conditions.
[0050] Set the boundary point set Γ0,Γ1, corresponding to the Dirichlet condition:
[0051]
[0052] Then:
[0053] For boundary point i, directly set:
[0054]
[0055] For interior vertex i, then:
[0056] b i = 0
[0057] Step 2A3, matrix system full expression form.
[0058] Combining all vertices (interior points and boundary points) to get the complete system:
[0059]
[0060] This system can be solved efficiently by conjugate gradient method (CG), preconditioned conjugate gradient (PCG) and so on.
[0061] Where L is a symmetric positive definite sparse matrix, obtained by steps 2A1-2A2.
[0062] Step 2A4, solve post-processing
[0063] Solve all u i After that, the scalar field is combined:
[0064]
[0065] For v(p), the above method can be used to solve all v i After that, the scalar field is combined:
[0066]
[0067] Thus used to construct two-dimensional parameter mapping φ(p) = (u(p), v(p)).
[0068] Step 2B, orthogonalization processing to construct two-dimensional parameter field.
[0069] Step 2B1, gradient orthogonalization (so that u(p), v(p) become orthogonal coordinates).
[0070] For the gradient field obtained by preliminary calculation Perform orthogonal projection correction:
[0071]
[0072] This step can correct the gradient face by face on the patch level, and reconstruct the updated v(p) by gradient reintegration.
[0073] Step 2B2, normalize the mapping domain.
[0074] In order to finally map to the image domain [0, 1] 2, u(p), v(p) need to be normalized:
[0075]
[0076] The final output gets a continuous mapping function:
[0077] φ(p) = (u(p), v(p)) ∈ [0, 1] 2
[0078] The points on each triangular facet Corresponding image domain coordinates (u, v) for subsequent path texture image reverse mapping and trajectory generation.
[0079] Step 3, process the path texture image to obtain the point sequence, and then reverse map the point sequence to the STL model based on the mapping. The set of points on the STL model to which the point sequence is reverse mapped is the initial trajectory point set
[0080] Step 3A, process the path texture image to obtain a plurality of equidistant point sequences in the path texture image.
[0081] The second input of the present application is the path texture image To define a two-dimensional image in the [0, 1] 2 region. The black line in the image represents the pre-defined "machining path area", as shown in Figure 4 .
[0082] The system first extracts the path boundary and center line in the image domain, using the following image processing procedure:
[0083] Step 3A1, grayscale and binarization;
[0084] Step 3A2, Canny edge detection to extract the main contour, i.e. to extract the path boundary;
[0085] Step 3A3, use findContours or skeletonize algorithm in OpenCV to extract the center line.
[0086] Note that the contour extraction method used in the present application is not limited.
[0087] Step 3A4, resample the center line into an equidistant point sequence N is the number of sampling points.
[0088] Step 3B, reverse map the points in the equidistant point sequence to the curved surface to obtain the initial trajectory point set
[0089] The system maps these points back to the curved surface through reverse mapping .
[0090] For each (u k ,v k ), traverse the triangular patches to find the grid that makes it fall into the parametric triangle and calculate the corresponding barycentric coefficients:
[0091] p k =λ1v1+λ2v2+λ3v3,
[0092] where(λ1,λ2,λ3)from barycentricinterpolation
[0093] Thus the initial trajectory point set on the surface can be obtained
[0094] In summary, step 3B specifically includes the following steps:
[0095] Step 3B1, reverse map the points in the equidistant point sequence into three-dimensional points p k0 .
[0096] At this time, the three-dimensional point p k0 may exist outside the surface of the STL model or on the surface of the STL model.
[0097] Outside the surface of the STL model refers to the left side or the right side of the triangular patch, that is, the positive direction or the negative direction of the patch normal direction
[0098] Step 3B2, based on the three-dimensional point p k0 , traverse the triangular patches to find the triangular patch that makes the three-dimensional point p k0 fall into.
[0099] If the three-dimensional point p k0 exists on the surface of the STL model, it can be identified by software that it is in the triangular patch.
[0100] If the three-dimensional point p k0 may exist outside the surface of the STL model, the triangular patch that makes the three-dimensional point p k0 fall into is identified by software.
[0101] The triangular patch that the three-dimensional point p k0 falls into has vertex coordinates v i .
[0102] The triangular patch that the three-dimensional point p k0 falls into has the minimum projection distance of the three-dimensional point p k0 along the normal direction of the patch.
[0103] Where the projection distance is obtained by the prior art.
[0104] Step 3B3: For the triangular facet obtained in step 3B2, apply existing technology (such as facet normal projection method) to obtain the weights (λ1, λ2, λ3) corresponding to the vertices of the triangular facet.
[0105] Step 3B4: Apply interpolation to the triangular patch obtained in step 3B2 to calculate the 3D point p. k0 The corresponding p k .
[0106] p k =λ1v1+λ2v2+λ3v3,
[0107] Input λ1,λ2,λ3, v1, v2, v3, output p k .
[0108] In summary, regarding the mapping φ(p):
[0109]
[0110] Step 4: 3D path smoothing and continuous curve generation.
[0111] To generate an executable trajectory, path points (trajectory points) p must be specified. k Smoothing and curve reconstruction are performed. The system employs a two-stage optimization process, with the following steps:
[0112] Step 4A: Smooth the three-point parabola (noise reduction).
[0113]
[0114] It can effectively eliminate high-frequency noise while preserving key geometric features.
[0115] Step 4B: Curvature minimization optimization.
[0116] Using the second-order difference of the path points as an approximate curvature term, construct the energy function:
[0117]
[0118] By minimizing this energy, the path can be made as smooth as possible while preserving its original shape, avoiding abrupt changes in the robot's trajectory. This allows for the acquisition of a smooth set of trajectory points on the curved surface. That is, the set of path points
[0119] Step 5: Calculate the trajectory attitude and output it.
[0120] For each path point q k The system calculates the tangent vector t. k With normal vector n k ,like Figure 5 As shown:
[0121] Tangent vector (processing direction) : Tangent vector of the point.
[0122]
[0123] Normal vector (contact direction) : Normal vector of the triangle patch where the point is located.
[0124] Final trajectory record is:
[0125]
[0126] Step 6, output the specified format.
[0127] According to the final trajectory record and STL, the present application can export various data formats, including the following formats:
[0128] CSV / TXT: This is a general path point file format that can be widely used in various systems and devices, thereby realizing the sharing and exchange of path data.
[0129] KRL / RAPID: These two formats are standard formats of industrial robot executable code, which can be directly read and executed by industrial robots, thereby realizing automatic control.
[0130] G-code: This is a code format suitable for CNC path control, which can be directly read and executed by CNC machine tools, thereby realizing precise path control.
[0131] Geometric STL: This is a format that embeds the path area as a belt-shaped groove, which can be read and executed by simulation software, thereby realizing path simulation and verification. As shown in Figure 6 , the triangle patches are not shown in Figure 6 , and the STL model can be enlarged in software to display the triangle patches.
[0132] The present application provides a path texture driven 3D surface machining trajectory generation device, which adopts modular design and is composed of six main functional modules, which respectively perform STL grid processing, parameter field construction, image path analysis, image and surface mapping, path curve reconstruction and posture trajectory output functions. As shown in Figure 7 , the functions and implementation methods of each module are as follows:
[0133] 1. Preprocessing module.
[0134] The main function of this module is to standardize the geometric structure of the input STL format model to adapt to subsequent parameter field calculation and trajectory mapping tasks.
[0135] The module first reads the STL file and extracts the set of triangular facets
[0136] Then, the system automatically detects whether the facet normals are consistent, and completes the unification by reversing the normal or rearranging the vertex order.
[0137] To improve the mesh quality and computational stability, the module performs geometric fairing on the model, including the Taubin Smoothing or Laplacian smoothing algorithm. At the same time, the system constructs the adjacency structure and topological information of each vertex, which is used for subsequent potential field construction and interpolation operations.
[0138] 2. Parameter field calculation module.
[0139] This module constructs two continuous scalar functions u(p) and v(p) on the STL mesh surface to form a two-dimensional parameterization coordinate system, which is used for subsequent mapping of image paths to surface paths. The module solves the following harmonic potential field equation by discretizing the Laplace-Beltrami operator, and applies Dirichlet boundary conditions at the boundary or seed points. After obtaining the preliminary solution, the gradient orthogonalization process is performed on the v field to satisfy the local constraint. Finally, the module outputs a continuous bidirectional mapping function φ(p) = (u(p), v(p)) from the surface to the unit square domain [0, 1] 2 for subsequent image path back projection.
[0140] 3. Path texture map processing module.
[0141] The path texture map processing module is responsible for analyzing and extracting path information from a two-dimensional image.
[0142] This module supports input of grayscale images, black and white binary images, or color images containing path encoding, with the size normalized to the [0, 1] 2 region.
[0143] The system first performs edge detection (such as Sobel or Canny), contour extraction, and centerline extraction on the image to obtain the main path line (centerline) in the path image.
[0144] Then, the curve resampling algorithm (such as uniform spacing sampling or curvature weighted sampling) is used to discretize the extracted path curve (centerline) into a series of image path points
[0145] These points define the coordinates in the image parameter domain, providing coordinate input for subsequent positioning on the surface.
[0146] 4. Image-surface mapping module.
[0147] The function of this module is to extract the path points (u) from the two-dimensional image. k ,v k Accurately map the path points onto the STL mesh surface to construct a three-dimensional path point sequence.
[0148] First, the system constructs a mapping φ based on the parameter field. -1 (u,v) reverses the mapping of image path points back onto the surface.
[0149] For precise positioning, the module searches for the triangular facet containing the point in the parameter domain, and then uses the centroid interpolation formula:
[0150] p k =λ1v i +λ2v j +λ3v k
[0151] Obtain the three-dimensional point p k0 The three-dimensional spatial position p on the STL model k .
[0152] The final output is a set of surface path points that maintains the same topology as the image path. This serves as the basis for subsequent trajectory reconstruction.
[0153] 5. Curve Reconstruction and Optimization Module
[0154] This module is responsible for reconstructing discrete 3D path points into continuous, smooth machining trajectory curves.
[0155] To eliminate jagged edges and oscillations caused by image noise and interpolation errors, the module first performs multiple three-point parabolic smoothing operations on the point sequence:
[0156]
[0157] While ensuring path geometric consistency, improve the C-axis of the curve. 1 Continuity. Subsequently, the module introduces an optimization model based on curvature energy, defining the following objective function:
[0158]
[0159] By using numerical optimization techniques to make subtle adjustments to the path point positions, the overall curvature is minimized, thereby improving the processability and stability of the trajectory in high curvature regions.
[0160] Trajectory and attitude output module
[0161] This module converts the smoothed path curve into trajectory data that can be executed by a robot or CNC machine. The module processes each path point p... k Calculate its tangent vector:
[0162]
[0163] And combined with the normal vector of the triangle face it belongs to, or using adjacent face weighted average to obtain smooth normal n k .
[0164] The tangent and normal together determine the direction and pose of the robot tool center point.
[0165] Finally, the module outputs the trajectory data in multiple industrial control formats, such as:
[0166] · KRL program segments for KUKA robots, including PTP / LINEAR point sequences;
[0167] · RAPID format for ABB robots;
[0168] · G-code trajectory files for CNC equipment;
[0169] · General CSV point cloud format for simulation or secondary processing.
[0170] The module also supports generating textured STL files with geometry, embedding the path as a curved groove or convex strip in the model for visualization or printing verification.
[0171] The above six modules together constitute a complete "path texture driven three-dimensional surface trajectory generation device" with high modularity, scalability, and the ability to adapt to multiple input formats and multiple output control platforms. The complete device supports an integrated workflow from image-based path design to robot trajectory execution, suitable for industrial polishing, engraving, patterning, and other intelligent manufacturing scenarios.
[0172] Compared with the prior art, the advantages of the present application are:
[0173] The present application combines the image path expression capability with the three-dimensional STL model processing capability, and constructs a high degree of freedom, high precision, and strong versatility trajectory generation scheme, which has outstanding technical advantages in flexible manufacturing, robot polishing, custom engraving, and other scenarios. The specific advantages are as follows:
[0174] 1. The core problem of the inability of STL models to directly support path definition and mapping is solved. The present application does not need to rely on CAD parameter models or traditional UV unfolding, but establishes a controllable two-dimensional parameter domain directly on the triangular mesh surface by constructing a harmonic potential field coordinate system, thereby realizing the mapping between the texture map and the three-dimensional surface. This method breaks through the dependence of existing path generation algorithms on surface parameterization, significantly widening the application range of STL models in path planning.
[0175] 2. Support users to freely define machining trajectory with image path, improve interaction and customization ability. The application takes image path as input interface, allows users to directly define machining path pattern through drawing software, AI assisted generation or external design draft, has advantages of high design freedom, intuitive expression, convenient operation and the like, and is especially suitable for flexible manufacturing scenes such as customized pattern machining and personalized decoration pattern polishing.
[0176] 3. Small trajectory distortion and high curvature continuity, guarantee machining stability and surface quality. Through harmonic potential field construction, orthogonal parameterization, path contour line extraction and subsequent curvature optimization, the trajectory generated by the application has good smoothness and local consistency in geometry, avoiding problems such as path corner and mutation. It can ensure that the robot maintains a stable posture under high-speed or constant force polishing mode, and significantly improves machining precision and surface quality.
[0177] 4. Clear posture output, suitable for industrial robots and CNC equipment. The tangent vector and normal vector of each path point are calculated synchronously during the trajectory generation process, forming spatial posture data, meeting the demand of six-axis robot polishing head or multi-degree-of-freedom CNC tool for posture control. It supports output of KRL, RAPID, G-code and other industrial control instruction formats, and has good platform compatibility.
[0178] 5. Process automation, high computing efficiency, suitable for batch operation deployment. The application uses sparse linear system solving and local interpolation technology, and the trajectory generation speed is fast, and the processing time of a typical model (one million faces) does not exceed 10 seconds. The whole process does not need manual teaching, manual splicing or trajectory reconstruction, and has real-time and high efficiency of engineering landing.
[0179] 6. General technical architecture, can be extended to multiple complex surface machining scenes. The method is suitable for polishing, engraving, laser ablation, spraying, sandblasting and other process types, and is widely used in complex surface machining tasks such as automobile parts, customized accessories, cultural and creative carving, aviation composite materials and orthopedic implants. The technical architecture is open, the algorithm can be embedded in multiple CAM / offline programming systems, and a general scheme is provided for free-form surface trajectory generation in intelligent manufacturing. BRIEF DESCRIPTION OF DRAWINGS
[0180] Figure 1 Flow chart of 3D surface machining trajectory generation method driven by path texture;
[0181] Figure 2 Schematic diagram of a triangle patch in an STL model;
[0182] Figure 3 Projection schematic diagram of two mutually orthogonal smooth potential fields;
[0183] Figure 4The schematic diagram of the center line extracted for the path texture image;
[0184] Figure 5 The schematic diagram of the machining trajectory;
[0185] Figure 6 The schematic diagram of the curved surface machining after the path texture is pasted;
[0186] Figure 7 The schematic diagram of the 3D surface machining trajectory generation device driven by the path texture;
[0187] Figure 8 The path texture image in the embodiment;
[0188] Figure 9 The 3D model of the automobile engine cover, that is, the STL model of the automobile engine cover;
[0189] Figure 10 The visualization effect of the path texture in the embodiment on the model;
[0190] Figure 11 The schematic diagram of the principle of constructing the cotangent weight;
[0191] Figure 12 The partial code corresponding to step 2A;
[0192] Figure 13 The normalized u in step 2A. DETAILED DESCRIPTION
[0193] The path texture driven 3D surface machining trajectory generation method and device of the present application will be described in more detail below with reference to the schematic diagrams, wherein the preferred embodiments of the present application are represented, and it should be understood that the present application described herein can be modified by those skilled in the art, and the advantageous effects of the present application can still be achieved. Therefore, the following description should be understood as extensive knowledge for those skilled in the art, and not as a limitation of the present application.
[0194] The embodiment faces the actual industrial scene, takes the user-defined pattern path texture image and the STL three-dimensional model to be machined as input, and generates continuous trajectory data that can be directly used for the force control polishing system of the six-axis industrial robot. The whole process does not need CAD modeling, and is suitable for complex workpieces such as irregular surfaces, reverse modeling pieces, and free curved surfaces.
[0195] I. Input preparation.
[0196] a. Path texture image
[0197] The user designs a polishing path pattern by hand drawing, Photoshop or SVG vector software, and generates a gray-scale image with a size of WxH The domain is a unit square [0,1] 2 .
[0198] As Figure 8 shown in the figure, the image gray value of 0 (black) represents the polishing path, and the gray value of 255 (white) represents the background.
[0199] b, three-dimensional STL model.
[0200] The surface shape of the workpiece is provided in an STL triangular mesh model, denoted as Each triangle T i =(v1,v2,v3), As Figure 9 shown in the figure, the STL model of the automobile engine cover is generated according to the automobile engine cover workpiece.
[0201] The triangular facets are not shown in Figure 9 , and the STL model can be enlarged in software to display the triangular facets.
[0202] II. Construction of parameter coordinate field.
[0203] In order to map the image path from the (u,v) space to the three-dimensional curved surface , a pair of continuous and smooth orthogonal parameter fields u(p) and v(p) need to be constructed on the surface of the STL model. The specific steps are as follows:
[0204] a. Construct the discrete Laplace-Beltrami equation:
[0205] A sparse matrix system is constructed by using the discrete Laplace formula with weight cotα+cotβ, that is, the discrete Laplace-Beltrami equation is constructed.
[0206] b. Set the boundary conditions:
[0207] Select a set of seed point set Γ u on the edge of the model or the polishing start and end area, and let Another set of Γ' u , let
[0208] Finally, solve the discrete Laplace-Beltrami equation.
[0209] Similarly, set the boundary point set of the v field.
[0210] c. Gradient projection orthogonalization of the initial solution of the v field:
[0211]
[0212] d. Obtain the parameter mapping function from the three-dimensional curved surface to the two-dimensional image domain:
[0213] φ(p) = (u(p), v(p)) ∈ [0, 1] 2
[0214] As shown in the following table, the codes corresponding to steps a-c are: Figure 12
[0215] As shown in the following table, the output u = (u1, u2,..., un) after normalization is: Figure 13 n T .
[0216] Three, image path extraction and mapping to three-dimensional surface.
[0217] In the image domain [0, 1] 2 , the image processing flow is performed:
[0218] Image binarization processing (threshold <128 is judged as path);
[0219] Using contour tracking or skeleton extraction method (such as Zhang-Suen algorithm) to obtain center line;
[0220] Resample the center line into an equidistant point sequence
[0221] For each two-dimensional path point (u k , v k ), find the patch containing the point in the triangular mesh parameter domain, and perform barycentric interpolation calculation on the corresponding three-dimensional coordinate point:
[0222] p k = λ1v1+ λ2v2+ λ3v3
[0223] Where λ is the barycentric coefficient of the point in the parameter triangle.
[0224] Four, path point smoothing and trajectory curve construction.
[0225] In order to make the robot polishing path smooth and continuous, and the posture transition natural, the following processing is performed on the initial point sequence obtained in step three:
[0226] Three-point smoothing (repeat 2-3 rounds):
[0227]
[0228] Curvature optimization:
[0229] Minimize curvature energy function:
[0230]
[0231] Fine-tune the position of path points to make the trajectory more suitable for force-controlled polishing with velocity and force feedback control.
[0232] V. Pose calculation and trajectory output.
[0233] For each path point p k , calculate the following two pose vectors:
[0234] Tangent vector (direction of robot motion)
[0235]
[0236] Normal vector (direction of robot polishing)
[0237] If p k falls on a triangular patch T i , take the patch normal;
[0238] Or take a weighted average of the normals at surrounding vertices to enhance continuity.
[0239] Combine to get the complete trajectory point pose triplet:
[0240] (p k , t k , n k )
[0241] The final output trajectory data is in a format supported by industrial robots, such as KUKA's KRL script file or CSV file, format: [X, Y, Z, TX, TY, TZ, NX, NY, NZ]. As shown in Figure 10 , it is a visual 3D texture effect of the trajectory.
[0242] VI. Robot execution example.
[0243] On a KUKA KR6 R900 robot platform, load the above trajectory and configure a constant normal polishing force (25N), with velocity control in linear mode (40mm / s). The robot executes the path according to the order of path points and poses, completing the polishing task of the required pattern on the target STL surface (workpiece, i.e. car engine cover).
[0244] The robot executes the path according to the order of path points and poses, and the construction steps are as follows:
[0245] 1. For all trajectory points, construct a graph;
[0246] 2. Then search for the start and end points of the line segment (degree 1).
[0247] 3. Sort all pixel points with the shortest path (from start point to end point)
[0248] 4. The pixel sequence is mapped to the corresponding three-dimensional sequence, that is, the sequence of trajectory points and poses executed by the robot is obtained.
[0249] The actual results show that the path is continuous, without jumping points, and the pose is smooth, the polishing pattern accurately reproduces the original texture path, the edge is clear, the corner transition is natural, and the surface roughness is reduced from 1.6 μm to 0.6 μm.
[0250] The present application takes a path texture image and an STL model as input, and generates a continuous trajectory that can be used for industrial polishing and other precision machining tasks through a series of mathematical mapping, image processing, geometric analysis and optimization algorithms. Figure 1 As shown in the figure, the overall process is based on the method of geometric parameterization and image path fusion, and has high universality and engineering practicability.
[0251] The present embodiment is based on the idea of image path design and three-dimensional surface fusion, and realizes the automatic generation of robot execution trajectory from two-dimensional image. The system is simple and has high universality, and is suitable for typical application scenarios such as custom pattern processing, reverse model polishing, and complex curved surface artistic carving. The method simultaneously supports image control, STL input and robot output, and is an important technical scheme for realizing flexibility and high precision in industrial intelligent polishing.
[0252] The application field of the present application is as follows:
[0253] 1. Personalized polishing and decorative texture processing of automobile parts.
[0254] Scene description: On automobile engine covers, door shells, B-pillar trim panels and other parts, perform wire drawing, sanding or decorative pattern polishing according to customer design patterns.
[0255] Advantages of the present application: The pattern (such as parallel lines, corrugations, totem symbols) can be directly defined from the image, without the need for CAD modeling, and can be fitted to a free curved surface shell to output continuous trajectories.
[0256] Typical process: robot force control polishing + wire drawing trajectory + surface Ra value control.
[0257] 2. Post-processing layering and functional texture polishing of 3D printed parts.
[0258] Scene description: Surface treatment is performed on plastic or metal parts formed by FDM / SLA 3D printing to eliminate layering lines and apply guiding textures (such as fluid channels, heat dissipation structures).
[0259] Advantages of the present application: The unmodeled STL printed parts can be directly processed, and the functional texture direction can be defined by image texture to improve processing efficiency and surface quality. "Unmodeled" means that there is no numerical model, and there is no laser or blue light copying scene. It may be because the customer does not open the numerical model, or the copying cost is high.
[0260] Typical process: Image texture control path + robot flexible force control grinding head.
[0261] 3. Medical implant and biological device surface microstructure polishing.
[0262] Scenario description: Engraving surface micro-grooves, pattern structures on orthopedic implants (such as acetabular cups, spinal plates) or dental devices to induce bone integration or anti-slippage;
[0263] Advantages of the present application: Support the fitting of medical images and surface micro-texture patterns to STL models (derived from CT reconstruction) to generate complex but highly consistent trajectories;
[0264] Typical process: Robot micro-trajectory engraving + high-precision pose control + biomedical polishing.
[0265] 4. Artistic sculpture and digital handwork reconstruction.
[0266] Scenario description: After digitizing sculptures, ceramics, jade and other artworks, restore hand strokes, totem patterns, and personal signatures on their surfaces.
[0267] Advantages of the present application: Support image input path, fit complex freeform surfaces, and automatically generate artistic trajectories, which can replace traditional hand engraving.
[0268] Typical process: Numerical control micro-sculpture + engraving texture path mapping + ST surface compatibility.
[0269] 5. Surface functional texture polishing of consumer electronics housings.
[0270] Scenario description: Apply conductive mesh, anti-slip grip or visual decorative patterns on plastic or metal housings of laptops, mobile phones, and wearable devices.
[0271] Advantages of the present application: Through pattern texture path control, realize visually consistent, periodic accurate and highly repetitive trajectory processing.
[0272] Typical process: Multi-degree-of-freedom polishing / etching + image-controlled trajectory generation + surface functionality enhancement.
[0273] The above are only preferred embodiments of the present application and do not limit the present application in any way. Any person skilled in the art can make any form of equivalent replacement, modification or change to the technical solutions and technical content disclosed by the present application without departing from the scope of the technical solutions of the present application, which still falls within the protection scope of the present application.
Claims
1. A path texture driven 3D surface machining trajectory generation method, characterized in that, The method comprises the following steps: Step 1, based on the STL model, obtain the 3 vertex coordinates of the triangular facet, the first-order adjacency table of each vertex ; Step 2, constructing a mapping of the curved path to the two- dimensional image path based on the vertex coordinates and the first order adjacency list obtained in Step 1 , constructing a mapping of the curved path to the two- dimensional image path ; Step 3, process the path texture image acquisition point sequence, then map based on the mapping Reverse mapping the point sequence to the STL model to obtain the initial trajectory point set; Step 4, optimizing the initial track point set to generate a path point set; Step 2 specifically comprises the following steps: Step 2A, constructing the harmonic potential field where the harmonic potential field is constructed and the harmonic potential field is constructed in the same way as the map ; Constructing a harmonic potential field includes: Step 2A0, constructing a mesh comprising vertices unknown scalar values sparse linear system; wherein the vertices on the STL model, including interior vertices and boundary points; Step 2A1, performing Laplace-Beltrami discretization on the first-order adjacent point set of the internal vertex; Step 2A2, introducing a boundary condition; Step 2A3, obtaining a complete expression form of the system and solving; Step 2A4, solve for all , combine to get scalar field; Step 2B, orthogonalization processing: Step 2B1, Gradient orthogonalization, so that becomes an orthogonal coordinate; Step 2B2, Normalizing the mapping domain: for each pixel in the image, compute the normalized value as , performing normalization; Step 3 specifically comprises the following steps: Step 3A, processing the path texture image to obtain a sequence of equally spaced points in the path texture image ; is the number of sampling points; is the number of the sampling point; 、 - the image domain coordinates of the sampling point ; Step 3B, mapping points in equidistant point sequence through inverse mapping inverse mapping to a curved surface to obtain an initial trajectory point set ; Step 3B specifically comprises the following steps: Step 3B1, reverse mapping points in the equidistant point sequence into three- dimensional points ; Step 3B2, finding a triangle patch based on the three-dimensional point , traversing the triangle patches to find a triangle patch that the three-dimensional point falls into; Step 3B3, based on the triangle patches obtained in step 3B2, obtaining weights corresponding to the vertices of the triangle patches ; Step 3B4. Apply interpolation to the triangle facets obtained in Step 3B2 to calculate the 3D points corresponding to .
2. The path- texture driven 3D surface machining trajectory generation method according to claim 1, characterized in that, Step 4 specifically comprises the following steps: Step 4A, three-point parabolic smoothing processing; Step 4B, constructing an energy function to minimize the energy as the target, and performing curvature minimization optimization processing; The energy function is: ; wherein, is a trajectory point in the initial set of trajectory points.
3. The path- texture driven 3D surface machining trajectory generation method according to claim 1, wherein, After step 4, the following steps are further included: Step 5, calculating the tangent vector and normal vector of each path point.
Citation Information
Patent Citations
Line laser scanning-based sand blasting robot automatic path generation method
CN105354880A
Parameter mapping-based measurement planning method for complex curved surface
CN108682043A