A method for generating a self-adapting topological contour gradual change structure of a three-dimensional geometric body

Through the adaptive topological contour gradient structure generation method, the problems of uneven chamfering effect and repeated vertex calculation in the 3D engine are solved, the smooth transition and efficient rendering of the chamfered geometry are achieved, and complex topological structures and path-specific chamfering are supported.

CN120510328BActive Publication Date: 2025-10-14山东捷瑞信息技术产业研究院有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511005557.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-10-14
Estimated Expiration
2045-07-22

AI Technical Summary

Technical Problem

When implementing chamfering of stretched geometry in a 3D engine, existing technologies have problems such as uneven contour connections, insufficient judgment of chamfer radius limits for concave polygons, repeated vertex calculations leading to memory waste and reduced efficiency, and a lack of support for path-specific chamfering.

Method used

A method for generating a three-dimensional geometric body's adaptive topological contour gradient structure is adopted. Through contour geometry smoothing, topology-aware dynamic constraints on chamfer radius, a vertex reuse optimization pipeline, and path-dependent chamfer parameterization, the visual quality of chamfered geometry is improved and complex topological structures are efficiently supported.

Benefits of technology

Smooth transitions of chamfered geometry are achieved, avoiding jagged transitions, supporting complex topologies and path-specific chamfers, reducing memory usage and improving rendering efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120510328B_ABST
    Figure CN120510328B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of chamfering of geometric bodies, and discloses a three-dimensional geometric body adaptive topology contour gradual change structure generation method, comprising the following steps: S1: input analysis and contour extraction; S2: calculating the maximum safe chamfer radius; S3: contour processing by triangulation; S4: constructing a chamfer path; S5: chamfer surface connection; S6: bottom / top surface generation; S7: data buffering and attribute binding. Through adaptive processing of concave corner arc connection and convex corner straight line connection, smooth transition is realized, and sawteeth are avoided; through the maximum inscribed circle radius and depth range to constrain the chamfer radius, the safe chamfer of complex contours is ensured; through shared vertex data and interleaved storage optimization, memory occupation is reduced and rendering efficiency is improved; path-specific chamfering is supported, and the needs of complex shapes are met.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of chamfering geometric bodies, and in particular to a method for generating a self-adaptive topological contour gradual change structure of a three-dimensional geometric body. BACKGROUND

[0002] Currently, when implementing the chamfering effect of a stretched geometric body in a three-dimensional engine, the following process is usually adopted: contour extraction and triangulation: a two-dimensional shape contour is analyzed and converted into a triangular mesh; chamfer offset calculation: multiple offsets are performed along the contour edge by a mathematical method to generate multiple chamfer layers; vertex connection and wall construction: the triangular facets are used to connect the chamfer layers to form a side wall; surface filling: the top and bottom surfaces are filled; performance optimization: repeated vertex generation is avoided, and the GPU data transmission amount is reduced.

[0003] The existing scheme has the following problems: the connection between the chamfer layers is not smooth enough, and jagged transitions are prone to occur; for concave polygons or complex paths, there is a lack of effective chamfer radius limit judgment mechanism; repeated vertex calculation leads to memory waste and drawing efficiency reduction; there is a lack of support for path-specific chamfering.

[0004] Therefore, it is urgent to propose a new chamfering geometric body generation method to improve visual quality, support more complex topological structures, and improve running efficiency.

[0005] The patent application with publication number CN114972114A discloses a chamfer structure generation method, device and equipment for three-dimensional text and a storage medium. This patent is based on picture pixel statistics and cannot directly analyze geometric path parameters, cannot process nested paths, and only supports simulating chamfer effects through normal rendering, cannot flexibly generate diversified types of chamfers, and multi-stage image processing also leads to memory and calculation overheads.

[0006] The patent with publication number CN111428439A proposes a mobile terminal three-dimensional text generation method based on a contour tree structure. This patent constructs a contour tree, relies on text odd-even filling rules, and is only suitable for word level topologies, and cannot process industrial irregular hole / suspended edge structures; the Earcut general hole division algorithm has obvious limitations, does not constrain the minimum internal angle (easily produces acute angle triangles), does not control the edge length gradual change (leads to uneven surface subdivision), and cannot optimize hole stitching quality (only guarantees topological correctness); relies on GPU normal vector interpolation to simulate smooth effects, and the geometric entity is still an angular mesh (corner points are forced to split vertices), and is actually a pseudo-geometric smoothness. SUMMARY

[0007] The purpose of the present application is to solve the problems and deficiencies in the prior art, such as the non-smooth contour connection of the chamfer effect of the three-dimensional engine stretched geometry, the insufficient limitation judgment mechanism of the chamfer radius of the concave polygon, the repeated calculation of the vertex leading to the waste of memory and efficiency, and the lack of path-specific chamfer support, and to propose a three-dimensional geometry adaptive topology contour gradual structure generation method. Through the introduction of contour geometry smoothing processing, topology-aware chamfer radius dynamic constraint, vertex reuse optimization pipeline, and path-dependent chamfer parameterization synchronous construction, the visual quality of the chamfer geometry is significantly improved, and efficient support for complex topology structure and path-specific chamfer is realized.

[0008] In order to achieve the above-mentioned purpose, the present application adopts the following technical scheme:

[0009] A three-dimensional geometry adaptive topology contour gradual structure generation method, comprising the following specific steps:

[0010] S1: input analysis and contour extraction: input parameters, extract shape contour and hole, 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 subdivision number, output a one-dimensional array containing vertex coordinates (each consecutive two elements represent the x, y coordinates of a point), call the contour extraction technology for each hole (shapeHoles array) in the shape object to convert it into a plane point array and store it in the array h, and construct a complete polygon vertex list m containing the vertex data of the outer contour (p) and all inner holes (h);

[0011] 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, the following steps are performed: if the shape is text (isText is true), estimate the default chamfer radius according to the size of the bounding box (width and height) of the shape, specifically: calculate the minimum size of the bounding box (min(width, height)), then calculate a default radius according to the proportion (such as 0.08); if it is not a text shape, use the polylabel algorithm 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, which calculates the farthest point from the boundary inside the polygon to get the inscribed circle radius; finally, the chamfer radius is set to the minimum value 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);

