A deterministic complex polyhedron modeling method

By combining the divide-and-conquer method and the incremental method, and utilizing spatial binary tree pruning and tetrahedral complementary surface replacement, the deterministic and efficiency problems in complex polyhedral modeling are solved, and the efficient generation of unique complex polyhedral models is achieved.

CN116109770BActive Publication Date: 2026-05-19GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG UNIV OF TECH
Filing Date
2023-01-16
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing technologies lack deterministic methods for modeling complex polyhedron geometry, especially concave polyhedrons. This results in high computational time complexity and the generation of voids and errors, making it difficult to efficiently generate unique and deterministic complex polyhedron models.

Method used

A method combining divide-and-conquer and incremental approaches is adopted. A convex polyhedron model is constructed through spatial binary tree pruning and post-order traversal. Concave polyhedra are generated by replacing the complementary faces of tetrahedrons. A hash table is used to bridge isolated faces to achieve deterministic complex polyhedron modeling.

Benefits of technology

It significantly reduces redundant calculations and improves the efficiency of complex polyhedron modeling, especially when the number of vertices is large, it significantly reduces the time consumption compared with traditional methods and generates a unique complex polyhedron model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116109770B_ABST
    Figure CN116109770B_ABST
Patent Text Reader

Abstract

The application discloses a certain complex polyhedron modeling method, which comprises the following steps: firstly, loading the vertex position coordinates of a to-be-modeled object through a text to generate a convex polyhedron model; if the to-be-modeled object is a concave polyhedron, the connection relationship of the vertices of the polyhedron is re-modified by using the convex polyhedron to replace the tetrahedron complementary surface and to re-topologize the free points, so that the concave polyhedron with a concave groove is generated. The application can quickly generate various complex convex polyhedrons and concave polyhedrons in engineering applications, reduces unnecessary modeling time consumption, improves work efficiency, and provides a new idea for complex polyhedron modeling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial modeling, and in particular to a deterministic method for geometric modeling of complex polyhedra. Background Technology

[0002] With the development of computer technology, computer-aided technology (CAD), computer-aided manufacturing (CAM), and computer-aided engineering (CAE) have emerged, and more and more tasks are being handled more conveniently on computers. Many engineering tasks now involve the CAD / CAM / CAE fields, and complex polyhedra have wide applications in this area.

[0003] Complex polyhedra, including convex and concave polyhedra, are crucial geometric structures in computational geometry. Typically, a convex polyhedron is uniquely determined for a given set of points, but a concave polyhedron is not. This makes it impossible to use a unified method for geometric modeling complex polyhedra. Therefore, there is a strong need for a deterministic method to unify the geometric modeling of convex and concave polyhedra.

[0004] Numerous studies have been conducted on geometric modeling methods for convex polyhedra. A convex polyhedron is a three-dimensional concept, and its construction is significantly more complex than that of convex polygons in two-dimensional space. There are four main categories of convex polyhedron algorithms. The first category is the exhaustive search method, which constructs faces by combining vertices. A face where all vertices lie on one side is considered a boundary face. However, this method has a relatively high time complexity, reaching O(n log n). The second type is the gift wrapping method. The first algorithm for constructing convex polyhedra was Chand and Kapuer's gift wrapping algorithm. This algorithm rotates a face around a known edge until it encounters a boundary point, forming a boundary triangle. It then continues rotating around the edges of the triangles until all the boundary triangles enclose the points, forming the convex polyhedron. The algorithm has a time complexity of O(n*f) from start to finish, and in the worst case, it is O(n*f). The third type is the incremental method. Early incremental algorithms all had a time complexity of O(n). Later, improvements were made, with classic examples including Clarkson and Shor's stochastic incremental algorithm and Barber and David's QuikHull algorithm. These algorithms primarily work by first constructing a tetrahedron, then continuously adding points to update the convex polyhedron, ultimately forming a convex polyhedron containing all points. Their time complexity is O(nlogn). The fourth category is divide-and-conquer algorithms. Divide-and-conquer algorithms are more difficult to conceive and write, but their time complexity is O(nlogn). Day and Minakawa's divide-and-conquer algorithm merges convex polyhedra to form a single entity. For existing algorithms, if there are a large number of redundant points within the convex polyhedron, these points will significantly increase the computation time. Therefore, researching new methods for constructing convex polyhedra is essential.

[0005] There has been considerable research on concave polyhedra, which are widely used in 3D point cloud reconstruction. Two main algorithms are employed: the Alpha-shape algorithm and the Ball Pivoting algorithm. Both can be visualized as a sphere of radius r rolling through a set of points; three points meeting certain conditions form a boundary triangle, ultimately generating a closed concave polyhedron. Both algorithms automatically converge point cloud data into surfaces, making them suitable for situations where the spacing between adjacent points is uniform and doesn't vary significantly. However, when the point cloud data is non-uniform, holes can form, causing algorithm instability and distortion. The convergence effect requires multiple parameter adjustments, and errors from the ideal shape necessitate manual adjustments. Therefore, deterministic methods for constructing concave polyhedra still require further research. Summary of the Invention

[0006] The purpose of this invention is to provide a deterministic complex polyhedron modeling method that can quickly generate various complex convex and concave polyhedra in engineering applications, reduce unnecessary modeling time, improve work efficiency, and provide a new approach to complex polyhedron modeling.

[0007] To achieve the above objectives, the present invention employs the following technical solution:

[0008] A deterministic method for modeling complex polyhedra includes the following steps:

[0009] Step 1: For convex polyhedral objects that need to be modeled in industry, first obtain the set of all vertices on the object, maintain the vertices in the set with a vertex array, and obtain the spatial boundary of all vertices.

[0010] Step 2: Perform divide-and-conquer pruning on the vertex array that stores all vertices to obtain a space binary tree with redundant space removed.

[0011] Step 3: By traversing the space binary tree in postorder, complete and merge the convex polyhedron objects. If only one of the left and right nodes of the current node exists, go to step 4; if both left and right nodes exist and only one of the corresponding convex polyhedron objects exists, go to step 5; if neither convex polyhedron object exists, go to step 6; if both convex polyhedron objects exist, go to step 8.

[0012] Step 4: When there is only one of the left and right nodes, assign the pointer of the convex polyhedron object of the existing node to the pointer of the convex polyhedron object of the current node, and update the start and end range of the vertex subarray corresponding to the node to the current node.

[0013] Step 5: Expand the topology of the convex polyhedron objects of the nodes where the convex polyhedron object exists using the method in Step 7, and then assign the pointer of the convex polyhedron object of the nodes where the convex polyhedron object exists to the pointer of the convex polyhedron object of the current node.

[0014] Step 6: If neither the left nor right node has a convex polyhedron object, then randomly select four vertices from the vertex array range corresponding to the current node and determine whether they are coplanar. If they are not coplanar, allocate memory for the convex polyhedron object of the current node, construct a tetrahedron, and then expand the convex polyhedron according to the method in Step 7 for the remaining points. If they are coplanar, then change the vertices in the vertex subarray until they are no longer coplanar, and then expand the convex polyhedron according to Step 7.

[0015] Step 7: Add isolated points to the convex polyhedron object using an incremental method; vertices are considered isolated points before topological relationships are established.

[0016] Step 8: Merge the topological structures of the convex polyhedron objects of the left and right nodes through post-order traversal;

[0017] Step 9: Post-order traversal, repeating the operation of step 8 until the merged convex polyhedron is passed to the root node. The topology of this convex polyhedron object is the convex polyhedron of the loaded point set, resulting in the final convex polyhedron model for the object to be modeled in industry.

