Characteristic line drawing method and device, computer equipment and storage medium
By automatically determining the tracking candidate points from the vertices of the three-dimensional grid model and determining the middle point of the feature line according to the target direction and the tracking direction, the poor quality of the feature line caused by manual selection of fit points in the prior art is solved, and the problem of poor quality of the feature line caused by manual selection of fit points in the prior art is improved. Drawing accuracy of feature lines.
Patent Information
- Application Number
- CN202310946514.5
- 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
In the prior art, the fitting point is manually selected to construct feature lines, resulting in poor selection of fitting points, which affects the construction quality and processing accuracy of feature lines.
By obtaining the starting point and target point of the feature line, the tracking candidate points are automatically determined from the vertices of the three-dimensional grid model, and the intermediate point of the feature line is determined based on the target direction and the tracking direction until the preset conditions are met, and the feature line is generated.
The accuracy of the middle point of the feature line and the drawing accuracy of the feature line are improved, and the steps for operators to manually select fitting points are reduced.
Smart Images

Figure CN119444914A_ABST
Abstract
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 drawing feature lines. Background Art
[0002] In the process of treating oral diseases, there is usually a need to construct a 3D model of the patient's teeth and extract special curves (feature lines) such as the gum line, curves or the boundary lines of different tooth surfaces on the 3D model, and then process the prepared body. For example, the feature line can be the neck edge 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. However, since the selection of fitting points will affect the quality of feature line construction, if the fitting points are selected solely based on the technicians' experience, it is easy to cause poor selection of fitting points, resulting in insufficient fit between the formed feature lines and the 3D model, which in turn leads to insufficient precision of the processed preparation. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for drawing feature lines in order to solve the above technical problems.
[0005] In a first aspect, the present application provides a method for drawing a feature line. The method comprises:
[0006] Obtaining a feature line starting point and a feature line target point, and using the feature line starting point as a tracking starting point;
[0007] Determining candidate tracking points corresponding to the tracking starting point from vertices of the three-dimensional mesh model;
[0008] Determine a target direction of the tracking starting point relative to the target point of the feature line, and a tracking direction of each of the tracking candidate points relative to the tracking starting point, and determine a tracking intermediate point from each of the tracking candidate points according to the target direction and each of the tracking directions, and use the tracking intermediate point as the feature line intermediate point;
[0009] If the preset condition is not met, the tracking intermediate point is used as the tracking starting point, and the process jumps to the step of determining each tracking candidate point corresponding to the tracking starting point from each vertex of the three-dimensional mesh model until the preset condition is met;
[0010] A feature line is generated according to the feature line starting point, each feature line intermediate point and the feature line target point.
[0011] In one embodiment, the method further comprises:
[0012] When the tracking intermediate point and the characteristic line target point coincide with each other, it is determined that the preset condition is satisfied; or,
[0013] When the tracking intermediate point and the characteristic line target point do not coincide with each other, it is determined that the preset condition is not satisfied.
[0014] In one embodiment, determining a tracking intermediate point from the tracking candidate points according to the target direction and each of the tracking directions includes:
[0015] Determine a tracking intermediate point from each of the tracking candidate points according to a previous direction, the target direction and each of the tracking directions, wherein the previous direction is a tracking direction corresponding to a previous tracking intermediate point;
[0016] The tracking direction corresponding to the tracking middle point is used as the previous direction.
[0017] In one embodiment, after determining the candidate tracking points corresponding to the tracking starting point from the vertices of the three-dimensional mesh model, the method further includes:
[0018] respectively determining a curvature corresponding to each of the candidate tracking points on the surface of the three-dimensional mesh model, and respectively determining a first distance between each of the candidate tracking points and the tracking starting point;
[0019] The tracking candidate points whose curvature does not satisfy the preset curvature condition and / or whose first distance is less than the first distance threshold are deleted from the tracking candidate points to obtain updated tracking candidate points.
[0020] In one embodiment, determining a tracking intermediate point from each of the tracking candidate points according to the previous direction, the target direction and each of the tracking directions includes:
[0021] In the case where the previous direction exists, for any of the tracking candidate points, determining a first angle between the tracking direction of the tracking candidate point and the previous direction, and determining a second angle between the tracking direction and the target direction, and in the case where the first angle is greater than a first angle threshold, and / or the second angle is greater than a second angle threshold, deleting the tracking candidate point from the tracking candidate points to obtain updated tracking candidate points;
[0022] Among the first distances corresponding to the updated tracking candidate points, the tracking candidate point corresponding to the smallest first distance is used as the tracking intermediate point.
[0023] In one embodiment, determining a tracking intermediate point from each of the tracking candidate points according to the previous direction, the target direction and each of the tracking directions further includes:
[0024] In the absence of the previous direction, for any of the tracking candidate points, determining a second angle between the tracking direction and the target direction, and in the case where the second angle is greater than a third angle threshold, deleting the tracking candidate point from the tracking candidate points to obtain updated tracking candidate points;
[0025] According to the updated curvature corresponding to each of the tracking candidate points, a tracking intermediate point is determined from each of the tracking candidate points.
[0026] In one embodiment, the method further comprises:
[0027] When the tracking candidate point does not exist in the tracking candidate points after the update, the tracking middle point is determined from the tracking candidate points before the update, and the process jumps to the step of using the tracking middle point as the feature line middle point.
[0028] In one embodiment, determining the candidate tracking points corresponding to the tracking starting point from the vertices of the three-dimensional mesh model includes:
[0029] Determine a second distance between each vertex of the three-dimensional mesh model and the tracking starting point;
[0030] The vertex whose second distance is smaller than a second distance threshold is used as a tracking candidate point corresponding to the tracking start point.
[0031] In one embodiment, obtaining a characteristic line target point includes:
[0032] When the movement of the mouse pointer is detected, obtaining the resting point of the mouse pointer;
[0033] The characteristic line target point corresponding to the stop point on the surface of the three-dimensional grid model is obtained.
[0034] In one embodiment, after generating the characteristic line according to the characteristic line starting point, the characteristic line target point and each characteristic line intermediate point, the method further includes:
[0035] If no save operation is detected and movement of the mouse pointer is detected, the feature line is deleted, and the process jumps to the step of obtaining the resting point of the mouse pointer if movement of the mouse pointer is detected;
[0036] When a save operation is detected, the target feature line is updated according to the feature line, and the target point of the feature line is used as the starting point of the feature line. The process jumps to the step of obtaining the resting point of the mouse pointer when movement of the mouse pointer is detected, until the target point of the feature line coincides with the starting point of the target feature line, and the target feature line is used as the final generated feature line.
[0037] In one embodiment, generating a characteristic line according to the characteristic line starting point, each characteristic line intermediate point and the characteristic line target point includes:
[0038] According to the starting point of the characteristic line, the middle points of each characteristic line and the target point of the characteristic line, a spline curve is fitted, and each interpolation point on the spline curve is obtained;
[0039] For any of the interpolation points, respectively determine a third 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 third 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;
[0040] A feature line is generated according to the feature line starting point, each feature line middle point, each projection point and the feature line target point.
[0041] In one embodiment, after taking the target feature line as the finally generated feature line, the method further includes:
[0042] When a mouse click is detected, acquiring a modification point corresponding to the click point of the mouse from the surface of the three-dimensional mesh model, and determining a fourth distance between the modification point and the feature line;
[0043] When the fourth distance is less than a fourth distance threshold, determining two first connection points corresponding to the modification point on the feature line;
[0044] 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.
[0045] In one embodiment, after taking the target feature line as the finally generated feature line, the method further includes:
[0046] In the case where the mouse movement is detected, determining the movement path of the mouse pointer, determining a modification line corresponding to the movement path from the surface of the three-dimensional mesh model, and determining a fifth distance between the modification line and the characteristic line;
[0047] When the fifth distance is less than a fifth distance threshold, determining two second connection points corresponding to the modification line on the characteristic line;
[0048] 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.
[0049] In one embodiment, after taking the target feature line as the finally generated feature line, the method further includes:
[0050] Determine a first point to be detected on the feature line, and determine a first feature line segment and a second feature line segment corresponding to the first point to be detected, wherein the second feature line segment is a feature line in the feature line other than the first feature line segment;
[0051] Traverse the second points to be detected in the second feature line segment, determine the sixth distance between the second point to be detected and the first point to be detected for any second point to be detected, and generate and display prompt information when the sixth distance is less than the sixth distance threshold, wherein the prompt information is used to indicate that the feature line has self-intersection.
[0052] In a second aspect, the present application also provides a device for drawing feature lines. The device comprises:
[0053] The first acquisition module is used to acquire the starting point of the characteristic line and the target point of the characteristic line, and use the starting point of the characteristic line as the tracking starting point;
[0054] A first determination module, used to determine each tracking candidate point corresponding to the tracking starting point from each vertex of the three-dimensional mesh model;
[0055] a second determination module, configured to determine a target direction of the tracking starting point relative to the target point of the feature line, and a tracking direction of each of the tracking candidate points relative to the tracking starting point, and determine a tracking intermediate point from each of the tracking candidate points according to the target direction and each of the tracking directions, and use the tracking intermediate point as the feature line intermediate point;
[0056] a processing module, configured to, if the preset condition is not met, use the tracking intermediate point as the tracking starting point, and jump to the step of determining each tracking candidate point corresponding to the tracking starting point from each vertex of the three-dimensional mesh model until the preset condition is met;
[0057] A generating module, used for generating a characteristic line according to the characteristic line starting point, each characteristic line intermediate point and the characteristic line target point;
[0058] In one embodiment, the device further comprises:
[0059] The judgment module is used to judge that the preset condition is met when the tracking intermediate point and the characteristic line target point coincide with each other; or judge that the preset condition is not met when the tracking intermediate point and the characteristic line target point do not coincide with each other.
[0060] In one embodiment, the second determining module is further used to:
[0061] Determine a tracking intermediate point from each of the tracking candidate points according to a previous direction, the target direction and each of the tracking directions, wherein the previous direction is a tracking direction corresponding to a previous tracking intermediate point;
[0062] The tracking direction corresponding to the tracking middle point is used as the previous direction.
[0063] In one embodiment, the device further comprises:
[0064] A third determination module, used to respectively determine the curvature corresponding to each of the tracking candidate points on the surface of the three-dimensional mesh model, and respectively determine the first distance between each of the tracking candidate points and the tracking start point;
[0065] The first deleting module is used to delete the tracking candidate points whose curvature does not meet the preset curvature condition and / or whose first distance is less than the first distance threshold from the tracking candidate points to obtain updated tracking candidate points.
[0066] In one embodiment, the second determining module is further used to:
[0067] In the case where the previous direction exists, for any of the tracking candidate points, determining a first angle between the tracking direction of the tracking candidate point and the previous direction, and determining a second angle between the tracking direction and the target direction, and in the case where the first angle is greater than a first angle threshold, and / or the second angle is greater than a second angle threshold, deleting the tracking candidate point from the tracking candidate points to obtain updated tracking candidate points;
[0068] Among the first distances corresponding to the updated tracking candidate points, the tracking candidate point corresponding to the smallest first distance is used as the tracking intermediate point.
[0069] In one embodiment, the second determining module is further used to:
[0070] In the absence of the previous direction, for any of the tracking candidate points, determining a second angle between the tracking direction and the target direction, and in the case where the second angle is greater than a third angle threshold, deleting the tracking candidate point from the tracking candidate points to obtain updated tracking candidate points;
[0071] According to the updated curvature corresponding to each of the tracking candidate points, a tracking intermediate point is determined from each of the tracking candidate points.
[0072] In one embodiment, the device further comprises:
[0073] The fourth determining module is used to determine the tracking middle point from the tracking candidate points before updating when the tracking candidate points after updating do not exist in the tracking candidate points, and jump to the step of using the tracking middle point as the feature line middle point.
[0074] In one embodiment, the first determining module is further used to:
[0075] Determine a second distance between each vertex of the three-dimensional mesh model and the tracking starting point;
[0076] The vertex whose second distance is smaller than a second distance threshold is used as a tracking candidate point corresponding to the tracking start point.
[0077] In one embodiment, the first acquisition module is further used to:
[0078] When the movement of the mouse pointer is detected, obtaining the resting point of the mouse pointer;
[0079] The characteristic line target point corresponding to the stop point on the surface of the three-dimensional grid model is obtained.
[0080] In one embodiment, the device further comprises:
[0081] A second deleting module is used to delete the feature line when no saving operation is detected and the movement of the mouse pointer is detected, and jump to the step of obtaining the resting point of the mouse pointer when the movement of the mouse pointer is detected;
[0082] The first updating module is used to update the target feature line according to the feature line when a save operation is detected, use the target point of the feature line as the starting point of the feature line, jump to the step of obtaining the resting point of the mouse pointer when the movement of the mouse pointer is detected, until the target point of the feature line coincides with the starting point of the target feature line, and use the target feature line as the finally generated feature line.
[0083] In one embodiment, the generating module is further used for:
[0084] According to the starting point of the characteristic line, the middle points of each characteristic line and the target point of the characteristic line, a spline curve is fitted, and each interpolation point on the spline curve is obtained;
[0085] For any of the interpolation points, respectively determine a third 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 third 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;
[0086] A feature line is generated according to the feature line starting point, each feature line middle point, each projection point and the feature line target point.
[0087] In one embodiment, the device further comprises:
[0088] 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 fourth distance between the modification point and the feature line;
[0089] A fifth determining module, configured to determine, when the fourth distance is less than a fourth distance threshold, two first connection points corresponding to the modification point on the feature line;
[0090] The second updating module is used to construct a first updating line based on the two first connecting points and the modification point, and to update the feature line based on the first updating line.
[0091] In one embodiment, the device further comprises:
[0092] a sixth determination module, configured to determine a movement path of the mouse pointer when the mouse movement is detected, determine a modification line corresponding to the movement path from the surface of the three-dimensional mesh model, and determine a fifth distance between the modification line and the characteristic line;
[0093] A seventh determination module, configured to determine, when the fifth distance is less than a fifth distance threshold, two second connection points corresponding to the modification line on the characteristic line;
[0094] The third 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.
[0095] In one embodiment, the device further comprises:
[0096] an eighth determination module, configured to determine a first to-be-detected point on the feature line, and determine a first feature line segment and a second feature line segment corresponding to the first to-be-detected point, wherein the second feature line segment is a feature line in the feature line other than the first feature line segment;
[0097] A ninth determination module is used to traverse the second points to be detected in the second feature line segment, determine the sixth distance between the second point to be detected and the first point to be detected for any second point to be detected, and generate and display prompt information when the sixth distance is less than the sixth distance threshold, wherein the prompt information is used to indicate that the feature line has self-intersection.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] The above-mentioned feature line drawing method, device, computer equipment and storage medium obtain the feature line starting point and the feature line target point, and then generate multiple feature line intermediate points between the feature line starting point and the feature line target point according to the tracking direction of each tracking candidate point relative to the tracking starting point, and the target direction of the tracking starting point relative to the feature line target point. After determining two points, the embodiment of the present application automatically tracks between the two points to obtain the fitting points (i.e., the feature line intermediate points) required to generate the feature line, without requiring the operator to manually select the fitting points, thereby improving the accuracy of the obtained feature line intermediate points, thereby improving the drawing accuracy of the feature line. BRIEF DESCRIPTION OF THE DRAWINGS
[0102] Figure 1 A schematic diagram of a neck margin line;
[0103] Figure 2 is a schematic flow chart of a method for drawing a characteristic line in one embodiment;
[0104] Figure 3 is a flow chart of step 206 in one embodiment;
[0105] Figure 4is a schematic flow chart of a method for drawing a characteristic line in one embodiment;
[0106] Figure 5 is a flow chart of step 302 in one embodiment;
[0107] Figure 6 A schematic diagram of determining a tracking intermediate point in one embodiment;
[0108] Figure 7 A schematic diagram of the middle points of multiple characteristic lines in one embodiment;
[0109] Figure 8 is a flow chart of step 302 in one embodiment;
[0110] Fig. 9 is a flow chart of step 204 in one embodiment;
[0111] Fig.10 is a flow chart of step 202 in one embodiment;
[0112] Fig.11 is a flow chart of step 210 in one embodiment;
[0113] Fig.12 A schematic diagram of segmented generation of characteristic lines in one embodiment;
[0114] Fig.13 is a schematic diagram of characteristic lines finally obtained in one embodiment;
[0115] Fig.14 is a flow chart of step 210 in one embodiment;
[0116] Fig.15 is a schematic flow chart of a method for drawing a characteristic line in one embodiment;
[0117] Fig.16 A schematic diagram of determining two first connection points in one embodiment;
[0118] Fig.17 A schematic diagram of the effect of clicking to modify a feature line in an embodiment;
[0119] Fig.18 is a schematic flow chart of a method for drawing a characteristic line in one embodiment;
[0120] Fig.19 A schematic diagram of determining two second connection points in one embodiment;
[0121] Fig. 20 A schematic diagram of the effect of drawing a line to modify a feature line in one embodiment;
[0122] Fig.21 is a schematic flow chart of a method for drawing a characteristic line in one embodiment;
[0123] Fig. 22 A schematic diagram of a self-intersecting characteristic line in one embodiment;
[0124] Fig.23 is a schematic diagram of self-intersection detection in one embodiment;
[0125] Fig.24 is a structural block diagram of a device for drawing characteristic lines in one embodiment;
[0126] Fig.25 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0127] 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.
[0128] In one embodiment, Figure 2 As shown, a method for drawing feature lines 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:
[0129] Step 202: Acquire the feature line starting point and the feature line target point, and use the feature line starting point as the tracking starting point.
[0130] In the embodiment of the present application, the feature line starting point and the feature line target point are points on the surface of the three-dimensional mesh model of the tooth. The operator can obtain the feature line starting point and the feature line target point by clicking the mouse: for example, the operator can click on the surface of the three-dimensional mesh model, and the terminal grabs the click point, and then projects the click point onto the surface of the three-dimensional mesh model to obtain the feature line starting point and the feature line target point. Alternatively, the operator can also obtain the feature line starting point by clicking the mouse, and then obtain the feature line target point by moving the mouse pointer: after the terminal grabs the feature line starting point according to the first click operation, the terminal can continuously detect the current stop position of the mouse pointer, and project the stop position onto the surface of the three-dimensional mesh model to obtain the feature line target point. The feature line starting point and the feature line target point can also be obtained by other means, such as allowing the operator to obtain the above two points by inputting coordinates, etc., and the embodiment of the present application does not specifically limit this.
[0131] The tracking start point is the reference point for obtaining the next feature line midpoint. After obtaining the feature line start point and feature line target point, the feature line start point can be used as the tracking start point, so that the next feature line midpoint can be obtained according to the tracking start point, and then the feature line midpoint can be used as the tracking start point to continuously track all feature line midpoints between the feature line start point and the feature line target point.
[0132] Step 204: determine candidate tracking points corresponding to the tracking starting point from the vertices of the three-dimensional mesh model.
[0133] In the embodiment of the present application, tracking candidate points can be selected from the vertices of the three-dimensional mesh model according to the preset strategy. For example, if the preset strategy is to select vertices near the path between the tracking starting point and the feature line target point, the tracking starting point and the feature line target point can be connected by a line segment, and the distance between each vertex of the three-dimensional mesh model and the line segment can be determined, and the vertices with a distance less than a threshold are used as tracking candidate points; or, if the preset strategy is to select vertices that are close to both the tracking starting point and the feature line target point, the distance between each vertex of the three-dimensional mesh model and the tracking starting point, as well as the distance between each vertex and the tracking candidate point can also be determined, and the vertices with the sum of the two distances less than the threshold are used as tracking candidate points. In addition, other preset strategies can also be selected, and the embodiment of the present application does not specifically limit this.
[0134] Step 206, determining the target direction of the tracking starting point relative to the target point of the feature line, and the tracking direction of each tracking candidate point relative to the tracking starting point, and determining a tracking middle point from each tracking candidate point according to the target direction and each tracking direction, and using the tracking middle point as the feature line middle point.
[0135] In the embodiment of the present application, a vector can be used to represent the direction from one point to another point. For example, the vector from the tracking starting point to the feature line target point can be calculated based on the coordinates of the tracking starting point and the coordinates of the feature line target point, and the vector can be used as the target direction. Similarly, the vector from the tracking starting point to the tracking candidate point can be calculated based on the coordinates of the tracking starting point and the coordinates of the tracking candidate point, and the vector can be used as the tracking direction.
[0136] In order to make the generated feature line smooth, the angle between the tracking direction and the target direction should be small. On the premise of meeting this requirement, other tracking intermediate point selection strategies can also be determined according to actual needs, and the tracking intermediate point can be selected from each tracking candidate point according to the selection strategy. For example, if the selection strategy is to select the tracking candidate point with the smallest corresponding angle as the tracking intermediate point, then after calculating the angle between each tracking direction and the target direction, the tracking candidate points can be sorted from small to large according to the angle, and the tracking candidate point ranked first can be selected as the tracking intermediate point; or, if the selection strategy is to select the tracking candidate point with a small angle and a distance from the tracking starting point within a certain distance interval as the tracking intermediate point, the distance between the tracking candidate point and the tracking starting point can be calculated, and the tracking candidate point with an angle less than a preset angle threshold and a distance within a preset distance interval can be selected, and then the tracking candidate point with the smallest angle among the selected tracking candidate points is used as the tracking intermediate point, and the embodiment of the present application does not make specific limitations on this.
[0137] After determining the tracking middle point, you need to save the tracking middle point as the feature line middle point for subsequent feature line generation.
[0138] Step 208, when the preset condition is not met, the tracking middle point is used as the tracking starting point, and the process jumps to the step of determining each tracking candidate point corresponding to the tracking starting point from each vertex of the three-dimensional mesh model until the preset condition is met.
[0139] In the embodiment of the present application, a preset condition can be set in advance. The preset condition can be that the tracking middle point coincides with the feature line target point, the tracking middle point cannot be determined from the tracking candidate points, or the determined tracking middle point does not meet the requirements, etc. The embodiment of the present application does not specifically limit this. If the preset condition is not met, the tracking middle point can be recorded as the feature line middle point, and the tracking middle point can be used as the tracking starting point to re-track a new tracking middle point; if the preset condition is met, the tracking of the tracking middle point can be stopped, and the feature line can be generated according to all the previously acquired feature line middle points, feature line starting points and feature line target points.
[0140] Step 210 , generating a feature line according to the feature line starting point, each feature line middle point and the feature line target point.
[0141] In an embodiment of the present application, a curve can be obtained by fitting the starting point of the characteristic line, the middle points of each characteristic line and the target point of the 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.
[0142] 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 feature line starting point, the middle points of each feature line, and the feature line target point. For example, the distance between every two adjacent feature line middle points can be determined. When the spacing between the two feature line middle points is too large, interpolation points can be inserted on the curve between the two feature line middle points; 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.
[0143] The method for drawing a feature line provided in the embodiment of the present application obtains a feature line starting point and a feature line target point, and then generates multiple feature line intermediate points between the feature line starting point and the feature line target point according to the tracking direction of each tracking candidate point relative to the tracking starting point, and the target direction of the tracking starting point relative to the feature line target point. After determining two points, the embodiment of the present application automatically tracks between the two points to obtain the fitting points (i.e., the feature line intermediate points) required to generate the feature line, without requiring the operator to manually select the fitting points, so that the accuracy of the obtained feature line intermediate points can be improved, thereby improving the drawing accuracy of the feature line.
[0144] In one embodiment, the method further includes:
[0145] When the tracking intermediate point and the characteristic line target point coincide, it is determined that the preset condition is met; or,
[0146] When the tracking intermediate point and the characteristic line target point do not coincide, it is judged that the preset condition is not met.
[0147] In the embodiment of the present application, the coincidence of the tracking intermediate point and the characteristic line target point can be used as a preset condition. When the tracking intermediate point and the characteristic line target point meet the coincidence condition, it can be determined that the tracking intermediate point and the characteristic line target point coincide, or when the tracking intermediate point and the characteristic line target point do not meet the coincidence condition, it can be determined that the tracking intermediate point and the characteristic line target point do not coincide. The coincidence condition can be that the distance between the tracking intermediate point and the characteristic line target point is less than a threshold value (for example, 0.5mm), the tracking direction and the target direction corresponding to the tracking intermediate point completely coincide (that is, the angle is 0 or a smaller value), or no tracking intermediate point is determined from the tracking candidate points, etc. The specific conditions can be set by those skilled in the art according to actual needs, and the embodiment of the present application does not specifically limit this.
[0148] In the case where the tracking middle point coincides with the feature line target point, the determination of the tracking middle point can be stopped, and the step of generating the feature line according to the previously determined feature line middle points, feature line starting points and feature line target points can be entered. If the tracking middle point and the feature line target point do not coincide, the tracking middle point can be used as the tracking starting point, and the above steps of obtaining the tracking candidate point according to the tracking starting point and selecting the tracking middle point from the tracking candidate points are repeated until the tracking middle point and the feature line target point coincide.
[0149] The method for drawing a feature line provided in an embodiment of the present application determines whether to stop repeatedly acquiring the tracking intermediate point based on whether the tracking intermediate point and the feature line target point coincide with each other. When the tracking intermediate point and the feature line target point have not coincided with each other, the step of acquiring the tracking intermediate point can be continued. Therefore, a plurality of evenly distributed feature line intermediate points can be automatically acquired between the feature line starting point and the feature line target point without requiring the operator to manually select the fitting points. Therefore, the accuracy of the acquired feature line intermediate points can be improved, thereby improving the accuracy of feature line drawing.
[0150] In one embodiment, Figure 3 As shown, in step 206, according to the target direction and each tracking direction, a tracking intermediate point is determined from the tracking candidate points, including:
[0151] Step 302, determining a tracking intermediate point from each tracking candidate point according to the previous direction, the target direction and each tracking direction, wherein the previous direction is the tracking direction corresponding to the previous tracking intermediate point.
[0152] Step 304: Use the tracking direction corresponding to the tracking middle point as the previous direction.
[0153] In the embodiment of the present application, in order to make the generated feature line smoother, the previous direction can also be used as one of the conditions for determining the tracking middle point. The previous direction is the tracking direction corresponding to the previous tracking middle point (that is, the current tracking starting point), which is equivalent to the direction of the current tracking starting point relative to the previous tracking starting point. In order to ensure the smoothness of the feature line, in addition to making the angle (second angle) between the tracking direction and the target direction smaller, it is also necessary to make the angle (first angle) between the tracking direction and the previous direction smaller, and on this basis, according to the selection strategy, select the feature line middle point from each feature line candidate point.
[0154] For example, if the selection strategy is to select the tracking candidate point with the smallest sum of the first angle and the second angle as the tracking intermediate point, then the tracking candidate points can be sorted from small to large according to the sum of the first angle and the second angle, and the tracking candidate point ranked first can be selected as the tracking intermediate point; or, if the selection strategy is to select the tracking candidate point with both the first angle and the second angle being small and the distance from the tracking starting point being within a certain distance interval as the tracking intermediate point, then the distance between the tracking candidate point and the tracking starting point can be calculated, and the tracking candidate point with the first angle less than the preset first angle threshold, the second angle less than the preset second angle threshold, and the distance within the preset distance interval can be selected, and then the tracking candidate point with the smallest sum of the first angle and the second angle among the selected tracking candidate points is selected as the tracking intermediate point. The embodiments of the present application do not make specific limitations on this.
[0155] After determining the tracking middle point, the currently recorded previous direction may be replaced with the tracking direction corresponding to the tracking middle point, so that after taking the tracking middle point as the tracking starting point, the next tracking middle point may be tracked according to the updated previous direction.
[0156] The method for drawing a feature line provided by the embodiment of the present application uses the tracking direction corresponding to the tracking middle point as the previous direction, so that after the tracking middle point is used as the tracking starting point, the next tracking middle point can be determined according to the previous direction, the target direction and the tracking direction. The embodiment of the present application simultaneously considers the relationship between the tracking direction and the previous direction and the target direction, which can improve the smoothness of the generated feature line.
[0157] In one embodiment, Figure 4 As shown, in step 204, after determining each tracking candidate point corresponding to the tracking starting point from each vertex of the three-dimensional mesh model, the method further includes:
[0158] Step 402 , respectively determining the curvature corresponding to each tracking candidate point on the surface of the three-dimensional mesh model, and respectively determining the first distance between each tracking candidate point and the tracking start point.
[0159] Step 404 : Deleting the tracking candidate points whose curvature does not satisfy the preset curvature condition and / or whose first distance is less than the first distance threshold from the tracking candidate points to obtain updated tracking candidate points.
[0160] In the embodiment of the present application, the curvature corresponding to the tracking candidate point refers to the curvature of the surface of the three-dimensional mesh model at the tracking candidate point, and the curvature corresponding to the tracking candidate point can be calculated by any algorithm, and the embodiment of the present application does not specifically limit this. The first distance between the tracking candidate point and the tracking starting point can be calculated by the coordinates of the tracking candidate point and the coordinates of the tracking starting point.
[0161] Since the feature line is generally a line on the surface of a three-dimensional mesh model with a curvature different from that of the nearby area (for example, when the feature line is the gum line, the boundary between the gums and the teeth is concave inward on the surface of the three-dimensional mesh model, and the curvature corresponding to each point on the gum line will be smaller than the curvature corresponding to the points in the nearby area; and when the feature line is the cervical margin line, when the cervical margin line needs to be extracted for processing and preparation, the patient's crown is usually partially ground off, so the boundary between the crown and the root (that is, the cervical margin line) will protrude outward on the three-dimensional mesh model, and each point on the cervical margin line is a point with a larger curvature on the three-dimensional mesh model), therefore, in order to make the generated feature line closer to the actual feature line, each tracking candidate point can be screened according to the curvature corresponding to each tracking candidate point according to the preset curvature condition, so that the tracking candidate point that is obviously not on the actual feature line will not become the tracking intermediate point. The preset curvature condition is related to the curvature characteristics of the feature line (the curvature characteristics are the curvatures corresponding to each point on the feature line and the relationship between the curvatures of each point in the area near the feature line). For example, when the feature line is the gum line, the preset curvature condition may be that the curvature is greater than a certain curvature threshold; and when the feature line is the cervical margin line, the preset curvature condition may be that the curvature is less than a certain curvature threshold (for example, 1.5 m -1 ).
[0162] At the same time, in order to avoid the situation where the tracking step size (that is, the first distance) is too small, resulting in a slow feature line generation speed, each tracking candidate point can also be screened according to the first distance. For example, the first distance threshold (for example, 0.2mm) can be set in advance, and the tracking candidate points whose first distance is less than the curvature threshold are deleted from each tracking candidate point. After deleting the tracking candidate points whose curvature or first distance does not meet the requirements, the updated tracking candidate points can be obtained, and then the middle point of the feature line can be selected from the updated tracking candidate points.
[0163] The method for drawing feature lines provided in the embodiment of the present application screens tracking candidate points according to the curvature and the first distance to delete tracking candidate points that obviously do not belong to the feature lines and tracking candidate points with too small tracking steps, thereby avoiding the generation of tracking intermediate points from the above-mentioned tracking candidate points, and making the obtained feature line intermediate points more reasonable.
[0164] In one embodiment, Figure 5 As shown, in step 302, according to the previous direction, the target direction and each tracking direction, a tracking intermediate point is determined from each tracking candidate point, including:
[0165] Step 502, when there is a previous direction, for any tracking candidate point, determine a first angle between the tracking direction of the tracking candidate point and the previous direction, and determine a second angle between the tracking direction and the target direction, and when the first angle is greater than a first angle threshold, and / or the second angle is greater than a second angle threshold, delete the tracking candidate point from each tracking candidate point to obtain updated tracking candidate points.
[0166] Step 504: Among the updated first distances corresponding to the tracking candidate points, the tracking candidate point corresponding to the smallest first distance is used as the tracking intermediate point.
[0167] In an embodiment of the present application, when there is a previous tracking intermediate point, the tracking candidate points can be screened based on the first angle between the tracking direction and the previous direction and the second angle between the tracking direction and the target direction. The first angle threshold and the second angle threshold are preset values, which can be the same or different. Generally speaking, in order to avoid a large curvature of the characteristic line, the first angle threshold can be set to a smaller value, such as 30°. For the second angle threshold, it is only necessary to ensure that tracking in the opposite direction does not occur during the tracking process, so the second angle threshold can be any value less than 90°, such as 70°. Refer to Figure 6 As shown in the figure, it is an example of the area where the tracking middle point should be located when the first angle threshold is 30° and the second angle threshold is 70°. In the figure, PP is the previous tracking middle point, CP is the tracking starting point, NP is the tracking candidate point, TP is the feature line target point, PCV is the previous direction, CNV is the tracking direction, and CTV is the target direction. The light gray area in the figure is the area where the tracking middle point should be located. The tracking candidate points outside the light gray area are deleted to obtain the updated tracking candidate points.
[0168] Since the smaller the tracking step size is, the easier it is for the generated feature line to be close to the surface of the three-dimensional mesh model when the tracking step size meets the minimum distance requirement (that is, the first distance is greater than or equal to the first distance threshold), the tracking candidate point with the smallest first distance can be selected as the tracking intermediate point. Figure 6 As shown in the figure, NP is the final tracking intermediate point. Figure 7 FIG. 4 shows an example of multiple feature line midpoints obtained by tracking according to the above method.
[0169] The method for drawing feature lines provided in the embodiment of the present application deletes the tracking candidate points whose first angle is greater than the first angle threshold or whose second angle is greater than the second angle threshold, and then obtains the tracking intermediate point from the updated tracking candidate points. This can avoid that the angle between the tracking direction and the previous direction or the target direction is too large, thereby improving the smoothness of the feature line.
[0170] In one embodiment, Figure 8As shown, in step 302, according to the previous direction, the target direction and each tracking direction, a tracking intermediate point is determined from each tracking candidate point, and further includes:
[0171] Step 802, when there is no previous direction, for any tracking candidate point, determine the second angle between the tracking direction and the target direction, and when the second angle is greater than a third angle threshold, delete the tracking candidate point from the tracking candidate points to obtain updated tracking candidate points.
[0172] Step 804 : determining a tracking middle point from each tracking candidate point according to the updated curvature corresponding to each tracking candidate point.
[0173] In the embodiment of the present application, when there is no previous direction, that is, when the tracking intermediate point is determined for the first time, the tracking intermediate point can be selected from the tracking candidate points according to the curvature and the second angle. Since there is no previous direction, there is no need to keep the feature line smooth, so under the premise of ensuring that tracking in the opposite direction does not occur, the tracking candidate point that is most likely to be on the actual feature line, that is, the one with the largest curvature, can be selected as the tracking intermediate point.
[0174] The second angle between the tracking direction and the target direction corresponding to each tracking candidate point can be determined. If the second angle is greater than a third angle threshold (the third angle threshold can be the same as or different from the second angle threshold), the tracking candidate point is deleted; if the second angle is less than or equal to the third angle threshold, the tracking candidate point is retained.
[0175] After updating each tracking candidate point through the above screening method, the tracking middle point can be selected according to the curvature feature of the feature line and the curvature of each tracking candidate point. For example, when the feature line is the gum line, since the curvature feature of the gum line is that the curvature of each point on the gum line is smaller than the curvature of each point in the area near the gum line, the tracking candidate point with the smallest curvature can be selected as the tracking middle point; when the feature line is the neck margin line, since the curvature feature of the neck margin line is that the curvature of each point on the neck margin line is larger than the curvature of each point in the area near the neck margin line, the tracking candidate point with the largest curvature can be selected as the tracking middle point.
[0176] The method for drawing feature lines provided in an embodiment of the present application, in the absence of a previous direction, screens out tracking candidate points whose second angle is less than a third angle threshold, and selects tracking intermediate points from the remaining tracking candidate points based on the curvature, which can improve the selection accuracy of the tracking intermediate points and thereby improve the drawing accuracy of the feature lines.
[0177] In one embodiment, the method further includes:
[0178] When there is no tracking candidate point among the tracking candidate points after the update, a tracking middle point is determined from the tracking candidate points before the update, and the process jumps to the step of using the tracking middle point as the feature line middle point.
[0179] In the embodiment of the present application, there may not be any point that can meet all the screening conditions in each tracking candidate point, that is, after screening each tracking candidate point, there may be no point in the updated tracking candidate point. At this time, the previous screening of the tracking candidate points can be abandoned, and the tracking intermediate point can be determined according to the tracking candidate points and the selection strategy before the update: for example, taking the method of selecting the tracking intermediate point according to the previous direction, the target direction and the tracking direction in the aforementioned embodiment as an example, after filtering out the tracking candidate points whose curvature and the first distance do not meet the requirements, if there is no point whose first angle is less than the first angle threshold and the second angle is less than the second angle threshold in the remaining tracking candidate points, the filtered tracking candidate points can be added back to each tracking candidate point, that is, the tracking candidate points before the update are obtained, and then the tracking intermediate point is determined from the tracking candidate points before the update; in addition, the tracking strategy can be abandoned, the requirements for the selection of the tracking intermediate point can be reduced, and the tracking intermediate point can be selected by other standards. For example, the requirements for the first angle and the second angle can be abandoned, and the tracking candidate point with the smallest first distance can be directly used as the tracking intermediate point. Alternatively, the requirement for the first angle or the second angle may be abandoned. For example, among the tracking candidate points whose first angle is less than the first angle threshold, the tracking candidate point with the smallest first distance may be used as the tracking intermediate point. The embodiments of the present application do not specifically limit this.
[0180] The method for drawing feature lines provided in the embodiment of the present application cancels the screening of tracking candidate points when there is no point in the updated tracking candidate points, and reselects the tracking middle point based on the tracking candidate points before the update, thereby avoiding the situation where the middle point of the feature line cannot be selected.
[0181] In one embodiment, Fig. 9 As shown, in step 204, each candidate tracking point corresponding to the tracking starting point is determined from each vertex of the three-dimensional mesh model, including:
[0182] Step 902: Determine a second distance between each vertex of the three-dimensional mesh model and the tracing start point.
[0183] Step 904: Use the vertex whose second distance is less than the second distance threshold as a tracking candidate point corresponding to the tracking start point.
[0184] In the embodiment of the present application, the candidate tracking point can be determined based on the second distance between the vertex and the tracking starting point. The second distance between all vertices and the tracking starting point can be calculated, and then the vertices whose second distance is less than the second distance threshold (a preset value, such as 0.07 mm) can be used as candidate tracking points; or a kdtree (k-dimensional tree) including all vertices in the three-dimensional mesh model can be pre-established, and then the nearest neighbor search algorithm based on the kdtree can be used to determine the vertices whose distance from the tracking starting point is less than the second distance threshold from each vertex as candidate tracking points, thereby speeding up the search for candidate tracking points. The embodiment of the present application does not specifically limit this.
[0185] The feature line drawing method provided in the embodiment of the present application selects tracking candidate points through the second distance between the vertex of the three-dimensional mesh model and the tracking starting point, and can determine the tracking candidate points and the tracking intermediate points from the vertices closer to the tracking starting point, so as to control the distance between the intermediate points of the two feature lines and improve the fit between the generated feature lines and the surface of the three-dimensional mesh model.
[0186] In one embodiment, Fig.10 As shown, in step 202, obtaining a characteristic line target point includes:
[0187] Step 1002: When the movement of the mouse pointer is detected, the resting point of the mouse pointer is obtained.
[0188] Step 1004: Obtain the characteristic line target point corresponding to the stop point on the surface of the three-dimensional mesh model.
[0189] In the embodiment of the present application, the operator can select the characteristic line target point by moving the mouse pointer. The stop point of the mouse pointer is the current position of the mouse pointer on the screen. The terminal can detect the position of the mouse pointer on the screen once every period of time and use the detected position as the stop point of the mouse pointer.
[0190] After obtaining the stop point, since the coordinates of the stop point are relative to the screen coordinates, it is necessary to convert the screen coordinates of the stop point into the target coordinates of the stop point in the model coordinate system (the coordinate system where the 3D 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 3D mesh model, the characteristic line target point corresponding to the stop point on the surface of the 3D mesh model can be obtained.
[0191] For example, the distance between each vertex of the three-dimensional mesh model and the target line can be determined to screen out the vertices whose distance from the target line is less than the distance threshold; clustering is performed on each vertex, and the distance between the cluster center and the camera coordinates is calculated to obtain a cluster closest to the camera coordinates. The vertices in this cluster are also the vertices on the surface of the three-dimensional mesh model. For this part of the vertices, the projection coordinates of the target coordinates on the tangent plane where each vertex is located are obtained based on the coordinates and normal of each vertex, and then the average value of the projection coordinates is taken to obtain the characteristic line target point.
[0192] The method for drawing feature lines provided in the embodiment of the present application obtains the resting point of the mouse pointer, projects the resting point onto the surface of the three-dimensional mesh model to obtain the target point of the feature line, and can generate the feature line in real time according to the position of the mouse pointer, so that the operator can see the drawing results of the feature line in real time.
[0193] In one embodiment, Fig.11 As shown, in step 210, after generating the characteristic line according to the characteristic line starting point, the characteristic line target point and the intermediate points of each characteristic line, the above method further includes:
[0194] Step 1102, when no save operation is detected and when movement of the mouse pointer is detected, the feature line is deleted, and the process jumps to the step of obtaining the resting point of the mouse pointer when movement of the mouse pointer is detected.
[0195] Step 1104, when a save operation is detected, the target feature line is updated according to the feature line, and the target point of the feature line is used as the starting point of the feature line. The process jumps to the step of obtaining the resting point of the mouse pointer when the movement of the mouse pointer is detected, until the target point of the feature line coincides with the starting point of the target feature line, and the target feature line is used as the final feature line generated.
[0196] In the present application, refer to Fig.12 As shown, after the operator obtains a reasonable feature line by moving the mouse pointer, the current feature line can be saved. For example, the save operation can be performed by clicking the mouse, or the save operation can be performed by keyboard input, etc., which is not specifically limited in the embodiments of the present application. In the case where the save operation is not performed, the terminal will continue to generate feature lines in real time according to the position of the mouse pointer, that is, the currently existing feature lines are deleted each time the mouse pointer moves, and the feature lines are regenerated according to the position where the mouse pointer is newly moved. In the case of a save operation, the terminal adds the feature line generated this time to the target feature line, and then uses the feature line target point of the feature line generated this time as the feature line starting point of the next feature line (or, the operator can also manually reselect the feature line starting point), so that the operator can continue to draw the next feature line.
[0197] The target feature line is a feature line spliced together from each feature line segment generated each time. When the end point of the target feature line (that is, the feature line target point of the feature line generated this time) and the starting point of the target feature line (the feature line starting point of the feature line generated for the first time) do not coincide, the terminal can continue to generate feature lines according to the point where the mouse pointer stops. For the target feature line, an end distance (for example, 0.5mm) can also be set, and the distance between the feature line target point and the starting point of the target feature line is calculated each time the feature line target point is obtained. When the distance is less than the end distance, it is determined that the feature line target point and the starting point of the target feature line coincide, and the target feature line is drawn. The feature line target point can be set as the feature line starting point, and the starting point of the target feature line can be set as the feature line target point. The process of tracing the middle point of the feature line and generating the feature line between the above two points can be performed to obtain the final feature line. The final generated feature line can be referred to Fig.13 shown.
[0198] The feature line drawing method provided in the embodiment of the present application continues to generate feature lines in real time when no save operation is detected, and continues to generate the next segment of feature lines when a save operation is detected until the end point of the target feature line coincides with the starting point of the target feature line. It can support segmented generation of feature lines, reducing the difficulty for operators to draw feature lines.
[0199] In one embodiment, Fig.14 As shown, in step 210, the characteristic line is generated according to the characteristic line starting point, each characteristic line middle point and the characteristic line target point, including:
[0200] Step 1402: fitting a spline curve according to the starting point of the characteristic line, the middle points of each characteristic line and the target point of the characteristic line, and obtaining each interpolation point on the spline curve.
[0201] Step 1404, for any interpolation point, determine the third distance between each vertex of the three-dimensional mesh model and the interpolation point, determine the target vertex from each vertex according to each third 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.
[0202] Step 1406, generating a feature line according to the feature line starting point, each feature line middle point, each projection point and the feature line target point.
[0203] In an embodiment of the present application, a spline curve fitting can be performed based on the starting point of the feature line, the middle points of each feature line and the target point of the feature line, and then the fitted spline curve is projected onto the surface of the three-dimensional mesh model to obtain the feature line.
[0204] 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.
[0205] 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)):
[0206]
[0207] 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.
[0208] 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.
[0209] Alternatively, the third distance between each vertex and the interpolation point can be directly calculated, and the target vertex can be selected from the third distance. For example, multiple vertices whose third distance is less than the third distance threshold can be selected as the target vertex, or the vertex with the smallest third 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)):
[0210]
[0211] 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.
[0212] After obtaining each projection point, a spline curve fitting can be performed again according to the starting point of the feature line, the middle points of each feature line, each projection point and the target point of the feature line to obtain the feature line; or the points can be directly connected by line segments to obtain the feature line. The embodiment of the present application does not make any specific limitations on this.
[0213] The method for drawing 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.
[0214] In one embodiment, Fig.15 As shown, in step 1104, after taking the target feature line as the finally generated feature line, the method further includes:
[0215] Step 1502, when a mouse click is detected, a modification point corresponding to the mouse click point is obtained from the surface of the three-dimensional mesh model, and a fourth distance between the modification point and the feature line is determined.
[0216] Step 1504: when the fourth distance is less than the fourth distance threshold, determine two first connection points corresponding to the modification point on the feature line.
[0217] Step 1506: 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.
[0218] 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 feature line target point corresponding to the stop point 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 fourth 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 fourth distance. For example, the point on the feature line closest to the modification point can be determined (the point on the feature line includes the feature line starting point, the feature line target point, the feature line middle point and the projection point), and the distance between the point and the modification point is used as the fourth 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 fourth distance.
[0219] When the fourth distance is less than the fourth distance threshold (the value can be preset by a person 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 the 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.16 As shown, you can also preset the preset distance ( Fig.16 The preset distance R in should be greater than the fourth distance threshold. Fig.16 D in is the fourth distance), and the modification point ( Fig.16 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.16 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.
[0220] 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.16 The following is a schematic diagram of the effect of clicking Modify.
[0221] The method for drawing 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.
[0222] In one embodiment, Fig.18 As shown, in step 1104, after taking the target feature line as the finally generated feature line, the method further includes:
[0223] Step 1802, 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 fifth distance between the modification line and the feature line.
[0224] Step 1804: when the fifth distance is less than the fifth distance threshold, determine two second connection points corresponding to the modification line on the feature line.
[0225] Step 1806: 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.
[0226] 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 feature line target point according to the stop point, and generate the feature line according to the starting point of the feature line, the middle point of the feature line and the target point of the 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 fifth 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 fifth 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 used as the fifth distance (there are multiple fifth distances), or the average value of the distances corresponding to all points is used as the fifth distance (there is only one fifth 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 used as the fifth distance.
[0227] When the fifth distance is less than the preset fifth distance threshold (if there are multiple fifth distances, all fifth distances may be less than the fifth distance threshold, or any fifth distance may be less than the fifth 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.18 As shown, the distance between the endpoints on the feature line ( Fig.19 The closest point between EP1 and EP2 in the figure is used as the second connection point ( Fig.19 FP1 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.
[0228] 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. 20 The figure below is a schematic diagram of the effect of modifying feature lines by drawing lines.
[0229] The method for drawing feature lines provided in the 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 line drawing.
[0230] In one embodiment, Fig.21 As shown, in step 1104, after taking the target feature line as the finally generated feature line, the method further includes:
[0231] Step 2102, determining a first point to be detected on the feature line, and determining a first feature line segment and a second feature line segment corresponding to the first point to be detected, wherein the second feature line segment is a feature line other than the first feature line segment.
[0232] Step 2104, traverse the second points to be detected in the second characteristic line segment, determine the sixth distance between the second point to be detected and the first point to be detected for any second point to be detected, and generate and display prompt information when the sixth distance is less than the sixth distance threshold, the prompt information is used to indicate that the characteristic line has self-intersection.
[0233] In the present application embodiment, Fig. 22 As shown, after the feature lines form a closed figure, there may be abnormal self-intersecting parts in the feature lines. Therefore, it is necessary to perform self-intersection detection on the feature lines, and when it is detected that the feature lines have self-intersections, the operator is prompted to eliminate the self-intersecting parts by modification.
[0234] You can determine whether a feature line has self-intersection by traversing each point on the feature line and detecting whether there are other line segments that are close to the point other than the line segment where the traversed point is located. The first point to be detected is any point on the feature line. Fig. 22 As shown, the preset distance can be preset by Fig. 22 R in, draw a circle with the first point to be detected as the center and the preset distance as the radius, take the two intersection points of the circle and the characteristic line as the endpoints of the first characteristic line segment, take the shorter characteristic line between the two endpoints as the first characteristic line segment, and take the longer characteristic line between the two endpoints as the second characteristic line segment.
[0235] It should be noted that, refer to Fig.23 As shown in the figure, there may be more than two intersection points between the circle and the feature line. In this case, two points can be randomly selected from the intersection points as endpoints, which will not affect the effect of self-intersection detection.
[0236] The second point to be detected is any point on the second characteristic line segment. Traverse each second point to be detected and determine the sixth distance between the second point to be detected and the first point to be detected ( Fig.23D) in, and determine whether the sixth distance is less than the sixth distance threshold. The sixth distance threshold is a preset value, which can take a smaller value slightly larger than the distance between vertices, such as 0.05mm. When the sixth distance is less than the sixth distance threshold, it means that the second characteristic line segment is relatively close to the first characteristic line segment at the first point to be detected. Since the second characteristic line segment is generally not parallel to the first characteristic line segment in the normal drawing of the characteristic line, and the distance between the two is less than the sixth distance threshold, it can be determined that the second characteristic line segment and the first characteristic line segment intersect when the sixth distance is less than the sixth distance threshold. At this time, a prompt message indicating that the characteristic line has self-intersection can be generated, and the prompt message can be displayed so that the operator can modify the characteristic line.
[0237] The method for drawing feature lines provided in the embodiment of the present application determines a first feature line segment and a second feature line segment, and determines whether there is an intersection between the first feature line segment and the second feature line segment by determining the distance between the first feature line segment and the second feature line segment, and then outputs a prompt message when there is an intersection, which can prevent operators from mistakenly saving feature lines that have self-intersections.
[0238] 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.
[0239] Based on the same inventive concept, the embodiment of the present application also provides a feature line drawing device for implementing the feature line drawing method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations of one or more feature line drawing device embodiments provided below can refer to the limitations of the feature line drawing method above, and will not be repeated here.
[0240] In one embodiment, Fig.24 As shown, a feature line drawing device 2400 is provided, comprising: a first acquisition module 2402, a first determination module 2404, a second determination module 2406, a processing module 2408, and a generation module 2410, wherein:
[0241] The first acquisition module 2402 is used to acquire a feature line starting point and a feature line target point, and use the feature line starting point as a tracking starting point;
[0242] A first determination module 2404 is used to determine each tracking candidate point corresponding to the tracking starting point from each vertex of the three-dimensional mesh model;
[0243] The second determination module 2406 is used to determine the target direction of the tracking starting point relative to the target point of the feature line, and the tracking direction of each of the tracking candidate points relative to the tracking starting point, and determine a tracking middle point from each of the tracking candidate points according to the target direction and each of the tracking directions, and use the tracking middle point as the feature line middle point;
[0244] The processing module 2408 is used for, when the preset condition is not met, taking the tracking intermediate point as the tracking starting point, and jumping to the step of determining each tracking candidate point corresponding to the tracking starting point from each vertex of the three-dimensional mesh model until the preset condition is met;
[0245] The generating module 2410 is used to generate a feature line according to the feature line starting point, each feature line middle point and the feature line target point.
[0246] The feature line drawing device provided in the embodiment of the present application obtains the feature line starting point and the feature line target point, and then generates multiple feature line intermediate points between the feature line starting point and the feature line target point according to the tracking direction of each tracking candidate point relative to the tracking starting point, and the target direction of the tracking starting point relative to the feature line target point. After determining two points, the embodiment of the present application automatically tracks between the two points to obtain the fitting points (i.e., the feature line intermediate points) required to generate the feature line, without requiring the operator to manually select the fitting points, so that the accuracy of the obtained feature line intermediate points can be improved, thereby improving the drawing accuracy of the feature line.
[0247] In one embodiment, the device further comprises:
[0248] The judgment module is used to judge that the preset condition is met when the tracking intermediate point and the characteristic line target point coincide with each other; or judge that the preset condition is not met when the tracking intermediate point and the characteristic line target point do not coincide with each other.
[0249] In one embodiment, the second determining module 2406 is further configured to:
[0250] Determine a tracking intermediate point from each of the tracking candidate points according to a previous direction, the target direction and each of the tracking directions, wherein the previous direction is a tracking direction corresponding to a previous tracking intermediate point;
[0251] The tracking direction corresponding to the tracking middle point is used as the previous direction.
[0252] In one embodiment, the device further comprises:
[0253] A third determination module, used to respectively determine the curvature corresponding to each of the tracking candidate points on the surface of the three-dimensional mesh model, and respectively determine the first distance between each of the tracking candidate points and the tracking start point;
[0254] The first deleting module is used to delete the tracking candidate points whose curvature does not meet the preset curvature condition and / or whose first distance is less than the first distance threshold from the tracking candidate points to obtain updated tracking candidate points.
[0255] In one embodiment, the second determining module 2406 is further configured to:
[0256] In the case where the previous direction exists, for any of the tracking candidate points, determining a first angle between the tracking direction of the tracking candidate point and the previous direction, and determining a second angle between the tracking direction and the target direction, and in the case where the first angle is greater than a first angle threshold, and / or the second angle is greater than a second angle threshold, deleting the tracking candidate point from the tracking candidate points to obtain updated tracking candidate points;
[0257] Among the first distances corresponding to the updated tracking candidate points, the tracking candidate point corresponding to the smallest first distance is used as the tracking intermediate point.
[0258] In one embodiment, the second determining module 2406 is further configured to:
[0259] In the absence of the previous direction, for any of the tracking candidate points, determining a second angle between the tracking direction and the target direction, and in the case where the second angle is greater than a third angle threshold, deleting the tracking candidate point from the tracking candidate points to obtain updated tracking candidate points;
[0260] According to the updated curvature corresponding to each of the tracking candidate points, a tracking intermediate point is determined from each of the tracking candidate points.
[0261] In one embodiment, the device further comprises:
[0262] The fourth determining module is used to determine the tracking middle point from the tracking candidate points before updating when the tracking candidate points after updating do not exist in the tracking candidate points, and jump to the step of using the tracking middle point as the feature line middle point.
[0263] In one embodiment, the first determining module 2404 is further configured to:
[0264] Determine a second distance between each vertex of the three-dimensional mesh model and the tracking starting point;
[0265] The vertex whose second distance is smaller than a second distance threshold is used as a tracking candidate point corresponding to the tracking start point.
[0266] In one embodiment, the first acquisition module 2402 is further used to:
[0267] When the movement of the mouse pointer is detected, obtaining the resting point of the mouse pointer;
[0268] The characteristic line target point corresponding to the stop point on the surface of the three-dimensional grid model is obtained.
[0269] In one embodiment, the device further comprises:
[0270] A second deleting module is used to delete the feature line when no saving operation is detected and the movement of the mouse pointer is detected, and jump to the step of obtaining the resting point of the mouse pointer when the movement of the mouse pointer is detected;
[0271] The first updating module is used to update the target feature line according to the feature line when a save operation is detected, use the target point of the feature line as the starting point of the feature line, jump to the step of obtaining the resting point of the mouse pointer when the movement of the mouse pointer is detected, until the target point of the feature line coincides with the starting point of the target feature line, and use the target feature line as the finally generated feature line.
[0272] In one embodiment, the generating module 2410 is further used to:
[0273] According to the starting point of the characteristic line, the middle points of each characteristic line and the target point of the characteristic line, a spline curve is fitted, and each interpolation point on the spline curve is obtained;
[0274] For any of the interpolation points, respectively determine a third 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 third 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;
[0275] A feature line is generated according to the feature line starting point, each feature line middle point, each projection point and the feature line target point.
[0276] In one embodiment, the device further comprises:
[0277] 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 fourth distance between the modification point and the feature line;
[0278] A fifth determining module, configured to determine, when the fourth distance is less than a fourth distance threshold, two first connection points corresponding to the modification point on the feature line;
[0279] The second updating module is used to construct a first updating line based on the two first connecting points and the modification point, and to update the feature line based on the first updating line.
[0280] In one embodiment, the device further comprises:
[0281] a sixth determination module, configured to determine a movement path of the mouse pointer when the mouse movement is detected, determine a modification line corresponding to the movement path from the surface of the three-dimensional mesh model, and determine a fifth distance between the modification line and the characteristic line;
[0282] A seventh determination module, configured to determine, when the fifth distance is less than a fifth distance threshold, two second connection points corresponding to the modification line on the characteristic line;
[0283] The third 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.
[0284] In one embodiment, the device further comprises:
[0285] an eighth determination module, configured to determine a first to-be-detected point on the feature line, and determine a first feature line segment and a second feature line segment corresponding to the first to-be-detected point, wherein the second feature line segment is a feature line in the feature line other than the first feature line segment;
[0286] A ninth determination module is used to traverse the second points to be detected in the second feature line segment, determine the sixth distance between the second point to be detected and the first point to be detected for any second point to be detected, and generate and display prompt information when the sixth distance is less than the sixth distance threshold, wherein the prompt information is used to indicate that the feature line has self-intersection.
[0287] Each module in the above-mentioned feature line drawing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module 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 module.
[0288] 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.25 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 drawing a feature line is implemented.
[0289] Those skilled in the art will understand that Fig.25 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.
[0290] 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.
[0291] 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.
[0292] 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.
[0293] 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.
[0294] 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.
[0295] The technical features of the above embodiments may be combined arbitrarily. 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.
[0296] 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 drawing a feature line, characterized in that: The method comprises: Obtaining a feature line starting point and a feature line target point, and using the feature line starting point as a tracking starting point; Determining candidate tracking points corresponding to the tracking starting point from vertices of the three-dimensional mesh model; Determine a target direction of the tracking starting point relative to the target point of the feature line, and a tracking direction of each of the tracking candidate points relative to the tracking starting point, and determine a tracking intermediate point from each of the tracking candidate points according to the target direction and each of the tracking directions, and use the tracking intermediate point as the feature line intermediate point; If the preset condition is not met, the tracking intermediate point is used as the tracking starting point, and the process jumps to the step of determining each tracking candidate point corresponding to the tracking starting point from each vertex of the three-dimensional mesh model until the preset condition is met; A feature line is generated according to the feature line starting point, each feature line intermediate point and the feature line target point.
2. The method according to claim 1, characterized in that The method further comprises: In the case where the tracking intermediate point and the characteristic line target point coincide with each other, determining that the preset condition is satisfied; or, When the tracking intermediate point and the characteristic line target point do not coincide with each other, it is determined that the preset condition is not satisfied.
3. The method according to claim 1, characterized in that The step of determining a tracking intermediate point from the tracking candidate points according to the target direction and each of the tracking directions includes: A tracking intermediate point is determined from each of the tracking candidate points according to a previous direction, the target direction and each of the tracking directions, wherein the previous direction is a tracking direction corresponding to a previous tracking intermediate point.
4. The method according to claim 3, characterized in that After determining the candidate tracking points corresponding to the tracking starting point from the vertices of the three-dimensional mesh model, the method further includes: respectively determining a curvature corresponding to each of the candidate tracking points on the surface of the three-dimensional mesh model, and respectively determining a first distance between each of the candidate tracking points and the tracking starting point; The tracking candidate points whose curvature does not satisfy the preset curvature condition and / or whose first distance is less than the first distance threshold are deleted from the tracking candidate points to obtain updated tracking candidate points.
5. The method according to claim 4, characterized in that The step of determining a tracking intermediate point from each of the tracking candidate points according to the previous direction, the target direction and each of the tracking directions comprises: In the case where the previous direction exists, for any of the tracking candidate points, determining a first angle between the tracking direction of the tracking candidate point and the previous direction, and determining a second angle between the tracking direction and the target direction, and in the case where the first angle is greater than a first angle threshold, and / or the second angle is greater than a second angle threshold, deleting the tracking candidate point from the tracking candidate points to obtain updated tracking candidate points; Among the first distances corresponding to the updated tracking candidate points, the tracking candidate point corresponding to the smallest first distance is used as the tracking intermediate point.
6. The method according to claim 4, characterized in that The step of determining a tracking intermediate point from each of the tracking candidate points according to the previous direction, the target direction and each of the tracking directions further comprises: In the absence of the previous direction, for any of the tracking candidate points, determining a second angle between the tracking direction and the target direction, and in the case where the second angle is greater than a third angle threshold, deleting the tracking candidate point from the tracking candidate points to obtain updated tracking candidate points; According to the updated curvature corresponding to each of the tracking candidate points, a tracking intermediate point is determined from each of the tracking candidate points.
7. The method according to any one of claims 4 to 6, characterized in that The method further comprises: When the tracking candidate point does not exist in the tracking candidate points after the update, the tracking middle point is determined from the tracking candidate points before the update, and the process jumps to the step of using the tracking middle point as the feature line middle point.
8. The method according to claim 1, characterized in that The step of determining, from the vertices of the three-dimensional mesh model, candidate tracking points corresponding to the tracking starting point comprises: Determine a second distance between each vertex of the three-dimensional mesh model and the tracking starting point; The vertex whose second distance is smaller than a second distance threshold is used as a tracking candidate point corresponding to the tracking start point.
9. The method according to claim 1, characterized in that: Get feature line target points, including: When the movement of the mouse pointer is detected, obtaining the resting point of the mouse pointer; The characteristic line target point corresponding to the stop point on the surface of the three-dimensional grid model is obtained.
10. The method according to claim 9, characterized in that After generating the characteristic line according to the characteristic line starting point, the characteristic line target point and each characteristic line intermediate point, the method further includes: If no save operation is detected and movement of the mouse pointer is detected, the feature line is deleted, and the process jumps to the step of obtaining the resting point of the mouse pointer if movement of the mouse pointer is detected; When a save operation is detected, the target feature line is updated according to the feature line, and the target point of the feature line is used as the starting point of the feature line. The process jumps to the step of obtaining the resting point of the mouse pointer when movement of the mouse pointer is detected, until the target point of the feature line coincides with the starting point of the target feature line, and the target feature line is used as the final generated feature line.
11. The method according to claim 1, characterized in that: The generating of the characteristic line according to the characteristic line starting point, each characteristic line intermediate point and the characteristic line target point comprises: According to the starting point of the characteristic line, the middle points of each characteristic line and the target point of the characteristic line, a spline curve is fitted, and each interpolation point on the spline curve is obtained; For any of the interpolation points, respectively determine a third 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 third 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 the feature line starting point, each feature line middle point, each projection point and the feature line target point.
12. A feature line drawing device, characterized in that: The device comprises: The first acquisition module is used to acquire the starting point of the characteristic line and the target point of the characteristic line, and use the starting point of the characteristic line as the tracking starting point; A first determination module, used to determine each tracking candidate point corresponding to the tracking starting point from each vertex of the three-dimensional mesh model; a second determination module, configured to determine a target direction of the tracking starting point relative to the target point of the feature line, and a tracking direction of each of the tracking candidate points relative to the tracking starting point, and determine a tracking intermediate point from each of the tracking candidate points according to the target direction and each of the tracking directions, and use the tracking intermediate point as the feature line intermediate point; a processing module, configured to, if the preset condition is not met, use the tracking intermediate point as the tracking starting point, and jump to the step of determining each tracking candidate point corresponding to the tracking starting point from each vertex of the three-dimensional mesh model until the preset condition is met; A generating module is used to generate a feature line according to the feature line starting point, each feature line intermediate point and the feature line target point.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
14. 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 11 are implemented.
15. 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 11 are implemented.