[0012] S3: Triangulation of the contour: Triangulate the main contour and the holes separately, triangulate the main contour point array p to get the main area grid data y; triangulate each hole point array (in h) to get the hole area grid data set (stored in x); merge the hole area grid data into the main area grid data to form the complete contour triangular mesh data;

[0013] S4: Build chamfer path: Generate multiple chamfer levels (the number of layers is determined by the number of chamfer segments, from 1 to curveSegments), each level corresponds to a inwardly converging 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 normal of the adjacent edges); judge the angle characteristics at the current vertex (concave or convex, whether it is a continuous curve part), select the connection method according to the angle characteristics: use circular arc connection at concave angle (discrete sampling to generate multiple points), use straight line connection at convex angle (generate a point); offset according to the offset of the current level (calculated by the chamfer radius and the proportion of the current level) along the normal direction, generate chamfer points and add them to the array re; triangulate the generated chamfer point set re by S3 to get the chamfer surface mesh se of the current level;

[0014] S5: Chamfer surface connection (wall part): Build the side surface (wall) between adjacent chamfer levels: get the vertex attributes (position, normal, UV coordinates) of each vertex on each chamfer level, where the position is calculated according to the level offset, the normal is mixed by the base contour normal and the stretching direction (using a smoothing function to interpolate), and the UV coordinates are parameterized by the contour position and the level height; build a connection between 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; build two triangular patches (quad is decomposed into two triangles): the first triangle is composed of p.topP (the position of the next vertex in the current level), u.topN (the position of the current vertex in the previous level) and u.bottomN (the position of the current vertex in the current level); the second triangle is composed of p.topP, u.bottomN and p.bottomN (the position of the next vertex in the current level); add the generated triangular indices to the index array r;

[0015] S6: Bottom / Top Surface Generation: Generate the bottom and top surfaces of the stretched body: build the surface vertices (including position, normal (0, 0, -1) for the bottom surface and (0, 0, 1) for the top surface) and UV coordinates for each vertex on the innermost inset profile (O.insetPoints) and all hole profiles (R), triangulate the combined profile with the triangulation method in S3 (note that holes are treated as internal boundaries) to get the triangular mesh data G for the upper and lower surfaces; iterate through each triangle in the triangular mesh: for each triangle's three vertices, get their top and bottom surface vertices; add the triangle indices of the top surface (in the original order) to the index array; add the triangle indices of the bottom surface (in reverse order to ensure correct normal direction) to the index array;

[0016] S7: Data Buffering and Attribute Binding: Store the generated vertex and index data in buffers and bind them to the geometry object: use a dynamic buffer (DynamicBuffer) to store all vertex attributes (position, normal, UV) in interleaved mode: store each vertex in the order of position (3 floats), normal (3 floats), and UV (2 floats), with a step size of 8 floats; use an index buffer (indexBuffer) to store all triangle indices (Uint32Array); set the vertex attributes of the geometry object: position attribute: offset from the buffer by 0, with a step size of 8 * 4 = 32 bytes for each group of 3 floats; normal attribute: offset from the buffer by 12 bytes (3 floats), with a step size of 32 bytes for each group of 3 floats; UV attribute: offset from the buffer by 24 bytes (6 floats), with a step size of 32 bytes for each group of 2 floats.

[0017] As a further technical solution of the present application, S1 specifically includes:

[0018] S11: Input parameters: shape: a two-dimensional shape object (supports text, path, etc.), depth: stretching depth, bevelRadius: bevel radius parameter, curveSegments: number of Bezier curve subdivision segments;

[0019] S12: Profile Extraction:

[0020] S121: Main Profile Conversion: Input point sequence P = {p0, p1,..., p n}← shape.

[0021] 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 planar coordinate array p=[x0,y0,x1,y1,...];

[0022] S122: Hole processing: for each hole in shape.shapeHoles: perform the same discretization as S121, add hole separator NaN, output hole array h = [h 0_x ,h 0_y ,...NaN,h 1_x ,...];

[0023] S123: Build complete polygon: m=[p,h] / / combine the main contour and holes, topological constraints: main contour point sequence clockwise, holes counterclockwise.

[0024] As a further technical solution of the present application, the S2 specifically comprises:

[0025] S21: Input parameter definition:

[0026] m: vertex sequence of two-dimensional polygon, containing outer contour and inner hole vertex data;

[0027] bevelRadius: user-set target chamfer radius;

[0028] depth: stretching height of the geometric body along the Z-axis direction;

[0029] isText: Boolean identifier, indicating whether the current shape is a text glyph;

[0030] S22: Calculation strategy selection module: if isText=true;

[0031] S23: In-circle calculation module for non-text shape: if non-text shape;

[0032] S24: Three-dimensional constraint processing module: final safe chamfer radius determination: constraint condition 1: bevelRadius ≤depth / 2 (prevent chamfer from penetrating the model), constraint condition 2: bevelRadius ≤g (prevent chamfer from exceeding the geometric boundary); mathematical expression: R_safe=min(bevelRadius,isText?defaultRadius:g,depth / 2).

[0033] As a further technical solution of the present application, the S22 and S23 specifically include:

[0034] S221: Obtain the shape bounding box: bbox = [min_x, min_y, max_x, max_y];

[0035] S222: Calculate the bounding box feature size: L = min(max_x-min_x, max_y-min_y);

[0036] S223: Set the default radius: defaultRadius = k*L (where k = 0.08);

[0037] S231: Process the vertex sequence m using the polygon center point algorithm (polylabel);

[0038] S232: Obtain the maximum inscribed circle by distance constraint optimization: g = argmax_radius{ p∈ polygon, dist(p, center) ≥ radius}.

[0039] As a further technical solution of the present application, the S3 specifically includes:

[0040] S31: Input data preprocessing: convert the contour data generated by S1 into a data structure recognizable by the triangular subdivision engine:

[0041] Main contour `P`: two-dimensional vertex sequence [x1, y1, x2, y2,...] arranged in clockwise order;