[0018] Furthermore, if the object to be modeled is a concave polyhedron, the connection relationship of the vertices of the convex regular polyhedron can be re-established by replacing the tetrahedral complementary surfaces with convex polyhedra and retopologically re-establishing the free points using convex polyhedra, thereby generating a concave polyhedron with grooves.

[0019] Furthermore, the divide-and-conquer pruning of the vertex array storing n vertices includes:

[0020] Step 2.1: Construct the node structure of the spatial binary tree. This structure contains the start and end positions of the corresponding node in the vertex array, thereby creating a sub-vertex array without having to allocate new memory. The structure also contains the corresponding spatial boundary and convex polyhedron object.

[0021] Step 2.2: Construct a spatial binary tree using a preorder recursive approach. Sort the vertex array corresponding to each node in ascending order of the vertex coordinates x, y, z, and use the vertex array split point index mid for binary search.

[0022] Step 2.3: Following the vertex array partitioning method in Step 2.2, allocate memory for the left and right nodes. The starting position value of the left node remains unchanged, and the ending position value is updated to mid. The starting position value of the right node is updated to mid+1, and the ending position value remains unchanged.

[0023] Step 2.4: Update the spatial boundaries of the left and right nodes using the value of the dividing point mid after the corresponding sorting of the array as the boundary.

[0024] Step 2.5: If the spatial boundaries of the left and right nodes contain any of the spatial boundaries of the root node, then keep it; otherwise, prune it.

[0025] Step 2.6: The termination condition for constructing the binary tree is that the length of the corresponding vertex subarray in the leaf node is less than or equal to 4. If the vertices of the corresponding vertex subarray of the leaf node are not coplanar, then memory for a convex polyhedron object is allocated, and the convex polyhedron object is constructed from the vertices of the corresponding vertex subarray. If the termination condition is not met, proceed to step 2.2.

[0026] Furthermore, the specific process of merging the topological structure of the convex polyhedron object with left and right nodes through post-order traversal is as follows:

[0027] Step 8.1: Perform sign judgment between the vertices on the convex polyhedron object of the right node and the faces on the convex polyhedron object of the left node, and delete all faces that are positive. If all faces on the convex polyhedron object of the left node are deleted, then expand the convex polyhedron of the right node with all vertices on the left according to step 7.

[0028] Step 8.2: If not all faces on the convex polyhedron object of the left node in Step 8.1 have been deleted, then perform boundary propagation on any triangular face of the remaining faces of the convex polyhedron object of the left node. As long as the adjacent face is any of the faces that have not been deleted, the propagation will continue. If the boundary is touched, the boundary line will be recorded using key-value pairs. This way, the boundary line of an island face can be recorded. Here, a set of faces with adjacent edges is called an island face. If the faces that have not been deleted can form two or more island faces, then only the boundary line of an island face is recorded, which is called the left-cut boundary loop, which is rotated counterclockwise. The remaining island faces are deleted. Then, the vertices on the left-cut boundary loop are used to determine the sign of the faces on the right polyhedron. All faces that are determined to be positive are deleted. If all faces on the convex polyhedron object of the right node are deleted, then the deleted faces on the convex polyhedron object of the left node are completed. All vertices of the convex polyhedron object of the right node are used to expand the convex polyhedron object of the left node according to Step 7.

[0029] Step 8.3: If not all faces on the convex polyhedron object of the right node were deleted in Step 8.2, then perform boundary spread on any triangular face among the remaining faces of the convex polyhedron object of the right node. If it touches the boundary, record the boundary line, thus recording the boundary line of an isolated face. If the remaining faces can form two or more isolated faces, then only record the boundary line of an isolated face, which is called the right tangent boundary loop, which wraps around clockwise, and delete the remaining isolated faces.

[0030] Step 8.4: Bridge the left and right tangent boundary rings obtained in steps 8.2 and 8.3. Both left and right tangent boundary rings are stored using a hash table data structure. Proceed to step 8.5.

[0031] Step 8.5: Starting from one edge of the left tangent boundary ring, search for a point on the right tangent boundary ring. If the positive point condition is not met, continue searching for a point. If it is met, check if the starting edge condition is met. If the starting edge condition is not met, the left tangent boundary ring jumps to the next edge and returns to step 8.5. If the starting edge condition is met, construct the first positive bridging triangle face and return to step 8.6.

[0032] Step 8.6: Jump to the next edge from the left tangent boundary loop. Start searching for a point from the previous point of the right tangent boundary loop. If the point condition is not met, continue searching for a point. If the point condition is met, construct the bridging triangle face according to step 8.7 until the end point of the edge coincides with the starting point of the starting edge, and then go to step 8.13.

[0033] Step 8.7: Construct a bridging triangle face using the edges on the left tangent boundary ring and the points on the right tangent boundary ring. If the bridging triangle does not satisfy the positive and negative edge conditions, proceed to step 8.8. If it satisfies the positive and negative edge conditions, proceed to step 8.9.

[0034] Step 8.8: Construct a complementary triangle face using the edge on the left-cut boundary ring and its next point, update the edge on the left-cut boundary ring as the new edge of the complementary triangle face, and go to step 8.7;

[0035] Step 8.9: Construct a positive bridging triangle with the edge on the left tangent boundary ring and the positive point found on the right tangent boundary ring, and record the positive point. If the positive point does not coincide with the previous positive point, then the two positive bridging triangles have a common intersection point, called the secondary point. Then go to step 8.10. If they coincide, go to step 8.6.

[0036] Step 8.10: Construct an edge using the vertex between the current point and the previous point. Start an edge from the previous point on the right-cut boundary ring and construct a bridging triangle with the secondary point of the positive bridging triangle corresponding to the two points. If the positive and secondary edge conditions are not met, go to step 8.11; if they are met, go to step 8.12.

[0037] Step 8.11: Construct a secondary complementary triangle face using the edge on the right-cut boundary ring and its next point, update the edge on the right-cut boundary ring as the new edge of the secondary complementary triangle face, and go to step 8.10;

[0038] Step 8.12: Construct a secondary bridging triangle face using the edges on the right-cut boundary ring and the secondary point, then proceed to step 8.6;

[0039] Step 8.13: After the left and right tangent boundary loops are bridged, a convex polyhedron is constructed. Then, the convex polyhedron is expanded incrementally using the points in the connected region between the left and right tangent boundary loops of the deleted face.

[0040] Step 8.14: Merge the two convex polyhedra into one convex polyhedron and pass it to the corresponding current node in the binary tree.

[0041] Furthermore, the entire bridging process involves four conditions: First, the positive point condition: the two adjacent vertices of the point on the right tangent boundary ring are both inside the bridging triangle face, and the found point is called the positive point; second, the secondary point condition: if two adjacent positive points do not coincide, then the intersection of the two positive points and the corresponding positive bridging triangles is called the secondary point, which falls on the left tangent boundary ring; third, the starting edge condition: the two adjacent points of the corresponding edge of the first positive bridging triangle on the left tangent boundary ring are both inside the bridging triangle; fourth, the positive and secondary edge condition: the next adjacent point of the corresponding edge on the left and right tangent boundary rings is inside the bridging triangle, and the edge on the left tangent boundary ring is called the positive edge, and the edge on the right tangent boundary ring is called the secondary edge.

[0042] The present invention has the following advantages and effects compared with the prior art:

[0043] 1. This invention improves the extraction and bridging of tangent boundary loops in the divide-and-conquer algorithm, making it more suitable for programming.

