Characteristic line generation method and device, computer equipment and storage medium

By automatically tracking the intermediate point of the tooth feature line, the problem of manual selection of fitting points in the prior art is solved, and efficient feature line generation is achieved.

CN119444916APending Publication Date: 2025-02-14HEFEI MEIYA OPTOELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310961171.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In the prior art, generating tooth characteristic lines (such as neck edge lines, gum lines) requires manual selection of a large number of fitting points, resulting in cumbersome and inefficient operations.

Method used

By obtaining two tracking starting points and tracking according to the preset direction, the intermediate points of the feature line are obtained, and the feature lines are generated based on these intermediate points. This method automatically tracks the complete closed feature line, avoiding the step of manually selecting the fitting point.

Benefits of technology

Improve the efficiency of feature line generation, reduce the workload of the operator, and automatically track the complete closed feature line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444916A_ABST
    Figure CN119444916A_ABST
Patent Text Reader

Abstract

The invention relates to a feature line generation method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring two first tracking starting points; tracking the two first tracking starting points according to a preset direction to obtain a first feature line middle point corresponding to each first tracking starting point; and taking the first feature line intermediate point obtained by the last tracking in the first feature line intermediate points corresponding to the two first tracking starting points as a second tracking starting point, and for any second tracking starting point, tracking the first feature line intermediate point according to the second tracking starting point and the opposite tracking starting point of the second tracking starting point. A second feature line middle point corresponding to a second tracking starting point is obtained through tracking, and the opposite side tracking starting point is the other second tracking starting point except the second tracking starting point in the two second tracking starting points; and generating a feature line according to each first feature line intermediate point and each second feature line intermediate point. By adopting the method, the generation efficiency of the feature line can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer image technology, and in particular to a method, device, computer equipment and storage medium for generating feature lines. Background Art

[0002] In the process of treating oral diseases, there is usually a need to construct a three-dimensional model of the patient's teeth, extract the tooth feature lines (cervical margin line, gum line or other lines with obvious features on the tooth surface) based on the three-dimensional model, and then process the prepared body. For example, the tooth feature line can be the cervical margin line of the tooth model, such as Figure 1 As shown, the boundary line between the removed area and the unremoved area on the tooth model can be regarded as the cervical margin line on the tooth model.

[0003] In the prior art, technicians usually need to manually select fitting points on the 3D model, and then the software connects the fitting points to form feature lines. In order to obtain enough fitting points, technicians usually need to manually select hundreds of fitting points, which makes the operation cumbersome and the efficiency of generating feature lines is low. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for generating feature lines in order to solve the above technical problems.

[0005] In a first aspect, the present application provides a method for generating a feature line. The method comprises:

[0006] Get two first tracking starting points;

[0007] Tracking the two first tracking starting points respectively according to a preset direction to obtain the middle point of the first characteristic line corresponding to each of the first tracking starting points;

[0008] The last tracked first characteristic line middle point among the first characteristic line middle points corresponding to the two first tracking starting points is respectively used as the second tracking starting point, and for any second tracking starting point, the second characteristic line middle point corresponding to the second tracking starting point is tracked according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point, wherein the tracking starting point on the opposite side is the other second tracking starting point among the two second tracking starting points except the second tracking starting point;

[0009] A characteristic line is generated according to each of the first characteristic line midpoints and each of the second characteristic line midpoints.

[0010] In one embodiment, obtaining two first tracking starting points includes:

[0011] When a mouse click is detected, a target point corresponding to the mouse click point on the surface of the three-dimensional mesh model is obtained;

[0012] Determine a first distance between each vertex in the three-dimensional mesh model and the target point, and determine a first candidate vertex from each of the vertices according to each of the first distances and a first distance range;

[0013] Determine a first curvature corresponding to each of the first candidate vertices on the surface of the three-dimensional mesh model, determine a first tracing starting point from each of the first candidate vertices based on the first curvatures and a preset curvature strategy, and determine a first direction of the first tracing starting point relative to the target point;

[0014] Determine a second direction of each of the first candidate vertices relative to the target point, and respectively determine a first angle between each of the second directions and the first direction, and select the first candidate vertices whose first angles are greater than a first angle threshold as second candidate vertices;

[0015] Based on the first curvature of each second candidate vertex and the preset curvature strategy, another first tracing starting point is determined from each second candidate vertex.

[0016] In one embodiment, tracking the two first tracking starting points respectively according to the preset direction to obtain the first characteristic line middle point corresponding to each of the first tracking starting points includes:

[0017] The two first tracking starting points are respectively used as the middle points of the first characteristic line;

[0018] For any of the first tracking starting points, determine the first tracking intermediate point that matches the first tracking starting point and the preset direction from each of the vertices of the three-dimensional mesh model; if the first tracking intermediate point exists, use the first tracking intermediate point as the first feature line intermediate point and the first tracking starting point, and jump to the step of determining the first tracking intermediate point that matches the first tracking starting point and the preset direction from each of the vertices of the three-dimensional mesh model, until the first tracking intermediate point does not exist.

[0019] In one embodiment, determining, from each vertex of the three-dimensional mesh model, a first tracking intermediate point that matches the first tracking starting point and a preset direction includes:

[0020] respectively determining a second distance between each vertex of the three-dimensional mesh model and the first tracing starting point, and determining a third candidate vertex from each of the vertices according to each of the second distances and the second distance range;

[0021] Acquire a second curvature corresponding to each of the third candidate vertices on the surface of the three-dimensional mesh model, and determine a first tolerable curvature according to each of the second curvatures;

[0022] According to the first tolerable curvature and the preset curvature strategy, a fourth candidate vertex is determined from each of the third candidate vertices, and a first tracking intermediate point is determined from each of the fourth candidate vertices based on a preset direction.

[0023] In one embodiment, the determining the first tracking intermediate point from each of the fourth candidate vertices based on the preset direction includes:

[0024] Determining, according to the coordinates of each of the fourth candidate vertices in the model coordinate system, a third distance of each of the fourth candidate vertices relative to the origin of the model coordinate system in the preset direction, wherein the model coordinate system is a coordinate system where the three-dimensional mesh model is located;

[0025] According to the third distance corresponding to each of the fourth candidate vertices, a first tracking intermediate point is determined from each of the fourth candidate vertices.

[0026] In one embodiment, the

[0027] The determining a first tracking intermediate point from each of the fourth candidate vertices according to the third distance corresponding to each of the fourth candidate vertices includes:

[0028] respectively determining a tracking direction of each of the fourth candidate vertices relative to the first tracking starting point, and determining a second angle of each of the tracking directions relative to a previous direction, where the previous direction is a tracking direction corresponding to a previous first tracking intermediate point;

[0029] A first tracking intermediate point is determined from fourth candidate vertices whose second angle is less than or equal to a second angle threshold and whose third distance relative to the origin of the model coordinate system satisfies a preset distance strategy.

[0030] In one embodiment, for any second tracking starting point, tracking the second characteristic line middle point corresponding to the second tracking starting point according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point includes:

[0031] Determine a first target tracking starting point and a second target tracking starting point from the two second tracking starting points;

[0032] Taking the second target tracking starting point as the tracking target and the first target tracking starting point as the tracking starting point, determining a second tracking middle point corresponding to the first target tracking starting point from each vertex of the three-dimensional mesh model according to a preset tracking algorithm, and taking the second tracking middle point as the middle point of the second characteristic line and the first target tracking starting point;

[0033] Taking the first target tracking starting point as the tracking target, taking the second target tracking starting point as the tracking starting point, determining a third tracking middle point corresponding to the second target tracking starting point from each of the vertices according to the preset tracking algorithm, and taking the third tracking middle point as the middle point of the second characteristic line and the second target tracking starting point;

[0034] When the second tracking intermediate point does not coincide with the third tracking intermediate point, the process jumps to the step of taking the second target tracking starting point as the tracking target and the first target tracking starting point as the tracking starting point until the second tracking intermediate point coincides with the third tracking intermediate point.

[0035] In one embodiment, the step of presetting the tracking algorithm includes:

[0036] Determine a fourth distance between each of the vertices and the tracing starting point, respectively, and determine a fifth candidate vertex from each of the vertices according to each of the fourth distances and a fourth distance range;

[0037] Acquire a third curvature corresponding to each of the fifth candidate vertices on the surface of the three-dimensional mesh model, and determine a second tolerance curvature according to each of the third curvatures;

[0038] Determine a sixth candidate vertex from each of the fifth candidate vertices according to the second tolerance curvature and a preset curvature strategy;

[0039] A fifth distance between each of the sixth candidate vertices and the tracking target is determined, and a tracking intermediate point corresponding to the tracking start point is determined from each of the sixth candidate vertices according to the fifth distance.

[0040] In one embodiment, the step of presetting the tracking algorithm further includes:

[0041] Determine respectively the tracking direction of each of the fifth candidate vertices relative to the tracking starting point, and determine a third angle of each of the tracking directions relative to a previous direction, where the previous direction is the tracking direction corresponding to the previous second tracking intermediate point;

[0042] The fifth candidate vertices whose third angle is greater than a third angle threshold are deleted from the fifth candidate vertices.

[0043] In one embodiment, generating a characteristic line according to each of the first characteristic line midpoints and each of the second characteristic line midpoints comprises:

[0044] Fitting a spline curve according to the middle points of each of the first characteristic lines and each of the middle points of the second characteristic lines, and obtaining each interpolation point on the spline curve;

[0045] For any of the interpolation points, respectively determine a sixth distance between each vertex of the three-dimensional mesh model and the interpolation point, determine a target vertex from each of the vertices according to each of the sixth distances, and determine a projection point of the interpolation point on the surface of the three-dimensional mesh model based on the coordinates of the interpolation point, the coordinates of the target vertex, and the normal of the target vertex;

[0046] A feature line is generated according to each of the first feature line midpoints, each of the second feature line midpoints and each of the projection points.

[0047] In one embodiment, after generating the characteristic line according to each of the first characteristic line midpoints and each of the second characteristic line midpoints, the method further comprises:

[0048] When a mouse click is detected, obtaining a modification point corresponding to the click point of the mouse from the surface of the three-dimensional mesh model, and determining a seventh distance between the modification point and the characteristic line;

[0049] When the seventh distance is less than a seventh distance threshold, determining two first connection points corresponding to the modification point on the feature line;

[0050] A first update line is constructed based on the two first connection points and the modification point, and the feature line is updated based on the first update line.

[0051] In one embodiment, after generating the characteristic line according to each of the first characteristic line midpoints and each of the second characteristic line midpoints, the method further comprises:

[0052] In the case where the mouse movement is detected, a movement path of the mouse pointer is determined, a modification line corresponding to the movement path is determined from the surface of the three-dimensional mesh model, and an eighth distance between the modification line and the characteristic line is determined;

[0053] When the eighth distance is less than an eighth distance threshold, determining two second connection points corresponding to the modification line on the characteristic line;

[0054] A second update line is constructed based on the two second connection points and the modification line, and the feature line is updated based on the second update line.

[0055] In a second aspect, the present application also provides a device for generating a characteristic line. The device comprises:

[0056] A first acquisition module, used for acquiring two first tracking starting points;