[0042] Hole set `H`: array containing k hole vertex sequences [(h1_x1, h1_y1,...), (h2_x1, h2_y1,...),...], each hole arranged in counterclockwise order;

[0043] S32: Constrained triangular subdivision: use a Delaunay triangular subdivision algorithm with boundary constraints:

[0044] Main contour processing: perform triangular subdivision on the contour `P` to generate the main grid `Y`;

[0045] Implementation process: establish an initial super-triangle → insert points one by one → Lawson edge exchange optimization;

[0046] Hole processing: independently perform subdivision on each hole `h∈H` to generate the hole region grid `X`;

[0047] S33: Hole merging technique: merge the hole grid into the main grid:

[0048] Spatial alignment: keep hole vertex original coordinates based on global coordinate system;

[0049] Topology stitching: add connected edges to connect body and hole boundaries;

[0050] Mesh reorganization: local triangle optimization on hole perimeter area.

[0051] As a further technical solution of the application, the S4 specifically comprises:

[0052] S41: hierarchical generation control structure, input parameters: chamfer segmentation number S (determined by curveSegments), initial contour V={v0, v1,..., v n} (vertex sequence);

[0053] S42: vertex offset calculation mechanism: for each vertex v i ∈V do:

[0054] S421: adjacent edge vector calculation: e i = v i -v i-1 (forward edge), e i+1 = v i+1 - v i (backward edge);

[0055] S422: normal direction solving: n i = normalize([-e i .y, e i .x]) (left normal),

[0056] n i+1 = normalize([-e i+1 .y, e i+1 .x]);

[0057] S423: effective offset direction calculation: d i =(n i + n i+1 ) / ||n i + n i+1 ||;

[0058] S43: corner connection intelligent decision: angle calculation: θ i = arccos(n i ·n i+1 ); connection rule: circular arc connection θ i <π-ε (concave angle), linear connection θ i ≥π-ε (convex angle); spline fitting continuous curve segment;

[0059] S44: Chamfer path generation implementation:

[0060] Arc connection implementation: sample point number m = ceil(θ i / Δα) / / Δα=5° as default angular resolution; for j = 0 to m: rotation angle φ = j * θ i / m; calculate interpolation direction: d ij = R(φ)·d i / / R is a rotation matrix; generate point: p j = v i +r s ·d ij ;

[0061] Linear connection implementation: generate a single point: p = v i +r s ·d i ;

[0062] S45: Geometric constraint triangulation.

[0063] As a further technical solution of the application, the S45 specifically includes:

[0064] S451: Input data loading: the computing system reads the input point set array P_s = [(x1,y1), (x2,y2),...,(x n ,y n )] to the memory buffer, while receiving the reference length parameter r_s (usually taking 10% of the diagonal length of the bounding box);

[0065] S452: Constraint parameter analysis: the computing engine automatically derives the geometric constraint condition: curve_

[0066] angle_threshold = math.pi - 0.1 # 169.3° (ε=0.1 radian), min_edge_

[0067] length = 0.01 * r_s;

[0068] S453: Constraint preprocessing: the system scans the point set to perform feature detection: traverse each vertex v i ∈P_s, calculate the adjacent edge angle: θ = arccos(v i -v i-1 ,v i-1 -v i ) / (‖v i - v i-1 ‖·‖v i+1 -v i||), mark the point of θ > curve_angle_threshold as curve constrained point, generate constrained edge set E_constrained = {(v i , v i+1 )|θ i >threshold};

[0069] S454: Core Triangulation: Compute T_s by calling constrained Delaunay triangulation in S32;

[0070] S455: Mesh Quality Optimization: System iteratively perform mesh refinement on T_s: detect triangles violating constraints: edge length < min_edge_length, inner angle < 25°, insert Steiner point (excenter or incenter of bad triangle), locally re-triangulate until all constraints are satisfied;

[0071] S456: Data Structure Output: Final triangulation mesh data structure: T_s = {vertices: [v1, v2,..., v m ], / / with new Steiner points, faces: [(i,j,k), / / triangle face vertex index...]}.

[0072] As a further technical solution of the present application, S5 specifically includes:

[0073] S51: Intelligent Chamfer Vertex Construction: Input Parameters: A Chamfer Layer Object, s Profile Segment Index, n Level Index, Process Flow as Follows:

[0074] 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;

[0075] S512: Normal Generation: Mix Base Normal and Extrusion Direction: normal = normalize[(1-α)*A.baseNormal+α*extrusionDir], α=(n / N)^β(β=1.5 Blend Curve Factor);

[0076] S513: UV Mapping: Parametric Mapping: u=A.arcLength[s] / totalArcLength,

[0077] v=n / N;

[0078] S52: Topology-optimized Wall Connection: Input adjacent chamfer layers L i and L i+1 , Process Flow as Follows:

[0079] S521: Ring structure generation: Create a connection ring R = {(v j i , v j i+1 )|j=0..m-1}, Add constraint edges: E_constraint = {(v j i , v j i+1 )};

[0080] 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 );

[0081] S523: Curvature adaptive optimization: if curvature κ between two points > κ_threshold: Insert midpoint v mid = (v j i + v j i+1 ) / 2, Create new triangles: {Δ(v j i , v mid , v j+1 i ), Δ(v mid , v j i+1 , v j+1 i+1}.

[0082] As a further technical solution of the application, the S6 specifically comprises:

[0083] S61: Vertex construction processing mechanism: Input parameters: O.insetPoints, the set of chamfered innermost contour points, R, the set of all hole contours, the processing flow is as follows:

[0084] S611: Vertex feature extraction: Label hole topological relationship: H = {H1, H2,..., H n}, Calculate contour direction: main contour → counterclockwise, hole → clockwise;

[0085] S612: Multi-layer composite triangulation: build combined contours combined_contours = [O.insetPoints] + R, perform constrained triangulation G = constrained_

[0086] triangulation{vertices=flatten(combined_contours),constraints=[(closed boundary: O.insetPoints), (hole boundary: R0), (hole boundary: R1),...], minAngle=25°, maxArea=0.001 * boundingArea};

[0087] S62: Surface mesh construction, dual surface generation in sync:

[0088] 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];