[0044] 2. This invention proposes a method for constructing convex polyhedra that combines the divide-and-conquer method with the incremental method, and prunes vertices that exist inside the convex polyhedron but do not participate in the construction of the convex polyhedron to reduce redundant calculations;

[0045] 3. Experimental verification shows that the method for constructing convex polyhedra in this invention significantly reduces the time consumption compared to the traditional incremental method when the number of vertices exceeds 2000; the more vertices, the higher the efficiency.

[0046] 4. This invention provides a general step and method for generating a complex polyhedral geometric model using the tetrahedral complementary surface replacement method; this invention provides a deterministic modeling method for complex polyhedra, which can generate uniquely determined complex polyhedra; the calculation is simple and the method is reliable. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the process for modeling deterministic complex polyhedra as described in this invention;

[0048] Figure 2 This is a schematic diagram of the spatial binary tree corresponding to the cyclic binary vertex array described in this invention;

[0049] Figure 3 This is a schematic diagram of the space stacking and internal redundant space after the cyclic binary vertex array described in this invention;

[0050] Figure 4 This is a schematic diagram illustrating the principle of the incremental method described in this invention;

[0051] Figure 5 This is a schematic diagram illustrating the principle of the divide-and-conquer method described in this invention;

[0052] Figure 6 This is a schematic diagram of the convex polyhedron with 17 vertices described in this invention;

[0053] Figure 7 This is a schematic diagram of the free point retopology as described in this invention;

[0054] Figure 8 This is a schematic diagram illustrating the principle of tetrahedral complementary surface replacement described in this invention;

[0055] Figure 9 This is a schematic diagram of a diamond complex polyhedron with a Y-shaped groove in the embodiment; Detailed Implementation

[0056] This invention provides a deterministic method for modeling complex polyhedra. Complex polyhedra refer to objects that may have both convex and concave forms. For example, objects such as telephone poles, tables, and chairs have no concave areas on their surfaces, so their shapes are convex polyhedra. However, objects such as washbasins and sinks have concave surfaces, so their shapes are concave polyhedra.

[0057] This solution first loads the vertex coordinates of the object to be modeled into the text, generating a convex polyhedron model. If the object to be modeled is a concave polyhedron, the connection relationship of the vertices of the polyhedron is corrected by replacing the tetrahedron complementary faces and retopologically correcting the free points using the convex polyhedron, thus generating a concave polyhedron with grooves.

[0058] I. Modeling when the object to be modeled is a convex polyhedron

[0059] This invention employs a combination of divide-and-conquer and incremental methods to construct convex polyhedra. Divide-and-conquer is most effective in the worst-case scenario compared to other algorithms, while incremental methods are more effective on average. Divide-and-conquer can eliminate redundant internal points, reducing their involvement in the incremental algorithm's calculations, while incremental methods can circumvent many obstacles of divide-and-conquer. Therefore, combining the two is likely to achieve even better results. This invention combines their advantages to improve the algorithm and make it applicable to cases with a large number of internal points, and is implemented through the following technical solutions.

[0060] Step 1: For convex polyhedral objects that need to be modeled in industrial applications, first obtain the set S of all vertices on the object, S = The i-th vertex The coordinates are represented as (x, y, z), i = 1, 2, ..., n. A vertex array Points is used to maintain these n vertices, and the spatial boundaries of these n vertices are obtained. The smallest covering convex polyhedron containing S is called the convex polyhedron of S, and here C(S) denotes the convex polyhedron of S; where These represent the minimum and maximum boundaries in the x-direction, y-direction, and z-direction, respectively.

[0061] Step 2: Perform divide-and-conquer pruning on the vertex array Points that stores n vertices to obtain a spaced binary tree with redundant space removed. The detailed process is as follows:

[0062] Step 2.1: Construct the node structure of the spatial binary tree. This structure contains the start and end positions of the corresponding node in the vertex array, thus creating a child vertex array without allocating new memory. This structure also contains the corresponding spatial boundaries. , and convex polyhedral objects.

[0063] Step 2.2: Construct the spatial binary tree using a preorder recursive approach, such as... Figure 2 As shown, the vertex array corresponding to the node is sorted in ascending order by vertex coordinates x, y, z, iteratively according to the recursion depth. Then, a binary search is performed using the vertex array splitting point index mid. The number of vertices in the split is determined by the following formula:

[0064] left:

[0065] right:

[0066]

[0067] In the formula This indicates the starting position of the vertex array, and [] represents rounding down. Using this formula to divide the left and right edge vertex sets has two advantages. The first advantage is that the vertices corresponding to the left and right nodes are divided as evenly as possible. The second advantage is that the number of vertices on the left is always a multiple of 4, which can also make the divided leaf node space contain as many as 4 data points as possible. If n itself is not a multiple of 4, then the number of vertices in the rightmost node at the bottom level of the binary tree is n%4.

[0068] Step 2.3: Following the vertex array partitioning method in Step 2.2, allocate memory for the left and right nodes. The starting position value of the left node remains unchanged, while the ending position value is updated to mid. The starting position value of the right node is updated to mid+1, while the ending position value remains unchanged.

[0069] Step 2.4: Update the spatial boundaries of the left and right nodes using the value of the mid point after the array is sorted and divided as the boundary.

[0070] Step 2.5: If the spatial boundaries of the left and right nodes contain any of the spatial boundaries of the root node, then keep it; otherwise, prune it.

[0071] Step 2.6: The termination condition for constructing the binary tree is that the length of the corresponding vertex subarray in the leaf node is less than or equal to 4. If the vertices of the corresponding vertex subarray of the leaf node are not coplanar, then memory for a convex polyhedron object is allocated, and the convex polyhedron object is constructed from the vertices of the corresponding vertex subarray. If the termination condition is not met, proceed to step 2.2. The vertex subarray refers to an array with vertices as array elements. A node is a data structure with an array start and end value, a left pointer and a right pointer, and a custom convex polyhedron object.

[0072] This solution uses only one array throughout. All subarrays are defined by array indices, such as 1 to 10, which can be transformed into 1 to 5 and 6 to 10. However, by only recording 1 and 5, and 6 and 10, we can know what the subarrays are.

[0073] The purpose of step 2 is to prune nodes with internal redundant space by sorting the array and using space boundaries, thereby avoiding internal points from participating in related operations, and thus obtaining a space binary tree with an array length of less than or equal to 4 corresponding to a leaf node.

[0074] Step 3: By traversing the binary tree in postorder, complete and merge the convex polyhedron objects. If only one of the left and right nodes of the current node exists, go to step 4; if both left and right nodes exist and only one of the corresponding convex polyhedron objects exists, go to step 5; if neither convex polyhedron object exists, go to step 6; if both convex polyhedron objects exist, go to step 8.

[0075] Except for a few leaf nodes, no memory is allocated for the convex polyhedron objects of other nodes. In this process, there is a sign-based discrimination formula that frequently determines the positional relationship between points and faces. Let... There are 4 points in space that form a tetrahedron F, of which 3 points are... , , Rotate counterclockwise around the surface to form the fourth point. On one side or coplanar, geometrically, the side of the boundary surface that winds counterclockwise is usually defined as the outer side, the visible side, and the side of the boundary surface that winds clockwise is defined as the inner side, the invisible side; if exist , , The side that rotates counterclockwise indicates... exist , , The outer edge of the triangle corresponds to a positive number in the sign discrimination formula, and vice versa. If they are coplanar, the result is 0.