[0057] A first tracking module, used to track the two first tracking starting points respectively according to a preset direction to obtain a first characteristic line middle point corresponding to each of the first tracking starting points;

[0058] A second tracking module is used to respectively use the last tracked first characteristic line middle point of each first characteristic line middle point corresponding to the two first tracking starting points as a second tracking starting point, and for any second tracking starting point, track the second characteristic line middle point corresponding to the second tracking starting point according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point, wherein the tracking starting point on the opposite side is another second tracking starting point of the two second tracking starting points except the second tracking starting point;

[0059] A generating module is used to generate a characteristic line according to each of the first characteristic line midpoints and each of the second characteristic line midpoints.

[0060] In one embodiment, the first acquisition module is further used to:

[0061] When a mouse click is detected, a target point corresponding to the mouse click point on the surface of the three-dimensional mesh model is obtained;

[0062] Determine a first distance between each vertex in the three-dimensional mesh model and the target point, and determine a first candidate vertex from each of the vertices according to each of the first distances and a first distance range;

[0063] Determine a first curvature corresponding to each of the first candidate vertices on the surface of the three-dimensional mesh model, determine a first tracing starting point from each of the first candidate vertices based on the first curvatures and a preset curvature strategy, and determine a first direction of the first tracing starting point relative to the target point;

[0064] Determine a second direction of each of the first candidate vertices relative to the target point, and respectively determine a first angle between each of the second directions and the first direction, and select the first candidate vertices whose first angles are greater than a first angle threshold as second candidate vertices;

[0065] Based on the first curvature of each second candidate vertex and the preset curvature strategy, another first tracing starting point is determined from each second candidate vertex.

[0066] In one embodiment, the first tracking module is further used to:

[0067] The two first tracking starting points are respectively used as the middle points of the first characteristic line;

[0068] For any of the first tracking starting points, determine the first tracking intermediate point that matches the first tracking starting point and the preset direction from each of the vertices of the three-dimensional mesh model; if the first tracking intermediate point exists, use the first tracking intermediate point as the first feature line intermediate point and the first tracking starting point, and jump to the step of determining the first tracking intermediate point that matches the first tracking starting point and the preset direction from each of the vertices of the three-dimensional mesh model, until the first tracking intermediate point does not exist.

[0069] In one embodiment, the first tracking module is further used to:

[0070] respectively determining a second distance between each vertex of the three-dimensional mesh model and the first tracing starting point, and determining a third candidate vertex from each of the vertices according to each of the second distances and the second distance range;

[0071] Acquire a second curvature corresponding to each of the third candidate vertices on the surface of the three-dimensional mesh model, and determine a first tolerable curvature according to each of the second curvatures;

[0072] According to the first tolerable curvature and the preset curvature strategy, a fourth candidate vertex is determined from each of the third candidate vertices, and a first tracking intermediate point is determined from each of the fourth candidate vertices based on a preset direction.

[0073] In one embodiment, the first tracking module is further used to:

[0074] Determining, according to the coordinates of each of the fourth candidate vertices in the model coordinate system, a third distance of each of the fourth candidate vertices relative to the origin of the model coordinate system in the preset direction, wherein the model coordinate system is a coordinate system where the three-dimensional mesh model is located;

[0075] According to the third distance corresponding to each of the fourth candidate vertices, a first tracking intermediate point is determined from each of the fourth candidate vertices.

[0076] In one embodiment, the first tracking module is further used to:

[0077] respectively determining a tracking direction of each of the fourth candidate vertices relative to the first tracking starting point, and determining a second angle of each of the tracking directions relative to a previous direction, where the previous direction is a tracking direction corresponding to a previous first tracking intermediate point;

[0078] A first tracking intermediate point is determined from fourth candidate vertices whose second angle is less than or equal to a second angle threshold and whose third distance relative to the origin of the model coordinate system satisfies a preset distance strategy.

[0079] In one embodiment, the second tracking module is further used to:

[0080] Determine a first target tracking starting point and a second target tracking starting point from the two second tracking starting points;

[0081] Taking the second target tracking starting point as the tracking target and the first target tracking starting point as the tracking starting point, determining a second tracking middle point corresponding to the first target tracking starting point from each vertex of the three-dimensional mesh model according to a preset tracking algorithm, and taking the second tracking middle point as the middle point of the second characteristic line and the first target tracking starting point;

[0082] Taking the first target tracking starting point as the tracking target, taking the second target tracking starting point as the tracking starting point, determining a third tracking middle point corresponding to the second target tracking starting point from each of the vertices according to the preset tracking algorithm, and taking the third tracking middle point as the middle point of the second characteristic line and the second target tracking starting point;

[0083] When the second tracking intermediate point does not coincide with the third tracking intermediate point, the process jumps to the step of taking the second target tracking starting point as the tracking target and the first target tracking starting point as the tracking starting point until the second tracking intermediate point coincides with the third tracking intermediate point.

[0084] In one embodiment, the second tracking module is further used to:

[0085] Determine a fourth distance between each of the vertices and the tracing starting point, respectively, and determine a fifth candidate vertex from each of the vertices according to each of the fourth distances and a fourth distance range;

[0086] Acquire a third curvature corresponding to each of the fifth candidate vertices on the surface of the three-dimensional mesh model, and determine a second tolerance curvature according to each of the third curvatures;

[0087] Determine a sixth candidate vertex from each of the fifth candidate vertices according to the second tolerance curvature and a preset curvature strategy;

[0088] A fifth distance between each of the sixth candidate vertices and the tracking target is determined, and a tracking intermediate point corresponding to the tracking start point is determined from each of the sixth candidate vertices according to the fifth distance.

[0089] In one embodiment, the second tracking module is further used to:

[0090] Determine respectively the tracking direction of each of the fifth candidate vertices relative to the tracking starting point, and determine a third angle of each of the tracking directions relative to a previous direction, where the previous direction is the tracking direction corresponding to the previous second tracking intermediate point;

[0091] The fifth candidate vertices whose third angle is greater than a third angle threshold are deleted from the fifth candidate vertices.

[0092] In one embodiment, the generating module is also used for

[0093] Fitting a spline curve according to the middle points of each of the first characteristic lines and each of the middle points of the second characteristic lines, and obtaining each interpolation point on the spline curve;

[0094] For any of the interpolation points, respectively determine a sixth distance between each vertex of the three-dimensional mesh model and the interpolation point, determine a target vertex from each of the vertices according to each of the sixth distances, and determine a projection point of the interpolation point on the surface of the three-dimensional mesh model based on the coordinates of the interpolation point, the coordinates of the target vertex, and the normal of the target vertex;

[0095] A feature line is generated according to each of the first feature line midpoints, each of the second feature line midpoints and each of the projection points.

[0096] In one embodiment, the device further comprises:

[0097] A second acquisition module is used to acquire, when a mouse click is detected, a modification point corresponding to the click point of the mouse from the surface of the three-dimensional mesh model, and determine a seventh distance between the modification point and the feature line;

[0098] A second determining module, configured to determine, when the seventh distance is less than a seventh distance threshold, two first connection points corresponding to the modification point on the feature line;

[0099] The first updating module is used to construct a first updating line based on the two first connection points and the modification point, and to update the feature line based on the first updating line.

[0100] In one embodiment, the device further comprises:

[0101] a third acquisition module, configured to determine a movement path of the mouse pointer when the movement of the mouse is detected, determine a modification line corresponding to the movement path from the surface of the three-dimensional mesh model, and determine an eighth distance between the modification line and the characteristic line;

[0102] A third determining module, configured to determine two second connection points corresponding to the modification line on the characteristic line when the eighth distance is less than an eighth distance threshold;

[0103] The second updating module is used to construct a second updating line based on the two second connection points and the modification line, and to update the feature line based on the second updating line.

[0104] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, any one of the above methods is implemented.

[0105] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, any of the above methods is implemented.

[0106] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, any of the above methods is implemented.

[0107] The above-mentioned method, device, computer equipment and storage medium for generating characteristic lines determine two first tracking starting points, respectively track and obtain a plurality of first characteristic line midpoints according to preset directions, and then determine a second tracking starting point from each first characteristic line midpoint, and then obtain a plurality of second characteristic line midpoints according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point, and generate a complete closed characteristic line according to each first characteristic line midpoint and each second characteristic line midpoint. After determining the two first tracking starting points, the embodiment of the present application can automatically track and obtain a complete closed characteristic line without requiring the operator to manually select the fitting points on the characteristic line, thereby improving the efficiency of generating characteristic lines. BRIEF DESCRIPTION OF THE DRAWINGS

[0108] Figure 1 A schematic diagram of a neck margin line;

[0109] Figure 2 is a flow chart of a method for generating a characteristic line in one embodiment;

[0110] Figure 3 is a schematic diagram of a gum line in one embodiment;

[0111] Figure 4 is a flow chart of step 202 in one embodiment;

[0112] Figure 5 A schematic diagram of obtaining two first tracking starting points in one embodiment;

[0113] Figure 6 is a flow chart of step 204 in one embodiment;

[0114] Figure 7 A schematic diagram of the middle points of the last two first characteristic lines obtained in one embodiment;

[0115] Figure 8is a schematic diagram of all the middle points of the first characteristic lines obtained in one embodiment;

[0116] Fig. 9 is a flow chart of step 604 in one embodiment;

[0117] Fig.10 is a flow chart of step 906 in one embodiment;

[0118] Fig.11 is a flow chart of step 1004 in one embodiment;

[0119] Fig.12 is a schematic diagram of tracking a first tracking intermediate point according to a previous direction in one embodiment;

[0120] Fig.13 is a flow chart of step 206 in one embodiment;

[0121] Fig.14 is a schematic diagram of all the middle points of the second characteristic lines obtained in one embodiment;

[0122] Fig.15 A schematic diagram of a flow chart of a preset tracking algorithm in one embodiment;

[0123] Fig.16 A schematic diagram of a flow chart of a preset tracking algorithm in one embodiment;

[0124] Fig.17 A schematic diagram of obtaining a tracking intermediate point according to a previous direction in one embodiment;

[0125] Fig.18 is a flow chart of step 208 in one embodiment;

[0126] Fig.19 is a flow chart of a method for generating a characteristic line in one embodiment;

[0127] Fig. 20 A schematic diagram of determining two first connection points in one embodiment;

[0128] Fig.21 A schematic diagram of the effect of clicking to modify a feature line in an embodiment;

[0129] Fig. 22 is a flow chart of a method for generating a characteristic line in one embodiment;

[0130] Fig.23 A schematic diagram of determining two second connection points in one embodiment;

[0131] Fig.24 A schematic diagram of the effect of drawing a line to modify the neck edge line in one embodiment;

[0132] Fig.25 is a structural block diagram of a device for generating a characteristic line in one embodiment;

[0133] Fig.26 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0134] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0135] In one embodiment, Figure 2 As shown, a method for generating a feature line is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0136] Step 202: Obtain two first tracking starting points.