[0089] Top surface processing: create vertex copies: v it =buildSurfaceVert

[0090] (v i , positionType="top"); assign attributes: normal=(0,0,1), UV= (v i.x / width, v i.y / height);

[0091] Bottom surface processing: create vertex copies: v ib =buildSurfaceVert

[0092] (v i , positionType="bottom"); assign attributes: normal=(0,0,-1), UV= (v i.x / width, v i.y / height);

[0093] Build indices: top indices: _.push(v 1t , v 2t , v 3t ); bottom indices: _.push(v 3b , v 2b , v 1b ) # clockwise inversion.

[0094] As a further technical solution of the present application, the S7 specifically comprises:

[0095] S71: Dynamic memory allocation, intelligent buffer management: input parameters vertex total number V_count, triangle patch number T_count, processing flow as follows:

[0096] S711: Memory pre-allocation: bufferSize = V_count * (3 + 3 + 2) # position + normal + UV, indexSize = T_count * 3 # triangle patch index;

[0097] S712: Dynamic buffer creation: vertexBuffer = DynamicBuffer (type = Float32Array, size = bufferSize, usage = DYNAMIC_DRAW),

[0098] indexBuffer = DynamicBuffer (type = Uint32Array, size = indexSize,

[0099] usage = STATIC_DRAW);

[0100] S72: Data buffering and attribute binding: the code is as follows:

[0101] S721: Structured storage of vertex attributes, [vertex structure] = [position x, y, z, normal x, y, z, UV u, v]: offset = 0

[0102] for i in range (V_count): position coordinates (x, y, z), vertexBuffer

[0103] [offset:offset+3] = positions[i], offset += 3; normal vector (nx, ny,

[0104] nz), vertexBuffer[offset:offset+3] = normals[i], offset += 3; UV coordinates (u, v), vertexBuffer[offset:offset+2] = uvs[i], offset += 2;

[0105] S722: Index buffer filling: for i in range (T_count): indexBuffer

[0106] [i*3]=triangles[i].v0; indexBuffer[i*3+1]=triangles[i].v1; indexBuffer[i*3+2]=triangles[i].v2;

[0107] S723: Attribute Binding: Interleaved Storage, Stride = 8*4 = 32 bytes;

[0108] Position Attribute: setAttribute ["position", Buffer (vertexBuffer, 3, 0, stride)];

[0109] Normal Attribute: setAttribute ["normal", Buffer (vertexBuffer, 3, 12, stride)] / / offset 12 bytes;

[0110] UV Attribute: setAttribute ["uv", Buffer (vertexBuffer, 2, 24,

[0111] stride)] / / offset 24 bytes.

[0112] The beneficial effects of the present application are:

[0113] 1. Smooth transition is achieved through adaptive processing of concave corner arc connection and convex corner straight line connection, avoiding sawtooth.

[0114] 2. The chamfer radius is constrained by the maximum inscribed circle radius and the depth range to ensure safe chamfering of complex contours.

[0115] 3. Through shared vertex data and interleaved storage optimization, memory occupation is reduced and rendering efficiency is improved.

[0116] 4. Support path-specific chamfering to meet the needs of complex shapes. BRIEF DESCRIPTION OF DRAWINGS

[0117] Figure 1 A three-dimensional geometric body adaptive topology contour gradual change structure generation method flow chart is proposed for the present application;

[0118] Figure 2 A triangular partitioning flowchart is shown.

[0119] Figure 3 A data storage structure diagram. DETAILED DESCRIPTION

[0120] In order to make the technical means, creative features, purposes and effects of the present application easy to understand, the present application is further described below in combination with specific embodiments.

[0121] Please refer to the accompanying Figure 1 Figure 3 A three-dimensional geometric body adaptive topology contour gradual change structure generation method, comprising the following specific steps:

[0122] S1: input analysis and contour extraction: input parameters, and 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 subdivision segment number, output a one-dimensional array containing vertex coordinates (according to two consecutive elements representing the x, y coordinates of a point), call the contour extraction technology for each hole (shapeHoles array) in the shape object to convert it into a plane point array and store it in the array h, and construct a complete polygon vertex list m containing the vertex data of the outer contour (p) and all inner holes (h);

[0123] S11: input parameters: shape: two-dimensional shape object (supports text, path, etc.), depth: stretching depth, bevelRadius: chamfer radius parameter, curveSegments: Bezier curve subdivision segment number;

[0124] S12: contour extraction:

[0125] S121: main contour conversion: input point sequence P={p0,p1,...,p n}← shape.

[0126] contours, discretize each Bezier curve according to 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,...];

[0127] S122: hole processing: for each hole in shape.shapeHoles: perform the same discretization as S121, add a hole separator NaN, output hole array h = [h 0_x ,h 0_y ,...NaN,h 1_x ,...];

[0128] ​S123: Construct complete polygon: m = [p, h] / / combine the main contour and holes, topological constraints: main contour point sequence clockwise, holes counterclockwise;

[0129] S2: Calculate the maximum safe bevel radius: in order to ensure the rationality of the bevel radius and avoid the bevel exceeding the boundary or depth range of the geometric body, the following steps are performed: if the shape is text (isText is true), estimate the default bevel radius according to the bounding box size (width and height) of the shape, specifically: calculate the minimum size of the bounding box (min(width, height)), then calculate a default radius by proportion (such as 0.08); if it is a non-text shape, use the polylabel algorithm to calculate the maximum inscribed circle radius g of the polygon (defined by the vertex list m) as the upper limit of the bevel radius, which calculates the farthest point inside the polygon to the boundary to get the inscribed circle radius; the final bevel radius is set to the minimum value among the user-set bevel radius (bevelRadius), the calculated maximum inscribed circle radius (g) and the depth range limit (depth / 2): this._bevel = Math.min(bevelRadius, g, depth / 2);

[0130] S21: Input parameter definition:

[0131] m: vertex sequence of a two-dimensional polygon, containing outer contour and inner hole vertex data;

[0132] bevelRadius: user-set target bevel radius;

[0133] depth: stretching height of the geometric body along the Z-axis direction;

[0134] isText: Boolean identifier indicating whether the current shape is a text character;