[0076]

[0077] in, , , for The coordinates of the points are determined; by using the sign discrimination formula, it is determined that the four points in space are not coplanar, and thus a tetrahedron can be formed.

[0078] Step 4: When there is only one of the left and right nodes, assign the convex polyhedron object pointer of the existing node to the convex polyhedron object pointer of the current node, and update the start and end range of the vertex subarray corresponding to the current node. The convex polyhedron object pointer is used to store the address, and the memory is allocated by using the pointer to receive the starting address.

[0079] Step 5: vertices within the range of the vertex subarray corresponding to nodes where no convex polyhedron object exists; expand the convex polyhedron topology of the convex polyhedron object of the node where the convex polyhedron object exists using Step 7, and then assign the pointer of the convex polyhedron object of the node where the convex polyhedron object exists to the pointer of the convex polyhedron object of the current node.

[0080] Step 6: If neither the left nor right node has a convex polyhedron object, then randomly select four vertices from the vertex array range corresponding to the current node and determine whether they are coplanar. If they are not coplanar, allocate memory for the convex polyhedron object of the current node, construct an initial tetrahedron, and then expand the convex polyhedron according to the method in Step 7 for the remaining points. If they are coplanar, then change the vertices in the vertex subarray until they are no longer coplanar, and then expand the convex polyhedron according to Step 7. If they are still coplanar, then backtrack to the previous level and perform the operation from the previous level.

[0081] Step 7: Add isolated points to the convex polyhedron object using an incremental method; vertices are considered isolated points until a topological relationship is established (before forming a convex polyhedron object).

[0082] Step 8: Merge the topological structures of the convex polyhedron objects of the left and right nodes through post-order traversal; the detailed implementation process is as follows:

[0083] Step 8.1: Perform sign judgment between the vertices on the convex polyhedron object of the right node and the faces on the convex polyhedron object of the left node, and delete all faces that are positive. If all faces on the convex polyhedron object of the left node are deleted, then expand the convex polyhedron of the right node with all vertices on the left according to step 7.

[0084] Step 8.2: If not all faces on the convex polyhedron object of the left node in Step 8.1 have been deleted, then perform boundary propagation on any triangular face of the remaining faces of the convex polyhedron object of the left node (find adjacent faces through half-edge structure). As long as the adjacent face is any of the faces that have not been deleted, propagate to it. If the boundary is touched, record the boundary line with key-value pairs. In this way, the boundary line of an island face can be recorded. Here, a set of faces with adjacent edges is called an island face. If the faces that have not been deleted can form two or more island faces, then only the boundary line of an island face is recorded, which is called the left-cut boundary loop, which is wrapped counterclockwise. The remaining island faces are deleted. Then, the vertices on the left-cut boundary ring perform sign checks on the faces of the right-hand polyhedron, deleting all faces that are judged as positive (by the sign check formula). If all faces on the right-hand convex polyhedron object are deleted, then the deleted faces on the left-hand convex polyhedron object are filled in. All vertices of the right-hand convex polyhedron object are used to expand the convex polyhedron of the left-hand convex polyhedron object according to step 7. The left-cut boundary ring is a ring constructed with ordered edges, stored in a hash table, for example, 1-2-3-4-5-1, corresponding to edges 1-2, 2-3, 3-4, 4-5, 5-1, etc.

[0085] Step 8.3: If not all faces on the convex polyhedron object of the right node were deleted in Step 8.2, then perform boundary propagation on any triangular face among the remaining faces of the convex polyhedron object of the right node. If it touches the boundary, record the boundary line, thus recording the boundary line of an isolated face. If the remaining faces can form two or more isolated faces, then only record the boundary line of one isolated face, denoted as a right-cut boundary loop, which wraps clockwise, and delete the remaining isolated faces.

[0086] Step 8.4: Bridge the left and right tangent boundary rings obtained in steps 8.2 and 8.3 (the edges on the left tangent boundary ring form triangles with the right tangent boundary ring). Both the left and right tangent boundary rings are stored using a hash table data structure. Proceed to step 8.5.

[0087] The entire bridging process involves four conditions: First, the positive point condition: the two adjacent vertices of the point on the right tangent boundary ring are both inside the bridging triangle face; the found point is called the positive point. Second, the secondary point condition: if two adjacent positive points do not coincide, the intersection of the two positive points and the corresponding positive bridging triangles is called the secondary point, which falls on the left tangent boundary ring. Third, the starting edge condition: the two adjacent points of the corresponding edge of the first positive bridging triangle on the left tangent boundary ring are both inside the bridging triangle. Fourth, the positive and secondary edge condition: the next adjacent point of the corresponding edge on the left and right tangent boundary rings is inside the bridging triangle; the edge on the left tangent boundary ring is called the positive edge, and the edge on the right tangent boundary ring is called the secondary edge.

[0088] Step 8.5: Starting from one edge of the left tangent boundary ring, search for a point on the right tangent boundary ring. If the positive point condition is not met, continue searching for a point. If it is met, check if the starting edge condition is met. If the starting edge condition is not met, the left tangent boundary ring jumps to the next edge and returns to step 8.5. If the starting edge condition is met, construct the first positive bridging triangle face and return to step 8.6.

[0089] Step 8.6: Jump to the next edge from the left tangent boundary loop. Start searching for a point from the previous point of the right tangent boundary loop. If the point condition is not met, continue searching for a point. If the point condition is met, construct the bridging triangle face according to step 8.7 until the end point of the edge coincides with the starting point of the starting edge (the positive edge of the first positive bridging triangle is the starting edge). Then go to step 8.13.

[0090] Step 8.7: Construct a bridging triangle face using the edges on the left tangent boundary ring and the points on the right tangent boundary ring. If the bridging triangle does not satisfy the positive and negative edge conditions, proceed to step 8.8. If it satisfies the positive and negative edge conditions, proceed to step 8.9.

[0091] Step 8.8: Construct a complementary triangle face using the edge on the left-cut boundary ring and its next point, update the edge on the left-cut boundary ring as the new edge of the complementary triangle face, and go to step 8.7.

[0092] Step 8.9: Construct a positive bridging triangle with the edge on the left tangent boundary ring and the positive point found on the right tangent boundary ring, and record the positive point. If the positive point does not coincide with the previous positive point, then the two positive bridging triangles have a common intersection point, called the secondary point. Then go to step 8.10. If they coincide, go to step 8.6.

[0093] Step 8.10: Construct an edge using the vertex between the current point and the previous point. Start an edge from the previous point on the right-cut boundary ring and construct a bridging triangle with the secondary point of the positive bridging triangle corresponding to the two points. If the positive and secondary edge conditions are not met, go to step 8.11; if they are met, go to step 8.12.

[0094] Step 8.11: Construct a secondary complementary triangle face using the edge on the right-cut boundary ring and its next point, update the edge on the right-cut boundary ring as the new edge of the secondary complementary triangle face, and go to step 8.10.

[0095] Step 8.12: Construct a secondary bridging triangle face using the edges on the right-cut boundary ring and the secondary point, then proceed to step 8.6.

[0096] Step 8.13: After bridging the left and right tangent boundary loops, a convex polyhedron is constructed. Then, the convex polyhedron is expanded incrementally using the points in the connected region between the left and right tangent boundary loops of the deleted face.

[0097] Step 8.14: Merge the two convex polyhedra into one convex polyhedron and pass it to the corresponding current node in the binary tree.

[0098] Step 8 is designed to merge the topological structures of the left and right convex polyhedron objects and assign them to the current node.