[0137] In the embodiment of the present application, the first tracking starting point is a point on the surface of the three-dimensional mesh model of the tooth. The operator can obtain two first tracking starting points by clicking the mouse twice on the surface of the three-dimensional mesh model, or by inputting coordinates twice; or, the operator can obtain a first tracking starting point by clicking the mouse or inputting coordinates, and then select a vertex that is closer to the first tracking starting point from each vertex of the three-dimensional mesh model as another first tracking starting point; the operator can also obtain a reference point by clicking the mouse or inputting coordinates, and then select a first tracking starting point from the vertices on both sides of the reference point, which is not specifically limited in the embodiment of the present application.

[0138] Step 204 , tracking the two first tracking starting points respectively according to the preset direction to obtain the middle points of the first characteristic lines corresponding to the first tracking starting points.

[0139] In the embodiment of the present application, since the characteristic line is a closed curve, the stage of tracking the midpoint of the characteristic line can be divided into two stages: in the first stage, the tracking is performed in the same direction (preset direction) along the two first tracking starting points respectively: if the two groups of first characteristic line midpoints can overlap in this stage, the tracking process of the characteristic line midpoint is terminated. If the midpoints of the first characteristic lines do not overlap, but other first characteristic line midpoints can no longer be searched, the second stage is entered: in the second stage, the last tracked midpoint of the first characteristic line in the two groups of first characteristic line feature points is used as the second tracking starting point, and then the tracking is performed in opposite directions based on the two second tracking starting points, so that the tracked midpoints of the second characteristic lines can overlap and the characteristic line is closed. According to the obtained midpoints of each first characteristic line and each second characteristic line, a complete closed characteristic line can be generated.

[0140] According to different types of characteristic lines, the preset direction may be pre-set by a person skilled in the art, or may be determined according to two first tracking starting points.

[0141] In one embodiment, for example, when the characteristic line is a neck edge line, and the neck edge line is approximately located on the same plane, the preset direction can be the direction of the other end vertex of the neck edge line relative to the two first tracking starting points. The operator can indicate the preset direction by drawing on the screen, or can first obtain a characteristic line middle point between the two first tracking starting points (can be obtained by tracking the characteristic line middle point between the two first tracking starting points, and the tracking method here can refer to the tracking method based on the second tracking starting point and the opposite tracking starting point in the following text; or, if a solution of taking a first tracking starting point on both sides of the reference point is adopted, the reference point can be used as the characteristic line middle point), so as to determine the plane where the characteristic line is located, and then connect the first tracking starting point and the characteristic line middle point respectively to obtain two connecting lines, and then determine two vertical lines perpendicular to the two connecting lines from the plane where the characteristic line is located; and then use the ray starting from the characteristic line middle point and passing through the intersection of the vertical lines as the preset direction.

[0142] In another embodiment, when the characteristic line is the gum line, the neck edge line that is not on the same plane is similar to it, and the method of determining the preset direction is also similar. Therefore, the gum line is taken as an example for explanation. Since the gum line is generally located on a saddle-shaped three-dimensional surface (refer to Figure 3As shown, it is an example of the gum line on the front and back of the tooth. It can be seen that the gum line is generally not located on the same plane), so the position range from which the operator can select the first tracking starting point can be preset, and then the preset direction can be determined according to the first tracking starting point selected by the operator. Exemplarily, the position range can be limited to the bottom edge of the gums on the front of the tooth, the bottom edge of the gums on the back of the tooth, and the gums between the tooth and the adjacent teeth. If the operator selects the first tracking starting point from the bottom edge of the gums on the front of the tooth or the bottom edge of the gums on the back of the tooth, the preset direction can be the vertical direction of the three-dimensional mesh model (generally the z-axis in the model coordinate system, the model coordinate system is the coordinate system where the three-dimensional mesh model is located; taking the positive direction of the z-axis of the model coordinate system from the lower tooth direction to the upper tooth direction as an example, when extracting the gum line of the lower tooth, the preset direction can be the positive direction of the z-axis; when extracting the gum line of the upper tooth, the preset direction can be the negative direction of the z-axis); if the operator selects the first tracking starting point from the gums between the tooth and the adjacent teeth, the direction of the gums between the tooth and the adjacent teeth on the other side can be used as the preset direction.

[0143] It should be noted that the above are only two examples of determining the preset direction when the characteristic line is the cervical margin line and the gum line. In fact, the preset direction can also be determined by other methods, and the embodiments of the present application do not specifically limit this.

[0144] After determining the preset direction, the midpoints of the first characteristic lines corresponding to the two first tracking starting points can be tracked respectively according to the preset direction. For example, for any first tracking starting point, a straight line passing through the first tracking starting point can be determined according to the first tracking starting point and the preset direction, and the midpoint of the first characteristic line can be selected from the vertices of the three-dimensional mesh model near the straight line according to the preset strategy. The preset strategy can be determined according to the type of characteristic line. Taking the gum line as an example, since the gum line is a concave line on the three-dimensional mesh model, the curvature of the three-dimensional mesh model on the gum line is small, so the vertex with a smaller curvature near the straight line can be selected as the midpoint of the first characteristic line. The preset strategy can also be determined according to other requirements, such as setting the preset strategy to select vertices whose distance from the straight line is less than a distance threshold, or selecting vertices whose direction relative to the previous first characteristic line midpoint and the angle between the straight line and the vertex is less than an angle threshold, etc. The embodiment of the present application does not make specific limitations on this.

[0145] Each time the middle point of the first characteristic line is tracked, the tracking can be performed according to the two first tracking starting points, and then the distance between the two middle points of the first characteristic line can be calculated. If the distance is less than a certain value, it is determined that the middle points of the two first characteristic lines coincide with each other. At this time, the first stage of tracking can be ended, and the second stage of tracking can be skipped directly to generate characteristic lines according to the middle points of each first characteristic line. Alternatively, when the middle point of the first characteristic line cannot be obtained according to the above tracking rules, the first stage of tracking can be ended, and the last middle point of the first characteristic line obtained according to the two first tracking starting points can be used as the second tracking starting point to enter the second stage of tracking.

[0146] Step 206, respectively, takes the last tracked first characteristic line midpoint of each first tracking starting point corresponding to the two first tracking starting points as the second tracking starting point, and for any second tracking starting point, tracks the second characteristic line midpoint corresponding to the second tracking starting point according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point, wherein the tracking starting point on the opposite side is the other second tracking starting point among the two second tracking starting points except the second tracking starting point.

[0147] In an embodiment of the present application, after the last midpoint of the first characteristic line obtained according to the two first tracking starting points is used as the second tracking starting point, for any second tracking starting point, the midpoint of the second characteristic line corresponding to the second tracking starting point can be obtained based on the second tracking starting point and another second tracking starting point (the tracking starting point on the opposite side).

[0148] For example, the second tracking starting point can be used as the tracking starting point, and the opposite tracking starting point can be used as the tracking target point. Then, according to the direction of the tracking target point relative to the tracking starting point, the second feature line midpoint can be determined from the tracking candidate points corresponding to the tracking starting point with reference to the aforementioned method of obtaining the first feature line midpoint according to the preset direction. Then, the second feature line midpoint is used as the tracking starting point, and the above process is repeated until the second feature line midpoint coincides with the tracking target point, thereby obtaining two groups of second feature line midpoints corresponding to the two second tracking starting points respectively. Both groups of second feature line midpoints can be used as the final second feature line midpoints, or only the points that coincide with each other in the two groups of second feature line midpoints, that is, the points tracked when tracking is performed according to the two second tracking starting points respectively, can be taken as the final second feature line midpoints. The embodiments of the present application do not make specific limitations on this.

[0149] Alternatively, each time tracking is performed, tracking may be performed based on the two second tracking starting points, that is, after obtaining a second characteristic line midpoint based on the opposite tracking starting point corresponding to the second tracking starting point on one side, and using the second characteristic line midpoint as the second tracking starting point on that side, a second characteristic line midpoint is obtained based on the opposite tracking starting point corresponding to the second tracking starting point on the other side (at this time, the opposite tracking starting point is already the second characteristic line midpoint determined previously), and the second characteristic line midpoint is used as the second tracking starting point on that side. Repeat the above process until the second characteristic line midpoints on both sides coincide, and the final second characteristic line midpoint can be obtained.

[0150] It should be noted that the above are only two examples of tracking and obtaining the middle point of the second characteristic line. In fact, the middle point of the second characteristic line tracking can also be obtained according to other methods, and the embodiments of the present application do not make specific limitations on this.

[0151] Step 208 , generating a characteristic line according to the middle points of each first characteristic line and the middle points of each second characteristic line.

[0152] In the embodiment of the present application, a curve can be obtained by fitting the midpoints of each first characteristic line and the midpoints of each second characteristic line according to any algorithm for fitting a curve according to multiple points (such as a curve fitting algorithm, an interpolation algorithm, etc.), and the curve can be used as the characteristic line.

[0153] It should be noted that the fitted curve may not completely fit the surface of the three-dimensional mesh model. The above problem can be solved by taking some interpolation points on the curve, projecting the interpolation points onto the surface of the three-dimensional mesh model, and then regenerating the feature lines based on the interpolation points projected onto the model surface, the midpoints of each first feature line, and the midpoints of each second feature line. For example, the distance between every two adjacent feature line midpoints (the feature line midpoints include the first feature line midpoint and the second feature line midpoint) can be determined. When the spacing between the two feature line midpoints is too large, interpolation points are inserted on the curve between the two feature line midpoints; or, multiple interpolation points can be obtained from the curve at equal intervals according to a preset spacing. In addition, interpolation points can also be obtained in other ways, which are not specifically limited in the embodiments of the present application.

[0154] The method for generating a characteristic line provided by the embodiment of the present application determines two first tracking starting points, and respectively tracks a plurality of first characteristic line midpoints according to a preset direction, and then determines a second tracking starting point from each of the first characteristic line midpoints, and then obtains a plurality of second characteristic line midpoints according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point, and generates a complete closed characteristic line according to each first characteristic line midpoint and each second characteristic line midpoint. After determining the two first tracking starting points, the embodiment of the present application can automatically track and obtain a complete closed characteristic line without requiring the operator to manually select the fitting points on the characteristic line, thereby improving the efficiency of generating characteristic lines.

[0155] In one embodiment, Figure 4 As shown, in step 202, two first tracking starting points are obtained, including:

[0156] Step 402: when a mouse click is detected, obtain the target point corresponding to the mouse click point on the surface of the three-dimensional mesh model.

[0157] Step 404 : determining a first distance between each vertex in the three-dimensional mesh model and the target point, and determining a first candidate vertex from each vertex according to each first distance and the first distance range.

[0158] Step 406, determining the first curvature corresponding to each first candidate vertex on the surface of the three-dimensional mesh model, determining a first tracking starting point from each first candidate vertex based on each first curvature and a preset curvature strategy, and determining a first direction of the first tracking starting point relative to the target point.

[0159] In the embodiment of the present application, the operator can select a target point on the three-dimensional grid model by clicking the mouse, and the terminal then selects a first tracking starting point on both sides of the target point according to the target point.