[0135] S22: Calculate strategy selection module: if isText = true;

[0136] S221: Get shape bounding box: bbox = [min_x, min_y, max_x, max_y];

[0137] S222: Calculate bounding box feature size: L = min(max_x-min_x, max_y-min_y);

[0138] S223: Set default radius: defaultRadius = k*L (where k = 0.08);

[0139] S23: Non-text shape inscribed circle calculation module: if it is a non-text shape;

[0140] S231: Process the vertex sequence m with the polygon center point algorithm (polylabel);

[0141] S232: Find the maximum inscribed circle by distance constraint optimization: g = argmax_radius{ p∈polygon,dist(p,center)≥radius}, where represents that the condition mentioned later holds for all elements, this time it means that for all p belongs to polygon, dist(p,center)≥radius holds;

[0142] S24: Three-dimensional constraint processing module: final safe chamfer radius determination:

[0143] Constraint condition 1: bevelRadius ≤depth / 2 (prevent chamfer from penetrating the model),

[0144] Constraint condition 2: bevelRadius ≤g (prevent chamfer from exceeding the geometric boundary);

[0145] Mathematical expression: R_safe=min(bevelRadius,isText?defaultRadius:g,depth / 2);

[0146] S3: Triangulation processing contour: triangulate the main contour and the hole respectively, triangulate the main contour point array p to get the main area grid data y; triangulate each hole point array (in h) to get the hole area grid data set (stored in x); merge the hole area grid data into the main area grid data to form complete contour triangular mesh data;

[0147] S31: Input data preprocessing: convert the contour data generated by S1 into a data structure that can be recognized by the triangulation engine:

[0148] Main contour `P`: two-dimensional vertex sequence [x1,y1,x2,y2,...] arranged in clockwise order;

[0149] Hole set `H`: an array containing k hole vertex sequences [(h1_x1,h1_y1,...), (h2_x1,h2_y1,...),...], each hole is arranged in counterclockwise order;

[0150] S32: Constraint triangulation: use the Delaunay triangulation algorithm with boundary constraints:

[0151] Main contour processing: perform triangulation on the contour `P` to generate the main grid `Y`;

[0152] Implementation process: Establish initial super-triangle → Insert point by point → Lawson edge exchange optimization;

[0153] Hole processing: Perform subdivision on each hole `h∈H` independently to generate hole region grid `X`;

[0154] S33: Hole merging technique: Merge hole grid to main body grid:

[0155] Spatial alignment: Keep the original coordinates of the hole vertices based on the global coordinate system;

[0156] Topological suture: Add connected edges to connect the main body and hole boundaries;

[0157] Mesh reorganization: Local triangle optimization on the hole perimeter area.

[0158] S4: Build chamfer path: Generate multiple chamfer levels (number of levels determined by chamfer segmentation number, from 1 to curveSegments), each level corresponds to a inwardly converging 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 the normals of adjacent edges); judge the angle characteristics at the current vertex (concave or convex, whether it is a continuous curve part), select the connection method according to the angle characteristics: use circular arc connection at concave corners (discrete sampling to generate multiple points), use straight line connection at convex corners (generate a point); offset along the normal direction according to the offset of the current level (calculated by chamfer radius and current level proportion), generate chamfer points and add them to array re; perform triangle subdivision on the generated chamfer point set re using S3 to obtain the chamfer surface grid se of the current level;

[0159] S41: Level generation control structure, input parameters: chamfer segmentation number S (determined by curveSegments), initial contour V={v0,v1,...,v n} (vertex sequence);

[0160] S42: Vertex offset calculation mechanism: for each vertex v i ∈V do:

[0161] S421: Adjacent edge vector calculation: e i = v i -v i-1 (forward edge), e i+1 = v i+1 - v i (backward edge);

[0162] S422: Normal direction solving: n i = normalize([-e i .y, e i .x]) (left normal),

[0163] n i+1 = normalize([-e i+1 .y, e i+1 .x]);

[0164] S423: Effective offset direction calculation: d i =(n i +n i+1 ) / ||n i + n i+1 ||;

[0165] S43: Corner connection intelligent decision-making: Angle calculation: θ i = arccos(n i ·n i+1 ); Connection rule: Circular arc connection θ i <π-ε (concave angle), Linear connection θ i ≥π-ε (convex angle); Spline fitting continuous curve segment, where indicates "exists" or "at least one";

[0166] S44: Chamfer path generation implementation:

[0167] Circular arc connection implementation: Sampling point number m=ceil(θ i / Δα) / / Δα=5° as the default angular resolution; for j= 0to m: Rotate 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 ;

[0168] Linear connection implementation: Generate a single point: p=v i + r s ·d i ;

[0169] S45: Geometric constraint triangulation:

[0170] S451: Input data loading: The calculation system reads the input point set array P_s = [(x1,y1), (x2,y2),...,(x n ,yn )] to the memory buffer while receiving a reference length parameter r_s (usually 10% of the bounding box diagonal length);

[0171] S452: constraint resolution: the computation engine automatically derives geometric constraints: curve_

[0172] angle_threshold = math.pi - 0.1 # 169.3° (epsilon = 0.1 radian), min_edge_

[0173] length = 0.01 * r_s;

[0174] S453: constraint preprocessing: the system scans the point set to perform feature detection: iterate through each vertex v i ∈ P_s, compute the adjacent edge angle: theta = arccos(v i -v i-1 ,v i-1 -v i ) / (‖v i - v i-1 ‖·‖v i+1 -v i ‖), mark points with theta > curve_angle_threshold as curve-constrained points, generate the constrained edge set E_constrained ={(v i ,v i+1 )|theta i > threshold};

[0175] S454: core triangulation operation: the computation process calls the constrained Delaunay triangulation algorithm in S32 to obtain T_s;

[0176] 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 (incenter or centroid of poor-quality triangles), locally re-triangulate until all constraints are met;

[0177] S456: data structure output: finally generate the triangular mesh data structure: T_s = {vertices: [v1, v2,..., v m ], / / contains new Steiner points, faces: [(i, j, k), / / triangle face vertex index...]};

