Region determination method and electronic equipment
By judging the target vertex in the denture model based on the number of collisions between vertex calculation points and polygon patches, the problem of insufficient accuracy in determining the area of the denture model in the prior art is solved, and higher accuracy and flexibility are achieved.
Patent Information
- Application Number
- CN202410897321.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-10-29
AI Technical Summary
The existing denture model area determination method does not have high accuracy when dealing with complex shapes or fine structures, resulting in large deviations in the judgment of unprocessable areas.
By determining the number of collisions based on the calculation points of each vertex and the polygonal patches in the denture model, setting a preset threshold, and determining the target vertex when the number is greater than the threshold, avoiding the simplified model to directly determine the target area.
It improves the accuracy of the target area, reduces the deviation of the unprocessable area, and is suitable for denture models of different shapes and sizes without setting different parameters for each model.
Smart Images

Figure CN118864765A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical technology, and in particular to a region determination method and electronic equipment. Background Art
[0002] Teeth are an important part of the human body and play a vital role in maintaining chewing function and facial shape. However, due to disease, injury or aging, people often need to use dentures to repair or replace teeth.
[0003] In the existing denture production process, the denture is generally designed first to obtain a virtual denture model, and then the denture is processed by processing equipment based on the denture model. However, when processing the denture using processing equipment, if the groove of the denture is too deep or narrow, the processing head of the processing equipment may not be able to reach it, so it is necessary to determine the non-processable area on the denture model.
[0004] In the existing region determination methods, when processing a denture model, it is often necessary to simplify the denture model and then calculate the target region on the simplified denture model, where the target region is the non-machinable region in the denture model.
[0005] However, the processing accuracy cannot be guaranteed by simplifying the denture model. When the denture model has a complex shape or fine structure, the processing accuracy of the existing area determination method is not high, which may cause large deviations in the determined target area. Summary of the invention
[0006] In response to the shortcomings of the prior art, the present application provides a region determination method and electronic device, which determines the number of polygonal facets colliding with each calculation point based on the calculation point corresponding to each vertex and all polygonal facets in the denture model, and when the number of polygonal facets colliding with the calculation point is greater than a first preset threshold, the vertex corresponding to the calculation point is determined as a target vertex belonging to the target area on the denture model. Each vertex in the denture model can be judged without simplifying the denture model, thereby improving the accuracy of the determined target area and making the deviation of the target area smaller.
[0007] To solve the above problems, the present invention provides the following technical solutions:
[0008] In a first aspect, an embodiment of the present application provides a region determination method, comprising: obtaining a denture model, wherein the denture model is a three-dimensional model composed of a plurality of polygonal facets, each of the polygonal facets comprising a plurality of vertices;
[0009] Determine a calculation point corresponding to each vertex based on each vertex and a preset distance;
[0010] Determine the number of the polygonal patches colliding with each of the calculated points based on the calculated points corresponding to each of the vertices and all of the polygonal patches in the denture model;
[0011] When the number of the polygonal facets colliding with the calculation point is greater than a first preset threshold, determining the vertex corresponding to the calculation point as a target vertex belonging to the target area on the denture model, and obtaining a plurality of the target vertices;
[0012] The target area on the denture model is determined based on a plurality of the target vertices.
[0013] In some embodiments, determining the number of the polygonal facets colliding with each of the calculated points based on the calculated points corresponding to each of the vertices and all of the polygonal facets in the denture model comprises:
[0014] Constructing a corresponding bounding unit for each of the polygonal face patches;
[0015] Determine the polygonal patch colliding with each of the calculation points based on each of the calculation points and all of the bounding cells;
[0016] The number of the polygonal patches that collide with each calculation point is obtained by counting.
[0017] In some implementations, determining the polygonal patch colliding with each of the calculation points based on each of the calculation points and all of the bounding units includes:
[0018] Sorting the enclosing units according to a preset sorting rule to obtain a plurality of leaf nodes in the search tree;
[0019] Combining the leaf nodes according to a preset combination rule to obtain a plurality of child nodes in the search tree;
[0020] Combining the multiple child nodes to obtain a root node in the search tree;
[0021] Determine the search tree according to the leaf nodes, the child nodes and the root node;
[0022] The polygonal patch colliding with each of the calculation points is determined based on the search tree, each of the leaf nodes in the search tree, the child nodes, the root node, and each of the calculation points.
[0023] In some embodiments, the enclosing unit of the polygonal patch is a polyhedron containing the polygonal patch, and the polyhedron is composed of multiple corner points. The enclosing units are sorted according to a preset sorting rule to obtain multiple leaf nodes in the search tree, including:
[0024] Determine a center point of a bounding unit of the polygonal face based on the coordinates of the plurality of corner points, wherein the center point has coordinates on a first coordinate axis;
[0025] The enclosing units of all the polygonal facets are sorted according to the coordinates of each of the central points on the first coordinate axis to obtain a plurality of leaf nodes in the search tree.
[0026] In some implementations, the root node has a plurality of subordinate child nodes, each of the child nodes has a plurality of subordinate child nodes or subordinate leaf nodes, and the step of determining the polygonal facets colliding with each of the calculation points based on the search tree, each of the leaf nodes, the child nodes, the root node, and each of the calculation points in the search tree comprises:
[0027] For each of the calculation points, when the calculation point is located within the root node, all child nodes of the root node are pushed into a stack;
[0028] For each node in the stack, when the calculation point is located in the current node, all child nodes or leaf nodes of the current node are pushed into the stack and the current node is popped out of the stack; when the calculation point is not located in the current node, the current node is popped out of the stack;
[0029] When the current node is a leaf node, judging whether the calculation point collides with the polygonal facet corresponding to the current leaf node based on the calculation point and the polygonal facet corresponding to the current leaf node;
[0030] When the calculation point collides with the polygonal patch corresponding to the current leaf node, the polygonal patch corresponding to the current leaf node is determined as one of the polygonal patches colliding with the calculation point;
[0031] Pop the current leaf node from the stack;
[0032] Return to the execution step. When the calculation point is located in the current node, all child nodes or leaf nodes of the current node are pushed into the stack. When the calculation point is not located in the current node, the current node is popped out of the stack until there are no nodes in the stack, thereby obtaining the polygonal facets that collide with each calculation point.
[0033] In some embodiments, determining the number of the polygonal facets colliding with each of the calculated points based on the calculated points corresponding to each of the vertices and all of the polygonal facets in the denture model comprises:
[0034] Calculate the projection point of the calculation point corresponding to each vertex on the plane where each polygonal facet to be detected is located;
[0035] Determine whether the projection point is within the polygonal patch;
[0036] When the projection point is within the polygonal patch, calculating the distance from the projection point to each edge of the polygonal patch;
[0037] When the shortest distance from the projection point to each edge of the polygonal patch is less than the preset distance, the polygonal patch is determined as a polygonal patch that collides with the calculation point;
[0038] When the projection point is outside the polygonal patch, calculating the distance from the calculation point to each edge of the polygonal patch;
[0039] When the shortest distance between the calculation point and each edge of the polygonal patch is less than the preset distance, the polygonal patch is determined as a polygonal patch that collides with the calculation point;
[0040] The number of the polygonal patches that collide with each calculation point is obtained by counting.
[0041] In some embodiments, the polygonal patch is a triangular patch consisting of three vertices, the polygonal patch includes a first vertex, a second vertex, and a third vertex, and determining whether the projection point is within the polygonal patch includes:
[0042] Taking the projection point as the starting point and the first vertex as the end point, construct a first vector;
[0043] Taking the projection point as the starting point and the second vertex as the end point, construct a second vector;
[0044] Taking the projection point as the starting point and the third vertex as the end point, construct a third vector;
[0045] When the first vector, the second vector and the third vector satisfy a first preset condition, determining that the projection point is within the polygonal patch;
[0046] When the first vector, the second vector and the third vector do not satisfy the first preset condition, it is determined that the projection point is not within the polygonal patch.
[0047] In some embodiments, the target area is composed of a plurality of sub-areas, and determining the target area on the denture model based on the plurality of target vertices comprises:
[0048] Classifying the target vertex based on a plurality of preset thresholds and the number of the polygonal facets colliding with the target vertex to obtain a plurality of types of target vertices, wherein the plurality of preset thresholds include the first preset threshold;
[0049] Determine a sub-region corresponding to each type of target vertex based on each type of target vertex, and obtain multiple sub-regions corresponding to the multiple types of target vertices;
[0050] The target area on the denture model composed of the multiple sub-areas is obtained.
[0051] In some embodiments, each of the multiple sub-regions corresponds to a color, and the multiple sub-regions correspond to different colors. After obtaining the target region on the denture model composed of the multiple sub-regions, the method further includes:
[0052] Each sub-region in the target region is displayed on the denture model using a color corresponding to the sub-region.
[0053] In a second aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
[0054] at least one processor; and,
[0055] a memory communicatively connected to the at least one processor; wherein,
[0056] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the area determination method as described in the first aspect.
[0057] The present application provides an area determination method and an electronic device. The present application determines the number of polygonal faces colliding with each calculation point based on the calculation point corresponding to each vertex and all polygonal faces in the denture model, and when the number of polygonal faces colliding with the calculation point is greater than a first preset threshold, the vertex corresponding to the calculation point is determined as a target vertex belonging to a target area on the denture model. Each vertex in the denture model can be judged without simplifying the denture model, and the accuracy of processing the denture model can be improved, thereby improving the accuracy of the target area. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a flowchart of the area determination method provided in an embodiment of the present application.
[0059] Figure 2 yes Figure 1 Detailed flowchart of step S300.
[0060] Figure 3 yes Figure 2 Detailed flowchart of step S320 in FIG.
[0061] Figure 4 It is a schematic diagram of the search tree provided in the embodiment of the present application.
[0062] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0064] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0065] The present application provides a region determination method and electronic device, which determines the number of polygonal patches colliding with each calculation point based on the calculation point corresponding to each vertex and all polygonal patches in the denture model, and when the number of polygonal patches colliding with the calculation point is greater than a first preset threshold, determines the vertex corresponding to the calculation point as a target vertex belonging to the target region on the denture model, and can judge each vertex in the denture model without simplifying the denture model, and can improve the accuracy of processing the denture model, thereby improving the accuracy of the target region. In addition, in the prior art, different algorithms need to be used to process denture models of different shapes and sizes, and different parameters need to be set according to different algorithms, while the region determination method provided in the embodiment of the present application does not need to set parameters for each denture model separately, and can flexibly process denture models of different shapes and sizes.
[0066] The area determination method provided by the present application will be described in detail below with reference to the accompanying drawings.
[0067] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of the region determination method provided in the embodiment of the present application. Figure 1 As shown, the area determination method includes: steps S100 to S500.
[0068] Step S100: Obtain a denture model.
[0069] In some embodiments, the denture model is a designed three-dimensional model, and the denture model is used for restoring or replacing teeth of a target object.
[0070] Optionally, the target object is any organism having teeth, such as a human or a dog.
[0071] In some embodiments, the denture model is a three-dimensional model composed of a plurality of polygonal patches, each of which includes a plurality of vertices.
[0072] In some embodiments, the polygon includes a triangle, a rectangle, a pentagon, a hexagon, or the like.
[0073] Furthermore, when the polygon is a triangle, because other polygons, such as rectangles, pentagons or hexagons, can be decomposed into multiple triangles, the polygonal patch is a triangular patch. Compared with the polygonal patch being other polygons, the processing of the denture model is more refined and the amount of calculation can be reduced.
[0074] In some embodiments, the denture model is a mesh model, which is composed of a plurality of triangular facets, each of which has three vertices.
[0075] In some embodiments, each polygonal patch in the denture model has a normal vector, and each vertex has a corresponding normal vector.
[0076] Optionally, the normal vector corresponding to the vertex is the average vector of the facets around the vertex.
[0077] In some embodiments, there are multiple denture models, and the region determination method in the embodiment of the present application is performed on each denture model to determine the target region for each denture model.
[0078] In some embodiments, when a processing device is used to process a denture, the processing head of the processing device may not be able to process certain areas of the denture. Therefore, by determining the calculation point corresponding to each vertex, it can be assumed that there is a corresponding processing head above each vertex, and it is determined whether the processing head can reach the vertex, and then it is determined whether the vertex belongs to the target area in the denture model. The target area is also the non-processable area, which can also be called the non-milling area.
[0079] Step S200: determining a calculation point corresponding to each vertex based on each vertex and a preset distance.
[0080] In some embodiments, the preset distance is determined according to a processing head of a processing device used to process the denture.
[0081] Optionally, the processing head is spherical or prismatic, etc.
[0082] Optionally, the preset distance is the distance from the center of the machining head to the surface of the machining head, for example, the preset distance is the spherical radius of a spherical machining head.
[0083] In some implementations, a point in a normal vector corresponding to a vertex and having a preset distance from the vertex is used as a calculation point corresponding to the vertex.
[0084] Step S300: Determine the number of polygonal patches colliding with each calculation point based on the calculation point corresponding to each vertex and all polygonal patches in the denture model.
[0085] In some implementations, collision detection is performed for each calculation point corresponding to each vertex to determine the number of polygonal facets that collide with the calculation point.
[0086] In some implementations, step S300 includes the following steps.
[0087] (1) Calculate the projection point of the calculation point corresponding to each vertex on the plane where each polygonal face to be detected is located.
[0088] As described above, collision detection is performed for the calculation point corresponding to each vertex, that is, collision detection is performed one by one for the calculation point corresponding to each vertex and all polygonal patches, and the polygonal patch to be detected is a polygonal patch that currently needs to be subjected to collision detection.
[0089] In some embodiments, a straight line passing through the calculation point corresponding to the vertex and parallel to the normal vector of the polygonal face to be detected is determined as the first straight line, and the first straight line is intersected with the plane where the polygonal face to be detected is located, and the intersection point obtained is the projection point.
[0090] (2) Determine whether the projection point is within the polygonal patch.
[0091] In some embodiments, the polygonal patch is a triangular patch consisting of three vertices, and the polygonal patch includes a first vertex, a second vertex, and a third vertex. Determining whether the projection point is within the polygonal patch includes the following steps (2.1) to (2.5).
[0092] (2.1) Construct the first vector with the projection point as the starting point and the first vertex as the end point.
[0093] (2.2) Construct the second vector with the projection point as the starting point and the second vertex as the end point.
[0094] (2.3) Construct the third vector with the projection point as the starting point and the third vertex as the end point.
[0095] (2.4) When the first vector, the second vector and the third vector satisfy the first preset condition, it is determined that the projection point is within the polygonal patch.
[0096] In some embodiments, a fourth vector is constructed with the first vertex as the starting point and the second vertex as the end point; a fifth vector is constructed with the second vertex as the starting point and the third vertex as the end point; and a sixth vector is constructed with the third vertex as the starting point and the first vertex as the end point.
[0097] In some implementations, the first preset condition is that the dot product value of the fourth vector and the first vector, the dot product value of the fifth vector and the second vector, and the dot product value of the sixth vector and the third vector are all greater than or equal to 0.
[0098] In some embodiments, the polygonal patch may not be a triangular patch.
[0099] In some embodiments, the projection point is connected to each vertex of the corresponding polygonal patch to be detected to obtain multiple sub-patches, each sub-patch includes the projection point and two vertices among all the vertices of the polygonal patch, and the first preset condition is: the total area of the multiple sub-patches is less than or equal to the area of the polygonal patch.
[0100] (2.5) When the first vector, the second vector and the third vector do not satisfy the first preset condition, it is determined that the projection point is not within the polygonal patch.
[0101] As described above, step S300 includes steps (1) calculating the projection point of the calculation point corresponding to each vertex on the plane where each polygonal face to be detected is located, (2) determining whether the projection point is within the polygonal face, and also includes the following steps (3) to (7).
[0102] Step (3) in step S300: when the projection point is within the polygonal patch, calculate the distance from the projection point to each edge of the polygonal patch.
[0103] (4) When the shortest distance from the projection point to each edge of the polygonal patch is less than a preset distance, the polygonal patch is determined as a polygonal patch that collides with the calculation point.
[0104] Optionally, when the shortest distance from the projection point to each edge of the polygonal patch is less than a preset distance, it indicates that the machining head corresponding to the calculation point will collide with the polygonal patch, and the polygonal patch is determined as a polygonal patch that collides with the calculation point.
[0105] (5) When the projection point is outside the polygonal patch, calculate the distance from the calculation point to each edge of the polygonal patch.
[0106] (6) When the shortest distance from the calculation point to each edge of the polygonal patch is less than a preset distance, the polygonal patch is determined as a polygonal patch that collides with the calculation point.
[0107] (7) Count the number of polygonal faces that collide with each calculation point.
[0108] In some implementations, for each calculation point, the number of polygonal patches colliding with the calculation point is counted.
[0109] See also Figure 2 , Figure 2 yes Figure 1 Detailed flow chart of step S300 in FIG. Figure 2 As shown, step S300 includes: step S310 to step S330.
[0110] Step S310: construct a corresponding bounding unit for each polygonal face.
[0111] Optionally, the bounding unit is a bounding box, which is the smallest geometric body including the corresponding polygonal facet.
[0112] Optionally, the bounding box is a regular geometric body, such as a cuboid or a sphere.
[0113] Optionally, methods for determining the bounding box of the polygonal face include the minimum bounding rectangle (MBR) method, the axis-aligned bounding box (AABB) method, the oriented bounding box (OBB) method, and the sphere-shell bounding box (Sphere-Shell Bounding Box) method.
[0114] In the above manner, there is no need to perform collision detection on each calculation point and all polygonal patches first. Instead, collision detection is performed on the calculation point and all enclosing units first. If a collision occurs, collision detection is then performed on the polygonal patches. Because the enclosing units are regular geometric bodies, the calculation amount of collision detection can be greatly reduced, thereby improving the processing speed.
[0115] Step S320: Determine the polygonal patch colliding with each calculation point based on each calculation point and all bounding cells.
[0116] See also Figure 3 , Figure 3 yes Figure 2 Detailed flow chart of step S320 in FIG. Figure 3 As shown, step S320 includes: step S321 to step S325.
[0117] Step S321: Sort the enclosing units according to a preset sorting rule to obtain a plurality of leaf nodes in the search tree.
[0118] Optionally, the preset sorting rule is to sort the enclosing units according to the center points of the enclosing units.
[0119] In some embodiments, the enclosing unit of the polygonal patch is a polyhedron containing the polygonal patch, and the polyhedron is composed of multiple corner points.
[0120] Optionally, a corresponding class function is constructed for the enclosing unit to facilitate subsequent calculations.
[0121] Optionally, the class function of each bounding cell includes coordinates of multiple corner points.
[0122] In some embodiments, step S321 includes the following steps.
[0123] (1) Determine the center point of the bounding unit of the polygonal patch based on the coordinates of multiple corner points.
[0124] The center point has coordinates on the first coordinate axis.
[0125] Optionally, the first coordinate axis is any one of the X-axis, the Y-axis or the Z-axis.
[0126] In some embodiments, the enclosing unit is a rectangular enclosing box having 8 corner points, and the average coordinate point of the first corner point and the second corner point among the 8 corner points is used as the center point of the enclosing unit. Among the 8 corner points, the coordinate value of the first corner point on the first coordinate axis is the smallest, and the coordinate value of the second corner point on the first coordinate axis is the largest.
[0127] In some embodiments, the enclosing unit is a spherical enclosing box, and the center point of the enclosing unit is the center of the spherical enclosing box.
[0128] Optionally, the class function of each bounding cell includes the coordinates of a center point.
[0129] (2) Sort the bounding cells of all polygonal patches according to the coordinates of each center point on the first coordinate axis to obtain multiple leaf nodes in the search tree.
[0130] In some embodiments, the center point of the enclosing unit corresponds to the enclosing unit, and the enclosing units of all polygonal faces are sorted in ascending or descending order according to the coordinates of each center point on the first coordinate axis to obtain multiple leaf nodes in the search tree.
[0131] Optionally, a leaf node sequence is constructed according to the order of the bounding units of all polygonal patches, and each leaf node is a bounding unit of one polygonal patch.
[0132] Step S322: Combine the leaf nodes according to a preset combination rule to obtain multiple child nodes in the search tree.
[0133] In some implementations, the search tree is a binary tree, a B-tree, a B+ tree, a KD tree, or the like.
[0134] In some implementations, the corresponding preset combination rule is determined according to the type of the search tree.
[0135] In some embodiments, the search tree is a binary tree, and the preset combination rule is that in the leaf node sequence, starting from the first leaf node, every two adjacent leaf nodes are combined into one child node to obtain a child node sequence. The combined leaf nodes are no longer involved in the combination.
[0136] See also Figure 4 , Figure 4 Schematic diagram of the search tree provided in the embodiment of the present application. Figure 4 As shown, search tree 1 is a binary tree, node 1, node 2, node 3, node 4, node 5 and node 6 are leaf nodes, node 7, node 8, node 9 and node 11 are child nodes, and node 10 is the root node. Figure 4 Ellipses indicate omitted nodes.
[0137] like Figure 4 As shown, optionally, node 1 and node 2 are combined into node 7, node 3 and node 4 are combined into node 8, and node 5 and node 6 are combined into node 9.
[0138] In some implementations, when the number of leaf nodes is odd, the last three leaf nodes of the leaf node sequence may be combined, and the same is true when the number of child nodes is odd.
[0139] In some implementations, each child node has multiple subordinate child nodes or subordinate leaf nodes.
[0140] like Figure 4 As shown, optionally, node 7 has two subordinate leaf nodes, namely node 1 and node 2. Node 11 has two subordinate child nodes, namely node 7 and node 8.
[0141] Optionally, each child node is composed of all subordinate child nodes or subordinate leaf nodes, that is, the child node is the union of the spaces occupied by all subordinate child nodes or subordinate leaf nodes.
[0142] Exemplarily, node 7 is the union of spaces occupied by node 1 and node 2, node 8 is the union of spaces occupied by node 3 and node 4, and node 11 is the union of spaces occupied by node 7 and node 8.
[0143] Step S323: Combine multiple child nodes to obtain a root node in the search tree.
[0144] In some implementations, in a sub-node sequence, every two adjacent sub-nodes are combined into one upper-level sub-node until a root node is finally obtained. Sub-nodes that have been combined are no longer involved in the combination.
[0145] In some implementations, a root node has multiple subordinate child nodes.
[0146] Optionally, a root node consists of all subordinate child nodes.
[0147] Because each child node is the union of the spaces occupied by all subordinate child nodes or subordinate leaf nodes, and a leaf node is an enclosing unit of one polygonal patch, the root node includes all polygonal patches, that is, the root node includes the entire denture model.
[0148] like Figure 4 As shown, optionally, the search tree 1 finally obtained includes a node 10 .
[0149] Step S324: Determine the search tree based on the leaf nodes, child nodes and root node.
[0150] Optionally, the position of each node in the search tree is determined according to the process of combining nodes.
[0151] Optionally, each node in the search tree has a unique corresponding ID, and the ID of the node indicates the position of the node in the search tree.
[0152] Optionally, the class function of each enclosing unit includes information related to the search tree, such as the ID of the corresponding polygon patch, the ID of the leaf node in the search tree, and the ID of the parent child node of the leaf node. In this way, it is convenient to perform collision detection on the calculation point and all enclosing units according to the search tree.
[0153] In some implementations, collision detection is performed between the computation point and all surrounding cells according to the search tree.
[0154] Step S325: Determine the polygonal patch that collides with each calculation point based on the search tree, each leaf node, child node, root node and each calculation point in the search tree.
[0155] In some embodiments, step S325 includes the following steps.
[0156] (1) For each calculation point, when the calculation point is located in the root node, all child nodes of the root node are pushed into the stack.
[0157] (2) For each node in the stack, when the calculation point is located in the current node, all child nodes or leaf nodes of the current node are pushed into the stack and the current node is popped out of the stack; when the calculation point is not located in the current node, the current node is popped out of the stack.
[0158] (3) When the current node is a leaf node, determine whether the calculated point collides with the polygonal patch corresponding to the current leaf node based on the calculated point and the polygonal patch corresponding to the current leaf node.
[0159] Optionally, the method for determining whether the calculated point collides with the polygonal face corresponding to the current leaf node is as described above.
[0160] (4) When the calculation point collides with the polygonal patch corresponding to the current leaf node, the polygonal patch corresponding to the current leaf node is determined as a polygonal patch that collides with the calculation point.
[0161] (5) Pop the current leaf node from the stack.
[0162] (6) Return to step (2) until there are no nodes in the stack, and obtain the polygonal facets that collide with each calculation point.
[0163] Step S330: Count and obtain the number of polygonal patches that collide with each calculation point.
[0164] Through the above method, first, there is no need to perform collision detection on each calculation point and all polygonal patches first, but collision detection is performed on the calculation point and all surrounding units first, and if a collision occurs, collision detection is then performed on the polygonal patches, which can greatly reduce the amount of calculation; second, a search tree is used. When the calculation point is not located in the current node, the current node is popped out of the stack, so there is no need to determine whether the calculation point is located in a subordinate child node or a subordinate leaf node of the current node, which can further reduce the amount of calculation, thereby further improving the processing speed.
[0165] In some implementations, the above region determination method may be executed in a computer using a parallel computing method.
[0166] In some implementations, the region determination method is performed by using OpenCL (Open Computing Language) in a parallel computing method. OpenCL is a cross-platform parallel programming framework that supports parallel computing, that is, executing multiple tasks simultaneously.
[0167] Optionally, a work item is created for each calculation point, and a search tree is used to perform multi-threaded calculations on each work item.
[0168] In this way, the computer can process multiple work items at the same time, thereby further improving the processing speed.
[0169] In some implementations, a search tree may not be constructed, and collision detection may be performed one by one between each calculation point and the enclosing units corresponding to all polygonal patches. This approach has no effect on processing accuracy.
[0170] In some implementations, a search tree and bounding cells may not be constructed, and collision detection may be performed on each calculation point and all polygonal patches one by one.
[0171] Step S400: When the number of polygonal facets colliding with the calculation point is greater than a first preset threshold, the vertex corresponding to the calculation point is determined as a target vertex belonging to the target area on the denture model, and a plurality of target vertices are obtained.
[0172] In some embodiments, when the number of polygonal facets colliding with the calculation point is greater than a first preset threshold, it indicates that the area where the vertex corresponding to the calculation point is located may be relatively narrow and thus cannot be processed by the processing head, so the vertex corresponding to the calculation point is determined as the target vertex belonging to the target area on the denture model.
[0173] In some embodiments, the first preset threshold is greater than 5, for example, the first preset threshold is 5, 6, 7, 8, 9, 10 or 15, etc.
[0174] Step S500: determining a target area on the denture model based on a plurality of target vertices.
[0175] In some embodiments, a plurality of target patches including the plurality of target vertices are determined based on the set of the plurality of target vertices, and the set of the plurality of target patches is used as the target region on the denture model.
[0176] In some embodiments, the target region is composed of multiple sub-regions.
[0177] In some implementations, the number of polygonal facets colliding with each calculation point is different, indicating that the narrowness of the region where the vertex corresponding to the calculation point is located is different, and multiple sub-regions of the target region can be determined and displayed separately.
[0178] In some implementations, step S500 includes the following steps.
[0179] (1) Based on multiple preset thresholds and the number of polygonal patches colliding with the target vertex, the target vertex is classified to obtain multiple types of target vertices.
[0180] The multiple preset thresholds include a first preset threshold.
[0181] In some implementations, the number of the plurality of preset thresholds is greater than 2, such as 2, 3, 4, or 5.
[0182] In some embodiments, the multiple preset thresholds include a first preset threshold, a second preset threshold, and a third preset threshold, the multiple types of first vertices include a second vertex, a third vertex, and a fourth vertex, and step (1) includes the following steps (1) to (3).
[0183] (1) When the number of polygonal facets colliding with the first vertex is greater than a first preset threshold and less than a second preset threshold, the first vertex is determined as the second vertex.
[0184] The second preset threshold is greater than the first preset threshold. For example, the first preset threshold is 9, and the second preset threshold is 15.
[0185] (2) When the number of polygonal facets colliding with the first vertex is greater than the second preset threshold and less than the third preset threshold, the first vertex is determined as the third vertex.
[0186] The third preset threshold is greater than the second preset threshold. For example, the first preset threshold is 15, and the second preset threshold is 20.
[0187] (3) When the number of polygonal facets colliding with the first vertex is greater than a third preset threshold, the first vertex is determined as the fourth vertex.
[0188] Step (2) in step S500: based on each type of target vertex, determine a sub-region corresponding to each type of target vertex, and obtain multiple sub-regions corresponding to multiple types of target vertices.
[0189] In some implementations, based on each type of target vertex, a patch of the sub-region corresponding to each type of target vertex is determined, and a set of patches of the sub-region is determined as a sub-region.
[0190] (3) Obtaining a target area on the denture model consisting of multiple sub-areas.
[0191] As described above, the target region is composed of multiple sub-regions. After the multiple sub-regions are determined, the target region is obtained.
[0192] In some embodiments, each of the multiple sub-regions corresponds to a color, and the colors corresponding to the multiple sub-regions are different. After obtaining the target region composed of the multiple sub-regions on the denture model in step (3), the method further includes: displaying each sub-region on the denture model using the color corresponding to each sub-region in the target region.
[0193] In some implementations, the greater the number of polygonal patches whose vertices collide in a sub-region, the darker the color corresponding to the sub-region, indicating that the sub-region is more unprocessable.
[0194] By means of the above method, the unprocessable degree of each sub-region can be displayed, thereby improving the intuitiveness of the target region.
[0195] In some embodiments, after determining the target area on the denture model, the user may choose to replace a processing head with a higher processing accuracy or modify the denture model.
[0196] In some embodiments, when the teeth of the target object need to be polished, a tooth model in the oral scan data of the target object may be obtained, and the target area on the tooth model may be determined using the area determination method described above.
[0197] Optionally, after determining the target area on the tooth model, the user may select a suitable grinding tool to grind the teeth of the target subject.
[0198] In summary, the region determination method provided in the embodiment of the present application has the following advantages:
[0199] 1. By determining the number of polygonal patches colliding with each calculation point based on the calculation point corresponding to each vertex and all polygonal patches in the denture model, and when the number of polygonal patches colliding with the calculation point is greater than a first preset threshold, the vertex corresponding to the calculation point is determined as the target vertex belonging to the target area on the denture model, each vertex in the denture model can be judged without simplifying the denture model, thereby improving the accuracy of the determined target area and making the deviation of the target area smaller. In addition, in the prior art, different algorithms need to be used to process denture models of different shapes and sizes, and different parameters need to be set according to different algorithms. The area determination method provided in the embodiment of the present application does not need to set parameters for each denture model separately, and can flexibly process denture models of different shapes and sizes.
[0200] 2. By constructing a corresponding enclosing unit for each polygonal face and determining the search tree method, first, there is no need to first perform collision detection on each calculation point and all polygonal faces, but first perform collision detection on the calculation point and all enclosing units. If a collision occurs, then perform collision detection on the polygonal faces, which can greatly reduce the amount of calculation; second, when the calculation point is not located in the current node, the current node is popped out of the stack, so there is no need to determine whether the calculation point is located in the subordinate child node or subordinate leaf node of the current node, which can further reduce the amount of calculation, thereby further improving the processing speed; third, the above method can be executed using parallel computing methods, and the computer can process multiple work items at the same time, thereby further improving the processing speed.
[0201] See also Figure 5 , Figure 5 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 400 includes: one or more processors 410 and a memory 420, Figure 5 A processor 410 is taken as an example.
[0202] In some implementations, the processor 410 and the memory 420 may be connected via a bus or other means. Figure 5The example of connecting through bus is taken in the following.
[0203] In some embodiments, the processor 410 is used to obtain a denture model, wherein the denture model is a three-dimensional model composed of multiple polygonal patches, each polygonal patch including multiple vertices; determining a calculation point corresponding to each vertex based on each vertex and a preset distance; determining the number of polygonal patches colliding with each calculation point based on the calculation point corresponding to each vertex and all polygonal patches in the denture model; when the number of polygonal patches colliding with the calculation point is greater than a first preset threshold, determining the vertex corresponding to the calculation point as a target vertex belonging to a target area on the denture model, and obtaining multiple target vertices; and determining a target area on the denture model based on the multiple target vertices.
[0204] In some embodiments, the memory 420, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules of the area determination method in the embodiment of the present application. The processor 410 executes various functional applications and data processing of the electronic device 400 by running the non-volatile software programs, instructions and modules stored in the memory 420, that is, implements the area determination method of the above method embodiment.
[0205] In some embodiments, the memory 420 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device 400, etc. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 420 may optionally include a memory remotely arranged relative to the processor 410, and these remote memories may be connected to the controller via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0206] In some embodiments, one or more modules are stored in the memory 420, and when executed by one or more processors 410, the region determination method in any of the above method embodiments is executed, for example, the region determination method described above is executed. Figure 1 Method steps 100 to 500 in.
[0207] In summary, the present application provides a region determination method and electronic device, the region determination method comprising obtaining a denture model, wherein the denture model is a three-dimensional model composed of a plurality of polygonal patches, each of which includes a plurality of vertices; determining a calculation point corresponding to each vertex based on each vertex and a preset distance; determining the number of polygonal patches colliding with each calculation point based on the calculation point corresponding to each vertex and all polygonal patches in the denture model; when the number of polygonal patches colliding with the calculation point is greater than a first preset threshold, determining the vertex corresponding to the calculation point as a target vertex belonging to a target region on the denture model, and obtaining a plurality of target vertices; determining a target region on the denture model based on the plurality of target vertices. The present application determines the number of polygonal patches colliding with each calculation point based on the calculation point corresponding to each vertex and all polygonal patches in the denture model, and when the number of polygonal patches colliding with the calculation point is greater than a first preset threshold, determining the vertex corresponding to the calculation point as a target vertex belonging to a target region on the denture model, so that each vertex in the denture model can be judged, without simplifying the denture model, and can improve the accuracy of processing the denture model, thereby improving the accuracy of the target region.
[0208] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements 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 the present application.
Claims
1. A method for determining a region, characterized in that: include: Acquire a denture model, wherein the denture model is a three-dimensional model composed of a plurality of polygonal facets, each of which includes a plurality of vertices; Determine a calculation point corresponding to each vertex based on each vertex and a preset distance; Determine the number of the polygonal patches colliding with each of the calculated points based on the calculated points corresponding to each of the vertices and all of the polygonal patches in the denture model; When the number of the polygonal facets colliding with the calculation point is greater than a first preset threshold, determining the vertex corresponding to the calculation point as a target vertex belonging to the target area on the denture model, and obtaining a plurality of the target vertices; The target area on the denture model is determined based on a plurality of the target vertices.
2. The area determination method according to claim 1, characterized in that: The step of determining the number of the polygonal facets colliding with each of the calculation points based on the calculation points corresponding to each of the vertices and all of the polygonal facets in the denture model comprises: Constructing a corresponding bounding unit for each of the polygonal face patches; Determine the polygonal patch colliding with each of the calculation points based on each of the calculation points and all of the bounding cells; The number of the polygonal patches that collide with each calculation point is obtained by counting.
3. The area determination method according to claim 2, characterized in that: The step of determining the polygonal patch colliding with each of the calculation points based on each of the calculation points and all of the enclosing units comprises: Sorting the enclosing units according to a preset sorting rule to obtain a plurality of leaf nodes in the search tree; Combining the leaf nodes according to a preset combination rule to obtain a plurality of child nodes in the search tree; Combining the multiple child nodes to obtain a root node in the search tree; Determine the search tree according to the leaf nodes, the child nodes and the root node; The polygonal patch colliding with each of the calculation points is determined based on the search tree, each of the leaf nodes in the search tree, the child nodes, the root node, and each of the calculation points.
4. The area determination method according to claim 3, characterized in that: The enclosing unit of the polygonal patch is a polyhedron containing the polygonal patch, and the polyhedron is composed of multiple corner points. The enclosing units are sorted according to a preset sorting rule to obtain multiple leaf nodes in the search tree, including: Determine a center point of a bounding unit of the polygonal face based on the coordinates of the plurality of corner points, wherein the center point has coordinates on a first coordinate axis; The enclosing units of all the polygonal facets are sorted according to the coordinates of each of the central points on the first coordinate axis to obtain a plurality of leaf nodes in the search tree.
5. The area determination method according to claim 3, characterized in that: The root node has a plurality of subordinate child nodes, each of the child nodes has a plurality of subordinate child nodes or subordinate leaf nodes, and the polygonal facets colliding with each of the calculation points are determined based on the search tree, each of the leaf nodes, the child nodes, the root node, and each of the calculation points in the search tree, including: For each of the calculation points, when the calculation point is located within the root node, all child nodes of the root node are pushed into a stack; For each node in the stack, when the calculation point is located in the current node, all child nodes or leaf nodes of the current node are pushed into the stack and the current node is popped out of the stack; when the calculation point is not located in the current node, the current node is popped out of the stack; When the current node is a leaf node, judging whether the calculation point collides with the polygonal facet corresponding to the current leaf node based on the calculation point and the polygonal facet corresponding to the current leaf node; When the calculation point collides with the polygonal patch corresponding to the current leaf node, the polygonal patch corresponding to the current leaf node is determined as one of the polygonal patches colliding with the calculation point; Pop the current leaf node from the stack; Return to the execution step. When the calculation point is located in the current node, all child nodes or leaf nodes of the current node are pushed into the stack. When the calculation point is not located in the current node, the current node is popped out of the stack until there are no nodes in the stack, thereby obtaining the polygonal facets that collide with each calculation point.
6. The area determination method according to claim 1, characterized in that: The step of determining the number of the polygonal facets colliding with each of the calculation points based on the calculation points corresponding to each of the vertices and all of the polygonal facets in the denture model comprises: Calculate the projection point of the calculation point corresponding to each vertex on the plane where each polygonal facet to be detected is located; Determine whether the projection point is within the polygonal patch; When the projection point is within the polygonal patch, calculating the distance from the projection point to each edge of the polygonal patch; When the shortest distance from the projection point to each edge of the polygonal patch is less than the preset distance, the polygonal patch is determined as a polygonal patch that collides with the calculation point; When the projection point is outside the polygonal patch, calculating the distance from the calculation point to each edge of the polygonal patch; When the shortest distance between the calculation point and each edge of the polygonal patch is less than the preset distance, the polygonal patch is determined as a polygonal patch that collides with the calculation point; The number of the polygonal patches that collide with each calculation point is obtained by counting.
7. The area determination method according to claim 6, characterized in that: The polygonal patch is a triangular patch composed of three vertices, the polygonal patch includes a first vertex, a second vertex and a third vertex, and the determining whether the projection point is within the polygonal patch includes: Taking the projection point as the starting point and the first vertex as the end point, construct a first vector; Taking the projection point as the starting point and the second vertex as the end point, construct a second vector; Taking the projection point as the starting point and the third vertex as the end point, construct a third vector; When the first vector, the second vector and the third vector satisfy a first preset condition, determining that the projection point is within the polygonal patch; When the first vector, the second vector and the third vector do not satisfy the first preset condition, it is determined that the projection point is not within the polygonal patch.
8. The area determination method according to claim 1, characterized in that: The target area is composed of a plurality of sub-areas, and the target area on the denture model is determined based on the plurality of target vertices, including: Classifying the target vertex based on a plurality of preset thresholds and the number of the polygonal facets colliding with the target vertex to obtain a plurality of types of target vertices, wherein the plurality of preset thresholds include the first preset threshold; Determine a sub-region corresponding to each type of target vertex based on each type of target vertex, and obtain multiple sub-regions corresponding to the multiple types of target vertices; The target area on the denture model composed of the multiple sub-areas is obtained.
9. The area determination method according to claim 8, characterized in that: Each of the multiple sub-regions corresponds to a color, and the multiple sub-regions correspond to different colors. After obtaining the target region on the denture model composed of the multiple sub-regions, the method further includes: Each sub-region in the target region is displayed on the denture model using a color corresponding to the sub-region.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the area determination method according to any one of claims 1 to 9.