[0160] Exemplarily, the terminal can capture the current position of the mouse pointer on the screen after the operator clicks the mouse. Since the coordinates of the mouse pointer are relative to the coordinates of the screen, it is necessary to convert the screen coordinates of the mouse pointer into the target coordinates of the mouse pointer in the model coordinate system (the coordinate system where the three-dimensional mesh model is located) through any screen coordinate and world coordinate conversion algorithm. Then, according to the target coordinates and the camera coordinates in the model coordinate system, a target straight line passing through the target coordinates and the camera coordinates can be obtained. By obtaining the position where the target straight line passes through the surface of the three-dimensional mesh model, the target point corresponding to the mouse pointer on the surface of the three-dimensional mesh model can be obtained.

[0161] In order to prevent the spacing between points on the feature line from being too large, the first tracking starting point can be selected from the vertices near the target point. A first distance range (e.g., 0.2mm-0.4mm) can be preset to determine the first distance between each vertex and the target point, and the vertex whose first distance is within the first distance range is used as the first candidate vertex. Alternatively, a kdtree (k-dimensional tree) can be constructed in advance based on each vertex in the three-dimensional mesh model, and then a kdtree-based nearest neighbor search algorithm is used to search for the first candidate vertex whose distance from the target point is within the first distance range. The embodiment of the present application does not specifically limit this.

[0162] The first curvature corresponding to the first candidate vertex refers to the curvature of the surface of the three-dimensional mesh model at the position of the first candidate vertex. The preset curvature strategy is used to limit the range of selecting the first tracing starting point, which is related to the type of feature line: for certain specific feature lines, the curvature corresponding to the points on the feature line is within a certain range, and setting the preset curvature strategy can make the first tracing starting point fall on the actual feature line. For example, when the feature line is the gum line, since the gum line is a line concave inward on the surface of the three-dimensional mesh model, the curvature corresponding to each point on the gum line is small, and the preset curvature strategy corresponding to the gum line is to select the first candidate vertex with a smaller first curvature. When the feature line is the cervical margin line, since the patient's crown is usually partially ground off when the cervical margin line needs to be extracted for processing and preparation, the boundary line between the crown and the root (that is, the cervical margin line) is a line protruding outward on the three-dimensional mesh model, and the curvature corresponding to each point on the cervical margin line is large, and the preset curvature strategy corresponding to the cervical margin line is to select the first candidate vertex with a larger first curvature. Alternatively, if the points on the feature line do not have obvious curvature features, the preset curvature strategy may not be set.

[0163] According to the preset curvature strategy and the first curvature, a first tracing starting point can be determined from the first candidate vertices. For example, when the preset curvature strategy is to select the first candidate vertex with the smaller first curvature, the first candidate vertices can be sorted from small to large according to the first curvature, and then the first candidate vertex that ranks first, that is, the first candidate vertex with the smallest first curvature is selected as the first tracing starting point. Alternatively, the queue can be traversed starting from the second first candidate vertex in the queue obtained after sorting, and the difference between the first curvature corresponding to the first candidate vertex currently traversed and the first curvature corresponding to the first candidate vertex ranked first is calculated to obtain all first candidate vertices whose differences are less than the difference threshold, and from all first candidate vertices whose differences are less than the difference threshold and the first candidate vertex ranked first, the vertex with the longest first distance is selected as the first tracing starting point, and the embodiments of the present application do not make specific limitations on this.

[0164] After obtaining the first tracking starting point, the direction of the first tracking starting point relative to the target point can be determined to determine another first tracking starting point according to the direction. For example, a vector pointing from the target point to the first tracking starting point can be obtained according to the coordinates of the first tracking starting point and the coordinates of the target point, and the vector can be used as the first direction.

[0165] Step 408, determining the second direction of each first candidate vertex relative to the target point, and respectively determining the first angle between each second direction and the first direction, and taking the first candidate vertex whose first angle is greater than the first angle threshold as the second candidate vertex.

[0166] Step 410 : determining another first tracing starting point from each second candidate vertex based on the first curvature of each second candidate vertex and a preset curvature strategy.

[0167] In the embodiment of the present application, the second direction of the remaining first candidate vertices except the first tracking starting point relative to the target point can be determined. For example, the vector pointing from the target point to the first candidate vertex can be used as the second direction.

[0168] Reference Figure 5 As shown, in order to enable tracking to be performed along the two first tracking starting points to the two sides of the target point respectively, a first candidate vertex with a larger angle between the second direction and the first direction may be selected as another first tracking starting point. Figure 5 PP in the equation refers to the target point, and SP1 and SP2 refer to the first candidate vertices. Figure 5 SPV1 in the second direction ( Figure 5 SPV2 in the figure), the first angle corresponding to each first candidate vertex can be calculated. According to the preset first angle threshold (which can be any value greater than 90°, such as 120°), all first candidate vertices whose first angles are greater than the first angle threshold can be screened out, that is, second candidate vertices. Based on the first curvature of each second candidate vertex and the preset curvature strategy, another first tracing starting point can be selected from each second candidate vertex. The method for selecting another first tracing starting point can refer to the method for selecting the first tracing starting point, and the embodiments of the present application will not be repeated here.

[0169] The method for generating a feature line provided in an embodiment of the present application determines a first tracking starting point on both sides of the target point according to the curvature and the distance based on the target point obtained by clicking a mouse, so that the first tracking starting point that is close to the target point and located on the actual feature line can be obtained, and when the first tracking starting point is subsequently tracked along a preset direction, two sets of non-overlapping middle points of the first feature lines can be tracked from both sides of the target point respectively.

[0170] In one embodiment, Figure 6As shown, in step 204, two first tracking starting points are tracked respectively according to the preset direction to obtain the first characteristic line middle points corresponding to the first tracking starting points, including:

[0171] Step 602, taking the two first tracking starting points as the middle points of the first characteristic line respectively;

[0172] Step 604, for any first tracking starting point, determine the first tracking intermediate point that matches the first tracking starting point and the preset direction from the vertices of the three-dimensional mesh model. If the first tracking intermediate point exists, use the first tracking intermediate point as the first feature line intermediate point and the first tracking starting point, and jump to the step of determining the first tracking intermediate point that matches the first tracking starting point and the preset direction from the vertices of the three-dimensional mesh model, until the first tracking intermediate point does not exist.

[0173] In an embodiment of the present application, the first tracking middle point can be repeatedly matched from the vertices of the three-dimensional mesh model according to the preset direction and the first tracking starting point, and then the first tracking middle point can be used as the first tracking starting point until the first tracking middle point can no longer be matched, thereby obtaining the middle points of the first characteristic lines corresponding to the two first tracking starting points respectively.

[0174] Exemplarily, multiple tracking candidate points can be determined from the vertices of the three-dimensional mesh model according to the first tracking starting point (the tracking candidate points can be selected according to the distance between the vertex and the first tracking starting point, the direction of the vertex relative to the first tracking starting point, or the curvature of the three-dimensional mesh model surface at the vertex according to actual needs, and the embodiments of the present application do not specifically limit this), and then the direction of each tracking candidate point relative to the first tracking starting point is determined, and the tracking candidate point with the smallest angle between the direction and the preset direction, that is, the closest to the preset direction, is used as the middle point of the first characteristic line. Alternatively, the projection length of the distance between each tracking candidate point and the first tracking starting point in the preset direction can be calculated, and the tracking candidate point with the longest projection length can be used as the middle point of the first characteristic line. The first tracking middle point can also be determined according to the preset direction and the first tracking starting point in other ways, and the embodiments of the present application do not specifically limit this.

[0175] The obtained first tracking middle point is used as the middle point of the first characteristic line and the first tracking starting point, and the process of tracking the first tracking middle point is repeated to obtain multiple first characteristic line middle points corresponding to the first tracking starting point.

[0176] When the first tracking middle point cannot be matched (for example, if the angle threshold is set in advance, and the first tracking middle point is determined from the tracking candidate points whose angles between the direction relative to the first tracking starting point and the preset direction are less than the angle threshold, there may be no tracking candidate points whose angles are less than the angle threshold, and therefore the first tracking middle point cannot be matched), the process of matching the first tracking middle point can be stopped, and the last first feature line middle point obtained at this time is used as the second tracking starting point. Figure 7 As shown, when a target point is selected, the middle point between the selected target point and the two first characteristic lines finally tracked; Figure 8 are the midpoints of all the first characteristic lines tracked.

[0177] The method for generating a feature line provided in an embodiment of the present application repeats the process of matching the first tracking middle point according to the first tracking starting point and the preset direction, and uses the first tracking middle point as the first tracking starting point until the first tracking middle point does not exist. All the first feature line middle points corresponding to the first tracking starting point can be automatically tracked according to the preset direction without the operator having to manually select the fitting point (the first feature line middle point) on the feature line, thereby improving the efficiency of generating the feature line.

[0178] In one embodiment, Fig. 9 As shown, in step 604, determining a first tracking intermediate point matching the first tracking start point and the preset direction from each vertex of the three-dimensional mesh model includes:

[0179] Step 902 : determining the second distance between each vertex of the three-dimensional mesh model and the first tracing starting point respectively, and determining a third candidate vertex from each vertex according to each second distance and the second distance range.

[0180] Step 904 : obtaining the second curvature corresponding to each third candidate vertex on the surface of the three-dimensional mesh model, and determining the first tolerable curvature according to each second curvature.

[0181] Step 906 : determining a fourth candidate vertex from each third candidate vertex according to the first tolerable curvature and the preset curvature strategy, and determining a first tracking intermediate point from each fourth candidate vertex based on a preset direction.

[0182] In the embodiment of the present application, a fourth candidate vertex can be screened out from each vertex according to the curvature corresponding to each vertex and the distance between each vertex and the first tracing starting point, and then the first tracing intermediate point can be determined from the fourth candidate vertex.

[0183] In order to make the distance between the midpoints of the two first characteristic lines within an appropriate distance interval, a second distance range can be preset, and the second distance between each vertex of the three-dimensional mesh model and the first tracking starting point can be calculated respectively, and the third candidate vertex can be selected according to the second distance and the second distance range. For example, a preset number of vertices whose second distance is within the second distance range and whose second distance is the smallest can be used as the third candidate vertex, so that the tracking step corresponding to the midpoint of the first characteristic line will not be too short, thereby improving the efficiency of obtaining the midpoint of the first characteristic line; or a preset number of vertices whose second distance is within the second distance range and whose second distance is the largest can be used as the third candidate vertex, so that the tracking step corresponding to the midpoint of the first characteristic line will not be too long, thereby improving the generation accuracy of the characteristic line; or all vertices whose second distance is within the second distance range can be used as the third candidate vertex, and the embodiments of the present application do not make specific limitations on this.

[0184] The curvature of the three-dimensional mesh model surface at the third candidate vertex is obtained as the second curvature corresponding to the third candidate vertex. The preset curvature strategy is the same as the preset curvature strategy when selecting the first candidate vertex in the aforementioned embodiment, and is related to the type of feature line. In order to ensure that enough vertices can be obtained from the third candidate vertices as the fourth candidate vertex, the first tolerance curvature can be determined according to the second curvature of each third candidate vertex, so as to control the number of the selected fourth candidate vertices and the corresponding curvature range through the first tolerance curvature and the preset curvature strategy.