[0178] S5: Chamfer surface connection (wall part): Build side between adjacent chamfer levels (wall): Get each vertex attribute (position, normal, UV coordinate) on each chamfer level, where position is calculated according to level offset, normal is mixed by base profile normal and extrusion direction (use smooth function interpolation), UV coordinate is parameterized by profile position and level height; Build connection between adjacent levels: For each segment on profile (defined by two consecutive vertices): Get vertex attributes of current vertex u and next vertex p on current level; Build two triangular patches (quad is decomposed into two triangles): The first triangle is composed of p.topP (position of next vertex on current level), u.topN (position of current vertex on previous level) and u.bottomN (position of current vertex on current level); The second triangle is composed of p.topP, u.bottomN and p.bottomN (position of next vertex on current level), add generated triangle index to index array r;

[0179] S51: Intelligent chamfer vertex construction: Input parameters: A chamfer layer object, s profile segment index, n level index, processing flow as follows:

[0180] 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;

[0181] S512: Normal generation: Mix base normal and extrusion direction: normal= normalize[(1-α)*A.baseNormal+α*extrusionDir], α=(n / N)^β (β=1.5 mixing curve factor);

[0182] S513: UV mapping: Parametric mapping: u=A.arcLength[s] / totalArcLength,

[0183] v=n / N;

[0184] S52: Topology-optimized wall connection: Input adjacent chamfer levels L i and L i+1 , processing flow as follows:

[0185] S521: Ring structure generation: Create connection ring R={(v j i , v j i+1 )|j=0..m-1}, add constraint edge: E_constraint={(v j i ,vj i+1 )};

[0186] 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 );

[0187] S523: Curvature adaptive optimization: if curvature κ between two points > κ_threshold: insert midpoint v mid =(v j i +v j i+1 ) / 2, create new triangles: {Δ(v j i , v mid , v j+1 i ), Δ(v mid , v j i+1 , v j+1 i+1 )};

[0188] S6: Bottom / Top surface generation: generate bottom and top surfaces of the stretch body: construct surface vertices (including position, normal (bottom surface is (0,0,-1), top surface is (0,0,1)) and UV coordinates) for each vertex on the innermost inset contour (O.insetPoints) and all hole contours (R), call the triangle subdivision method in S3 to triangulate the combined contour of the innermost contour and hole contours (note that holes are treated as internal boundaries), get the triangle mesh data G of the top and bottom surfaces; traverse each triangle in the triangle mesh: for each triangle, get 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 reverse order to ensure correct normal direction) to the index array;

[0189] S61: Vertex construction processing mechanism: input parameters: O.insetPoints inset contour point set, R all hole contour set, processing flow as follows:

[0190] S611: vertex feature extraction: label hole topology: H = {H1, H2,..., H n}, compute contour orientation: main contour -> counter-clockwise, hole -> clockwise;

[0191] S612: multi-layer composite triangulation: construct combined contour combined_contours = [O.insetPoints] + R, perform constrained triangulation G = constrained_

[0192] triangulation{vertices=flatten(combined_contours),constraints=[(closed boundary: O.insetPoints), (hole boundary: R0), (hole boundary: R1),...], minAngle=25°, maxArea=0.001 * boundingArea};

[0193] S62: surface mesh construction, dual surface generation simultaneously:

[0194] 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];

[0195] top surface processing: create vertex copy: v it =buildSurfaceVert

[0196] (v i , positionType="top"); assign attribute: normal=(0,0,1), UV=

[0197] (v i.x / width, v i.y / height);

[0198] bottom surface processing: create vertex copy: v ib =buildSurfaceVert

[0199] (v i , positionType="bottom"); assign attribute: normal=(0,0,-1), UV= (v i.x / width, v i.y / height);

[0200] build index: top index: _.push(v 1t , v2t , v 3t );bottomIndex.push(v 3b , v 2b , v 1b );

[0201] S7: Data Buffering and Attribute Binding: Store the generated vertex and index data into buffers and bind to the geometry object: Use a DynamicBuffer to store all vertex attributes (position, normal, UV) in interleaved manner: each vertex is stored as position (3 floats), normal (3 floats), UV (2 floats) in sequence, step size is 8 floats; use an indexBuffer to store all triangle indices (Uint32Array); set the vertex attributes of the geometry object: position attribute: offset from buffer start 0, step size is 8 * 4 = 32 bytes per 3 floats; normal attribute: offset from buffer start 12 bytes (3 floats), step size is 32 bytes per 3 floats; UV attribute: offset from buffer start 24 bytes (6 floats), step size is 32 bytes per 2 floats;

[0202] S71: Dynamic Memory Allocation, Intelligent Buffer Management: input parameters vertex total number V_count, triangle number T_count, processing flow as follows:

[0203] S711: Memory Pre-allocation: bufferSize = V_count * (3 + 3 + 2) # position + normal + UV, indexSize = T_count * 3 # triangle index;

[0204] S712: Dynamic Buffer Creation: vertexBuffer = DynamicBuffer(type = Float32Array, size = bufferSize, usage = DYNAMIC_DRAW),

[0205] indexBuffer = DynamicBuffer(type = Uint32Array, size = indexSize,

[0206] usage = STATIC_DRAW);

[0207] S72: Data Buffering and Attribute Binding: code as follows:

[0208] S721: Vertex attribute structured storage, [vertex structure] = [position x, y, z, normal x, y, z, UV u, v]: offset = 0;

[0209] for i in range(V_count): position coordinates (x, y, z), vertexBuffer

[0210] [offset:offset+3]=positions[i], offset+=3; normal vector (nx, ny,

[0211] nz), vertexBuffer[offset:offset+3]=normals[i], offset+=3; UV coordinates (u, v), vertexBuffer[offset:offset+2]=uvs[i], offset+= 2;

[0212] S722: Index buffer filling: for i in range(T_count): indexBuffer

[0213] [i*3]=triangles[i].v0; indexBuffer[i*3+1]=triangles[i].v1; indexBuffer[i*3+2]=triangles[i].v2;

[0214] S723: Attribute binding: interleaved storage, stride = 8*4 = 32 bytes;

[0215] Position attribute: setAttribute["position", Buffer(vertexBuffer, 3, 0, stride)];