[0099] Step 9: Post-order traversal, repeating the operation in Step 8 until the merged convex polyhedron is passed to the root node. The topology of this convex polyhedron object is the convex polyhedron of the loaded point set, resulting in the final convex polyhedron model for the object.

[0100] II. Modeling when the object to be modeled is a concave polyhedron

[0101] If the target complex polyhedron has concavities, then a concave polyhedron is constructed. Concave polyhedra have local concavities that cannot be uniquely represented by algorithms, so a convex polyhedron, a uniquely representable intermediate state, is needed as a transition. In this invention, each face exists in the form of a triangle; two vertices uniquely determine an edge, and three vertices uniquely determine a face. On the polyhedron, an edge connecting two triangles, if the two connected triangles are not coplanar, uniquely determines a tetrahedron. Choosing an edge, if the two triangles connected by this edge open inwards, a tetrahedron can be geometrically removed. If the two triangles connected by this edge open outwards, a tetrahedron can be geometrically filled.

[0102] This process does not create new points; it only changes the topological relationships between edges and faces. Therefore, by selecting a point (each point has connected edges, selecting a point means selecting all edges connected to that point), an edge, or a face (each face has three edges, selecting all three edges), or by using regular geometry to select the edges that come into contact with it, the connections between edges in the convex polyhedron are modified, thus changing the faces and obtaining a uniquely defined complex polyhedron. The technical solution is as follows:

[0103] Step 10: If the target complex polyhedron has a depression, construct the concave polyhedron; otherwise, proceed to step 17.

[0104] Step 11: Set the replacement method: collapse replacement or dilation replacement. The default is collapse replacement.

[0105] Step 12: Set the operation mode. There are two operation modes. The first mode is to replace by selecting points, edges, or faces. The principle of points and faces is the same as that of edges. A point connects to multiple edges, and a face has three edges. Then, the edges are selected by the mouse and the selected replacement mode is used to replace them locally. The second mode is to select the edges on the polyhedron by using a regular geometric shape (sphere or cube). All lines that come into contact with the polyhedron are selected. Then, the edges are selected by the mouse and the selected replacement mode is used to replace them locally.

[0106] Step 13: The construction of the concave polyhedron is based on the convex polyhedron. There are two cases: the first is the case without free points, which is carried out according to step 14; the second is the case with free points, which is carried out according to step 16.

[0107] Step 14: Select the edge according to the operation method, proceed to step 15. If the replacement method is collapse replacement, only the edges of the shared-edge faces facing inward will be operated on; if the replacement method is expansion replacement, only the edges of the shared-edge faces facing outward will be operated on. The orientation of the opening can be determined by the midpoint of the line connecting the non-shared-edge vertices. Suppose there are two faces sharing edge AB. and They all rotate counterclockwise towards the outside. yes , yes The midpoint P of the line connecting the non-shared vertices C and D can be easily obtained and determined using the formula:

[0108]

[0109] Step 15, Tetrahedral Complementary Face Replacement. In a polyhedron, each edge is a common edge of two adjacent triangular faces. Therefore, any edge of the polyhedron can uniquely identify two adjacent triangular faces, called the original adjacent triangular faces. If the original adjacent triangular faces are not coplanar, then the four vertices of the two original adjacent triangular faces can uniquely identify a tetrahedron, called the adjacent tetrahedron. Selecting an edge in the convex polyhedron by mouse interaction will delete the original adjacent triangular face identified by that edge from the convex polyhedron and generate two complementary triangular faces of the original adjacent triangular face in the adjacent tetrahedron identified by that edge, called adjacent complementary triangular faces, thus causing the replacement.

[0110] Step 16: Re-establish topological relationships for the free points, then proceed to Step 14. For free points with useful vertices inside the convex polyhedron, the tetrahedral complementary surface replacement method in Step 15 is performed based on existing topological relationships. This method is not applicable to points without topological relationships. To include the free point in the tetrahedral complementary surface replacement method, select the free point and one face of the convex polyhedron using mouse interaction; this is called the breakout face. By connecting the free point and three edges on the breakout face, three faces are generated, called retopological triangle faces. Then, delete the breakout face. This brings the free point into the scope of the tetrahedral complementary surface replacement method, and then the tetrahedral complementary surface replacement is performed using the method in Step 14.

[0111] Step 17: Sew the facets together to create a solid, then finish.

[0112] After the above steps, all the triangular faces of the obtained complex polyhedron are stitched together to form a solid, resulting in a defined, complex, and irregular polyhedron, thus obtaining the model of the object to be modeled. This method can be used in fields such as particle modeling, collision detection, point cloud reconstruction, and post-processing of crystal models.

[0113] Example

[0114] The present invention will be further described in detail below with reference to a diamond model with a Y-shaped groove and the accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0115] like Figure 1 As shown:

[0116] Step 1, let S = It is the set of coordinates of n points of the Y-groove diamond model loaded from text. The coordinates are (x, y, z), i = 1, 2, ..., n. A vertex array Points is used to maintain these n points, and the boundaries of these n points are obtained during the loading process. The smallest covering convex polyhedron containing S is called the convex polyhedron of S, and here we use C(S) to denote the convex polyhedron of S.

[0117] Step 2: Perform divide-and-conquer pruning on the Points vertex array containing n points from Step 1 to obtain a spaced binary tree with redundant space removed. The detailed process is as follows:

[0118] Step 2.1: Construct the node structure of the binary tree. This structure contains the start and end positions of the corresponding nodes in the vertex array Points, thus creating a vertex subarray without allocating new memory. This structure also contains the corresponding space boundaries. and convex polyhedral objects.

[0119] Step 2.2: Construct a spatial binary tree using preorder recursion. Sort the vertex arrays corresponding to each node in ascending order of x, y, and z as the recursion depth increases. Then, perform a binary search using the vertex array splitting point index `mid`. The number of vertices in the split is determined by the following formula:

[0120] left:

[0121] right:

[0122]

[0123] In this formula, [] represents rounding down. Using this formula to divide the left and right edge point sets has two advantages. The first advantage is that the corresponding vertices of the left and right nodes are divided as evenly as possible. The second advantage is that the number of vertices on the left is always a multiple of 4, which can also make the divided space contain as many as 4 data points as possible. If n itself is not a multiple of 4, then the number of vertices of the rightmost node at the bottom level of the binary tree is n%4.

[0124] Step 2.3: Following the vertex partitioning method in Step 2.2, allocate memory for the left and right nodes. The starting position value of the left node remains unchanged, while the ending position value is updated to mid. The starting position value of the right node is updated to mid+1, while the ending position value remains unchanged.

[0125] Step 2.4: Using the values ​​of the split points after dividing the vertex array according to the corresponding sorting, update the spatial boundaries of the left and right nodes. Specifically, first sort the vertex array in ascending order according to the x-axis, then divide the vertex array into two parts, using a binary tree to maintain the vertex set, such as... Figure 2 As shown, the current node of the binary tree The space is divided into left and right parts by the x-value of the vertex array element with index mid. The left node is the left vertex array sorted by x. Space, where the right node is an array of right vertices sorted by x. Similarly, the space of the left and right nodes is further divided according to the y-axis direction, and then according to the z-axis direction, and so on.

[0126] Step 2.5: If the spatial boundaries of the left and right nodes contain any spatial boundary of the root node, then retain it; otherwise, prune it. For example... Figure 3 As shown, nodes containing internal space do not participate in the relevant operations of convex polyhedra, thus achieving the purpose of pruning.