[0185] Taking the preset curvature strategy of selecting a vertex with a smaller curvature as the first tracking intermediate point as an example, the strategy for selecting the fourth candidate vertex can be set to select a third candidate vertex whose second curvature is less than or equal to the first tolerance curvature according to the preset curvature strategy. If a preset number of third candidate vertices need to be selected as the fourth candidate vertex, each third candidate vertex can be sorted from small to large according to the second curvature, and the second curvature corresponding to the third candidate vertex arranged in the preset number of positions is used as the first tolerance curvature, so that when the third candidate vertex whose second curvature is less than or equal to the first tolerance curvature is selected as the fourth candidate vertex, a preset number of fourth candidate vertices can be obtained. Alternatively, if a certain proportion of the third candidate vertices need to be selected as the fourth candidate vertex, the median, average, or the product of the average and a certain weight of each second curvature can be taken as the first tolerance curvature, and the embodiments of the present application do not specifically limit this.

[0186] After the fourth candidate vertices are obtained, the first tracking intermediate point can be obtained from each fourth candidate vertex by referring to the method of determining the first tracking intermediate point according to the preset direction in the above embodiment. The embodiments of the present application will not be described in detail here.

[0187] The method for generating feature lines provided in the embodiment of the present application screens vertices twice according to the second distance and the second curvature of each vertex to obtain a vertex whose distance from the first tracking starting point meets the requirements and whose curvature also meets the preset curvature strategy as the fourth candidate vertex, and then obtains the first tracking midpoint from the fourth candidate vertex, which can make the obtained first feature line midpoint more reasonable.

[0188] In one embodiment, Fig.10 As shown, in step 906, determining a first tracking intermediate point from each fourth candidate vertex based on a preset direction includes:

[0189] Step 1002: Determine a third distance of each fourth candidate vertex in a preset direction relative to the origin of the model coordinate system according to the coordinates of each fourth candidate vertex in the model coordinate system, wherein the model coordinate system is a coordinate system where the three-dimensional mesh model is located.

[0190] Step 1004 : determining a first tracking intermediate point from each fourth candidate vertex according to the third distance corresponding to each fourth candidate vertex.

[0191] In an embodiment of the present application, the first tracking intermediate point can be determined according to the length (third distance) of each fourth candidate vertex in the preset direction, so that each time the tracking is performed, the vertex with a larger span in the preset direction relative to the first tracking starting point can be used as the first tracking intermediate point, thereby speeding up the acquisition of all the intermediate points of the first characteristic lines. The third distance can be calculated by the coordinates of the fourth candidate vertex in the model coordinate system. For example, the projection point of the fourth candidate vertex in the preset direction can be calculated according to the preset direction, and the distance between the projection point and the origin of the model coordinate system can be used as the third distance.

[0192] After obtaining the third distance corresponding to each fourth candidate vertex, the fourth candidate vertex with the longest third distance can be directly used as the first tracking intermediate point; or the direction of the fourth candidate vertex relative to the first tracking starting point can also be considered at the same time: for example, after sorting the fourth candidate vertices from large to small according to the third distance, traverse the queue obtained after sorting, and take the first fourth candidate vertex whose direction relative to the first tracking starting point and the angle between the preset direction and the direction is less than the angle threshold as the first tracking starting point. The embodiment of the present application does not make specific limitations on this.

[0193] The method for generating a characteristic line provided in the embodiment of the present application selects the first tracking intermediate point according to the third distance of each fourth candidate vertex in the preset direction. In each tracking, the vertex with a larger span in the preset direction relative to the first tracking starting point can be used as the first tracking intermediate point, thereby speeding up the acquisition of all the intermediate points of the first characteristic line.

[0194] In one embodiment, Fig.11As shown, in step 1004, determining a first tracking intermediate point from each fourth candidate vertex according to the third distance corresponding to each fourth candidate vertex includes:

[0195] Step 1102 , respectively determine the tracking direction of each fourth candidate vertex relative to the first tracking starting point, and determine a second angle of each tracking direction relative to a previous direction, where the previous direction is the tracking direction corresponding to the previous first tracking middle point.

[0196] Step 1104 : Determine a first tracking intermediate point from fourth candidate vertices whose second angle is less than or equal to the second angle threshold and whose third distance relative to the origin of the model coordinate system satisfies a preset distance strategy.

[0197] In an embodiment of the present application, a vector pointing from the first tracking starting point to the fourth candidate vertex can be determined based on the coordinates of the fourth candidate vertex and the coordinates of the first tracking starting point, and the vector is used as the tracking direction, and then the second angle between the tracking direction and the previous direction is calculated. The previous direction is the tracking direction corresponding to the previous first tracking intermediate point, that is, the tracking direction corresponding to the first tracking starting point of this time during the previous round of tracking. Alternatively, when the first tracking starting point is the first two first tracking starting points determined based on the target point, the previous direction may be the direction of the first tracking starting point relative to the target point. In order to make the finally generated feature line smooth, the first tracking intermediate point can be determined from the fourth candidate vertex with the smaller second angle.

[0198] The second angle threshold is a preset value, which can be a smaller value; or, considering that the angle between the preset direction and the previous direction may be larger, in order to enable tracking to the first tracking intermediate point in the preset direction, the second angle threshold can also be set to a value less than 90° (e.g. 80°), that is, under the premise of ensuring that the reverse search does not occur to the minimum extent, it is ensured that the first tracking intermediate point can be obtained from the preset direction. Fig.12 FIG. 4 is an example of a case where the second angle threshold is 80°. Fig.12 In it, CP refers to the first tracking starting point, NP refers to the first tracking middle point, PP refers to the previous first tracking starting point, PCV is the previous direction, and CNV is the tracking direction. Fig.12 The fourth candidate vertex located in the light gray area is a point that can be selected as the first tracking intermediate point.

[0199] The preset distance strategy is a strategy for controlling the distance between the first tracking intermediate point and the origin. For example, if the tracking step size needs to be increased so that the distance difference between each first tracking intermediate point is larger, the preset distance strategy can be set to select the fourth candidate vertex with the largest third distance as the first tracking intermediate point. Or if the smoothness of the feature line needs to be improved so that the distance difference between each first tracking intermediate point is smaller, the preset distance strategy can be set to select the fourth candidate vertex with the third distance within a smaller distance interval as the first tracking intermediate point. The embodiments of the present application do not specifically limit this.

[0200] After the first tracking intermediate point is obtained, the previous direction may be replaced with the tracking direction corresponding to the first tracking intermediate point obtained this time, and the previous direction may be updated.

[0201] The method for generating a feature line provided in an embodiment of the present application determines the tracking direction corresponding to the fourth candidate vertex, and screens the fourth candidate vertex according to the second angle between the tracking direction and the previous direction and the second angle threshold, which can improve the smoothness of the feature line.

[0202] In one embodiment, Fig.13 As shown, in step 206, for any second tracking starting point, according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point, the middle point of the second characteristic line corresponding to the second tracking starting point is tracked, including:

[0203] Step 1302: Determine a first target tracking starting point and a second target tracking starting point from two second tracking starting points.

[0204] Step 1304, taking the second target tracking starting point as the tracking target, taking the first target tracking starting point as the tracking starting point, determining the second tracking middle point corresponding to the first target tracking starting point from each vertex of the three-dimensional mesh model according to a preset tracking algorithm, and taking the second tracking middle point as the middle point of the second feature line and the first target tracking starting point.

[0205] Step 1306, taking the first target tracking starting point as the tracking target, taking the second target tracking starting point as the tracking starting point, determining the third tracking middle point corresponding to the second target tracking starting point from each vertex according to the preset tracking algorithm, and taking the third tracking middle point as the middle point of the second characteristic line and the second target tracking starting point.

[0206] When the second tracking intermediate point does not coincide with the third tracking intermediate point, the process jumps to the step of taking the second target tracking starting point as the tracking target and the first target tracking starting point as the tracking starting point until the second tracking intermediate point coincides with the third tracking intermediate point.

[0207] In the embodiment of the present application, the second tracking middle points corresponding to the two second tracking starting points can be obtained in a cross-tracking manner. That is, firstly, a second tracking middle point is tracked for a second tracking starting point, and the second tracking middle point is used as the second tracking starting point and the middle point of the second characteristic line on this side, and then a third tracking middle point is tracked according to another second tracking starting point, and the third tracking middle point is used as the second tracking starting point and the middle point of the second characteristic line on this side, and the above process is repeated until the second tracking middle point and the third tracking middle point coincide, and all the middle points of the second characteristic lines can be obtained.

[0208] The two second tracking starting points can be divided into the first target tracking starting point and the second target tracking starting point, that is, any one of the second tracking starting points can be used as the first target tracking starting point, and the other second tracking starting point is the second target tracking starting point. The first target tracking starting point can be tracked once: the first target tracking starting point is used as the tracking starting point, the second target tracking starting point is used as the tracking target, and the second tracking middle point is selected from each vertex according to the preset tracking algorithm (the preset tracking algorithm can refer to the algorithm for tracking according to the preset direction in the aforementioned embodiment, and the preset direction is replaced with the direction where the tracking target is located, and the embodiment of the present application is not repeated here), and the second tracking middle point is used as the second characteristic line middle point on this side, and the second tracking middle point is updated to the first target tracking starting point on this side; the second target tracking starting point is tracked once again: the second target tracking starting point is used as the tracking starting point, and the first target tracking starting point is used as the tracking target (the first target tracking starting point at this time is already the second tracking middle point determined last time), and a tracking is performed according to the preset tracking algorithm to obtain a third tracking middle point.

[0209] An end distance can be set for the second tracking middle point and the third tracking middle point. When the distance between the second tracking middle point and the third tracking middle point is greater than or equal to the end distance, the second tracking middle point and the third tracking middle point are determined to be coincident, or when the distance between the second tracking middle point and the third tracking middle point is less than the end distance, the second tracking middle point and the third tracking middle point are determined not to be coincident. When the second tracking middle point and the third tracking middle point do not coincide, the above tracking process is repeated until the second tracking middle point and the third tracking middle point coincide, thereby obtaining all the second feature line middle points. Fig.14 As shown, these are all the middle points of the second characteristic lines finally obtained.

[0210] The method for generating a feature line provided by the embodiment of the present application tracks two second tracking vertices respectively during one tracking process: firstly determine a second tracking middle point according to the distance of each vertex relative to the two second tracking vertices, update the distance of each vertex relative to the two second tracking vertices according to the second tracking middle point, and then determine another second tracking middle point. When tracking, each second tracking vertex can refer to the real-time position of another second tracking vertex, so that the feature line finally generated is smoother.

[0211] In one embodiment, Fig.15 As shown, the steps of the above preset tracking algorithm include:

[0212] Step 1502 , respectively determine the fourth distance between each vertex and the tracing start point, and determine a fifth candidate vertex from each vertex according to each fourth distance and the fourth distance range.

[0213] Step 1504 , obtaining the third curvature corresponding to each fifth candidate vertex on the surface of the three-dimensional mesh model, and determining the second tolerance curvature according to each third curvature.

[0214] Step 1506 : Determine a sixth candidate vertex from the fifth candidate vertices according to the second tolerable curvature and the preset curvature strategy.

[0215] Step 1508 : determining a fifth distance between each sixth candidate vertex and the tracking target, and determining a tracking intermediate point corresponding to the tracking start point from each sixth candidate vertex according to the fifth distance.