[0216] Normal attribute: setAttribute["normal", Buffer(vertexBuffer, 3, 12, stride)] / / offset 12 bytes;

[0217] UV attribute: setAttribute["uv",Buffer(vertexBuffer,2,24,

[0218] stride)] / / offset 24 bytes.

[0219] Example 1

[0220] Generation of the chamfered geometry of the Chinese character "China":

[0221] 1. Input parameters:

[0222] Shape: Chinese character "China" vector path (contains 2 holes);

[0223] "Zhong" character: 1 outer contour + 1 square hole;

[0224] "Guo" character: 1 outer contour + 4 holes (contains 1 complex curve hole);

[0225] Depth: depth = 10.0 units;

[0226] Bevel radius: bevelRadius = 1.2 units;

[0227] Curve segments: curveSegments = 24.

[0228] 2. Execution flow:

[0229] S1: Contour extraction and discretization,

[0230] Main contour processing: "Zhong" character outer contour: 4 straight line segments → discretized into 8 points;

[0231] "Guo" character outer contour: 6 cubic Bezier curves → divided into 48 segments according to curvature;

[0232] Hole processing: "Zhong" character square hole: 4 straight line segments → discretized into 8 points; "Guo" character complex hole: 3 cubic Bezier curves → divided into 32 segments according to curvature;

[0233] Output structure: p = [x0, y0, x1, y1,..., x n , y n ] / / main contour point set; h = [NaN, h 0_x , h 0_y ,..., h m_x , h m_y ] / / hole point set + separator;

[0234] S2: Safe bevel radius calculation,

[0235] Text type determination: shape.isText = true;

[0236] Bounding box calculation: width = 38.2 units, height = 42.5 units → L = min(38.2, 42.5) = 38.2 units;

[0237] Default bevel radius: defaultRadius = 0.08 × 38.2 = 3.056 units;

[0238] Depth constraint: depth / 2 = 5.0 units;

[0239] Final bevel radius: this._bevel = min(1.2, 3.056, 5.0) = 1.2 units;

[0240] S3: Topology-preserving split,

[0241] "Zhong" character outline split: input: 8 points -> output 6 triangles, triangle quality: min inner angle = 28° > 25° (constraint satisfied);

[0242] "Zhong" character hole split: input: 8 points -> output 6 triangles, exclusion zone constraint: automatically limited within the main outline bounding box;

[0243] "Guo" character outline split: input: 48 points -> output 86 triangles; "Guo" character hole split: complex hole: 32 points -> output 56 triangles, simple holes: 3 (each 8 points) -> each output 6 triangles;

[0244] Stitching: add 3 stitching edges for each hole ("Guo" character has 12 stitching edges in total);

[0245] S4: Bevel path generation (5 layers)

[0246] Layer count: curveSegments = 5;

[0247] Layer offset: [0.24, 0.48, 0.72, 0.96, 1.2];

[0248] Re-entrant handling: "Zhong" character: 4 straight angles -> treated as convex angles (each generates 1 point), "Guo" character: detects 8 re-entrant angles (θ = 90° - 135°), maximum re-entrant angle θ = 135° -> sampling point m = ceil(135 / 5) = 27, total new points for re-entrant angles: 8 re-entrant angles x average 18 points = 144 points;

[0249] Bevel point statistics: base points: (48 + 32 + 24) = 104 points, increment per layer: 104 base points + 144 new points for re-entrant angles = 248 points, total for 5 layers: 1240 points;

[0250] S5: Bevel wall connection,

[0251] Vertex attribute generation: position: P = lerp(P_base, P_offset, level proportion), normal: N = normalize((1 - α²)N_base + α²N_ext), α = smoothstep(0,1, level proportion) = 3t² - 2t³;

[0252] Wall construction: convex corner area: generate 2 triangles / connection section, concave corner area: star topology → generate 8 triangles / concave corner;

[0253] Total: "China" word: 32 triangles, "country" word: 288 triangles;

[0254] S6: top and bottom surface generation,

[0255] Surface vertex: top surface: all contour points + (0, 0, 10),

[0256] Bottom surface: all contour points + (0, 0, 0), UV mapping: u = bounding box ratio, v = 0 (top) / 1 (bottom);

[0257] Multi-hole triangle subdivision:

[0258] Constraints: main contour: counterclockwise, hole: clockwise, maximum triangle area = 0.001 × bounding box area = 0.16 units²;

[0259] Output: "China" word: 12 triangles, "country" word: 104 triangles;

[0260] S7: data buffering and binding,

[0261] Vertex statistics: wall vertex: 1240 points, top and bottom vertex: 104 × 2 = 208 points, total: 1448 points;

[0262] Memory allocation: vertex buffer: 1448 points × (3 + 3 + 2) × 4 bytes = 46,336 bytes, index buffer: (32 + 288 + 12 + 104) × 3 indexes × 4 bytes = 5,232 bytes;

[0263] Interleaved storage structure: vertex format: [x, y, z, nx, ny, nz, u, v];

[0264] Attribute binding: position → offset 0, step 32 bytes; normal → offset 12 bytes, step 32 bytes; UV → offset 24 bytes, step 32 bytes.

[0265] The technical effects of the traditional method and the method of the present application are compared as shown in the following table 1:

[0266] Table 1: Technical effect comparison table

[0267] Indicator Conventional method The present invention Lifting amplitude Total vertex number 3820 1448 62%↓ Total triangle number 6984 436 94%↓ Concave angle smoothness (QI) 0.55 0.92 67%↑ Hole boundary precision (px) ±3.2 ±0.5 84%↑ Memory occupation (KB) 305 51.5 83%↓ GPU rendering frame rate (fps) 42 68 62%↑

[0268] Note: QI is the mesh quality index (0-1 range, 1 is the best).

[0269] Technical advantages:

[0270] 1) Complex topology processing capability: Successfully processed the four nested holes (including complex curved holes) in the Chinese character "国" (country), with hole boundary error <0.5px.

[0271] 2) Concave corner smoothing optimization: 27 sampling points are generated at the 135° concave corner, improving curvature continuity by 67%.