[0127] Step 2.6: The construction of the binary tree terminates when the length of the corresponding subarray in the leaf node is less than or equal to 4. If the vertices of the corresponding array of the leaf node are not coplanar, then memory for a convex polyhedron object is allocated, and the topological relationship of the convex polyhedron is constructed from the vertices of the corresponding vertex array. If the termination condition is not met, proceed to step 2.2.

[0128] The purpose of step 2 is to prune nodes with internal redundant space by sorting the array and using space boundaries, thereby avoiding internal points from participating in related operations, and thus obtaining a space binary tree with an array length of less than or equal to 4 corresponding to a leaf node.

[0129] Step 3: Construct the initial convex polyhedron and merge convex polyhedra by post-order traversal of the binary tree space. If only one of the left and right nodes exists, proceed to step 4; if both left and right nodes exist, and only one of the corresponding convex polyhedron objects exists, proceed to step 5; if neither convex polyhedron object exists, proceed to step 6; if both convex polyhedron objects exist, proceed to step 8. Except for some leaf nodes, the memory for the convex polyhedron objects of other nodes is not allocated. In this process, there is a sign discrimination formula that involves many judgments about the positional relationship between points and faces. Let... There are 4 points in space that form a tetrahedron F, of which 3 points are... , , Rotate counterclockwise around the surface to form the fourth point. On one side of it or on the same plane, if exist , , The side that rotates counterclockwise indicates... exist , , The outer edge of the triangle corresponds to a positive number in the sign discrimination formula, and vice versa. If they are coplanar, the result is 0.

[0130]

[0131] By using the sign discrimination formula, it can be determined that four points in space are not coplanar, thus forming an initial tetrahedron.

[0132] Step 4: When there is only one of the left and right nodes, assign the convex polyhedron object pointer of the existing node to the convex polyhedron object pointer of the current node, and update the start and end range of the vertex subarray corresponding to the current node. The convex polyhedron object pointer is used to store the address, and the memory is allocated by using the pointer to receive the starting address.

[0133] Step 5: For nodes where the convex polyhedron object does not exist, the topology of the convex polyhedron object of the corresponding vertex subarray range is expanded using Step 7. Then, the pointer of the convex polyhedron object of the node where the convex polyhedron object exists is assigned to the pointer of the convex polyhedron object of the current node.

[0134] Step 6: If neither the left nor right node has a convex polyhedron object, then randomly select four vertices from the vertex array range corresponding to the current node and determine whether they are coplanar. If they are not coplanar, allocate memory for the convex polyhedron object of the current node, construct an initial tetrahedron, and then expand the convex polyhedron according to the method in Step 7 for the remaining points. If they are coplanar, then change the vertices in the vertex subarray until they are no longer coplanar, and then expand the convex polyhedron according to Step 7. If they are still coplanar, then backtrack to the previous level and perform the operation from the previous level.

[0135] Step 7: Add isolated points to the convex polyhedron using an incremental method. This can be done as follows: Figure 4 As shown, select With tetrahedron Perform sign determination. Only with It is an external relationship, with If the adjacent triangular faces of the boundary are all internal, then... In tetrahedron The tangent boundary loop is Therefore, it is possible to build , , At the same time, delete all faces that are opposite to the outside, i.e., delete. This forms a convex polyhedron with 5 points. The other points are added in the same way.