[0216] In the embodiment of the present application, the tracking intermediate point can be determined according to the distance between each vertex and the tracking starting point, the curvature of each vertex, and the distance between each vertex and the tracking target.

[0217] The fourth distance range is a preset range interval (for example, 0.2 mm-0.6 mm). For example, the fourth distance can be within the fourth distance range, and a preset number of vertices with the smallest fourth distance can be used as the fifth candidate vertices, a preset number of vertices with the largest fourth distance can be used as the fifth candidate vertices, or all vertices with the fourth distance within the fourth distance range can be used as the fifth candidate vertices, etc., and the embodiments of the present application do not specifically limit this.

[0218] The preset curvature strategy is related to the characteristic line type, which can refer to the preset curvature strategy in the aforementioned embodiment. The calculation method of the second tolerance curvature and the method of determining the sixth candidate vertex from each fifth candidate vertex according to the second tolerance curvature and the preset curvature strategy can also refer to the method of determining the fourth candidate vertex according to the first tolerance curvature and the preset curvature strategy in the aforementioned embodiment, which will not be repeated in this embodiment of the present application.

[0219] After the sixth candidate vertex is determined, the tracking intermediate point (the tracking intermediate point includes the second tracking intermediate point and the third tracking intermediate point) can be determined from the sixth candidate vertex according to the distance between the sixth candidate vertex and the tracking target. The distance is related to the tracking step size. For example, if a larger tracking step size is required to improve the efficiency of generating feature lines, the sixth candidate vertex with the largest distance can be selected as the tracking intermediate point. If a smaller tracking step size is required to improve the accuracy of generating feature lines, the sixth candidate vertex with the smallest distance can be selected as the tracking intermediate point. This embodiment of the present application does not specifically limit this.

[0220] The method for generating feature lines provided in the embodiment of the present application determines the tracking intermediate point according to the distance between each vertex and the tracking starting point, the curvature of each vertex, and the distance between each vertex and the tracking target, which can make the tracking intermediate point obtained by tracking more reasonable and improve the smoothness of the generated feature line.

[0221] In one embodiment, Fig.16 As shown, the steps of the above preset tracking algorithm also include:

[0222] Step 1602 , respectively determine the tracking direction of each fifth candidate vertex relative to the tracking start point, and determine a third angle of each tracking direction relative to a previous direction, where the previous direction is the tracking direction corresponding to the previous second tracking middle point.

[0223] Step 1604: Delete the fifth candidate vertices whose third angle is greater than the third angle threshold from the fifth candidate vertices.

[0224] In the embodiment of the present application, in order to make the generated feature line smooth, the fifth candidate vertex can be screened according to the third angle corresponding to the fifth candidate vertex. The previous direction is the tracking direction corresponding to the previous second tracking middle point, that is, the tracking direction corresponding to the starting point of this tracking in the previous round of tracking. In order to make the last generated feature line smooth, the second tracking middle point can be determined from the fifth candidate vertex with the smaller third angle.

[0225] The third angle threshold is a preset value, which may be the same as or different from the second angle threshold in the aforementioned embodiment. For example, the third angle threshold may be set to 90°. When the third angle is greater than the third angle threshold, the fifth candidate vertex is deleted, so that the fifth candidate vertices that are retained are all vertices whose third angle is less than or equal to the third angle threshold.

[0226] Reference Fig.17 , which is a schematic diagram of the fifth candidate vertex obtained according to the preset tracking algorithm. Fig.17 CP refers to the current tracking starting point, PP is the previous tracking starting point, NP is the tracking middle point, and TP is the tracking target. The points in the gray area in the figure are all the fifth tracking candidate points.

[0227] The method for generating feature lines provided in the embodiment of the present application deletes the fifth candidate vertex whose third angle is greater than the third angle threshold, so that the tracking intermediate point must be a point whose third angle is less than or equal to the third angle threshold, making the final generated feature line smoother.

[0228] In one embodiment, Fig.18 As shown, in step 208, generating characteristic lines according to the midpoints of each first characteristic line and each second characteristic line midpoint includes:

[0229] Step 1802: fitting a spline curve according to the midpoints of each first characteristic line and each second characteristic line, and obtaining each interpolation point on the spline curve.

[0230] Step 1804, for any interpolation point, determine the sixth distance between each vertex of the three-dimensional mesh model and the interpolation point, determine the target vertex from each vertex according to each sixth distance, and determine the projection point of the interpolation point on the surface of the three-dimensional mesh model based on the coordinates of the interpolation point, the coordinates of the target vertex and the normal of the target vertex.

[0231] Step 1806, generating a feature line according to each midpoint of the first feature line, each midpoint of the second feature line and each projection point.

[0232] In the embodiment of the present application, a spline curve fitting can be performed based on the midpoints of each first characteristic line and each second characteristic line, and then the fitted spline curve is projected onto the surface of the three-dimensional mesh model to obtain the characteristic line.

[0233] Exemplarily, at least one interpolation point can be taken from the fitted spline curve (the interpolation points can be taken at equal intervals, or multiple interpolation points with the largest curvature can be taken, etc.), and the interpolation point can be projected onto the surface of the three-dimensional mesh model, and then the curve can be regenerated according to the starting point of the feature line, the middle points of each feature line, the target point of the feature line and each interpolation point, and the regenerated curve can be used as the feature line projected onto the surface of the three-dimensional mesh model.

[0234] Exemplarily, the interpolation point can be projected onto the surface of the three-dimensional mesh model as follows: the interpolation point can be connected to the camera coordinates (the camera coordinates are the coordinates of the viewpoint used to observe the three-dimensional mesh model in the model coordinate system) to obtain a straight line passing through the surface of the three-dimensional mesh model. The distance between each vertex of the three-dimensional mesh model and the straight line is calculated (it can be the straight-line distance between the coordinates of each vertex of the three-dimensional mesh model and the straight line), and the target vertex whose distance is less than the distance threshold is determined, and then the projection point of the interpolation point on the three-dimensional mesh surface is calculated according to the normal of each target vertex on the surface of the three-dimensional mesh model. For example, assuming that the vector representation of the straight line is The normal of the target vertex is The vector representation from the interpolation point to the target vertex is Then by calculating the vector and vector The dot multiplication and division of the vector and vector The dot product of In vector The projection length in the direction is related to the vector In vector The ratio m of the projection length in the direction; the vector By magnifying the ratio m, we can get the vector from the interpolation point to the surface of the 3D mesh model. By summing, we can get the coordinates of the projection point (see formula (1)):

[0235]

[0236] Among them, O i Refers to the coordinates of the projection point on the i-axis (i can be x, y or z), P i Refers to the value of the interpolation point coordinate on the i-axis. It refers to the component of the direction vector of the straight line on the i-axis, and m refers to the ratio.

[0237] Since multiple target vertices are selected before, the average of the projection point coordinates obtained according to each target vertex can be taken here as the final projection point coordinates.

[0238] Alternatively, the sixth distance between each vertex and the interpolation point can be calculated, and the target vertex can be selected from the sixth distance. For example, multiple vertices whose sixth distance is less than the sixth distance threshold can be selected as the target vertex, or the vertex with the smallest sixth distance can be selected as the target vertex. The vector representation from the interpolation point to the target vertex is To explain, since there is no straight line at this time By calculating the vector and vector The dot multiplication and division of the vector and vector The dot product of In vector The length of the projection in the direction, which is the same as the vector The ratio m of the length; use the ratio m to vector Zoom in and use the coordinates of the interpolation point and the enlarged vector By summing, we can get the coordinates of the projection point (see formula (II)):

[0239]

[0240] Among them, O i Refers to the coordinates of the projection point on the i-axis (i can be x, y or z), P i Refers to the coordinates of the interpolation point on the i-axis, Refers to the component vector of the normal of the target vertex on the i-axis, and m refers to the ratio.

[0241] After obtaining each projection point, a spline curve fitting can be performed again according to the middle points of each first characteristic line, the middle points of each second characteristic line and each projection point to obtain a characteristic line; or each point can be directly connected by a line segment to obtain a characteristic line. The embodiment of the present application does not make any specific limitations on this.

[0242] The method for generating feature lines provided in an embodiment of the present application, after fitting the spline curve, projects each interpolation point on the spline curve onto the surface of the three-dimensional mesh model to obtain the feature line, thereby improving the fit between the feature line and the surface of the three-dimensional mesh model.

[0243] In one embodiment, Fig.19 As shown, in step 208, after generating characteristic lines according to the midpoints of each first characteristic line and each second characteristic line, the method further includes:

[0244] Step 1902, when a mouse click is detected, obtain a modification point corresponding to the mouse click point from the surface of the three-dimensional mesh model, and determine the seventh distance between the modification point and the feature line.

[0245] Step 1904: When the seventh distance is less than the seventh distance threshold, determine two first connection points corresponding to the modification point on the feature line.

[0246] Step 1906: construct a first update line based on the two first connection points and the modification point, and update the feature line based on the first update line.

[0247] In the embodiment of the present application, after the feature line is drawn, the operator can modify the feature line by clicking. When a mouse click is detected, the method of obtaining the target point corresponding to the mouse pointer in the aforementioned embodiment can be referred to to obtain the modification point corresponding to the mouse click point on the surface of the three-dimensional mesh model, and when the seventh distance between the modification point and the feature line is small, the feature line is modified according to the modification point. The embodiment of the present application does not specifically limit the method of determining the seventh distance. For example, the point on the feature line closest to the modification point (the point on the feature line includes the middle point of the first feature line and the middle point of the second feature line) can be determined, and the distance between the point and the modification point is used as the seventh distance; or the analytical expression of the feature line can be determined, the projection point of the modification point on the feature line is calculated, and the distance between the modification point and the projection point is used as the seventh distance.