[0272] 3) Improved resource efficiency: By reusing vertices and optimizing topology, the number of triangles is reduced by 94%.

[0273] 4) Visual quality assurance: Smooth transitions are achieved in concave corners, completely eliminating visible jagged edges.

[0274] This embodiment proves that the method of the present invention can efficiently process the generation of Chinese characters containing complex hole structures, significantly improving performance indicators while ensuring visual quality.

[0275] From the above description, it can be seen that the above-mentioned embodiments of the present invention achieve the following technical effects: through adaptive processing of concave corner arc connections and convex corner straight line connections, smooth transitions are achieved to avoid jagged edges; the chamfer radius is constrained by the maximum inscribed circle radius and depth range to ensure safe chamfering of complex contours; through shared vertex data and interleaved storage optimization, memory usage is reduced and rendering efficiency is improved; and path-specific chamfering is supported to meet the needs of complex shapes.

[0276] 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.

[0277] 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; 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: Vertex buffer size = V_count * (position 3 floats + normal 3 floats + UV 2 floats), index buffer size = T_count * triangle index number 3; S712: Dynamic buffer creation: Create a vertex buffer: use the Float32Array type, the size of which is the pre-allocated vertex buffer size for dynamic drawing; Create an index buffer: Use the Uint32Array type and the size of the pre-allocated index buffer for static drawing; S72: Data buffering and attribute binding: S721: Vertex attributes are stored in a structured manner. The vertex structure includes position x, y, z, normal x, y, z, UV coordinates u, v, and the initial offset is 0. Traverse the total number of vertices V_count range through the loop variable i: 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: Fill index buffer: traverse the range of triangle count T_count through loop variable i: 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; Position attribute: starting from buffer offset 0, every 3 floating point numbers are grouped together; Normal attributes: starting from the buffer offset 12 bytes, each group of 3 floating point numbers; UV attributes: starting from the buffer offset 24 bytes, each 2 floating point numbers are grouped together.

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: Extract contour points from a two-dimensional shape object and input point sequence P={p0,p1,...,p n }, discretize each Bezier curve by curveSegments: iterate each point t on the Bezier curve from 0 to 1 with a step size of 1 / curveSegments to generate discrete points on the curve, p(t)=(1-t)³p0+ 3(1-t)²tp1+ 3(1-t)t²p2+ t³p3, and output the plane coordinate array p=[x0,y0,x1,y1,...]; S122: Hole processing: traverse each hole element in the shapeHoles attribute set in the shape object, 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 = [combined main contour p, hole h], 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; g: maximum inscribed circle radius; S22: calculation strategy selection module: if the shape currently being processed is a text glyph; 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; Constraint 2: bevelRadius ≤ g; The final safe chamfer radius R_safe takes the minimum value of bevelRadius, defaultRadius or g, and 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: 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, k=0.08; S231: Processing the vertex sequence m using a polygon center point algorithm; S232: Obtain a maximum inscribed circle through distance constraint optimization, where the radius g of the maximum inscribed circle satisfies that the maximum inscribed circle is completely contained in the polygon and the center of the circle is the center point.

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 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: triangulate 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.

6. The method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 1, characterized in that: The S4 specifically includes: S41: Hierarchical generation control structure, input parameters: number of chamfer segments S, initial contour V={v0,v1,...,v n }; S42: Vertex offset calculation mechanism: Each vertex in the vertex sequence of the two-dimensional polygon is processed in turn: 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 has continuous curve segments; S44: Chamfer path generation implementation: Arc connection implementation: number of sampling points m=ceil(θ i / Δα), where Δα=5° is the default angular resolution; for loop traversal of index j from 0 to m: rotation angle φ=j *θ i / m; Calculate interpolation direction: d ij = R(φ)·d i , R is the rotation matrix; generating 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.

7. A method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 6, characterized in that: The S45 specifically includes: 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; S452: Constraint parameter analysis: The calculation engine automatically derives geometric constraints: curve_ angle_threshold=math.pi-0.1 # 169.3°, min_edge_ length=0.01*r_s; S453: Constraint preprocessing: The system scans the point set to perform feature detection: traverse each vertex v in the point set P_s i , 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 θ> the curve angle threshold as curve constraint points, and generate the constraint edge set E_constrained ={(v i ,v i+1 )|θ i > curve angle threshold}; S454: Core triangulation operation: The calculation 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: detects triangles that violate constraints: edge length < minimum edge length threshold, internal angle < 25°, inserts Steiner points, and locally retriangulates until all constraints are met; S456: Data structure output: The final triangular mesh data structure is generated: T_s = {vertices:[v1,v2,...,v m ]}, which contains the newly added Steiner points and triangle vertex indices.

8. The method for generating a three-dimensional geometric body adaptive topological contour gradient structure according to claim 1, characterized in that: The S5 specifically includes: S51: Intelligent chamfer vertex construction: Input parameters: A chamfer layer object, s contour segment index, n level index. The processing flow is as follows: S511: Position calculation: based on bilinear interpolation: P = lerp (base point position and initial contour of the sth segment point, offset of the sth segment point, 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 patch generation rule: For index 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 is greater than κ_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: the main contour is counterclockwise, and the hole is clockwise; S612: Multi-layer composite triangulation: Construct a combined contour = [O.insetPoints] + R, perform constrained triangulation, and generate a triangular mesh G. Constraints include: closed boundary: O.insetPoints, hole boundaries R0, R1, ..., the minimum triangle angle is 25°, and the maximum triangle area is 0.1% of the boundary area; S62: Surface mesh construction, dual surface simultaneous generation: For each triangle, use a loop variable t to index in the 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 =(v i , top); assign attributes: normal=(0,0,1), UV=(v i.x / width,v i.y / height); Bottom surface treatment: Create vertex copies: v ib =(v i , bottom); Assign attributes: Normal=(0,0,-1), UV=(v i.x / width,v i.y / height); Build index: top index is added in order (v 1t ,v 2t ,v 3t ); bottom index is added in reverse clockwise order (v 3b ,v 2b ,v 1b ).

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

  • Method for beveling for 3D(dimension) model and apparatus for performing the method

    KR102302833B1