[0136] Step 8: Merge the topological structures of the convex polyhedron objects of the left and right nodes through post-order traversal. For example... Figure 5 As shown in (a), let the convex polyhedron under the left leaf node be C( The convex polyhedron under the right child node is C( Then the current node corresponds to the merged convex polyhedron C( of the left and right leaf nodes). The detailed implementation process is as follows:

[0137] Step 8.1, the convex polyhedron object C of the right node ( The vertex on the left node and the convex polyhedron object C( Perform sign judgment on the faces of ) and delete all faces that are positive. If the convex polyhedron object C( of the left node) is positive, then the left node is positive. If all faces on a given surface are deleted, then the convex polyhedron object C(where all vertices on the left are connected to the right node) will have the following structure. Expand the convex polyhedron according to step 7.

[0138] Step 8.2, if the convex polyhedron object C of the left node in step 8.1 ( If not all faces on the left node of the convex polyhedron object C() are deleted, then the left node of the convex polyhedron object C() is considered to be not deleted. For any of the remaining triangular faces, extend the boundary along the edge. Extend the boundary if any adjacent face is one of the remaining faces. If a boundary is reached, record the boundary line. This records the boundary line of one isolated face. If the remaining faces can form two or more isolated faces, record only the boundary line of one isolated face, denoted as a left-cut boundary loop, and extend it counter-clockwise. Delete the remaining isolated faces. Then, the vertices on the left-cut boundary loop are linked to the right polyhedron C(…). Perform sign judgment on the faces of ) and delete all faces that are positive. If the right node's convex polyhedron object C( If all faces on the left node are deleted, then the convex polyhedron object C( Complete the deleted faces on the right node of the convex polyhedron object C(). The convex polyhedron object C(where all vertices are to the left node) Expand the convex polyhedron according to step 7.

[0139] Step 8.3, if the convex polyhedron object C of the right node in step 8.2 ( If not all faces on the polyhedron object C( ) are deleted, then for the right node of the convex polyhedron object C( )... For any of the remaining triangular faces, extend the boundary. If it touches a boundary, record the boundary line. This records the boundary line of one isolated face. If the remaining faces can form two or more isolated faces, then record the boundary line of only one isolated face, denoted as a right-cut boundary loop, which wraps around clockwise. The remaining isolated faces are then deleted.

[0140] Step 8.4: Bridge the left and right tangent boundary rings obtained in steps 8.2 and 8.3, then proceed to step 8.5. The entire bridging process involves four conditions: First, the positive point condition: the two adjacent vertices of a point on the right tangent boundary ring are both inside the bridging triangle face; the found point is called the positive point. Second, the secondary point condition: if two adjacent positive points do not coincide, the intersection of the corresponding positive bridging triangles is called the secondary point, which falls on the left tangent boundary ring. Third, the starting edge condition: the two adjacent points of the corresponding edge of the first positive bridging triangle on the left tangent boundary ring are both inside the bridging triangle. Fourth, the positive and secondary edge condition: the next adjacent point of the corresponding edge on the left and right tangent boundary rings is inside the bridging triangle; the edge on the left tangent boundary ring is called the positive edge, and the edge on the right tangent boundary ring is called the secondary edge.

[0141] Step 8.5: Construct the first equilateral bridging triangle face, then proceed to step 8.6. (As follows...) Figure 5 As shown in (b), a portion of the left-cut boundary loop is The right-cut boundary ring segment is The bridging begins with C( Starting with edge kl on ), find C( Vertex r on ) constitutes The formula, determined by the sign, satisfies both the positive point condition and the starting edge condition; the two vertices j and m of edge kl are also present. If the triangle is in the plane, then the triangle can be determined as the first positive bridging triangle used for the beginning, and r is called the positive point, which is recorded.

[0142] Step 8.6: Jump to the next edge from the left-cut boundary loop. Start searching for a point from the previous point of the right-cut boundary loop. If the point condition is not met, continue searching for a point; if the point condition is met, construct the bridging triangle face according to step 8.7. Continue until the end point of the edge coincides with the starting point of the starting edge, then go to step 8.13.

[0143] Step 8.7: Construct a bridging triangle face using the edges on the left tangent boundary ring and the points on the right tangent boundary ring, as follows: Figure 5 (b) lm and t construct a bridging triangle. If the bridging triangle does not satisfy the positive and negative side conditions, proceed to step 8.8; if it does satisfy the positive and negative side conditions, proceed to step 8.9.

[0144] Step 8.8: Construct a complementary triangle face using the edge on the left-cut boundary ring and its next point, update the edge on the left-cut boundary ring as the new edge of the complementary triangle face, and go to step 8.7. (See step 8.7.) Figure 5 (b) lm and n construct a complementary triangle surface The new edge is ln.

[0145] Step 8.9: Construct a bridging triangle using the edges on the left tangent boundary ring and the points found on the right tangent boundary ring, and record the points. If this point does not coincide with the previous point, then the two bridging triangles have a common intersection point, called the secondary point. Proceed to step 8.10; if they coincide, proceed to step 8.6. Figure 5 (b) lo and t construct a positive bridging triangle. , where l is a secondary point.

[0146] Step 8.10: Starting from the previous positive point on the right-cut boundary ring, construct a bridging triangle with the secondary points of the corresponding positive bridging triangles. If the positive and secondary edge conditions are not met, proceed to step 8.11; otherwise, proceed to step 8.12. Figure 5 (b) rs and l construct a bridging triangle. .

[0147] Step 8.11: Construct a secondary complementary triangle face using the edge on the right-cut boundary ring and its next point, update the edge on the right-cut boundary ring as the new edge of the secondary complementary triangle face, and go to step 8.10. (See step 8.10.) Figure 5 (b) rs and t construct a secondary complementary triangle surface The new edge is rt.

[0148] Step 8.12: Construct a secondary bridging triangle using the edges on the right-cut boundary ring and the secondary point, then proceed to step 8.6. (As follows...) Figure 5 (b) rt and l construct a secondary bridging triangle surface .

[0149] Step 8.13: After bridging the left and right tangent boundary loops, a convex polyhedron is constructed. Then, the convex polyhedron is expanded incrementally using the points in the connected region between the left and right tangent boundary loops of the deleted face.

[0150] Step 8.14 allows merging the two convex polyhedra into a single convex polyhedron and passing it to the corresponding current node in the binary tree.

[0151] Step 8 is designed to merge the topological structures of the left and right convex polyhedron objects and assign them to the current node.

[0152] Step 9: Post-order traversal, repeating step 8 until the convex polyhedron object is assigned to the root node's convex polyhedron object. The topology of this convex polyhedron object is the convex polyhedron of the loaded point set. In this example, for ease of illustration, let n=17, a total of 17 vertices, finally generating as shown below. Figure 6 A diamond-shaped convex polyhedron.

[0153] Step 10: If the target complex polyhedron has a depression, construct the concave polyhedron; otherwise, proceed to step 17.

[0154] Step 11: Set the replacement method: collapse replacement or dilation replacement. The default is collapse replacement.

[0155] Step 12: Set the operation mode. There are two operation modes. The first mode is to replace by selecting points, edges, or faces. The principle of points and faces is the same as that of edges. A point connects to multiple edges, and a face has three edges. Then, the edges are selected by the mouse and the selected replacement mode is used to replace them locally. The second mode is to select the edges on the polyhedron by using a regular geometric shape (sphere or cube). All lines that come into contact with the polyhedron are selected. Then, the edges are selected by the mouse and the selected replacement mode is used to replace them locally.

[0156] Step 13: The construction of the concave polyhedron is based on the convex polyhedron. There are two cases: the first is the case without free points, which is carried out according to step 14; the second is the case with useful free points, which is carried out according to step 16.

[0157] Step 14: Select the edge according to the operation method, proceed to step 15. If the replacement method is collapse replacement, only the edges of the shared-edge faces facing inward will be operated on; if the replacement method is expansion replacement, only the edges of the shared-edge faces facing outward will be operated on. The orientation of the opening can be determined by the midpoint of the line connecting the non-shared-edge vertices. Suppose there are two faces sharing edge AB. and They all rotate counterclockwise towards the outside. yes , yes The midpoint P of the line connecting the non-shared vertices C and D can be easily obtained and determined using the formula:

[0158]

[0159] Step 15, Tetrahedral Complementary Face Replacement. To generate the Y-shaped groove, the polyhedron obtained in the previous step needs to be replaced with tetrahedral complementary faces. Select the collapse replacement method and select edges 14-15 by mouse interaction, i.e., select the edges. and The algorithm obtains the convex polyhedron by its edges. The original adjacent triangle face with edge and The original adjacent triangle face with edge The four vertices on these two triangular faces can uniquely determine a tetrahedron. That is, an adjacent tetrahedron, in this case, it is removed from the face set of the convex polyhedron by its edge. The original adjacent triangle face with edge and The original adjacent triangle face with edge Generate its tetrahedron on the adjacent face. complementary triangular faces in and That is, adjacent faces are complementary triangles, the principle is as follows: Figure 8 As shown. For edges 13-14 and 13-15, the same method can be used to replace the tetrahedral complementary surfaces by collapse.

[0160] Step 16: Re-establish the topological relationships for the free points, and then proceed to step 14. Figure 6 The convex polyhedron in the image has a useful internal free vertex 16. Free vertex 16 and the breakout face can be selected via mouse interaction. Then, with free vertex 16 and The three boundary lines establish a topology, generating retopological triangles. , and .like Figure 7 As shown, this step establishes a topological relationship between the free vertex and the convex polyhedron.

[0161] Step 17: Sew the facets together to create a solid object. End. Figure 9 As shown, the faces of a complex diamond polyhedron with Y-shaped grooves are stitched together to form a solid.

[0162] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A deterministic method for modeling complex polyhedra, characterized in that, Includes the following steps: Step 1: Load the vertex position coordinates of the object to be modeled by text and generate a convex polyhedron object. For the convex polyhedron object, first obtain the set of all vertices on the object, maintain the vertices in the set with a vertex array, and obtain the spatial boundary of all vertices. Step 2: Perform divide-and-conquer pruning on the vertex array that stores all vertices to obtain a space binary tree with redundant space removed. Step 3: By traversing the space binary tree in postorder, complete and merge the convex polyhedron objects. If only one of the left and right nodes of the current node exists, go to step 4; if both left and right nodes exist and only one of the corresponding convex polyhedron objects exists, go to step 5; if neither convex polyhedron object exists, go to step 6; if both convex polyhedron objects exist, go to step 8. Step 4: When there is only one of the left and right nodes, assign the pointer of the convex polyhedron object of the existing node to the pointer of the convex polyhedron object of the current node, and update the start and end range of the vertex subarray corresponding to the node to the current node. Step 5: Expand the topology of the convex polyhedron objects of the nodes where the convex polyhedron object exists using the method in Step 7, and then assign the pointer of the convex polyhedron object of the nodes where the convex polyhedron object exists to the pointer of the convex polyhedron object of the current node. Step 6: If neither the left nor right node has a convex polyhedron object, then randomly select four vertices from the vertex array range corresponding to the current node and determine whether they are coplanar. If they are not coplanar, allocate memory for the convex polyhedron object of the current node, construct a tetrahedron, and then expand the convex polyhedron according to the method in Step 7 for the remaining points. If they are coplanar, then change the vertices in the vertex subarray until they are no longer coplanar, and then expand the convex polyhedron according to Step 7. Step 7: Add isolated points to the convex polyhedron object using an incremental method; vertices are considered isolated points before topological relationships are established. Step 8: Merge the topological structures of the convex polyhedron objects of the left and right nodes through post-order traversal; Step 9: Post-order traversal, repeating the operation of step 8 until the merged convex polyhedron is passed to the root node. The topology of this convex polyhedron object is the convex polyhedron of the loaded point set, resulting in the final convex polyhedron model for the object to be modeled in industry.

2. The deterministic complex polyhedron modeling method according to claim 1, characterized in that, If the object to be modeled is a concave polyhedron, the connection relationship of the vertices of the convex polyhedron can be re-established by replacing the complementary faces of the tetrahedrons with convex polyhedra and retopologically re-establishing the free points, thereby generating a concave polyhedron with grooves.

3. The deterministic complex polyhedron modeling method according to claim 1, characterized in that, Divide and conquer pruning is performed on a vertex array storing n vertices, including: Step 2.1: Construct the node structure of the spatial binary tree. This structure contains the start and end positions of the corresponding node in the vertex array, thereby creating a sub-vertex array without having to allocate new memory. The structure also contains the corresponding spatial boundary and convex polyhedron object. Step 2.2: Construct a spatial binary tree using a preorder recursive approach. Sort the vertex array corresponding to each node in ascending order of the vertex coordinates x, y, z, and use the vertex array split point index mid for binary search. Step 2.3: Following the vertex array partitioning method in Step 2.2, allocate memory for the left and right nodes. The starting position value of the left node remains unchanged, and the ending position value is updated to mid. The starting position value of the right node is updated to mid+1, and the ending position value remains unchanged. Step 2.4: Update the spatial boundaries of the left and right nodes using the value of the dividing point mid after the corresponding sorting of the array as the boundary. Step 2.5: If the spatial boundaries of the left and right nodes contain any of the spatial boundaries of the root node, then keep it; otherwise, prune it. Step 2.6: The termination condition for constructing the binary tree is that the length of the corresponding vertex subarray in the leaf node is less than or equal to 4. If the vertices of the corresponding vertex subarray of the leaf node are not coplanar, then memory for a convex polyhedron object is allocated, and the convex polyhedron object is constructed from the vertices of the corresponding vertex subarray. If the termination condition is not met, proceed to step 2.

2.

4. The deterministic complex polyhedron modeling method according to claim 1, characterized in that, The specific process of merging the topological structure of the convex polyhedron object with left and right nodes through post-order traversal is as follows: Step 8.1: Perform sign judgment between the vertices on the convex polyhedron object of the right node and the faces on the convex polyhedron object of the left node, and delete all faces that are positive. If all faces on the convex polyhedron object of the left node are deleted, then expand the convex polyhedron of the right node with all vertices on the left according to step 7. Step 8.2: If not all faces on the convex polyhedron object of the left node in Step 8.1 have been deleted, then perform boundary propagation on any triangular face of the remaining faces of the convex polyhedron object of the left node. As long as the adjacent face is any of the faces that have not been deleted, the propagation will continue. If the boundary is touched, the boundary line will be recorded using key-value pairs. This way, the boundary line of an island face can be recorded. Here, a set of faces with adjacent edges is called an island face. If the faces that have not been deleted can form two or more island faces, then only the boundary line of an island face is recorded, which is called the left-cut boundary loop, which is rotated counterclockwise. The remaining island faces are deleted. Then, the vertices on the left-cut boundary loop are used to determine the sign of the faces on the right polyhedron. All faces that are determined to be positive are deleted. If all faces on the convex polyhedron object of the right node are deleted, then the deleted faces on the convex polyhedron object of the left node are completed. All vertices of the convex polyhedron object of the right node are used to expand the convex polyhedron object of the left node according to Step 7. Step 8.3: If not all faces on the convex polyhedron object of the right node were deleted in Step 8.2, then perform boundary spread on any triangular face among the remaining faces of the convex polyhedron object of the right node. If it touches the boundary, record the boundary line, thus recording the boundary line of an isolated face. If the remaining faces can form two or more isolated faces, then only record the boundary line of an isolated face, which is called the right tangent boundary loop, which wraps around clockwise, and delete the remaining isolated faces. Step 8.4: Bridge the left and right tangent boundary rings obtained in steps 8.2 and 8.

3. Both left and right tangent boundary rings are stored using a hash table data structure. Proceed to step 8.

5. Step 8.5: Starting from one edge of the left tangent boundary ring, search for a point on the right tangent boundary ring. If the positive point condition is not met, continue searching for a point. If it is met, check if the starting edge condition is met. If the starting edge condition is not met, the left tangent boundary ring jumps to the next edge and returns to step 8.

5. If the starting edge condition is met, construct the first positive bridging triangle face and return to step 8.

6. Step 8.6: Jump to the next edge from the left tangent boundary loop. Start searching for a point from the previous point of the right tangent boundary loop. If the point condition is not met, continue searching for a point. If the point condition is met, construct the bridging triangle face according to step 8.7 until the end point of the edge coincides with the starting point of the starting edge, and then go to step 8.

13. Step 8.7: Construct a bridging triangle face using the edges on the left tangent boundary ring and the points on the right tangent boundary ring. If the bridging triangle does not satisfy the positive and negative edge conditions, proceed to step 8.

8. If it satisfies the positive and negative edge conditions, proceed to step 8.

9. Step 8.8: Construct a complementary triangle face using the edge on the left-cut boundary ring and its next point, update the edge on the left-cut boundary ring as the new edge of the complementary triangle face, and go to step 8.7; Step 8.9: Construct a positive bridging triangle with the edge on the left tangent boundary ring and the positive point found on the right tangent boundary ring, and record the positive point. If the positive point does not coincide with the previous positive point, then the two positive bridging triangles have a common intersection point, called the secondary point. Then go to step 8.

10. If they coincide, go to step 8.

6. Step 8.10: Construct an edge using the vertex between the current point and the previous point. Start an edge from the previous point on the right-cut boundary ring and construct a bridging triangle with the secondary point of the positive bridging triangle corresponding to the two points. If the positive and secondary edge conditions are not met, go to step 8.11; if they are met, go to step 8.

12. Step 8.11: Construct a secondary complementary triangle face using the edge on the right-cut boundary ring and its next point, update the edge on the right-cut boundary ring as the new edge of the secondary complementary triangle face, and go to step 8.10; Step 8.12: Construct a secondary bridging triangle face using the edges on the right-cut boundary ring and the secondary point, then proceed to step 8.6; Step 8.13: After the left and right tangent boundary loops are bridged, a convex polyhedron is constructed. Then, the convex polyhedron is expanded incrementally using the points in the connected region between the left and right tangent boundary loops of the deleted face. Step 8.14: Merge the two convex polyhedra into one convex polyhedron and pass it to the corresponding current node in the binary tree.

5. The deterministic complex polyhedron modeling method according to claim 4, characterized in that, The entire bridging process involves four conditions: First, the positive point condition: the two adjacent vertices of the point on the right tangent boundary ring are both inside the bridging triangle face; the found point is called the positive point. Second, the secondary point condition: if two adjacent positive points do not coincide, the intersection of the two positive points and the corresponding positive bridging triangles is called the secondary point, which falls on the left tangent boundary ring. Third, the starting edge condition: the two adjacent points of the corresponding edge of the first positive bridging triangle on the left tangent boundary ring are both inside the bridging triangle. Fourth, the positive and secondary edge condition: the next adjacent point of the corresponding edge on the left and right tangent boundary rings is inside the bridging triangle; the edge on the left tangent boundary ring is called the positive edge, and the edge on the right tangent boundary ring is called the secondary edge.