[0248] When the seventh distance is less than the seventh distance threshold (the value can be preset by those skilled in the art), it is necessary to determine two first connection points from the feature line, so as to update the feature line by constructing a first update line passing through the two first connection points and the modification point. Exemplarily, a preset angle can be set in advance, and a straight line perpendicular to the feature line and passing through the modification point is used as the baseline. Straight lines passing through the modification point and having an angle of preset angle with the baseline are determined on the left and right sides of the baseline, respectively, and then the intersection points of the two straight lines with the feature line are respectively used as the first connection points, so as to keep the curvature of the update line constant; or, referring to Fig. 20 As shown, you can also preset the preset distance ( Fig. 20 The preset distance R in should be greater than the seventh distance threshold. Fig. 20 D in is the seventh distance), and the modification point ( Fig. 20 Draw a circle with the preset distance as the radius and the two intersection points of the circle and the characteristic line as the first connection points ( Fig. 20 It should be noted that the above are only two examples of determining the first connection point. In fact, the first connection point can also be determined by other methods. The embodiment of the present application does not specifically limit the method of determining the first connection point.

[0249] After determining the first connection point, a spline curve can be fitted based on the first connection point and the modification point, and then the interpolation point can be taken from the spline curve with reference to the method in the aforementioned embodiment, and the interpolation point is projected onto the surface of the three-dimensional mesh model, and then the first update line is obtained based on the projection points, the first connection point and the modification point. The feature line between the two first connection points can then be deleted (since the feature line is a closed figure, the two first connection points will divide the feature line into a shorter line segment and a longer line segment, and both line segments belong to the feature line between the two first connection points by definition. Since the purpose of modification is generally to modify the shorter line segment, only the shorter portion of the feature line between the two first connection points can be deleted here). The first update line is connected to the deleted portion of the feature line to complete the modification of the feature line. Refer to Fig.21 The following is a schematic diagram of the effect of clicking Modify.

[0250] The method for generating a feature line provided in an embodiment of the present application determines a modification point and two first connection points on the feature line, constructs a first update line based on the modification point and the two first connection points, and updates the feature line. After the feature line is drawn, it supports modifying the feature line by clicking on it.

[0251] In one embodiment, Fig. 22As shown, in step 208, after generating characteristic lines according to the midpoints of each first characteristic line and each second characteristic line, the method further includes:

[0252] Step 2202, when the mouse movement is detected, determine the movement path of the mouse pointer, determine the modification line corresponding to the movement path from the surface of the three-dimensional mesh model, and determine the eighth distance between the modification line and the characteristic line.

[0253] Step 2204, when the eighth distance is less than the eighth distance threshold, determine two second connection points corresponding to the modification line on the feature line.

[0254] Step 2206: construct a second update line based on the two second connection points and the modification line, and update the feature line based on the second update line.

[0255] In the embodiment of the present application, after the feature line is drawn, the operator can modify the feature line by drawing a line. For example, the operator can start the line drawing modification by clicking the mouse to indicate, and draw a line on the screen by moving the mouse; the terminal can start detecting the moving path of the mouse pointer when the mouse click is detected, and grab multiple target points from the moving path, and then refer to the above-mentioned embodiment to obtain the target point according to the mouse pointer, and generate the neck margin line according to the middle point of the first feature line and the middle point of the second feature line, and generate the modification line according to the target point grabbed from the moving path, and modify the feature line according to the modification line when the eighth distance between the modification line and the feature line is small. The embodiment of the present application does not specifically limit the method of determining the eighth distance. For example, the distance between the point closest to the point on the feature line and the point can be determined for any point on the modification line, and the distances corresponding to all points are taken as the eighth distance (there are multiple eighth distances), or the average value of the distances corresponding to all points is taken as the ninth distance (there is only one eighth distance); or the two endpoints of the modification line can be respectively determined for the points closest to the endpoints on the feature line, and the distance between the endpoint and the point closest to the endpoint is taken as the eighth distance.

[0256] When the eighth distance is less than the preset eighth distance threshold (if there are multiple eighth distances, all eighth distances may be less than the eighth distance threshold, or any eighth distance may be less than the eighth distance threshold), two second connection points need to be determined from the feature line to update the feature line by connecting the two second connection points with the update line. An extension line of the update line may be constructed based on the arc of the update line at the endpoint, and the intersection of the extension line and the feature line may be used as the second connection point. Or Fig.23 As shown, the distance end point ( Fig.23 The closest point between EP1 and EP2 in the figure is used as the second connection point ( Fig.23FP1 and FP2 in the figure, D1 is the distance between EP1 and FP1, and D2 is the distance between EP2 and FP2), which is not specifically limited in the embodiments of the present application.

[0257] After determining the second connection point, for any endpoint of the update line, the update line and the second connection point can be connected by a line segment, and referring to the method of projecting the spline curve onto the surface of the three-dimensional mesh model in the above embodiment, the line segment connecting the endpoint and the second connection point is also projected onto the surface of the three-dimensional mesh model to construct the second update line. The shorter part of the feature line between the two second connection points can be deleted to obtain the updated feature line. Fig.24 The figure below is a schematic diagram of the effect of modifying feature lines by drawing lines.

[0258] The method for generating a feature line provided in an embodiment of the present application determines a modification line and two second connection points on the feature line, constructs a second update line based on the modification point and the two second connection points, and updates the feature line. After the feature line is drawn, it can support modifying the feature line by drawing a line.

[0259] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0260] Based on the same inventive concept, the embodiment of the present application also provides a device for generating characteristic lines for implementing the method for generating characteristic lines involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the method above, so the specific limitations in the embodiments of one or more characteristic line generation devices provided below can refer to the limitations of the characteristic line generation method above, and will not be repeated here.

[0261] In one embodiment, Fig.25 As shown, a device 2500 for generating a feature line is provided, comprising: a first acquisition module 2502, a first tracking module 2504, a second tracking module 2506, and a generating module 2508, wherein:

[0262] A first acquisition module 2502, used to acquire two first tracking starting points;

[0263] A first tracking module 2504 is used to track the two first tracking starting points respectively according to a preset direction to obtain the middle point of the first characteristic line corresponding to each of the first tracking starting points;

[0264] The second tracking module 2506 is configured to use the last tracked first feature line middle point of each of the first feature line middle points corresponding to the two first tracking starting points as a second tracking starting point, and for any second tracking starting point, track the second feature line middle point corresponding to the second tracking starting point according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point, wherein the tracking starting point on the opposite side is the other second tracking starting point of the two second tracking starting points except the second tracking starting point;

[0265] The generating module 2508 is used to generate a characteristic line according to each of the middle points of the first characteristic lines and each of the middle points of the second characteristic lines.

[0266] The characteristic line generation device provided in the embodiment of the present application determines two first tracking starting points, and respectively tracks a plurality of first characteristic line midpoints according to preset directions, and then determines a second tracking starting point from each of the first characteristic line midpoints, and then obtains a plurality of second characteristic line midpoints according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point, and generates a complete closed characteristic line according to each first characteristic line midpoint and each second characteristic line midpoint. After determining the two first tracking starting points, the embodiment of the present application can automatically track and obtain a complete closed characteristic line without requiring the operator to manually select the fitting points on the characteristic line, thereby improving the efficiency of characteristic line generation.

[0267] In one embodiment, the first acquisition module 2502 is further used to:

[0268] When a mouse click is detected, a target point corresponding to the mouse click point on the surface of the three-dimensional mesh model is obtained;

[0269] Determine a first distance between each vertex in the three-dimensional mesh model and the target point, and determine a first candidate vertex from each of the vertices according to each of the first distances and a first distance range;

[0270] Determine a first curvature corresponding to each of the first candidate vertices on the surface of the three-dimensional mesh model, determine a first tracing starting point from each of the first candidate vertices based on the first curvatures and a preset curvature strategy, and determine a first direction of the first tracing starting point relative to the target point;

[0271] Determine a second direction of each of the first candidate vertices relative to the target point, and respectively determine a first angle between each of the second directions and the first direction, and select the first candidate vertices whose first angles are greater than a first angle threshold as second candidate vertices;

[0272] Based on the first curvature of each second candidate vertex and the preset curvature strategy, another first tracing starting point is determined from each second candidate vertex.

[0273] In one embodiment, the first tracking module 2504 is further configured to:

[0274] The two first tracking starting points are respectively used as the middle points of the first characteristic line;

[0275] For any of the first tracking starting points, determine the first tracking intermediate point that matches the first tracking starting point and the preset direction from each of the vertices of the three-dimensional mesh model; if the first tracking intermediate point exists, use the first tracking intermediate point as the first feature line intermediate point and the first tracking starting point, and jump to the step of determining the first tracking intermediate point that matches the first tracking starting point and the preset direction from each of the vertices of the three-dimensional mesh model, until the first tracking intermediate point does not exist.

[0276] In one embodiment, the first tracking module 2504 is further configured to:

[0277] respectively determining a second distance between each vertex of the three-dimensional mesh model and the first tracing starting point, and determining a third candidate vertex from each of the vertices according to each of the second distances and the second distance range;

[0278] Acquire a second curvature corresponding to each of the third candidate vertices on the surface of the three-dimensional mesh model, and determine a first tolerable curvature according to each of the second curvatures;

[0279] According to the first tolerable curvature and the preset curvature strategy, a fourth candidate vertex is determined from each of the third candidate vertices, and a first tracking intermediate point is determined from each of the fourth candidate vertices based on a preset direction.

[0280] In one embodiment, the first tracking module 2504 is further configured to:

[0281] Determining, according to the coordinates of each of the fourth candidate vertices in the model coordinate system, a third distance of each of the fourth candidate vertices relative to the origin of the model coordinate system in the preset direction, wherein the model coordinate system is a coordinate system where the three-dimensional mesh model is located;

[0282] According to the third distance corresponding to each of the fourth candidate vertices, a first tracking intermediate point is determined from each of the fourth candidate vertices.

[0283] In one embodiment, the first tracking module 2504 is further configured to:

[0284] respectively determining a tracking direction of each of the fourth candidate vertices relative to the first tracking starting point, and determining a second angle of each of the tracking directions relative to a previous direction, where the previous direction is a tracking direction corresponding to a previous first tracking intermediate point;

[0285] A first tracking intermediate point is determined from fourth candidate vertices whose second angle is less than or equal to a second angle threshold and whose third distance relative to the origin of the model coordinate system satisfies a preset distance strategy.

[0286] In one embodiment, the second tracking module 2506 is further configured to:

[0287] Determine a first target tracking starting point and a second target tracking starting point from the two second tracking starting points;

[0288] Taking the second target tracking starting point as the tracking target and the first target tracking starting point as the tracking starting point, determining a second tracking middle point corresponding to the first target tracking starting point from each vertex of the three-dimensional mesh model according to a preset tracking algorithm, and taking the second tracking middle point as the middle point of the second characteristic line and the first target tracking starting point;

[0289] Taking the first target tracking starting point as the tracking target, taking the second target tracking starting point as the tracking starting point, determining a third tracking middle point corresponding to the second target tracking starting point from each of the vertices according to the preset tracking algorithm, and taking the third tracking middle point as the middle point of the second characteristic line and the second target tracking starting point;

[0290] When the second tracking intermediate point does not coincide with the third tracking intermediate point, the process jumps to the step of taking the second target tracking starting point as the tracking target and the first target tracking starting point as the tracking starting point until the second tracking intermediate point coincides with the third tracking intermediate point.

[0291] In one embodiment, the second tracking module 2506 is further configured to:

[0292] Determine a fourth distance between each of the vertices and the tracing starting point, respectively, and determine a fifth candidate vertex from each of the vertices according to each of the fourth distances and a fourth distance range;

[0293] Acquire a third curvature corresponding to each of the fifth candidate vertices on the surface of the three-dimensional mesh model, and determine a second tolerance curvature according to each of the third curvatures;

[0294] Determine a sixth candidate vertex from each of the fifth candidate vertices according to the second tolerance curvature and a preset curvature strategy;

[0295] A fifth distance between each of the sixth candidate vertices and the tracking target is determined, and a tracking intermediate point corresponding to the tracking start point is determined from each of the sixth candidate vertices according to the fifth distance.

[0296] In one embodiment, the second tracking module 2506 is further configured to:

[0297] Determine respectively the tracking direction of each of the fifth candidate vertices relative to the tracking starting point, and determine a third angle of each of the tracking directions relative to a previous direction, where the previous direction is the tracking direction corresponding to the previous second tracking intermediate point;

[0298] The fifth candidate vertices whose third angle is greater than a third angle threshold are deleted from the fifth candidate vertices.

[0299] In one embodiment, the generating module 2508 is further used to:

[0300] Fitting a spline curve according to the middle points of each of the first characteristic lines and each of the middle points of the second characteristic lines, and obtaining each interpolation point on the spline curve;

[0301] For any of the interpolation points, respectively determine a sixth distance between each vertex of the three-dimensional mesh model and the interpolation point, determine a target vertex from each of the vertices according to each of the sixth distances, and determine a projection point of the interpolation point on the surface of the three-dimensional mesh model based on the coordinates of the interpolation point, the coordinates of the target vertex, and the normal of the target vertex;

[0302] A feature line is generated according to each of the first feature line midpoints, each of the second feature line midpoints and each of the projection points.

[0303] In one embodiment, the device further comprises:

[0304] A second acquisition module is used to acquire, when a mouse click is detected, a modification point corresponding to the click point of the mouse from the surface of the three-dimensional mesh model, and determine a seventh distance between the modification point and the feature line;

[0305] A second determining module, configured to determine, when the seventh distance is less than a seventh distance threshold, two first connection points corresponding to the modification point on the feature line;

[0306] The first updating module is used to construct a first updating line based on the two first connection points and the modification point, and to update the feature line based on the first updating line.

[0307] In one embodiment, the device further comprises:

[0308] a third acquisition module, configured to determine a movement path of the mouse pointer when the movement of the mouse is detected, determine a modification line corresponding to the movement path from the surface of the three-dimensional mesh model, and determine an eighth distance between the modification line and the characteristic line;

[0309] A third determining module, configured to determine two second connection points corresponding to the modification line on the characteristic line when the eighth distance is less than an eighth distance threshold;

[0310] The second updating module is used to construct a second updating line based on the two second connection points and the modification line, and to update the feature line based on the second updating line.

[0311] Each module in the above-mentioned characteristic line generation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0312] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.26 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating a characteristic line is implemented.

[0313] Those skilled in the art will understand that Fig.26 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0314] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0315] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0316] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0317] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0318] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0319] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0320] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for generating a feature line, characterized in that: The method comprises: Get two first tracking starting points; Tracking the two first tracking starting points respectively according to a preset direction to obtain the middle point of the first characteristic line corresponding to each of the first tracking starting points; The last tracked first characteristic line middle point among the first characteristic line middle points corresponding to the two first tracking starting points is respectively used as the second tracking starting point, and for any second tracking starting point, the second characteristic line middle point corresponding to the second tracking starting point is tracked according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point, wherein the tracking starting point on the opposite side is the other second tracking starting point among the two second tracking starting points except the second tracking starting point; A characteristic line is generated according to each of the first characteristic line midpoints and each of the second characteristic line midpoints.

