Method for generating adaptive topological contour gradient structure of three-dimensional geometry
Through the adaptive topological contour gradient structure generation method, the problems of unsmooth chamfering effect and memory waste in the three-dimensional engine are solved, and the smooth transition and efficient rendering of chamfered geometry are realized, supporting the chamfering requirements of complex shapes.
Patent Information
- Application Number
- CN202511005557.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-07-22
AI Technical Summary
The geometric chamfering effect in existing three-dimensional engines is not smooth, and it is easy to produce jagged transitions. The lack of effective chamfer radius limitation judgment mechanism. Repeated vertex calculations lead to memory waste and drawing efficiency reduction, and lack of path-specific chamfering support.
Adaptive topological contour gradient structure generation method of three-dimensional geometry is adopted, and the visual quality improvement of chamfer geometry and efficient support for complex topological structures are achieved through contour geometry smoothing processing, topology-aware dynamic constraints of chamfer radius, vertex multiplexing optimization pipelines and path-dependent chamfer parameterization.
It realizes smooth transition of chamfered geometry, ensures safe chamfering of complex contours, reduces memory usage and improves rendering efficiency, and supports path-specific chamfering.
Smart Images

Figure CN120510328A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of geometric body chamfering, and in particular to a method for generating a three-dimensional geometric body adaptive topological contour gradient structure. Background Art
[0002] Currently, when implementing the chamfer effect of stretched geometry in a 3D engine, the following process is usually adopted: contour extraction and triangulation: parsing the 2D shape contour and converting it into a triangular mesh; chamfer offset calculation: using mathematical methods to perform multiple offsets along the contour edge to generate multiple chamfer layers; vertex connection and wall construction: connecting each chamfer layer with triangular facets to form side walls; surface filling: filling the top and bottom faces; performance optimization: avoiding repeated vertex generation and reducing GPU data transmission.
[0003] The existing solutions have the following problems: the connection between chamfer layers is not smooth enough, and jagged transitions are prone to occur; there is a lack of effective chamfer radius limit judgment mechanism for concave polygons or complex paths; repeated vertex calculation leads to memory waste and reduced drawing efficiency; there is a lack of support for path-specific chamfers.
[0004] Therefore, there is an urgent need to propose a new chamfer geometry generation method to improve visual quality, support more complex topological structures, and improve operational efficiency.
[0005] Patent application CN114972114A discloses a method, device, apparatus, and storage medium for generating chamfered structures for 3D text. Based on image pixel statistics, this patent cannot directly parse geometric path parameters or handle nested paths. It only supports simulating chamfer effects through normal rendering, lacking the flexibility to generate diverse chamfer types. Multi-stage image processing also incurs memory and computational overhead.
[0006] Patent publication number CN111428439A proposes a method for generating three-dimensional text on a mobile terminal based on a contour tree structure. This patent is constructed through a contour tree, relies on the odd-even filling rule of the text, and is only adapted to the hierarchical topology of the glyphs, and cannot handle industrial irregular holes / overhanging edge structures; the Earcut general hole subdivision algorithm has obvious limitations, does not constrain the minimum internal angle (which easily produces sharp-angled triangles), does not control the edge length gradient (resulting in uneven surface subdivision), and cannot optimize the hole stitching quality (only ensures topological correctness); it relies on GPU normal vector interpolation to simulate the smooth effect, and the geometric entity is still an angular mesh (the inflection point forces the vertex to be split), which is actually pseudo-geometric smoothing. Summary of the Invention
[0007] The purpose of the present invention is to solve the problems and shortcomings of the existing technology in the chamfering effect of stretched geometric bodies in three-dimensional engines, such as uneven contour connections that are prone to jagged edges, insufficient judgment mechanism for limiting the chamfer radius of concave polygons, repeated calculation of vertices leading to waste of memory and efficiency, and lack of support for path-specific chamfers. A method for generating a three-dimensional geometric body's adaptive topological contour gradient structure is proposed. By introducing contour geometry smoothing processing, topology-aware dynamic constraints on chamfer radius, a vertex reuse optimization pipeline, and path-dependent chamfer parameterized synchronous construction, the visual quality of chamfered geometry is significantly improved, and efficient support is provided for complex topological structures and path-specific chamfers.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions: A method for generating a three-dimensional geometric body adaptive topological contour gradient structure includes the following specific steps: S1: Input parsing and contour extraction: Input parameters, then extract shape contours and holes, call contour extraction technology, convert the main contour of the shape object into a plane point array p, discretize the Bezier curve according to the given number of subdivisions, and output a one-dimensional array containing vertex coordinates (two consecutive elements represent the x, y coordinates of a point). For each hole in the shape object (shapeHoles array), call contour extraction technology to convert it into a plane point array and store it in array h. Construct a complete polygon vertex list m, which contains the vertex data of the outer contour (p) and all inner holes (h); S2: Calculate the maximum safe chamfer radius: In order to ensure the rationality of the chamfer radius and avoid the chamfer exceeding the boundary or depth range of the geometry, perform the following steps: If the shape is text (isText is true), the default chamfer radius is estimated based on the bounding box size (width and height) of the shape. The specific method is: calculate the minimum size of the bounding box (min(width, height)), and then calculate a default radius proportionally (such as 0.08); If it is not a text shape, the polylabel algorithm is used to calculate the maximum inscribed circle radius g of the polygon (defined by the vertex list m) as the upper limit of the chamfer radius. The algorithm calculates the inscribed circle radius by calculating the farthest point from the interior of the polygon to the boundary; the final chamfer radius is set to the minimum of the user-set chamfer radius (bevelRadius), the calculated maximum inscribed circle radius (g), and the depth range limit (depth / 2): this._bevel = Math.min(bevelRadius, g, depth / 2); S3: Triangulate the contour: Triangulate the main contour and holes separately. Triangulate the main contour point array p to obtain the main area mesh data y. Triangulate each hole point array (in h) to obtain the hole area mesh data set (stored in x). Merge the hole area mesh data into the main area mesh data to form the complete contour triangulated mesh data. S4: Construct chamfer path: Generate multiple chamfer levels (the number of levels is determined by the number of chamfer segments, from 1 to curveSegments), each level corresponds to an inward-shrinking contour, for each chamfer level (from 1 to curveSegments), initialize an empty array re to store the chamfer points of the current level; traverse each vertex V of the contour, calculate the normal direction of the current vertex (average according to the normals of the adjacent edges); judge the angle characteristics of the current vertex (concave or convex, whether it is a continuous curve part), and select the connection method according to the angle characteristics: use arc connection for concave corners (discrete sampling to generate multiple points), and use straight line connection for convex corners (generate one point); offset along the normal direction according to the offset of the current level (calculated by the chamfer radius and the current level ratio), generate chamfer points and add them to the array re; perform triangulation of S3 on the generated chamfer point set re to obtain the chamfer surface mesh se of the current level; S5: Chamfered surface connection (wall part): Construct the side surfaces (walls) between adjacent chamfered levels: Get the vertex attributes (position, normal, UV coordinates) of each vertex on each chamfered level, where the position is calculated according to the level offset, the normal is blended with the stretching direction by the base contour normal (using a smoothing function interpolation), and the UV coordinates are obtained by contour position parameterization and level height parameterization; Construct connections to adjacent levels: For each segment on the contour (defined by two consecutive vertices): Get the vertex attributes of the current vertex u and the next vertex p on the current level; Construct two triangular patches (a quadrilateral is decomposed into two triangles): The first triangle consists of p.topP (the position of the next vertex at the current level), u.topN (the position of the current vertex at the previous level), and u.bottomN (the position of the current vertex at the current level); The second triangle consists of p.topP, u.bottomN, and p.bottomN (the position of the next vertex at the current level), and adds the generated triangle index to the index array r; S6: Bottom / top surface generation: Generate the bottom and top surfaces of the extruded body: Construct the surface vertices (including position, normal (bottom is (0,0,-1) and top is (0,0,1)) and UV coordinates of each vertex on the innermost chamfer outline (O.insetPoints) and all hole outlines (R), call the triangulation method in S3 to triangulate the outline after the innermost outline and the hole outline are combined (note that the hole is the internal boundary), and obtain the triangular mesh data G of the upper and lower surfaces; traverse each triangle in the triangular mesh: for each triangle's three vertices, obtain its top and bottom surface vertices; add the triangle index of the top surface (in the original order) to the index array; add the triangle index of the bottom surface (in the reverse order to ensure the correct normal direction) to the index array; S7: Data buffer and attribute binding: Store the generated vertex and index data in the buffer and bind it to the geometry object: Use a dynamic buffer (DynamicBuffer) to store all vertex attributes (position, normal, UV), and adopt an interleaved storage method: Each vertex is stored in the order of position (3 floats), normal (3 floats), and UV (2 floats), with a step of 8 floats. Use an index buffer (indexBuffer) to store all triangle indices (Uint32Array); Set the vertex attributes of the geometry object: Position attribute: Starting from buffer offset 0, every 3 floating-point numbers are a group, with a step of 8 * 4 = 32 bytes; Normal attribute: Starting from buffer offset 12 bytes (3 floats), every 3 floating-point numbers are a group, with a step of 32 bytes; UV attribute: Starting from buffer offset 24 bytes (6 floats), every 2 floating-point numbers are a group, with a step of 32 bytes.
[0009] As a further technical solution of the present invention, S1 specifically includes: S11: Input parameters: shape: 2D shape object (supports text, path, etc.), depth: stretching depth, bevelRadius: chamfer radius parameter, curveSegments: number of Bezier curve segments; S12: Contour extraction: S121: Main contour conversion: Input point sequence P={p0,p1,...,p n}← shape. contours, discretize each Bezier curve by curveSegments: for t=0 to 1 step 1 / curveSegments, p(t)= (1-t)³p0+ 3(1-t)²tp1+ 3(1-t)t²p2+ t³p3, output plane coordinate array p=[x0,y0,x1,y1,...]; S122: Hole processing: for each hole in shape.shapeHoles: perform the same discretization as S121, add the hole separator NaN, and output the hole array h = [h 0_x ,h 0_y ,...NaN,h 1_x ,...]; S123: Construct a complete polygon: m=[p,h] / / Combine the main contour and the hole, topological constraint: the main contour point order is clockwise, and the hole point order is counterclockwise.
[0010] As a further technical solution of the present invention, S2 specifically includes: S21: Input parameter definition: m: Vertex sequence of a two-dimensional polygon, including outer contour and inner hole vertex data; bevelRadius: target chamfer radius set by the user; Depth: The height of the geometry along the Z axis; isText: Boolean identifier indicating whether the current shape is a text glyph; S22: Calculation strategy selection module: if isText=true; S23: Non-text shape inscribed circle calculation module: If it is a non-text shape; S24: 3D constraint processing module: Final safe chamfer radius determination: Constraint 1: bevelRadius ≤ depth / 2 (prevent chamfer from penetrating the model), Constraint 2: bevelRadius ≤ g (prevent chamfer from exceeding the geometric boundary); Mathematical expression: R_safe=min(bevelRadius,isText? defaultRadius:g,depth / 2).
[0011] As a further technical solution of the present invention, S22 and S23 specifically include: S221: Get the shape bounding box: bbox=[min_x,min_y,max_x,max_y]; S222: Calculate the bounding box feature size: L = min(max_x-min_x, max_y-min_y); S223: Set the default radius: defaultRadius = k × L (where k = 0.08); S231: Process the vertex sequence m using the polygon center point algorithm (polylabel); S232: Obtain the maximum inscribed circle through distance constraint optimization: g=argmax_radius{ p∈ polygon,dist(p,center)≥radius}.
[0012] As a further technical solution of the present invention, S3 specifically includes: S31: Input data preprocessing: Convert the contour data generated by S1 into a data structure that can be recognized by the triangulation engine: Main contour `P`: 2D vertex sequence [x1, y1, x2, y2, ...] arranged clockwise; Hole set `H`: an array containing k hole vertex sequences [(h1_x1,h1_y1,...), (h2_x1,h2_y1,...), ...], where the holes are arranged counterclockwise; S32: Constrained triangulation: Using the Delaunay triangulation algorithm with boundary constraints: Main contour processing: perform triangulation on the contour `P` to generate the main mesh `Y`; Implementation process: Create the initial super triangle → insert point by point → Lawson edge exchange optimization; Hole processing: perform segmentation on each hole `h∈H` independently to generate the hole area mesh `X`; S33: Hole merging technology: Merge the hole mesh into the main mesh: Spatial alignment: maintain the original coordinates of the hole vertices based on the global coordinate system; Topological stitching: adding connected edges to connect the main body and the hole boundary; Mesh Restructuring: Perform local triangulation optimization on the area around the hole.
[0013] As a further technical solution of the present invention, the S4 specifically includes: S41: Hierarchical generation control structure, input parameters: number of chamfer segments S (determined by curveSegments), initial contour V={v0,v1,...,v n}(vertex_sequence); S42: Vertex offset calculation mechanism: for each vertex v i∈V do: S421: Calculation of adjacent edge vectors: e i = v i -v i-1 (forward edge), e i+1 = v i+1 -v i (backward side); S422: Normal direction solution: n i = normalize([-e i .y, e i .x]) (left normal), n i+1 = normalize([-e i+1 .y, e i+1 .x]); S423: Calculation of effective offset direction: d i =(n i + n i+1 ) / ||n i + n i+1 ||; S43: Intelligent decision-making for corner connection: Angle calculation: θ i = arccos(n i ·n i+1 ); Connection rule: arc connection θ i <π-ε(concave angle), linear connection θ i ≥π-ε(convex angle); spline fitting continuous curve segments; S44: Chamfer path generation implementation: Arc connection implementation: number of sampling points m=ceil(θ i / Δα) / / Δα=5° is the default angular resolution; for j= 0 to m: rotation angle φ=j *θ i / m; Calculate interpolation direction: d ij = R(φ)·d i / / R is the rotation matrix; generate point: p j = v i +r s ·d ij ; Linear connection implementation: Generate a single point: p=v i + r s ·d i ; S45: Geometrically constrained triangulation.
[0014] As a further technical solution of the present invention, the S45 specifically includes: S451: Input data loading: The computing system reads the input point set array P_s = [(x1,y1), (x2,y2),...,(x n ,y n )] into the memory buffer, and at the same time receives the reference length parameter r_s (usually taking 10% of the diagonal length of the bounding box); S452: Constraint parameter parsing: The computing engine automatically derives geometric constraint conditions: curve_ angle_threshold = math.pi - 0.1 # 169.3°(ε = 0.1 radian), min_edge_ length = 0.01 * r_s; S453: Constraint preprocessing: The system scans the point set to perform feature detection: Traverse each vertex v i ∈P_s, calculate the included angle of adjacent edges: θ = arccos(v i -v i-1 ,v i-1 -v i ) / (‖v i - v i-1 ‖ · ‖v i+1 -v i ‖), mark the points with θ > curve_angle_threshold as curve constraint points, and generate the constraint edge set E_constrained ={(v i ,v i+1 )|θ i > threshold}; S454: Core triangulation operation: The computing process calls the constrained Delaunay triangulation algorithm in S32 to obtain T_s; S455: Mesh quality optimization: The system iteratively performs mesh refinement on T_s: Detect triangles that violate constraints: edge length < min_edge_length, interior angle < 25°, insert Steiner points (circumcenter or centroid of inferior triangles), and perform local retriangulation until all constraints are satisfied; S456: Data structure output: Finally, generate a triangular mesh data structure: T_s = {vertices:[v1,v2,...,v m , / / including newly added Steiner points, faces: [(i,j,k), / / vertex indices of triangular patches...]}.
[0015] As a further technical solution of the present invention, the S5 specifically includes: S51: Intelligent chamfer vertex construction: Input parameters: A chamfer layer object, s contour segment index, n level index, and the processing flow is as follows: S511: Position calculation: based on bilinear interpolation: P = lerp(A.base[s], A.offset[s], n / N), where N is the total number of chamfer layers; S512: Normal generation: blending base normal and extrusion direction: normal = normalize[(1-α)*A.baseNormal+α*extrusionDir], α=(n / N)^β (β=1.5 blending curve factor); S513: UV mapping: parametric mapping: u=A.arcLength[s] / totalArcLength, v=n / N; S52: Topology optimized wall connections: Input adjacent chamfer layers L i and L i+1 The processing flow is as follows: S521: Ring structure generation: Create a connection ring R={(v j i , v j i+1 )|j=0..m-1}, add constraint edge: E_constraint={(v j i ,v j i+1 )}; S522: Triangle generation rule: for jin [0, m-1]: add triangle Δ(v j i , v j i+1 , v j+1 i ), add triangle Δ(v j+1 i ,v j i+1 ,v j+1 i+1 ); S523: Curvature adaptive optimization: if the curvature between two points κ>κ_threshold: insert the midpoint v mid =(v j i +v j i+1 ) / 2, create a new triangle: {Δ(v j i ,v mid ,v j+1 i ), Δ(v mid , v j i+1, v j+1 i+1 )}.
[0016] As a further technical solution of the present invention, the S6 specifically includes: S61: Vertex construction processing mechanism: Input parameters: O.insetPoints innermost contour point set of chamfer, R all hole contour set, the processing flow is as follows: S611: Vertex feature extraction: Mark hole topology relationship: H={H1,H2,...,H n}, calculate the contour direction: main contour → counterclockwise, hole → clockwise;
[0017] S612: Multi-layer composite triangulation: Construct combined contours combined_contours = [O.insetPoints]+R, and perform constrained triangulation G=constrained_ triangulation{vertices=flatten(combined_contours),constraints=[(closed boundary: O.insetPoints),(hole boundary: R0),(hole boundary: R1),...],minAngle=25°,maxArea=0.001*boundingArea}; S62: Surface mesh construction, dual surface simultaneous generation: For each triangle index t in range(G.elementCount): Get the three vertices of the triangle: v1=G[t][0], v2=G[t][1], v3=G[t][2]; Top Surface Treatment: Create Vertex Copy: v it =buildSurfaceVert (v i ,positionType="top"); Assign attributes: normal=(0,0,1), UV= (v i.x / width,v i.y / height); Bottom surface treatment: Create vertex copies: v ib =buildSurfaceVert (v i ,positionType="bottom"); Assign attributes: normal=(0,0,-1), UV= (v i.x / width,v i.y / height); Build index: Top index: _.push(v 1t , v 2t , v 3t ); bottom index: _.push(v 3b , v 2b ,v 1b )#Reverse clockwise.
[0018] As a further technical solution of the present invention, the S7 specifically includes: S71: Dynamic memory allocation, intelligent buffer management: Input parameters: total number of vertices V_count, number of triangles T_count. The processing flow is as follows: S711: Memory pre-allocation: bufferSize=V_count*(3+3+2)#position+normal+UV, indexSize=T_count*3#triangle index; S712: Dynamic buffer creation: vertexBuffer = DynamicBuffer (type = Float32Array, size = bufferSize, usage = DYNAMIC_DRAW), indexBuffer=DynamicBuffer(type=Uint32Array,size=indexSize, usage=STATIC_DRAW); S72: Data buffering and attribute binding: The code is as follows: S721: Vertex attribute structured storage, [vertex structure] = [position x, y, z, normal x, y, z, UVu, v]: offset = 0 for i in range(V_count): position coordinates (x, y, z), vertexBuffer [offset:offset+3]=positions[i], offset+=3; normal vector (nx, ny, nz), vertexBuffer[offset:offset+3]=normals[i], offset+=3; UV coordinates (u,v), vertexBuffer[offset:offset+2]=uvs[i], offset+= 2; S722: Fill index buffer: for i in range(T_count):indexBuffer [i*3]=triangles[i].v0; indexBuffer[i*3+1]=triangles[i].v1; indexBuffer[i*3+2]=triangles[i].v2; S723: Attribute binding: interleaved storage, stride = 8*4 = 32 bytes; Position attribute: setAttribute["position", Buffer(vertexBuffer, 3, 0, stride)]; Normal attribute: setAttribute["normal", Buffer(vertexBuffer, 3, 12, stride)] / / offset 12 bytes; UV attribute: setAttribute["uv",Buffer(vertexBuffer,2,24, stride)] / / Offset 24 bytes.
[0019] The beneficial effects of the present invention are: 1. Adaptive processing of concave corner arc connection and convex corner straight line connection to achieve smooth transition and avoid jagged edges.
[0020] 2. Constrain the chamfer radius by the maximum inscribed circle radius and depth range to ensure safe chamfering of complex contours.
[0021] 3. Reduce memory usage and improve rendering efficiency through shared vertex data and interleaved storage optimization.
[0022] 4. Support path-specific chamfering to meet the needs of complex shapes. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flow chart of a method for generating a three-dimensional geometric body adaptive topological contour gradient structure proposed by the present invention; Figure 2 Schematic diagram of the triangulation process; Figure 3 This is a diagram of the data storage structure. DETAILED DESCRIPTION
[0024] In order to make the technical means, creative features, objectives and effects achieved by the present invention easier to understand, the present invention is further described below in conjunction with specific implementation methods.
[0025] Please see the attached Figure 1 -Attached Figure 3 A method for generating a three-dimensional geometric body adaptive topological contour gradient structure includes the following specific steps: S1: Input parsing and contour extraction: Input parameters, then extract shape contours and holes, call contour extraction technology, convert the main contour of the shape object into a plane point array p, discretize the Bezier curve according to the given number of subdivisions, and output a one-dimensional array containing vertex coordinates (two consecutive elements represent the x, y coordinates of a point). For each hole in the shape object (shapeHoles array), call contour extraction technology to convert it into a plane point array and store it in array h. Construct a complete polygon vertex list m, which contains the vertex data of the outer contour (p) and all inner holes (h); S11: Input parameters: shape: 2D shape object (supports text, path, etc.), depth: stretching depth, bevelRadius: chamfer radius parameter, curveSegments: number of Bezier curve segments; S12: Contour extraction: S121: Main contour conversion: Input point sequence P={p0,p1,...,p n}← shape. contours, discretize each Bezier curve by curveSegments: for t=0 to 1 step 1 / curveSegments, p(t)= (1-t)³p0+ 3(1-t)²tp1+ 3(1-t)t²p2+ t³p3, output plane coordinate array p=[x0,y0,x1,y1,...]; S122: Hole processing: for each hole in shape.shapeHoles: perform the same discretization as S121, add the hole separator NaN, and output the hole array h = [h 0_x ,h 0_y ,...NaN,h 1_x ,...]; S123: Construct complete polygon: m=[p,h] / / Combine main contour and hole, topological constraint: main contour point order is clockwise, hole point order is counterclockwise; S2: Calculate the maximum safe chamfer radius: In order to ensure the rationality of the chamfer radius and avoid the chamfer exceeding the boundary or depth range of the geometry, perform the following steps: If the shape is text (isText is true), the default chamfer radius is estimated based on the bounding box size (width and height) of the shape. The specific method is: calculate the minimum size of the bounding box (min(width, height)), and then calculate a default radius proportionally (such as 0.08); If it is not a text shape, the polylabel algorithm is used to calculate the maximum inscribed circle radius g of the polygon (defined by the vertex list m) as the upper limit of the chamfer radius. The algorithm calculates the inscribed circle radius by calculating the farthest point from the interior of the polygon to the boundary; the final chamfer radius is set to the minimum of the user-set chamfer radius (bevelRadius), the calculated maximum inscribed circle radius (g), and the depth range limit (depth / 2): this._bevel = Math.min(bevelRadius, g, depth / 2); S21: Input parameter definition: m: Vertex sequence of a two-dimensional polygon, including outer contour and inner hole vertex data; bevelRadius: target chamfer radius set by the user; Depth: The height of the geometry along the Z axis; isText: Boolean identifier indicating whether the current shape is a text glyph; S22: Calculation strategy selection module: if isText=true; S221: Get the shape bounding box: bbox=[min_x,min_y,max_x,max_y]; S222: Calculate the bounding box feature size: L = min(max_x-min_x, max_y-min_y); S223: Set the default radius: defaultRadius = k × L (where k = 0.08); S23: Non-text shape inscribed circle calculation module: If it is a non-text shape; S231: Process the vertex sequence m using the polygon center point algorithm (polylabel); S232: Obtain the maximum inscribed circle through distance constraint optimization: g=argmax_radius{ p∈polygon,dist(p,center)≥radius}, where Indicates that the following conditions hold for all elements, which means that for all elements p belonging to polygon, dist(p, center) ≥ radius holds. S24: 3D constraint processing module: Final safe chamfer radius determination: Constraint 1: bevelRadius ≤ depth / 2 (prevents chamfers from penetrating the model), Constraint 2: bevelRadius ≤ g (prevents the chamfer from exceeding the geometric boundary); Mathematical expression: R_safe=min(bevelRadius,isText? defaultRadius:g,depth / 2); S3: Triangulate the contour: Triangulate the main contour and holes separately. Triangulate the main contour point array p to obtain the main area mesh data y. Triangulate each hole point array (in h) to obtain the hole area mesh data set (stored in x). Merge the hole area mesh data into the main area mesh data to form the complete contour triangulated mesh data. S31: Input data preprocessing: Convert the contour data generated by S1 into a data structure that can be recognized by the triangulation engine: Main contour `P`: 2D vertex sequence [x1, y1, x2, y2, ...] arranged clockwise; Hole set `H`: an array containing k hole vertex sequences [(h1_x1,h1_y1,...), (h2_x1,h2_y1,...), ...], where the holes are arranged counterclockwise; S32: Constrained triangulation: Using the Delaunay triangulation algorithm with boundary constraints: Main contour processing: perform triangulation on the contour `P` to generate the main mesh `Y`; Implementation process: Create the initial super triangle → insert point by point → Lawson edge exchange optimization; Hole processing: perform segmentation on each hole `h∈H` independently to generate the hole area mesh `X`; S33: Hole merging technology: Merge the hole mesh into the main mesh: Spatial alignment: maintain the original coordinates of the hole vertices based on the global coordinate system; Topological stitching: adding connected edges to connect the main body and the hole boundary; Mesh Restructuring: Perform local triangulation optimization on the area around the hole.
[0026] S4: Construct chamfer path: Generate multiple chamfer levels (the number of levels is determined by the number of chamfer segments, from 1 to curveSegments), each level corresponds to an inward-shrinking contour, for each chamfer level (from 1 to curveSegments), initialize an empty array re to store the chamfer points of the current level; traverse each vertex V of the contour, calculate the normal direction of the current vertex (average according to the normals of the adjacent edges); judge the angle characteristics of the current vertex (concave or convex, whether it is a continuous curve part), and select the connection method according to the angle characteristics: use arc connection for concave corners (discrete sampling to generate multiple points), and use straight line connection for convex corners (generate one point); offset along the normal direction according to the offset of the current level (calculated by the chamfer radius and the current level ratio), generate chamfer points and add them to the array re; perform triangulation of S3 on the generated chamfer point set re to obtain the chamfer surface mesh se of the current level; S41: Hierarchical generation control structure, input parameters: number of chamfer segments S (determined by curveSegments), initial contour V={v0,v1,...,v n}(vertex_sequence); S42: Vertex offset calculation mechanism: for each vertex v i ∈V do: S421: Calculation of adjacent edge vectors: e i = v i -v i-1 (forward edge), e i+1 = v i+1 -v i (backward side); S422: Normal direction solution: n i = normalize([-e i .y, e i .x]) (left normal), n i+1 = normalize([-e i+1 .y, e i+1 .x]); S423: Calculation of effective offset direction: d i =(n i +n i+1 ) / ||n i + n i+1 ||; S43: Intelligent decision-making for corner connection: Angle calculation: θ i = arccos(n i ·n i+1 ); Connection rule: arc connection θ i <π-ε(concave angle), linear connection θi ≥π-ε(convex angle); spline fitting Continuous curve segments, where It means "there is" or "there is at least one"; S44: Chamfer path generation implementation: Arc connection implementation: number of sampling points m=ceil(θ i / Δα) / / Δα=5° is the default angular resolution; for j= 0 to m: rotation angle φ=j *θ i / m; Calculate interpolation direction: d ij = R(φ)·d i / / R is the rotation matrix; generate point: p j = v i +r s ·d ij ; Linear connection implementation: Generate a single point: p=v i + r s ·d i ; S45: Geometrically constrained triangulation: S451: Input data loading: The computing system reads the input point array P_s = [(x1,y1), (x2,y2),...,(x n ,y n )] to the memory buffer and receive the reference length parameter r_s (usually 10% of the diagonal length of the bounding box); S452: Constraint parameter analysis: The calculation engine automatically derives geometric constraints: curve_ angle_threshold=math.pi-0.1 # 169.3°(ε=0.1 radians), min_edge_ length=0.01*r_s; S453: Constraint preprocessing: The system scans the point set to perform feature detection: traverse each vertex v i ∈P_s, calculate the angle between adjacent edges: θ=arccos(v i -v i-1 ,v i-1 -v i ) / (‖v i -v i-1 ‖·‖v i+1 -v i ‖), mark the points where θ> curve_angle_threshold as curve constraint points, and generate the constraint edge set E_constrained ={(v i ,v i+1 )|θi >threshold}; S454: Core triangulation operation: The computing process calls the constrained Delaunay triangulation algorithm in S32 to obtain T_s; S455: Mesh quality optimization: The system iteratively performs mesh refinement on T_s: Detect triangles that violate the constraints: edge length < min_edge_length, interior angle < 25°, insert Steiner points (circumcenter or centroid of inferior triangles), and perform local retriangulation until all constraints are satisfied; S456: Data structure output: Finally generate a triangular mesh data structure: T_s = {vertices: [v1, v2,..., v m , / / including newly added Steiner points, faces: [(i, j, k), / / vertex indices of triangular patches...]}; S5: Chamfered surface connection (wall part): Construct the side surfaces (walls) between adjacent chamfered levels: Obtain the vertex attributes (position, normal, UV coordinates) of each vertex on each chamfered level. Among them, the position is calculated according to the level offset, the normal is mixed by the base contour normal and the extrusion direction (interpolated using a smoothing function), and the UV coordinates are parameterized by the contour position and the level height; Construct the connection between adjacent levels: For each segment on the contour (defined by two consecutive vertices): Obtain the vertex attributes of the current vertex u and the next vertex p on the current level; Construct two triangular patches (a quadrilateral is decomposed into two triangles): The first triangle consists of p.topP (the position of the next vertex on the current level), u.topN (the position of the current vertex on the upper level), and u.bottomN (the position of the current vertex on the current level); The second triangle consists of p.topP, u.bottomN, and p.bottomN (the position of the next vertex on the current level), and add the generated triangle indices to the index array r; S51: Intelligent chamfered vertex construction: Input parameters: A chamfered layer object, s contour segment index, n level index, and the processing flow is as follows: S511: Position calculation: Based on bilinear interpolation: P = lerp(A.base[s], A.offset[s], n / N), where N is the total number of chamfered layers; S512: Normal generation: Mix the base normal and the extrusion direction: normal = normalize[(1 - α)*A.baseNormal + α*extrusionDir], α = (n / N)^β (β = 1.5 mixing curve factor); S513: UV mapping: parametric mapping: u=A.arcLength[s] / totalArcLength, v=n / N; S52: Topology optimized wall connections: Input adjacent chamfer layers L i and L i+1 The processing flow is as follows: S521: Ring structure generation: Create a connection ring R={(v j i , v j i+1 )|j=0..m-1}, add constraint edge: E_constraint={(v j i ,v j i+1 )}; S522: Triangle generation rule: for j in [0, m-1]: add triangle Δ(v j i , v j i+1 , v j+1 i ), add triangle Δ(v j+1 i , v j i+1 , v j+1 i+1 ); S523: Curvature adaptive optimization: if the curvature between two points κ>κ_threshold: insert the midpoint v mid =(v j i +v j i+1 ) / 2, create a new triangle: {Δ(v j i ,v mid ,v j+1 i ), Δ(v mid , v j i+1 , v j+1 i+1 )}; S6: Bottom / top surface generation: Generate the bottom and top surfaces of the extruded body: Construct the surface vertices (including position, normal (bottom is (0,0,-1) and top is (0,0,1)) and UV coordinates of each vertex on the innermost chamfer outline (O.insetPoints) and all hole outlines (R), call the triangulation method in S3 to triangulate the outline after the innermost outline and the hole outline are combined (note that the hole is the internal boundary), and obtain the triangular mesh data G of the upper and lower surfaces; traverse each triangle in the triangular mesh: for each triangle's three vertices, obtain its top and bottom surface vertices; add the triangle index of the top surface (in the original order) to the index array; add the triangle index of the bottom surface (in the reverse order to ensure the correct normal direction) to the index array; S61: Vertex construction processing mechanism: Input parameters: O.insetPoints innermost contour point set of chamfer, R all hole contour set, the processing flow is as follows: S611: Vertex feature extraction: Mark hole topology relationship: H={H1,H2,...,H n}, calculate the contour direction: main contour → counterclockwise, hole → clockwise; S612: Multi-layer composite triangulation: Construct combined contours combined_contours = [O.insetPoints]+R, and perform constrained triangulation G=constrained_ triangulation{vertices=flatten(combined_contours),constraints=[(closed boundary: O.insetPoints),(hole boundary: R0),(hole boundary: R1),...],minAngle=25°,maxArea=0.001*boundingArea}; S62: Surface mesh construction, dual surface simultaneous generation: For each triangle index t in range(G.elementCount): Get the three vertices of the triangle: v1=G[t][0], v2=G[t][1], v3=G[t][2]; Top Surface Treatment: Create Vertex Copy: v it =buildSurfaceVert (v i ,positionType="top"); Assign attributes: normal=(0,0,1), UV= (v i.x / width,v i.y / height); Bottom surface treatment: Create vertex copies: v ib =buildSurfaceVert (v i ,positionType="bottom"); Assign attributes: normal=(0,0,-1), UV= (v i.x / width,v i.y / height); Build index: Top index: _.push(v 1t , v 2t , v 3t ); bottom index: _.push(v 3b , v 2b ,v 1b )#Reverse clockwise; S7: Data buffer and attribute binding: Store the generated vertex and index data in the buffer and bind it to the geometry object: Use a dynamic buffer (DynamicBuffer) to store all vertex attributes (position, normal, UV), and adopt an interleaved storage method: Each vertex is stored in the order of position (3 float), normal (3 float), UV (2 float), with a step of 8 float, and use an index buffer (indexBuffer) to store all triangle indices (Uint32Array); Set the vertex attributes of the geometry object: Position attribute: Starting from the buffer offset 0, every 3 floating point numbers are a group, with a step of 8 * 4 = 32 bytes; Normal attribute: Starting from the buffer offset 12 bytes (3 float), every 3 floating point numbers are a group, with a step of 32 bytes; UV attribute: Starting from the buffer offset 24 bytes (6 float), every 2 floating point numbers are a group, with a step of 32 bytes; S71: Dynamic memory allocation, intelligent buffer management: Input parameters: total number of vertices V_count, number of triangles T_count. The processing flow is as follows: S711: Memory pre-allocation: bufferSize=V_count*(3+3+2)#position+normal+UV, indexSize=T_count*3#triangle index; S712: Dynamic buffer creation: vertexBuffer = DynamicBuffer (type = Float32Array, size = bufferSize, usage = DYNAMIC_DRAW), indexBuffer = DynamicBuffer(type = Uint32Array, size = indexSize, usage = STATIC_DRAW); S72: Data buffering and attribute binding: The code is as follows: S721: Structured storage of vertex attributes, [vertex structure] = [position x, y, z, normal x, y, z, UV u, v]: offset = 0; for i in range(V_count): position coordinates (x, y, z), vertexBuffer [offset:offset + 3]=positions[i], offset += 3; normal vector (nx, ny, nz), vertexBuffer[offset:offset + 3]=normals[i], offset += 3; UV coordinates (u, v), vertexBuffer[offset:offset + 2]=uvs[i], offset += 2; S722: Filling the index buffer: for i in range(T_count): indexBuffer [i * 3]=triangles[i].v0; indexBuffer[i * 3 + 1]=triangles[i].v1; indexBuffer[i * 3 + 2]=triangles[i].v2; S723: Attribute binding: Interleaved storage, stride = 8 * 4 = 32 bytes; Position attribute: setAttribute["position", Buffer(vertexBuffer, 3, 0,stride)]; Normal attribute: setAttribute["normal", Buffer(vertexBuffer, 3, 12,stride)] / / Offset 12 bytes; UV attribute: setAttribute["uv",Buffer(vertexBuffer,2,24, stride)] / / Offset 24 bytes.
[0027] Example 1 Generating chamfered geometry for the Chinese characters "中国": 1. Input parameters: Shape: Vector path of the Chinese character "中国" (including 2 holes); Character "中": 1 outer contour + 1 square hole; Character "国": 1 outer contour + 4 holes (including 1 complex curve hole); Depth: depth = 10.0 units; Chamfer radius: bevelRadius = 1.2 units; Curve segments: curveSegments = 24.
[0028] 2. Execution process: S1: Contour extraction and discretization, Processing of the main contour: Outer contour of the character "中": 4 straight line segments → Discretized into 8 points; Outer contour of the character "国": 6 cubic Bezier curves → Divided into 48 segments according to curvature; Hole processing: Square hole of the character "中": 4 straight line segments → Discretized into 8 points; Complex hole of the character "国": 3 cubic Bezier curves → Divided into 32 segments according to curvature; Output structure: p = [x0, y0, x1, y1,..., x n , y n / / Set of main contour points; h = [NaN, h 0_x , h 0_y ,..., h m_x , h m_y / / Set of hole points + delimiter; S2: Calculation of the safe chamfer radius, Judgment of text type: shape.isText = true; Calculation of the bounding box: width = 38.2 units, height = 42.5 units → L = min(38.2, 42.5) = 38.2 units; Default chamfer radius: defaultRadius = 0.08 × 38.2 = 3.056 units; Depth constraint: depth / 2 = 5.0 units; Final chamfer radius: this._bevel = min(1.2, 3.056, 5.0) = 1.2 units; S3: Topology-preserving triangulation, Triangulation of the outer contour of the character "中": Input: 8 points → Output: 6 triangles, Triangle quality: Minimum interior angle = 28° > 25° (meets the constraint); "Middle" character hole subdivision: Input: 8 points → Output: 6 triangles, Exclusion area constraint: Automatically limited within the bounding box of the main contour; "Country" character outer contour subdivision: Input: 48 points → Output: 86 triangles; "Country" character hole subdivision: Complex hole: 32 points → Output: 56 triangles, Simple hole: 3 (each with 8 points) → Each outputs 6 triangles; Sewing process: Add 3 sewing edges to each hole (a total of 12 sewing edges for the "Country" character); S4: Chamfer path generation (in 5 layers) Number of layers: curveSegments = 5; Level offset: [0.24, 0.48, 0.72, 0.96, 1.2]; Concave corner processing: "Middle" character: 4 right angles → Processed as convex corners (each generates 1 point), "Country" character: 8 concave corners detected (θ = 90° - 135°), Maximum concave corner θ = 135° → Sampling points m = ceil(135 / 5) = 27, Total number of newly added points for concave corners: 8 concave corners × average 18 points = 144 points; Chamfer point statistics: Base points: (48 + 32 + 24) = 104 points, Increment per layer: 104 base points + 144 newly added points for concave corners = 248 points, Total for 5 layers: 1240 points; S5: Chamfer wall connection, Vertex attribute generation: Position: P = lerp(P_base, P_offset, level ratio), Normal: N = normalize((1 - α²)N_base + α²N_ext), α = smoothstep(0,1,level ratio) = 3t² - 2t³; <Vertex Statistics: Wall vertices: 1,240 points, top and bottom vertices: 104×2 = 208 points, total: 1,448 points; Memory Allocation: Vertex buffer: 1,448 points × (3 + 3 + 2) × 4 bytes = 46,336 bytes, Index buffer: (32 + 288 + 12 + 104) × 3 indices × 4 bytes = 5,232 bytes; Interleaved Storage Structure: Vertex format: [x, y, z, nx, ny, nz, u, v]; Attribute Binding: Position → offset 0, stride 32 bytes; Normal → offset 12 bytes, stride 32 bytes; UV → offset 24 bytes, stride 32 bytes.
[0029] The technical effects of the traditional method and the method of the present invention are compared as shown in Table 1 below: Table 1: Comparison Table of Technical Effects index Traditional methods The present invention Improvement Total number of vertices 3820 1448 62%↓ Total number of triangles 6984 436 94%↓ Concave angle smoothness (QI) 0.55 0.92 67%↑ Hole boundary accuracy (px) ±3.2 ±0.5 84%↑ Memory usage (KB) 305 51.5 83%↓ GPU rendering frame rate (fps) 42 68 62%↑ Note: QI is the mesh quality index (range 0 - 1, 1 being the best).
[0030] Embodiment of Technical Advantages: 1) Complex Topology Processing Ability: Successfully processed 4 nested holes (including complex curve holes) of the character "国", with the hole boundary error < 0.5px.
[0031] 2) Concave Angle Smoothing Optimization: 27 sampling points are generated at the 135° concave angle, and the curvature continuity is increased by 67%.
[0032] 3) Resource Efficiency Improvement: By vertex reuse and optimized topology, the number of triangular patches is reduced by 94%.
[0033] 4) Visual Quality Assurance: Smooth transition is achieved in the concave angle area, and visible jaggedness to the naked eye is completely eliminated.
[0034] This embodiment proves that the method of the present invention can efficiently process the generation of Chinese characters containing complex hole structures, significantly improving the performance index while ensuring visual quality.
[0035] From the above description, it can be seen that the above embodiments of the present invention achieve the following technical effects: Through the adaptive processing of connecting concave angles with arcs and convex angles with straight lines, smooth transition is achieved to avoid jaggedness; By constraining the chamfer radius with the maximum inscribed circle radius and depth range, safe chamfers for complex contours are ensured; By sharing vertex data and optimizing interleaved storage, memory occupancy is reduced and rendering efficiency is improved; Support for path-specific chamfers to meet the requirements of complex shapes.
[0036] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present invention is limited to these examples. Within the scope of the present invention, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity.
[0037] The present invention is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the specification. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for generating a three-dimensional geometric body adaptive topological contour gradient structure, characterized in that: The specific steps include: S1: Input parsing and contour extraction: Input parameters and then extract shape contours and holes; S2: Calculate the maximum safe chamfer radius: The final chamfer radius is set to the minimum of the user-set chamfer radius, the calculated maximum inscribed circle radius, and the depth range limit; S3: Triangulate the contour: triangulate the main contour and holes separately, merge the hole area mesh data into the main area mesh data to form a complete contour triangulated mesh data; S4: Constructing the chamfer path: Generate multiple chamfer levels. For each chamfer level, initialize an empty array re to store the chamfer points of the current level; traverse each vertex V of the contour and calculate the normal direction of the current vertex; determine the angle characteristics of the current vertex and select a connection method based on the angle characteristics; offset along the normal direction according to the offset of the current level, generate chamfer points and add them to the array re; perform triangulation of the generated chamfer point set re in S3 to obtain the chamfer surface mesh se of the current level; S5: Chamfer surface connection: construct the side faces between adjacent chamfer levels, connect adjacent levels, and construct two triangular facets; S6: Bottom / top surface generation: Generate the bottom and top surfaces of the extruded body, traversing each triangle in the triangular mesh; S7: Data buffer and attribute binding: Store the generated vertex and index data in the buffer, bind it to the geometry object, and set the vertex attributes of the geometry object.
2. A method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 1, characterized in that: Said S1 specifically includes: S11: Input parameters: shape: 2D shape object, depth: extrusion depth, bevelRadius: chamfer radius parameter, curveSegments: number of Bezier curve segments; S12: Contour extraction: S121: Main contour conversion: Input point sequence P={p0,p1,...,p n }← shape. contours, discretize each Bezier curve by curveSegments: for t=0 to 1 step 1 / curveSegments, p(t)= (1-t)³p0+ 3(1-t)²tp1+ 3(1-t)t²p2+ t³p3, output plane coordinate array p=[x0,y0,x1,y1,...]; S122: Hole processing: for each hole in shape.shapeHoles: perform the same discretization as S121, add the hole separator NaN, and output the hole array h = [h 0_x ,h 0_y ,...NaN,h 1_x ,...]; S123: Construct a complete polygon: m=[p,h] / / Combine the main contour and the hole, topological constraint: the main contour point order is clockwise, and the hole point order is counterclockwise.
3. The method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 1, characterized in that: The S2 specifically includes: S21: Input parameter definition: m: Vertex sequence of a two-dimensional polygon, including outer contour and inner hole vertex data; bevelRadius: target chamfer radius set by the user; Depth: The height of the geometry along the Z axis; isText: Boolean identifier indicating whether the current shape is a text glyph; S22: Calculation strategy selection module: if isText=true; S23: Non-text shape inscribed circle calculation module: If it is a non-text shape; S24: 3D constraint processing module: Final safe chamfer radius determination: Constraint condition 1: bevelRadius ≤ depth / 2; Constraint condition 2: bevelRadius ≤ g; Mathematical expression: R_safe = min(bevelRadius, isText? defaultRadius:g,depth / 2).
4. A method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 3, characterized in that: The S22 and S23 specifically include: S221: Obtain the shape bounding box: bbox = [min_x, min_y, max_x, max_y]; S222: Calculate the characteristic dimension of the bounding box: L = min(max_x - min_x, max_y - min_y); S223: Set the default radius: defaultRadius = k × L; S231: Process the vertex sequence m using the polygon center point algorithm; S232: Obtain the maximum inscribed circle through distance constraint optimization: g=argmax_radius{ p∈polygon,dist(p,center)≥radius}.
5. The method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 1, characterized in that: The S3 specifically includes: S31: Input data preprocessing: Convert the contour data generated by S1 into a data structure recognizable by the triangulation engine: Main contour `P`: The two-dimensional vertex sequence [x1, y1, x2, y2,...] is arranged in a clockwise order; Hole set `H`: An array containing k hole vertex sequences [(h1_x1, h1_y1,...), (h2_x1, h2_y1,...),...], and each hole is arranged in a counterclockwise order; S32: Constrained triangulation: Use the Delaunay triangulation algorithm with boundary constraints: Main contour processing: Perform triangulation on the contour `P` to generate the main body mesh `Y`; Implementation process: Establish an initial super triangle → Insert points one by one → Lawson edge swap optimization; Hole processing: Independently perform triangulation on each hole `h ∈ H` to generate the hole region mesh `X`; S33: Hole merging technology: Merge the hole meshes into the main body mesh: Spatial alignment: Keep the original coordinates of the hole vertices based on the global coordinate system; Topological stitching: Add connecting edges to connect the main body and the hole boundaries; 6. The method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 1, characterized in that: Mesh reorganization: Perform local triangle optimization on the area around the hole. S41: Hierarchical generation control structure, input parameters: number of chamfer segments S, initial contour V={v0,v1,...,v n }; S42: Vertex offset calculation mechanism: for each vertex v i ∈V do: S421: Calculation of adjacent edge vectors: e i =v i -v i-1 , e i+1 =v i+1 -v i ; S422: Normal direction solution: n i = normalize([-e i .y,e i .x]), n i+1 =normalize([-e i+1 .y,e i+1 .x]); S423: Calculation of effective offset direction: d i =(n i + n i+1 ) / ||n i + n i+1 ||; S43: Intelligent decision-making for corner connection: Angle calculation: θ i = arccos(n i ·n i+1 ); Connection rule: arc connection θ i <π-ε, linear connection θ i ≥π-ε; spline fitting continuous curve segments; The S4 specifically includes: Arc connection implementation: number of sampling points m=ceil(θ i / Δα) / / Δα=5° is the default angular resolution; for j= 0 to m: rotation angle φ=j *θ i / m; Calculate interpolation direction: d ij = R(φ)·d i / / R is the rotation matrix; generate point: p j =v i + r s ·d ij ; Linear connection implementation: Generate a single point: p=v i + r s ·d i ; S44: Realize the generation of the chamfer path:
7. A method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 6, characterized in that: S45: Geometric constraint triangulation. S451: Input data loading: The computing system reads the input point array P_s = [(x1,y1), (x2,y2),...,(x n ,y n )] to the memory buffer and receive the reference length parameter r_s; The S45 specifically includes: S452: Parse the constraint parameters: The calculation engine automatically deduces the geometric constraint conditions: curve_ angle_threshold = math.pi - 0.1 # 169.3°, min_edge_ S453: Constraint preprocessing: The system scans the point set to perform feature detection: traverse each vertex v i ∈P_s, calculate the angle between adjacent edges: θ=arccos(v i -v i-1 ,v i-1 -v i ) / (‖v i -v i-1 ‖·‖v i+1 -v i ‖), mark the points where θ> curve_angle_threshold as curve constraint points, and generate the constraint edge set E_constrained ={(v i ,v i+1 )|θ i > threshold}; length = 0.01 * r_s; S454: Core triangulation operation: The calculation process calls the constrained Delaunay triangulation algorithm in S32 to obtain T_s; S456: Data structure output: The final triangular mesh data structure is generated: T_s = {vertices:[v1,v2,...,v m ], / / Contains newly added Steiner points, faces: [(i,j,k), / / Triangle vertex index...]}.
8. The method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 1, characterized in that: S455: Mesh quality optimization: The system iteratively performs mesh refinement on T_s: Detect triangles that violate the constraints: edge length < min_edge_length, interior angle < 25°, insert Steiner points, and perform local retriangulation until all constraints are satisfied; The S5 specifically includes: S51: Build intelligent chamfer vertices: Input parameters: A chamfer layer object, s contour segment index, n level index, and the processing flow is as follows: S511: Position calculation: based on bilinear interpolation: P=lerp(A.base[s], A.offset[s], n / N), where N is the total number of chamfer layers; S512: Normal generation: blending base normal and extrusion direction: normal = normalize[(1-α)*A.baseNormal+α*extrusionDir], α=(n / N)^β; S513: UV mapping: parametric mapping: u=A.arcLength[s] / totalArcLength, v=n / N; S52: Topology optimized wall connections: Input adjacent chamfer layers L i and L i+1 The processing flow is as follows: S521: Ring structure generation: Create a connection ring R={(v j i , v j i+1 )|j=0..m-1}, add constraint edge: E_constraint={(v j i ,v j i+1 )}; S522: Triangle generation rule: for jin[0, m-1]: add triangle Δ(v j i , v j i+1 , v j+1 i ), add triangle Δ(v j+1 i ,v j i+1 ,v j+1 i+1 ); S523: Curvature adaptive optimization: if the curvature between two points κ>κ_threshold: insert the midpoint v mid =(v j i +v j i+1 ) / 2, create a new triangle: {Δ(v j i ,v mid ,v j+1 i ), Δ(v mid , v j i+1 , v j+1 i+1 )}.
9. The method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 1, characterized in that: The S6 specifically includes: S61: Vertex construction processing mechanism: Input parameters: O.insetPoints innermost contour point set of chamfer, R all hole contour set, the processing flow is as follows: S611: Vertex feature extraction: Mark hole topology relationship: H={H1,H2,...,H n }, calculate the contour direction: main contour → counterclockwise, hole → clockwise; S612: Multi-layer composite triangulation: Construct combined contours combined_contours = [O.insetPoints]+R, perform constrained triangulation G=constrained_ triangulation{vertices=flatten(combined_contours),constraints=[(closed boundary: O.insetPoints),(hole boundary: R0),(hole boundary: R1),...],minAngle=25°,maxArea=0.001*boundingArea}; S62: Surface mesh construction, dual surface simultaneous generation: For each triangle index t in range: Get the three vertices of the triangle: v1=G[t][0], v2=G[t][1], v3=G[t][2]; Top Surface Treatment: Create Vertex Copy: v it =buildSurfaceVert (v i ,positionType="top"); Assign attributes: normal=(0,0,1), UV= (v i.x / width,v i.y / height); Bottom surface treatment: Create vertex copies: v ib =buildSurfaceVert (v i ,positionType="bottom"); Assign attributes: normal=(0,0,-1), UV= (v i.x / width,v i.y / height); Build index: Top index: _.push(v 1t , v 2t , v 3t ); bottom index: _.push(v 3b , v 2b ,v 1b )#Reverse clockwise.
10. The method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 1, characterized in that: The S7 specifically includes: S71: Dynamic memory allocation, intelligent buffer management: Input parameters: total number of vertices V_count, number of triangles T_count. The processing flow is as follows: S711: Memory pre-allocation: bufferSize=V_count*(3+3+2)#position+normal+UV, indexSize=T_count*3#triangle index; S712: Dynamic buffer creation: vertexBuffer = DynamicBuffer (type = Float32Array, size = bufferSize, usage = DYNAMIC_DRAW), indexBuffer=DynamicBuffer(type=Uint32Array,size=indexSize, usage=STATIC_DRAW); S72: Data buffering and attribute binding: The code is as follows: S721: Vertex attribute structured storage, [vertex structure] = [position x, y, z, normal x, y, z, UVu, v]: offset = 0 for i in range: position coordinates, vertexBuffer[offset: offset+3]=positions[i], offset+=3; normal vector, vertexBuffer [offset:offset+3]=normals[i], offset+=3; UV coordinates, vertexBuffer [offset:offset+2]=uvs[i], offset+= 2; S722: Index buffer fill: for i in range: indexBuffer [i*3]=triangles[i].v0; indexBuffer[i*3+1]=triangles[i].v1; indexBuffer[i*3+2]=triangles[i].v2; S723: Attribute binding: interleaved storage, step size = 8*4 = 32 bytes; Position attribute: setAttribute["position", Buffer(vertexBuffer, 3, 0, stride)]; Normal attribute: setAttribute["normal", Buffer(vertexBuffer, 3, 12, stride)] / / offset 12 bytes; UV attribute: setAttribute["uv",Buffer(vertexBuffer,2,24, stride)] / / Offset 24 bytes.
Citation Information
Patent Citations
Method for generating three-dimensional character model by mobile terminal based on contour tree structure
CN111428439A
Three-dimensional character chamfer structure generation method and device, equipment and storage medium
CN114972114A
Chamfer determining method, device, equipment and medium
CN116823766A
Three-dimensional modeling and hole repairing method and system based on industrial CT image
CN118229918A
Box girder three-dimensional model modeling method, device and equipment and storage medium
CN118484860A
Cited By
Architectural design modeling method and system based on parameter entity and Boolean relationship thereof
CN121502893A