2. The method according to claim 1, characterized in that The obtaining of two first tracking starting points includes: When a mouse click is detected, a target point corresponding to the mouse click point on the surface of the three-dimensional mesh model is obtained; Determine a first distance between each vertex in the three-dimensional mesh model and the target point, and determine a first candidate vertex from each of the vertices according to each of the first distances and a first distance range; Determine a first curvature corresponding to each of the first candidate vertices on the surface of the three-dimensional mesh model, determine a first tracing starting point from each of the first candidate vertices based on the first curvatures and a preset curvature strategy, and determine a first direction of the first tracing starting point relative to the target point; Determine a second direction of each of the first candidate vertices relative to the target point, and respectively determine a first angle between each of the second directions and the first direction, and select the first candidate vertices whose first angles are greater than a first angle threshold as second candidate vertices; Based on the first curvature of each second candidate vertex and the preset curvature strategy, another first tracing starting point is determined from each second candidate vertex.

3. The method according to claim 1, characterized in that The step of tracking the two first tracking starting points respectively according to the preset direction to obtain the first characteristic line middle points corresponding to the first tracking starting points includes: The two first tracking starting points are respectively used as the middle points of the first characteristic line; For any of the first tracking starting points, determine the first tracking intermediate point that matches the first tracking starting point and the preset direction from each of the vertices of the three-dimensional mesh model; if the first tracking intermediate point exists, use the first tracking intermediate point as the first feature line intermediate point and the first tracking starting point, and jump to the step of determining the first tracking intermediate point that matches the first tracking starting point and the preset direction from each of the vertices of the three-dimensional mesh model, until the first tracking intermediate point does not exist.

4. The method according to claim 3, characterized in that The step of determining, from the vertices of the three-dimensional mesh model, a first tracking intermediate point that matches the first tracking starting point and the preset direction comprises: respectively determining a second distance between each vertex of the three-dimensional mesh model and the first tracing starting point, and determining a third candidate vertex from each of the vertices according to each of the second distances and the second distance range; Acquire a second curvature corresponding to each of the third candidate vertices on the surface of the three-dimensional mesh model, and determine a first tolerable curvature according to each of the second curvatures; According to the first tolerable curvature and the preset curvature strategy, a fourth candidate vertex is determined from each of the third candidate vertices, and a first tracking intermediate point is determined from each of the fourth candidate vertices based on a preset direction.

5. The method according to claim 4, characterized in that The determining a first tracking intermediate point from each of the fourth candidate vertices based on the preset direction includes: Determining, according to the coordinates of each of the fourth candidate vertices in the model coordinate system, a third distance of each of the fourth candidate vertices relative to the origin of the model coordinate system in the preset direction, wherein the model coordinate system is a coordinate system where the three-dimensional mesh model is located; According to the third distance corresponding to each of the fourth candidate vertices, a first tracking intermediate point is determined from each of the fourth candidate vertices.

6. The method according to claim 5, characterized in that The determining a first tracking intermediate point from each of the fourth candidate vertices according to the third distance corresponding to each of the fourth candidate vertices includes: respectively determining a tracking direction of each of the fourth candidate vertices relative to the first tracking starting point, and determining a second angle of each of the tracking directions relative to a previous direction, where the previous direction is a tracking direction corresponding to a previous first tracking intermediate point; A first tracking intermediate point is determined from fourth candidate vertices whose second angle is less than or equal to a second angle threshold and whose third distance relative to the origin of the model coordinate system satisfies a preset distance strategy.

7. The method according to claim 1, characterized in that The step of tracking, for any second tracking starting point, obtaining a second characteristic line middle point corresponding to the second tracking starting point according to the second tracking starting point and a tracking starting point on the opposite side of the second tracking starting point includes: Determine a first target tracking starting point and a second target tracking starting point from the two second tracking starting points; Taking the second target tracking starting point as the tracking target and the first target tracking starting point as the tracking starting point, determining a second tracking middle point corresponding to the first target tracking starting point from each vertex of the three-dimensional mesh model according to a preset tracking algorithm, and taking the second tracking middle point as the middle point of the second characteristic line and the first target tracking starting point; Taking the first target tracking starting point as the tracking target, taking the second target tracking starting point as the tracking starting point, determining a third tracking middle point corresponding to the second target tracking starting point from each of the vertices according to the preset tracking algorithm, and taking the third tracking middle point as the middle point of the second characteristic line and the second target tracking starting point; When the second tracking intermediate point does not coincide with the third tracking intermediate point, the process jumps to the step of taking the second target tracking starting point as the tracking target and the first target tracking starting point as the tracking starting point until the second tracking intermediate point coincides with the third tracking intermediate point.

8. The method according to claim 7, characterized in that The steps of presetting the tracking algorithm include: Determine a fourth distance between each of the vertices and the tracing starting point, respectively, and determine a fifth candidate vertex from each of the vertices according to each of the fourth distances and a fourth distance range; Acquire a third curvature corresponding to each of the fifth candidate vertices on the surface of the three-dimensional mesh model, and determine a second tolerance curvature according to each of the third curvatures; Determine a sixth candidate vertex from each of the fifth candidate vertices according to the second tolerance curvature and a preset curvature strategy; A fifth distance between each of the sixth candidate vertices and the tracking target is determined, and a tracking intermediate point corresponding to the tracking start point is determined from each of the sixth candidate vertices according to the fifth distance.

9. The method according to claim 8, characterized in that The step of presetting the tracking algorithm also includes: Determine respectively the tracking direction of each of the fifth candidate vertices relative to the tracking starting point, and determine a third angle of each of the tracking directions relative to a previous direction, where the previous direction is the tracking direction corresponding to the previous second tracking intermediate point; The fifth candidate vertices whose third angle is greater than a third angle threshold are deleted from the fifth candidate vertices.

10. The method according to claim 1, characterized in that The generating of the characteristic line according to the midpoints of the first characteristic lines and the midpoints of the second characteristic lines comprises: Fitting a spline curve according to the middle points of each of the first characteristic lines and each of the middle points of the second characteristic lines, and obtaining each interpolation point on the spline curve; For any of the interpolation points, respectively determine a sixth distance between each vertex of the three-dimensional mesh model and the interpolation point, determine a target vertex from each of the vertices according to each of the sixth distances, and determine a projection point of the interpolation point on the surface of the three-dimensional mesh model based on the coordinates of the interpolation point, the coordinates of the target vertex, and the normal of the target vertex; A feature line is generated according to each of the first feature line midpoints, each of the second feature line midpoints and each of the projection points.

11. The method according to claim 1, characterized in that: After generating the characteristic lines according to the midpoints of the first characteristic lines and the midpoints of the second characteristic lines, the method further includes: When a mouse click is detected, obtaining a modification point corresponding to the click point of the mouse from the surface of the three-dimensional mesh model, and determining a seventh distance between the modification point and the characteristic line; When the seventh distance is less than a seventh distance threshold, determining two first connection points corresponding to the modification point on the feature line; A first update line is constructed based on the two first connection points and the modification point, and the feature line is updated based on the first update line.

12. The method according to claim 1, characterized in that After generating the characteristic lines according to the midpoints of the first characteristic lines and the midpoints of the second characteristic lines, the method further includes: In the case where the mouse movement is detected, a movement path of the mouse pointer is determined, a modification line corresponding to the movement path is determined from the surface of the three-dimensional mesh model, and an eighth distance between the modification line and the characteristic line is determined; When the eighth distance is less than an eighth distance threshold, determining two second connection points corresponding to the modification line on the characteristic line; A second update line is constructed based on the two second connection points and the modification line, and the feature line is updated based on the second update line.

13. A device for generating a characteristic line, characterized in that: The device comprises: A first acquisition module, used for acquiring two first tracking starting points; A first tracking module, used to track the two first tracking starting points respectively according to a preset direction to obtain a first characteristic line middle point corresponding to each of the first tracking starting points; A second tracking module is used to respectively use the last tracked first characteristic line middle point of each first characteristic line middle point corresponding to the two first tracking starting points as a second tracking starting point, and for any second tracking starting point, track the second characteristic line middle point corresponding to the second tracking starting point according to the second tracking starting point and the tracking starting point on the opposite side of the second tracking starting point, wherein the tracking starting point on the opposite side is another second tracking starting point of the two second tracking starting points except the second tracking starting point; A generating module is used to generate a characteristic line according to each of the first characteristic line midpoints and each of the second characteristic line midpoints.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.