Self-intersection detection method and program product of spiral surface model in geometry engine
Through the self -intersecting detection method of the spiral curved model in the geometric engine, the spiral curved model self -intersecting detection problem is solved, and the accurate construction of the model and the accuracy of the subsequent simulation results are realized.
Patent Information
- Application Number
- CN202411349439.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-26
AI Technical Summary
In the geometry engine, it is difficult to accurately and comprehensively detect the self-intersection of the spiral surface model, resulting in problems such as rendering errors, incorrect geometry shapes, and physical simulation distortion.
Through the self -intersecting detection method of the spiral curved model in the geometric engine, including non -cyclical and cyclical self -interaction testing. This method involves measure the contour line of the rotation cycle, determines the self -intersecting point, and expresses the self -intersecting situation through the section.
The comprehensive and accurate self -intersecting detection of the spiral curved model is implemented, and the model of the model is avoided, and the accuracy of subsequent rendering, geometric shapes and physical simulation is ensured.
Smart Images

Figure CN118864474B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of three-dimensional modeling of geometric figures, and in particular to a self-intersection detection method and program product of a spiral surface model in a geometric engine. Background Art
[0002] In computer graphics and computer-aided design, the geometry engine constructs various models through 3D modeling, surface and solid modeling. The constructed model carries a spiral surface, that is, when constructing a spiral surface model, the spiral surface model often intersects with itself, that is, a part of the spiral surface model intersects with other parts of itself, that is, the constructed spiral surface model is wrong, which will lead to subsequent rendering errors, incorrect geometric shapes, and physical simulation distortion.
[0003] However, it is difficult to accurately and comprehensively detect the self-intersection of spiral surface models in the implementation of the three-dimensional modeling, surface and solid modeling functions of the geometry engine. Summary of the invention
[0004] One purpose of the present application is to solve the technical problem of self-intersection of spiral surface models accurately and comprehensively for three-dimensional modeling, surface and solid modeling.
[0005] According to one aspect of an embodiment of the present application, a method for detecting self-intersection of a spiral surface model in a geometry engine is disclosed, the method comprising:
[0006] In response to the parametric modeling of the spiral surface model initiated by the geometry engine, a self-intersection detection of the spiral surface model to be constructed is initiated, wherein the self-intersection detection includes a non-periodic self-intersection detection and a periodic self-intersection detection;
[0007] By performing a non-periodic self-intersection detection of a spiral surface model corresponding to a contour line of a rotation period, a self-intersection situation of contour lines on the spiral surface model is determined, and the spiral surface model is a model to be constructed and output by the geometric engine for current parametric modeling;
[0008] By continuing to process the self-intersection detection under the non-periodic condition for the profile expression of the contour line in the rotation period, the self-intersection condition of the non-contour line on the spiral surface model is determined;
[0009] Performing self-intersection detection under continuous periods to determine the periodic self-intersection situation on the spiral surface model;
[0010] The self-intersection points located in the self-intersection detection are obtained to form a self-intersection point set on the spiral surface model, and the self-intersection point set is used for processing the self-intersection situation of the spiral surface model.
[0011] According to one aspect of an embodiment of the present application, the non-periodic self-intersection detection of the spiral surface model is performed by the contour line corresponding to the rotation period to determine the self-intersection of the contour line on the spiral surface model, including:
[0012] On the contour line corresponding to the rotation period, the distance between two points is measured to determine the minimum measurement parameter of the mapping;
[0013] According to the minimum metric parameter on the contour line, it is determined that there is a self-intersection of the contour line on the spiral surface model, and the point on the contour line corresponding to the minimum metric parameter is the located self-intersection point.
[0014] According to one aspect of the embodiment of the present application, the distance between two points is measured on the contour line corresponding to the rotation period to determine the minimum metric parameter mapped, including:
[0015] Facing a contour line corresponding to a rotation period, obtaining a curve function of the contour line;
[0016] Performing measurement calculation between two points on the contour line by using the curve function, thereby obtaining a set of distance measurement values measuring the size of the distance, each distance measurement value corresponding to the two points on the contour line;
[0017] The minimum value in the set of distance measurement values is taken as the minimum metric parameter on the contour line.
[0018] According to one aspect of an embodiment of the present application, the step of performing a metric calculation between two points on a contour line by using the curve function and thereby obtaining a set of distance measurement values for measuring the distance size includes:
[0019] Approximating the contour line at both ends, determining the mapping values of two points in the two-dimensional space by the curve function during the approximation of the contour line at both ends, and performing metric calculation between the two points by the mapping values;
[0020] The distance between the two points is measured by the numerical value obtained by measuring on the contour line to obtain the distance measurement value between the two points, and so on, to complete the approximation of the two ends on the contour line.
[0021] According to one aspect of an embodiment of the present application, measuring the distance between two points by a numerical value obtained by measuring on a contour line to obtain a distance measurement value between the two points includes:
[0022] The distance between two points is measured by using the binary norm of the value measured on the contour line, and the square of the binary norm is used as the distance measurement value between the two points.
[0023] According to one aspect of an embodiment of the present application, the self-intersection detection under the non-periodic condition is continued to be processed by the profile expression of the contour line in the rotation period to determine the self-intersection of the non-contour line on the spiral surface model, including:
[0024] Obtaining a profile expression of the contour line through the contour line in the rotation period and the corresponding spiral axis, wherein the profile expression is a profile line of the spiral surface model where the contour line is located or an approximate representation of the profile line;
[0025] A self-intersection detection is performed on the cross-section expression, and the self-intersection of non-contour lines on the spiral surface model is determined based on whether the cross-section expression is self-intersecting.
[0026] According to one aspect of an embodiment of the present application, the profile is expressed as a profile line, and the profile expression of the profile is obtained through the profile in the rotation period and the corresponding spiral axis, including:
[0027] For all contour lines in the rotation period, a spiral surface model under the rotation period and a cross section in the spiral surface model are generated, wherein the cross section includes a spiral axis of the spiral surface model;
[0028] An intersection operation is performed on the spiral surface model and the cross section to obtain a section line.
[0029] According to one aspect of an embodiment of the present application, the self-intersection detection of the cross-section expression is performed, and the self-intersection of the non-contour lines on the spiral surface model is determined by whether the cross-section expression is self-intersecting, including:
[0030] Measuring the distance between two points on the profile line to determine the minimum measurement parameter of the profile line;
[0031] The self-intersection of the section line is determined according to the minimum metric parameter of the section line, and the self-intersection of the non-contour line on the spiral surface model is determined according to the self-intersection of the section line.
[0032] According to one aspect of an embodiment of the present application, measuring the distance between two points on the profile line to determine the minimum measurement parameter of the profile line includes:
[0033] Obtaining a curve function of the profile line for the profile line;
[0034] Performing measurement calculation between two points on the profile line by using the curve function, thereby obtaining a set of distance measurement values measuring the distance between the two points, each distance measurement value corresponding to two points on the profile line;
[0035] The minimum value in the set of distance measurement values is taken as the minimum measurement parameter of the profile line.
[0036] According to one aspect of an embodiment of the present application, the step of performing a measurement calculation between two points on a profile line by using the curve function, and thereby obtaining a set of distance measurement values for measuring the distance between the two points, includes:
[0037] Approximating the two ends of the profile line, and determining the mapping values of two points in the two-dimensional space by the curve function during the approximation of the two ends of the profile line, and then performing a metric calculation between the two points on the mapping value;
[0038] The distance between the two points is measured by the numerical value obtained by measuring on the contour line to obtain the distance measurement value between the two points, and so on, to complete the approximation of the two ends on the profile line.
[0039] According to one aspect of an embodiment of the present application, measuring the distance between two points by a numerical value obtained by measuring on a contour line to obtain a distance measurement value between the two points includes:
[0040] The distance between two points is measured by using the binary norm of the value measured on the contour line, and the square of the binary norm is used as the distance measurement value between the two points.
[0041] According to one aspect of an embodiment of the present application, the profile expression is an approximate representation of the profile line, and the profile expression of the profile line is obtained through the profile line in the rotation period and the corresponding spiral axis, including:
[0042] Generating a sampling parameter set for the contour line, wherein the sampling parameter set is used to control sampling of the contour line;
[0043] Sampling the contour line according to the sampling parameter set, and forming a point set with the sampling points obtained by sampling;
[0044] The sampling points in the point set are converted to the same plane containing the spiral axis to obtain an approximate representation of the section line on the spiral surface model where the contour line is located.
[0045] According to one aspect of the embodiment of the present application, the sampling parameter set is an increasing sequence within the definition domain.
[0046] According to one aspect of an embodiment of the present application, the step of generating a sampling parameter set for the contour line includes:
[0047] The sampling parameter set is formed by acquiring arbitrary points of the contour line adapted to the sampling accuracy, the arbitrary points belonging to the definition domain of the contour line, and the number of the acquired arbitrary points corresponds to the sampling accuracy.
[0048] According to one aspect of an embodiment of the present application, converting the sampling points in the point set to the same plane containing the spiral axis to obtain an approximate representation of the profile line on the spiral surface model where the contour line is located includes:
[0049] For each sampling point in the point set, the spiral axis is rotated to the same plane containing the spiral axis, and the two-dimensional points of the sampling point on the plane are obtained to form a two-dimensional point set;
[0050] An approximate representation of a section line on the spiral surface model where the contour line is located is obtained through all points in the two-dimensional point set.
[0051] According to one aspect of an embodiment of the present application, obtaining an approximate representation of a section line on the spiral surface model where the contour line is located through all points in the two-dimensional point set includes:
[0052] All points in the two-dimensional point set are fitted, and the line obtained by fitting is used as an approximate representation of the profile line on the spiral surface model where the contour line is located.
[0053] According to one aspect of an embodiment of the present application, obtaining an approximate representation of a section line on the spiral surface model where the contour line is located through all points in the two-dimensional point set includes:
[0054] Connecting the two-dimensional points in the two-dimensional point set, a plurality of broken line segments are obtained, and the plurality of broken line segments form a broken line segment set, and the broken line segment set is used as an approximate representation of the section line on the spiral surface model where the contour line is located.
[0055] According to one aspect of an embodiment of the present application, the self-intersection detection of the cross-section expression is performed, and the self-intersection of the non-contour lines on the spiral surface model is determined by whether the cross-section expression is self-intersecting, including:
[0056] For the cross-sectional expression, measuring the distance between two points and determining the minimum measurement parameter of the mapping;
[0057] The self-intersection of the section expression is determined according to the minimum metric parameter, and the self-intersection of the non-contour lines on the spiral surface model is determined by whether the section expression is self-intersecting. The point on the section expression corresponding to the minimum metric parameter is the located self-intersection point.
[0058] According to one aspect of an embodiment of the present application, the step of measuring the distance between two points on the profile expression and determining the mapped minimum measurement parameter includes:
[0059] For the cross-sectional expression corresponding to the rotation period, obtain the corresponding curve function;
[0060] Performing measurement calculation between two points on the profile expression by using the curve function, and thereby obtaining a set of distance measurement values measuring the size of the distance, each distance measurement value corresponding to two points on the profile expression;
[0061] The minimum value in the set of distance measurement values is taken as the minimum metric parameter on the contour line.
[0062] According to one aspect of an embodiment of the present application, the step of performing a measurement calculation between two points on the profile expression by using the curve function, and thereby obtaining a set of distance measurement values for measuring the distance size, includes:
[0063] Performing two-end approximation on the cross-sectional expression, determining mapping values of two points in two-dimensional space by the curve function during the two-end approximation of the cross-sectional expression, and performing metric calculation between the two points by the mapping values;
[0064] The distance between two points is measured by the numerical value obtained by measuring on the contour line to obtain the distance measurement value between the two points, and so on, to complete the two-end approximation on the profile expression.
[0065] According to one aspect of an embodiment of the present application, measuring the distance between two points by a numerical value obtained by measuring on a contour line to obtain a distance measurement value between the two points includes:
[0066] The distance between two points is measured by using the binary norm of the value measured on the contour line, and the square of the binary norm is used as the distance measurement value between the two points.
[0067] According to one aspect of an embodiment of the present application, the self-intersection detection under continuous periods to determine the periodic self-intersection situation on the spiral surface model includes:
[0068] Obtaining a section line corresponding to each rotation period by drawing a spiral surface model corresponding to each rotation period;
[0069] Calculate the distance between the section lines corresponding to the adjacent periods to obtain the section line distance between the adjacent periods;
[0070] The intersecting section lines are determined according to the section line distances of adjacent periods to determine whether the spiral surface model where the intersecting section lines are located is periodically self-intersecting.
[0071] According to one aspect of an embodiment of the present application, the self-intersection detection under continuous periods to determine the periodic self-intersection situation on the spiral surface model includes:
[0072] For the pre-constructed spiral surface model, obtaining a curve function representing a starting profile line, wherein the curve function represents a profile line of the spiral surface model on a cross section at a starting period of the pre-constructed spiral surface model;
[0073] The curve function of the starting profile line is iteratively calculated to obtain the curve function of the profile line corresponding to the adjacent period, and the profile line distance calculation of the adjacent period is controlled by the curve function to obtain the profile line distance of the adjacent period;
[0074] The intersecting section lines are determined according to the section line distances of adjacent periods to determine whether the spiral surface model where the intersecting section lines are located is periodically self-intersecting.
[0075] According to one aspect of the embodiment of the present application, the curve function calculation of the profile lines corresponding to the adjacent periods further includes:
[0076] Relative to the profile line corresponding to the current period, the profile line curve function is translated to obtain the curve function of the profile line corresponding to the adjacent period. The profile line corresponding to the current period includes the starting profile line and the profile line of the previous period of the iterative calculation of the profile line corresponding to the adjacent period.
[0077] According to one aspect of an embodiment of the present application, the pitch of the spiral surface model increases or decreases in consecutive cycles, and the profile line corresponding to the current cycle is translated to obtain the profile line curve function corresponding to the adjacent cycle, including:
[0078] The curve function of the section line corresponding to the current period is deformed and translated to obtain the curve function of the section line corresponding to the adjacent period.
[0079] According to one aspect of an embodiment of the present application, after obtaining the self-intersection points located in the self-intersection detection to form a set of self-intersection points on the spiral surface model, the method further includes:
[0080] The self-intersecting helical surfaces on the helical surface model are segmented according to the self-intersecting lines formed by the self-intersecting point set.
[0081] According to one aspect of an embodiment of the present application, a computer program product is disclosed, including a computer program, wherein the computer program implements the steps of any of the above methods when executed by a processor.
[0082] According to one aspect of an embodiment of the present application, a computer device is disclosed, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any of the methods described above.
[0083] According to one aspect of an embodiment of the present application, a computer program product is disclosed, including a computer program, wherein when the computer program is executed by a processor, the steps of the method described above are implemented.
[0084] According to one aspect of an embodiment of the present application, a computer-readable storage medium is disclosed, on which a computer program is stored, and when the program is executed by a processor, the steps of the method described above are implemented.
[0085] The embodiment of the present application is directed to the required construction of a spiral surface model. In response to the parametric modeling of the spiral surface model initiated by the geometry engine, the self-intersection detection of the spiral surface model to be constructed is initiated. The self-intersection detection includes a non-periodic self-intersection detection and a periodic self-intersection detection. The non-periodic self-intersection detection of the spiral surface model is performed by the contour lines corresponding to the rotation period to first determine the self-intersection of the contour lines on the spiral surface model. Then, the non-periodic self-corresponding detection is continued to be processed by the profile line expression of the contour lines in the rotation period to determine the self-intersection of the non-contour lines on the spiral surface model. In this way, the non-periodic self-intersection detection can be completed for the required construction of the spiral surface model.
[0086] After the geometry engine determines the non-periodic self-intersection of the spiral surface model to be constructed, it then performs self-intersection detection under continuous periods to determine the periodic self-intersection. At this point, both non-periodic and periodic self-intersection detections are implemented in the self-intersection detection of the spiral surface model to be implemented, ensuring that the self-intersection detection of the spiral surface model can be realized and is comprehensive and accurate.
[0087] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0088] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
[0090] Figure 1 A flow chart of a method for detecting self-intersection of a spiral surface model in a geometry engine according to an embodiment of the present application is shown.
[0091] Figure 2 is based on Figure 1 A flowchart of a method for describing the steps of performing non-periodic self-intersection detection of a spiral surface model by contour lines corresponding to a rotation period to determine the self-intersection of contour lines on the spiral surface model is shown in the corresponding embodiment.
[0092] Figure 3 is based on Figure 2The corresponding embodiment shows a flow chart of a method for measuring the distance between two points on a contour line corresponding to a rotation period and determining the mapped minimum measurement parameter step.
[0093] Figure 4 is based on Figure 3 A flowchart of a method for performing measurement calculation between two points on a contour line by using a curve function and thereby obtaining a set of distance measurement value steps for measuring the distance size is shown in the corresponding embodiment.
[0094] Figure 5 is based on Figure 1 The corresponding embodiment shows a flowchart of a method for determining the self-intersection of non-contour lines on a spiral surface model by continuing to process the self-intersection detection under non-periodic conditions on the cross-sectional expression of the contour lines in the rotation period.
[0095] Figure 6 is based on Figure 5 A flowchart of a method for obtaining a profile expression step of a contour line through the contour line in a rotation cycle and the corresponding spiral axis is shown in the corresponding embodiment.
[0096] Figure 7 is based on Figure 5 A flowchart of a method for obtaining a profile expression step of a contour line through the contour line in a rotation cycle and the corresponding spiral axis is shown in the corresponding embodiment.
[0097] Figure 8 is based on Figure 7 A flowchart of a method for converting sampling points in a point set to the same plane containing the spiral axis to obtain an approximate representation of a section line on a spiral surface model where a contour line is located, shown in a corresponding embodiment.
[0098] Fig. 9 is based on Figure 1 A flowchart of a method for describing the situation of performing self-intersection detection in continuous periods to determine periodic self-intersections on a spiral surface model is shown in the corresponding embodiment.
[0099] Fig.10 is based on Figure 1 A flowchart of a method for describing the steps of performing self-intersection detection in continuous periods to determine the periodic self-intersection on a spiral surface model is shown in the corresponding embodiment. DETAILED DESCRIPTION
[0100] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present application will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0101] In addition, the described features, structures or characteristics may be combined in one or more example embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present application. However, those skilled in the art will appreciate that the technical solution of the present application may be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. may be adopted. In other cases, known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring the present application and making the various aspects of the present application obscure.
[0102] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0103] The embodiments of the present application are applied to the construction of spiral surface models in three-dimensional modeling, surface and solid modeling in the geometry engine, so that the self-intersection detection of the spiral surface model to be constructed in the geometry engine is implemented through the embodiments of the present application, so as to comprehensively and accurately ensure the detection of self-intersections in the spiral surface model, avoid errors in the construction of the spiral surface model, and thus achieve the spiral surface model and the smooth construction of the spiral surface model.
[0104] On the one hand, through the execution of the embodiments of the present application, the geometry engine can perform pre-calculation before generating the spiral surface model, thereby processing the spiral surface model to be generated by pre-calculating the self-intersection of the spiral surface model, such as pre-generating the spiral surface model pulled by the current surface function and implementing corresponding surface clipping.
[0105] On the other hand, after eliminating the self-intersection of the pre-generated helical surface model, the corresponding section line can be solved therefrom, so that the correct helical surface model can be generated from the curve function of the section line.
[0106] In summary, in the model generation of three-dimensional modeling, surface and solid modeling implemented by the geometry engine, the self-intersection of the spiral surface model to be generated will be detected through the embodiments of the present application, so that the spiral surface model can be finally generated.
[0107] See also Figure 1 , Figure 1 A flow chart of a method for detecting self-intersection of a spiral surface model in a geometry engine according to an embodiment of the present application is shown. The present application embodiment provides a method for detecting self-intersection of a spiral surface model in a geometry engine, the method comprising:
[0108] Step S110, in response to the parametric modeling of the spiral surface model initiated by the geometry engine, initiating a self-intersection detection of the spiral surface model to be constructed, wherein the self-intersection detection includes a non-periodic self-intersection detection and a periodic self-intersection detection;
[0109] Step S120, performing a non-periodic self-intersection detection of the spiral surface model by using contour lines corresponding to the rotation period to determine the self-intersection of contour lines on the spiral surface model, where the spiral surface model is the model to be constructed and output by the geometry engine for current parametric modeling;
[0110] Step S130, by continuing to process the self-intersection detection under the non-periodic condition on the profile expression of the contour line in the rotation period, determining the self-intersection of the non-contour line on the spiral surface model;
[0111] Step S140, performing self-intersection detection under continuous periods to determine the periodic self-intersection situation on the spiral surface model;
[0112] Step S150, obtaining the self-intersection points located in the self-intersection detection, forming a self-intersection point set on the spiral surface model, and the self-intersection point set is used for processing the self-intersection situation of the spiral surface model.
[0113] These steps are described in detail below.
[0114] First of all, it should be explained that the spiral surface model is a three-dimensional spiral body, which can be a part of a model or the model itself. For example, in the three-dimensional modeling, surface and solid modeling, the surface can be constructed by rotating the section line according to a certain spiral direction and pitch.
[0115] In step S110, the geometry engine implements the construction of various three-dimensional models through parametric modeling. Exemplarily, the parametric modeling refers to determining the corresponding function through the parameters defined in the geometry engine, and the function describes the three-dimensional model to be constructed.
[0116] Take the spiral surface model as an example. The geometry engine will determine the surface function that describes the spiral surface model to be constructed by defining its spiral direction, pitch and other parameters, and then the spiral surface model to be constructed can be pulled out by the surface function.
[0117] Before the geometry engine pulls and outputs the spiral surface model, that is, after initiating the parametric modeling of the spiral surface model based on the parameter input and before constructing and outputting the spiral surface model, the self-intersection detection of the spiral surface model will be initiated to avoid and resolve errors in the construction of the spiral surface model in the geometry engine, to ensure the construction and output of the spiral surface model, and thereby enable the geometry engine to possess and enhance the modeling parameters of the spiral surface model.
[0118] In step S120, the contour line self-intersection detection in the non-periodic self-intersection detection is first performed for the spiral surface model to be constructed. On the spiral surface model formed by the rotation of the profile line, the several lines used to constitute the surface are the contour lines on the spiral surface model. In other words, the contour lines weave a spiral surface model. The spiral surface model is the spiral surface model to be generated and output, and the self-intersection situation of the spiral surface model to be generated and output is first detected based on the contour line.
[0119] When the contour line intersects itself, the spiral surface model in the rotation period where the contour line is located must be self-intersecting. Based on this, a non-periodic self-intersection detection is first performed based on the contour line corresponding to the rotation period to determine the existence of contour line self-intersection in non-periodic self-intersection on the spiral surface model corresponding to certain rotation periods.
[0120] For the self-intersection detection performed, the contour lines corresponding to each rotation period are first used to implement one aspect of the self-intersection detection, namely, the self-intersection of non-periodic contour lines, which will enhance the ease of use of the self-intersection detection of the spiral surface model and lower the threshold.
[0121] The contour line will rotate periodically according to the spiral path to generate a spiral surface model. Therefore, on the spiral surface model generated by rotating the contour line according to the set pitch and spiral path, the self-intersecting surface includes non-periodic self-intersection and periodic self-intersection. Among them, the self-intersection under non-periodic refers to the self-intersection under non-continuous period, for example, the self-intersection of the surface occurs within a certain period. Further explanation, the self-intersection under non-periodic includes the contour line self-intersection referred to in step S120, and the non-contour line self-intersection referred to in step S130.
[0122] If the contour lines within a rotation period are self-intersecting, then the spiral surface model within the rotation period is self-intersecting. The case of non-periodic self-intersection other than contour line self-intersection is non-contour line self-intersection, and the self-intersection detection involved is implemented as shown in the following step S130.
[0123] The case of surface self-intersection other than non-periodic self-intersection is the case of periodic self-intersection. So far, the surface referred to is the spiral surface model within the rotation period. It should be understood that periodic self-intersection is the self-intersection of the surface due to the pitch. Exemplarily, because the pitch of the spiral surface model in adjacent rotation periods is too short, the spiral surface models in adjacent rotation periods intersect. Specifically, the pitch (HLoop) refers to the distance that the section line moves along the spiral axis in one rotation period, which is equivalent to the offset of the section line on the spiral axis.
[0124] During the execution of step S120, the self-intersection detection of the contour line of each rotation period is performed. If the contour line self-intersects, it is determined that the spiral surface model within the rotation period where the contour line is located has self-intersection. The self-intersection is the self-intersection of the non-periodic contour line as described above.
[0125] When constructing a spiral surface model, we first check whether the contour lines corresponding to each rotation period are self-intersecting, so as to determine the self-intersection of the surface within a rotation period. When the section lines are self-intersecting, the spiral surface model within the rotation period must be self-intersecting. Therefore, the self-intersection detection of the spiral surface model implemented by the contour lines corresponding to the rotation period enhances accuracy.
[0126] As mentioned above, the contour line is a continuous curve, corresponding to continuous rotation cycles, and each rotation cycle has a corresponding contour line, which can be used for full-cycle self-intersection detection on the spiral surface model, so that all rotation cycles cover the surface self-intersection detection, ensuring the comprehensiveness of the spiral surface model self-intersection detection.
[0127] Exemplarily, the self-intersection detection of the contour line includes: on the contour line corresponding to the rotation period, measuring the distance between two points on the contour line, thereby determining the minimum measurement parameter on the contour line, and determining whether the contour line is self-intersecting by the minimum measurement parameter. If the contour line is self-intersecting, the spiral surface model within the rotation period is also self-intersecting.
[0128] Exemplarily, the contour line corresponding to the rotation period has a corresponding contour line and a corresponding curve function, and the contour line is characterized by the curve function. Therefore, in the self-intersection detection of the contour line corresponding to the rotation period, the distance between two points on the contour line is measured by the curve function.
[0129] To further illustrate, for the contour line corresponding to each rotation period, the distance measurement between two points on the contour line is performed through a curve function, including: using the curve function of the contour line to perform a measurement calculation between the two points on the contour line, thereby obtaining a distance measurement value between any two points on the contour line, and the distance measurement value between any two points on the contour line constitutes a set of distance measurement values corresponding to the rotation period, and the minimum value is selected from them as a measurement of the distance between the two points on the contour line.
[0130] Among them, the distance measurement between two points of the contour line is to approximate the contour line at both ends to determine the slope between the two points involved by approximating the two ends, and measure the distance between the two points by the obtained slope to obtain the distance measurement value.
[0131] For two points approaching the contour line, the distance between the two points is measured by the bi-norm of the obtained slope, and the square of the bi-norm is used as the distance measurement value between the two points.
[0132] The obtained distance measurement value is used to determine whether the spiral surface model corresponding to the rotation period has a spiral surface model self-intersection situation in which the non-periodic contour lines self-intersect in the execution of step S120.
[0133] See also Figure 2 , Figure 2 is based on Figure 1 A flowchart of a method for describing the steps of performing non-periodic self-intersection detection of a spiral surface model by contour lines corresponding to a rotation period to determine the self-intersection of contour lines on the spiral surface model is shown in the corresponding embodiment.
[0134] The step S120 of performing a non-periodic self-intersection detection of a spiral surface model by using contour lines corresponding to a rotation period to determine the self-intersection of contour lines on the spiral surface model provided in the embodiment of the present application includes:
[0135] Step S121, measuring the distance between two points on the contour line corresponding to the rotation period, and determining the minimum measurement parameter of the mapping;
[0136] Step S122, determining whether there is a self-intersection of the contour line on the spiral surface model according to the minimum metric parameter on the contour line, and the point on the contour line corresponding to the minimum metric parameter is the located self-intersection point.
[0137] These two steps are described in detail below.
[0138] In step S121, the distance between any two points on the contour line is measured to determine the distance measurement value mapped by the distance between the two points. It can be understood that a number of groups of distance measurement values between any two points are obtained, and the minimum value in the group of distance measurement values is taken as the minimum measurement parameter of the contour line mapping within the rotation cycle. In other words, the minimum measurement parameter of the contour line mapping within a rotation cycle is the minimum value of the distance measurement value obtained.
[0139] See also Figure 3 , Figure 3 is based on Figure 2 The corresponding embodiment shows a flow chart of a method for measuring the distance between two points on a contour line corresponding to a rotation period and determining the mapped minimum measurement parameter step.
[0140] The embodiment of the present application provides a step S121 of measuring the distance between two points on the contour line corresponding to the rotation period and determining the mapped minimum measurement parameter, including:
[0141] Step S1211, facing the contour line corresponding to the rotation period, obtaining a curve function of the contour line;
[0142] Step S1212, performing measurement calculation between two points on the contour line by using a curve function, and thereby obtaining a set of distance measurement values for measuring the distance, each distance measurement value corresponding to two points on the contour line;
[0143] Step S1213: taking the minimum value in the group of distance measurement values as the minimum metric parameter on the contour line.
[0144] These steps are described below.
[0145] As mentioned above, the contour line corresponding to each rotation period is characterized by a curve function, that is, the curve function is the existence form of the contour line. Therefore, the distance calculation between two points on the contour line is implemented by the curve function, thereby ensuring the accuracy of the calculation.
[0146] On the contour line, the distance between two points is continuously measured to find the two points corresponding to the minimum distance measurement value, so as to confirm whether the contour line of the corresponding rotation period is self-intersecting or not.
[0147] The distance measurement performed will be based on the slope between the two points. It can be understood that the distance measurement involved in determining whether the contour line within the rotation period is self-intersecting is the execution process of finding the two points with the closest distance. When the two points are infinitely close until they coincide, the corresponding slope is zero, but it is impossible to calculate to zero in the actual operation. Therefore, the relationship between the two points will be characterized by the measurement calculation between the two points first, and then the distance between the two points will be measured by the distance operation in the vector, such as the second norm of the slope, and finally the square of the second norm will be taken as the measurement value of the distance between the two points.
[0148] See also Figure 4 , Figure 4 is based on Figure 3 A flowchart of a method for performing measurement calculation between two points on a contour line by using a curve function and thereby obtaining a set of distance measurement value steps for measuring the distance size is shown in the corresponding embodiment.
[0149] The step S1212 of performing measurement calculation between two points on a contour line by using a curve function and thereby obtaining a set of distance measurement values for measuring the distance provided in the embodiment of the present application includes:
[0150] Step S301, approximating the contour line at both ends, determining the mapping values of two points in the two-dimensional space by using a curve function during the approximation of the contour line at both ends, and performing metric calculation between the two points by using the mapping values;
[0151] Step S302, measuring the distance between two points by the numerical value obtained by measuring on the contour line, obtaining the distance measurement value between the two points, and so on, completing the approximation of the two ends on the contour line.
[0152] These two steps are explained below.
[0153] In each rotation period, for the contour line within the rotation period, the mapping value of the two approximated points in the two-dimensional space is determined under the action of the curve function. The mapping value is the two-dimensional vector corresponding to the point on the contour line in the two-dimensional space.
[0154] After obtaining the mapping value representing the two-dimensional vector, the metric calculation between two points can be performed based on it.
[0155] For example, the metric calculation between two points may be performed by slope calculation, and then the corresponding slope is obtained to characterize the relationship between the two points, as shown in the following formula:
[0156]
[0157] in, are two points on the contour line that measure the distance, which exist in the form of mapping values, and its domain is .
[0158] From this, the calculated value can be measured, that is, the slope To represent the points on the contour line s and Point t The relationship between.
[0159] After calculating the slope of two points, the distance between the two points is measured by the obtained slope. For example, it can be obtained by calculating the Euclidean distance between vectors, for example, taking the square of the second norm of the slope to obtain the distance measurement value between the two points.
[0160] In summary, by approximating the two ends of the contour line, the mapping values corresponding to the two points in the two-dimensional space are continuously determined and measured, and then the distance between the two points is measured to obtain the distance measurement value between the two points currently being approximated, and so on, until the approximation of the two points in each rotation period of the contour line is completed, thereby obtaining a set of distance measurement values, each of which corresponds to two points.
[0161] Specifically, the calculation of the distance measurement value between two points can be implemented by the following formula, namely:
[0162]
[0163] Will Recorded as The square of the 2-norm.
[0164] It should be understood that the function to which the calculated distance measure is mapped is is the curve function of the contour line L Correspondingly, the minimum metric parameter required to be determined d As described in the following formula, that is:
[0165]
[0166] in, Is the distance measure The minimum value of .
[0167] Therefore, it can be seen that the execution process of measuring the distance between the two points by the numerical value obtained by measuring on the contour line in step S302 to obtain the distance measurement value between the two points includes: measuring the distance between the two points by the second norm of the slope, and taking the square of the second norm as the distance measurement value between the two points.
[0168] The self-intersection problem is now converted to the minimum metric parameter d The solution is when d = 0, the contour lines intersect with each other. In actual operation, is a non-self-intersecting curve, and when is a self-intersecting curve.
[0169] d The solution is converted into a numerical solution, which can be achieved through algorithms such as gradient descent, conjugate gradient method, Newton method and quasi-Newton method.
[0170] This is the non-periodic contour line self-intersection detection. By executing step S120, it is confirmed whether the spiral surface model has a surface self-intersection type of non-periodic contour line self-intersection.
[0171] After completing the non-periodic contour line self-intersection detection, the spiral surface model is subjected to non-contour line self-intersection detection corresponding to each rotation period in step S130 to determine whether there is a spiral surface model self-intersection situation in which the non-contour lines are self-intersecting under the non-periodic condition on the spiral surface model.
[0172] In step S130, it should be first explained that the self-intersection detection of the spiral surface model is performed before the spiral surface model is generated, so as to confirm that the spiral surface model to be generated has no self-intersection, so that the generation of the spiral surface model will not be wrong. Therefore, it can be understood that there is no spiral surface model at this time, but only the contour line used to generate the spiral surface model. At this time, it is necessary to continue the self-intersection detection under non-periodic conditions by expressing the profile of the contour line in the rotation period to determine the self-intersection of the non-contour line in the self-intersection of the spiral surface model.
[0173] The contour lines within the rotation period are non-self-intersecting, but a self-intersecting surface is generated. The self-intersection of the spiral surface model that occurs at this time is the non-contour line self-intersection in the non-periodic self-intersection.
[0174] As mentioned above, the self-intersection under non-periodic, i.e., non-continuous periodic, includes contour line self-intersection and non-contour line self-intersection. The self-intersection of the spiral surface model with self-intersection of contour line is first eliminated by the execution of step S120, and then the non-contour line self-intersection on the spiral surface model is determined by the execution of step S120.
[0175] In the execution of step S130, for each rotation period, the profile expression of the contour line is first obtained, and then the self-intersection detection of the profile expression of the contour line is performed, and the self-intersection of the non-contour line on the spiral surface model is determined by whether the profile expression is self-intersecting.
[0176] The profile expression refers to the mapping of the contour line on a plane containing the spiral axis. The profile expression is used to characterize the section line corresponding to the contour line. Based on this, the profile expression includes the section line itself and the approximate representation of the section line.
[0177] The profile line is obtained by intercepting the pre-generated spiral surface model; the approximate representation of the profile line is obtained by sampling and mapping the contour line.
[0178] The profile expression of the contour line is first obtained by using the contour lines distributed in each rotation period and the corresponding spiral axis. The profile expression is the section line of the spiral surface model where the contour line is located or an approximate expression of the section line. The section line or the approximate expression of the section line is then subjected to self-intersection detection. The self-intersection of non-contour lines on the spiral surface model is determined by whether the detection results in intersection.
[0179] Exemplarily, in the execution of step S130, the section line of the spiral surface model where the contour line is located can be obtained through the contour lines distributed in each rotation period and the corresponding spiral axis. The execution process involved includes: pre-generation of the spiral surface model under the control of the contour line and the spiral axis, and pre-generation of the section containing the spiral axis in the pre-generated spiral surface model; the required section line can be obtained by performing an intersection operation between the pre-generated section and the spiral surface model.
[0180] In addition, in the execution of step S130, the helical surface model and the section may not be pre-generated, but an approximate representation of the section line may be obtained only by sampling the contour line and converting the sampling points obtained by sampling to the same plane containing the helical axis.
[0181] See also Figure 5 , Figure 5 is based on Figure 1 The corresponding embodiment shows a flowchart of a method for determining the self-intersection of non-contour lines on a spiral surface model by continuing to process the self-intersection detection under non-periodic conditions on the cross-sectional expression of the contour lines in the rotation period.
[0182] The step S130 provided in the embodiment of the present application of further processing the self-intersection detection under the non-periodic condition for the profile expression of the contour line in the rotation period to determine the self-intersection of the non-contour line on the spiral surface model includes:
[0183] Step S131, obtaining a profile expression of the contour line through the contour line in the rotation period and the corresponding spiral axis, the profile expression being a profile line of the spiral surface model where the contour line is located or an approximate representation of the profile line;
[0184] Step S132, performing self-intersection detection of the cross-section expression, and determining whether the cross-section expression is self-intersecting or not, whether the non-contour lines on the spiral surface model are self-intersecting.
[0185] These two steps are described in detail below.
[0186] First of all, it should be explained that the contour line, the spiral axis and the pitch define the spiral surface model. Therefore, on the one hand, the spiral surface model is determined under the action of the contour line and the spiral axis during the rotation period. On the other hand, the profile line of the contour line or the approximate representation of the profile line is also determined under the action of the contour line and the spiral axis.
[0187] Therefore, in the execution of step S131, the cross-sectional expression of the contour line can be obtained through the contour line and the spiral axis in the rotation period, and then the self-intersection detection of the cross-sectional expression is performed through the execution of step S132.
[0188] See also Figure 6 , Figure 6 is based on Figure 5 A flow chart of a method for obtaining a profile expression step of a contour line through the contour line in a rotation cycle and the corresponding spiral axis according to an embodiment.
[0189] The profile is expressed as a profile line. The step S131 of obtaining the profile expression of the profile through the profile in the rotation period and the corresponding spiral axis provided in the embodiment of the present application includes:
[0190] Step S1311a, generating a spiral surface model and a cross section in the spiral surface model for all contour lines in the rotation period, wherein the cross section includes the spiral axis of the spiral surface model;
[0191] Step S1312a, performing intersection operation on the spiral surface model and the cross section to obtain a section line.
[0192] These two steps are described below.
[0193] As mentioned above, the contour line and the spiral axis define the spiral surface model, and through the defined spiral surface model and its spiral axis, the spiral surface model can be cut through the spiral axis to obtain a corresponding section, so the section must contain the spiral axis in the spiral surface model.
[0194] In this way, the helical surface model and the cross section can be pre-generated, and then the intersection operation between the two can be performed to obtain the section line of the contour line on the cross section. In other words, the intersection line of the helical surface model and the cross section is the section line to be obtained.
[0195] Therefore, a self-intersection check is performed on the section line obtained from the contour line in step S130 to determine whether the section line self-intersects or not to determine the self-intersection of the non-contour line on the spiral surface model.
[0196] Specifically, Figure 5 The step S132 shown will perform the following process on the obtained profile line to complete the detection of the self-intersection of the non-contour line on the spiral surface model, namely:
[0197] Measure the distance between two points on the profile line and determine the minimum measurement parameter of the profile line;
[0198] The self-intersection of the section line is determined according to the minimum metric parameter of the section line, and the self-intersection of the non-contour line on the spiral surface model is determined by the self-intersection of the section line.
[0199] Just as the distance between two points is measured in the self-intersection detection of contour lines, the self-intersection detection on profile lines is similar. The two points closest to each other are found on the profile line, and the distance measurement value mapped by the distance between these two points is used as the minimum measurement parameter to determine whether it is an intersection point.
[0200] The profile line obtained by pre-generating the spiral surface model and the cross section also corresponds to each rotation cycle. Therefore, in each rotation cycle, the distance between two points on the profile line is measured iteratively until the distance calculation between the two points on the profile line is completed to obtain the minimum measurement parameter of the profile line.
[0201] The measurement of the distance between two points on the profile line is to continuously obtain the relationship between the two points on the profile line under the control of the curve function of the profile line, and then obtain the distance measurement value that measures the distance between the two points based on the relationship between the two points. For a rotation period, the minimum value of the distance measurement value on the profile line is finally taken as the minimum measurement parameter of the profile line in this rotation period.
[0202] The relationship between two points is characterized by the slope of the two points in the two-dimensional space. The distance measurement value for measuring the distance between the two points based on the relationship between the two points can be obtained by performing the Euclidean distance operation between the vectors based on the slope. For example, the distance measurement value for measuring the distance between the two points can be obtained by taking the square of the two-norm of the slope between the two points.
[0203] Furthermore, the distance between two points on the profile line is measured to determine the minimum measurement parameter of the profile line, including:
[0204] Obtain the curve function on the profile line for the profile line;
[0205] The measurement calculation between two points on the profile line is performed by using a curve function, and thereby a set of distance measurement values measuring the distance between the two points is obtained, and each distance measurement value corresponds to two points on the profile line;
[0206] The minimum value in the set of distance measurement values is taken as the minimum measurement parameter of the profile line.
[0207] In one embodiment, the profile line is also characterized by a curve function. Therefore, for two points on the profile line, the mapping values of the two points in the two-dimensional space are determined by the curve function. The mapping value is the two-dimensional vector of the point in the two-dimensional space.
[0208] The mapping values of two points are measured and calculated to obtain the relationship between the two points, and then the distance between the two points is measured by the slope, that is, the distance between the two points is measured by the two norm of the value measured on the contour line, and then the square of the two norm is used as the distance measurement value between the two points.
[0209] Therefore, in one embodiment, the execution process of the step of performing a measurement calculation between two points on a profile line by using a curve function and thereby obtaining a set of distance measurement values measuring the distance between the two points includes:
[0210] Approximating the two ends of the profile line, determining the mapping values of the two points in the two-dimensional space by using the curve function during the approximation of the two ends of the profile line, and then performing the metric calculation between the two points on the mapping value;
[0211] The distance between two points is measured by the value obtained by measuring on the contour line, and the distance measurement value between the two points is obtained. Similarly, the approximation of the two ends on the profile line is completed.
[0212] With the completion of the approximation at both ends, the search for two points infinitely close to each other within the rotation period is completed. Therefore, a set of distance measurement values on the profile line corresponding to the rotation period will be obtained, and the minimum value will be selected as the minimum measurement parameter.
[0213] As for the distance measurement value between two points, the two-norm of the value measured on the contour line is used to measure the distance between the two points, and the value corresponding to the square of the two-norm is used as the distance measurement value between the two points.
[0214] At this point, the distance between two points on the section line has been measured, and the minimum measurement parameter of the section line has been determined. The minimum measurement parameter can be used to determine whether the section line is self-intersecting, and then determine the self-intersection of the spiral surface model within the rotation period.
[0215] See also Figure 7 , Figure 7 is based on Figure 5 A flowchart of a method for describing the steps of obtaining a profile expression of a contour line through a contour line in a rotation cycle and a corresponding spiral axis is shown in a corresponding embodiment.
[0216] The profile expression is an approximate representation of the profile line. The step S131 of obtaining the profile expression of the profile line through the profile line and the corresponding spiral axis in the rotation period provided in the embodiment of the present application includes:
[0217] Step S1311b, generating a sampling parameter set for the contour line, where the sampling parameter set is used to control the sampling of the contour line;
[0218] Step S1312b, sampling the contour line according to the sampling parameter set, and the sampling points obtained by sampling form a point set;
[0219] Step S1313b: convert the sampling points in the point set to the same plane containing the spiral axis to obtain an approximate representation of the section line on the spiral surface model where the contour line is located.
[0220] These steps are described in detail below.
[0221] The sampling parameter set is used to control the sampling of the contour line, and the sampling parameter set represents the sampling accuracy. The sampling parameter set is obtained according to the definition domain corresponding to the contour line within the rotation period, and the obtained sampling parameter set is suitable for the increasing sequence of the definition domain. Exemplarily, the sampling parameter set , corresponding to which, the corresponding domain is , is the sampling parameter in the sampling parameter set, and n is the number of set sampling parameters.
[0222] Therefore, it should be understood that the sampling parameter set middle, n indivual The resulting increasing series will be used as sampling control points on the contour line to sample the contour line, thereby obtaining sampling points. For example, It can be 0, 0.1, 0.2, 0.3, etc. and belongs to the domain If it is an increasing sequence of 11 points, the contour line can be sampled at the positions corresponding to 0, 0.1, 0.2, 0.3, etc. to obtain the corresponding sampling points.
[0223] The sampling points corresponding to the sampling will form a point set, and the sampling points in the point set will be transformed to the same plane containing the spiral axis to obtain an approximate representation of the profile line.
[0224] The plane containing the spiral axis is the section through the spiral axis on the spiral surface model. After sampling the contour line to obtain a number of sampling points, the conversion to the section can be performed point by point. Specifically, each sampling point is rotated around the spiral axis to the same plane, that is, the section of the spiral surface model. The point on the plane is the point where the sampling point is converted to the same plane. By analogy, all points on the plane constitute an approximate representation of the section line.
[0225] At this point, the cross-sectional expression can be obtained without pre-generating the spiral surface model and cross-section.
[0226] In summary, the sampling parameter set used to control sampling is an increasing sequence within the domain. In one embodiment, step S1311b of generating a sampling parameter set for a contour line includes:
[0227] Adapting to the sampling precision indicated by the sampling parameter set, arbitrary points are obtained for the contour line to form the sampling parameter set, and the arbitrary points belong to the definition domain of the contour line. The number of the obtained arbitrary points corresponds to the sampling precision.
[0228] See also Figure 8 , Figure 8 is based on Figure 7 The corresponding embodiment shows a method flow chart describing the steps of converting the sampling points in the point set to the same plane containing the spiral axis to obtain an approximate representation of the profile line on the spiral surface model where the contour line is located.
[0229] The step S1313b of converting the sampling points in the point set to the same plane containing the spiral axis to obtain an approximate representation of the profile line on the spiral surface model where the contour line is located, provided in the embodiment of the present application, includes:
[0230] Step S401, for each sampling point in the point set, rotate around the spiral axis to the same plane containing the spiral axis, and obtain the two-dimensional points of the sampling point on the plane to form a two-dimensional point set;
[0231] Step S402, obtaining an approximate representation of a section line on the spiral surface model where the contour line is located through all points in the two-dimensional point set.
[0232] These two steps are explained below.
[0233] As mentioned above, the point set is obtained by sampling and is composed of several sampling points. The points obtained by converting the sampling points to the plane containing the spiral axis, that is, the cross section of the spiral surface model, exist in the form of a two-dimensional vector. Therefore, the point is a two-dimensional point on the plane. Several two-dimensional points obtained by converting the point set to the cross section constitute a two-dimensional point set.
[0234] For example, the point set is rotated around the spiral axis and converted to the same plane by the following conversion formula: To achieve, that is:
[0235]
[0236] in, is the two-dimensional point obtained by rotation; is the spiral axis, is the three-dimensional point that needs to be rotated, that is, the sampling point. It should be understood that the point set obtained by sampling the contour line is as follows:
[0237]
[0238] In the above conversion formula middle,
[0239] yes To the straight line, that is, the screw axis distance; To the spiral axis The intersection point of the perpendicular lines is , from which we can get:
[0240]
[0241] in, is the dot product of the vectors, " is used to control the normal used in the calculations performed.
[0242] Based on this operation, the point set can be The elements in get a two-dimensional point set, namely:
[0243]
[0244] By connecting or fitting the points in the two-dimensional point set, an approximate representation of the profile line on the spiral surface model can be obtained.
[0245] At this point, in one embodiment, the execution process of step S402 includes: fitting all points in the two-dimensional point set, and using the fitted line as an approximate representation of the profile line on the spiral surface model where the contour line is located.
[0246] In another embodiment, the execution process of step S402 includes: connecting the two-dimensional points in the two-dimensional point set to obtain a plurality of broken line segments, the plurality of broken line segments form a broken line segment set, and using the broken line segment set as an approximate representation of the profile line on the spiral surface model where the contour line is located.
[0247] In this way, the two-dimensional point set can be fitted or connected to automatically detect intersections through a set of broken line segments or a continuous curve obtained by fitting. If self-intersection is detected, it means that the spiral surface model has a self-intersection situation.
[0248] It can be understood that by using the section line approximation as the section expression, there is no need to calculate the spiral surface model and the straight surface on it, or even calculate the intersection line between the two, which greatly reduces the calculation complexity, reduces the time cost, effectively avoids accuracy problems, and improves the accuracy of the obtained section expression.
[0249] After obtaining the profile expression of the contour line, such as the aforementioned profile line or the approximate representation of the profile line, in one embodiment, the execution of step S120 further includes:
[0250] The distance between two points of the approximate representation of the profile line is measured to determine the minimum measurement parameter of the mapping;
[0251] The self-intersection of the profile expression is determined according to the minimum metric parameter, and the self-intersection of the non-contour lines on the spiral surface model is determined by whether the approximately represented profile line self-intersects. The point on the approximately represented profile line corresponding to the minimum metric parameter is the located self-intersection point.
[0252] Similar to the self-intersection detection of contour lines, the approximate representation of profile lines will obtain the distance measurement value that measures the distance between any two points under the action of the corresponding curve function, and then obtain the minimum measurement parameter consisting of the minimum distance measurement value on the approximate representation of the profile line.
[0253] The distance measurement value will also be calculated based on the value obtained by the approximate calculation between the two points, such as the square calculation of the two-norm of the value measured on the contour line. Specifically, the distance between the two points is measured for the approximate representation of the profile line, and the execution process of determining the minimum measurement parameter mapped includes:
[0254] Obtaining a corresponding curve function based on a profile approximation corresponding to the rotation period;
[0255] By using the curve function, a measurement calculation is performed between two points on the approximate representation of the profile line, and thereby a set of distance measurement values for measuring the size of the distance is obtained, each distance measurement value corresponding to two points on the approximate representation of the profile line;
[0256] The minimum value among the set of distance measurement values is taken as the minimum metric parameter on the approximate representation of the profile line.
[0257] Furthermore, the process of performing measurement calculation between two points on the approximate representation of the profile line through the curve function and thereby obtaining a set of distance measurement values for measuring the distance includes:
[0258] The approximate expression of the profile line is approximated at both ends. During the approximation of the approximate expression of the profile line at both ends, the mapping values of the two points in the two-dimensional space are determined by the curve function, and the metric calculation between the two points is performed by the mapping value;
[0259] The distance between two points is measured by the numerical value obtained by measuring on the contour line, and the distance measurement value between the two points is obtained. Similarly, the approximation of both ends on the approximate representation of the profile line is completed.
[0260] Therefore, as pointed out above, through the curve function, two points can be determined for the approximate representation of the profile line. In order to improve the calculation efficiency, the distance between the two points is continuously measured by approximating the two ends of the curve mapped by the approximate representation of the profile line to obtain a number of distance measurement values.
[0261] In a distance measurement, a two-dimensional vector of two points in two-dimensional space is obtained by a curve function, and a measurement calculation is performed on the two-dimensional vector. The distance between the two points is measured by the second norm of the value measured on the contour line, and the square of the second norm is used as the distance measurement value between the two points.
[0262] This is the detection of the self-intersection of the non-contour lines, i.e., the profile lines, under the non-periodic condition implemented in step S130. Then, following the determination of the self-intersection of the non-periodic contour lines, it is determined whether the spiral surface model to be constructed has the self-intersection of the non-contour lines under the non-periodic condition, and the detection of the self-intersection of the non-periodic spiral surface model is completed, thereby ensuring the comprehensiveness and accuracy of the self-intersection detection.
[0263] After completing the non-periodic self-intersection detection, it is necessary to perform a periodic self-intersection detection on the spiral surface model to be constructed in step S140.
[0264] In step S140, it should be pointed out first that, unlike non-periodic self-intersection, periodic self-intersection is self-intersection in continuous periods, which is caused by the small pitch in the rotation period. Therefore, in an exemplary embodiment, it is necessary to detect whether the two section lines of the spiral surface model in adjacent rotation periods intersect to confirm whether the spiral surface model self-intersects in these two rotation periods.
[0265] For example, instead of constructing a spiral surface model, a function after the curve spiral is calculated to obtain the curve function of the profile line in each rotation period, which is then used to calculate the distance between two profile lines between adjacent rotation periods to determine the self-intersection.
[0266] See also Fig. 9 , Fig. 9 is based on Figure 1 A method flow chart describing the steps of performing self-intersection detection in continuous periods to determine the periodic self-intersection on a spiral surface model is shown in the corresponding embodiment.
[0267] The step S140 of performing self-intersection detection in a continuous period to determine the periodic self-intersection on the spiral surface model provided in the embodiment of the present application includes:
[0268] Step S141a, obtaining a section line corresponding to each rotation period by drawing a spiral surface model corresponding to the rotation period;
[0269] Step S142a, calculating the distance between the profile lines corresponding to adjacent periods to obtain the profile line distance between adjacent periods;
[0270] Step S143a, determining whether the spiral surface model where the intersecting section lines are located is periodically self-intersecting according to the section line distances of adjacent periods.
[0271] These steps are described below.
[0272] In step S141a, it should be understood that the spiral surface model covers several consecutive rotation periods, each rotation period corresponds to a part of the spiral surface model, and the spiral surface model has a corresponding section line in each rotation period. Therefore, for each rotation period, the section line of the spiral surface model in the rotation period will be drawn first, and the section lines corresponding to the adjacent periods in the consecutive periods will be obtained.
[0273] In step S142a, the distance between the profile lines of adjacent periods is calculated to obtain the profile line distance of adjacent periods. After obtaining the profile line distance of adjacent periods, it is determined whether the profile lines of the adjacent periods intersect. For example, the profile line distance , the profiles of the adjacent cycles intersect.
[0274] Therefore, in step S143a, for two adjacent rotation periods, if it is determined that their section lines intersect, it can be determined that the spiral surface model has periodic self-intersection in the two adjacent rotation periods.
[0275] For example, in the specific implementation process, in order to realize the drawing of the profile line, firstly, the corresponding parameters are obtained for pre-drawing the spiral surface model, and the obtained parameters include the spiral direction, profile line, spiral axis, top rotation radius, pitch and spiral height. Among them, the spiral direction includes clockwise direction and counterclockwise direction; the profile line of the spiral surface model For building spirals, ; The axis of the constructed spiral surface model, that is, the spiral axis is a straight line , which contains the starting point and direction , set the spiral axis to the curve, that is, the section line The distance on , then we can get: Assume For hatching Any point on for To the spiral axis The nearest point on .
[0276] The pitch HLoop is the distance that the profile moves along the screw axis during one rotation cycle. This distance is defined as ; The spiral height is the distance that the section line moves along the spiral axis in a spiral surface model with one rotation period.
[0277] At this point, the helical surface model corresponding to each rotation period can be pre-drawn based on the preset parameters. ,in, Helical surface model A section line on ;
[0278] is the section line of the next rotation cycle. In other words, relative to the section line The corresponding section line of the next rotation cycle of the rotation cycle is . Hatching and hatching It is the section line corresponding to two adjacent periods.
[0279] Therefore, by executing step S142, the distance between the profile lines of adjacent periods is calculated, that is, the profile line is calculated. and hatching The distance between , in judging the obtained section line distance When , the section lines intersect. At this time, the spiral surface models in two adjacent periods are not periodically self-intersecting.
[0280] In addition, for step S140 , it is also possible to implement the step directly through function calculation without drawing the spiral surface model or the section line.
[0281] See also Fig.10 , Fig.10 is based on Figure 1 A flowchart of a method for describing the steps of performing self-intersection detection in continuous periods to determine the periodic self-intersection on a spiral surface model is shown in the corresponding embodiment.
[0282] The step S140 of performing self-intersection detection in a continuous period to determine the periodic self-intersection on the spiral surface model provided in the embodiment of the present application includes:
[0283] Step S141b, for the pre-constructed spiral surface model, obtaining a curve function representing a starting profile line, wherein the curve function represents a profile line of the spiral surface model on a cross section at a starting period of the pre-constructed spiral surface model;
[0284] Step S142b, using the curve function of the initial profile line, iteratively calculates the curve function of the profile line corresponding to the adjacent period, and controls the curve function to perform the profile line distance calculation of the adjacent period to obtain the profile line distance of the adjacent period;
[0285] Step S143b, determining whether the spiral surface model where the intersecting profile lines are located is periodically self-intersecting according to the profile line distances of adjacent periods.
[0286] These steps are described below.
[0287] The parameters defined by constructing the helical surface model, namely the helical direction, profile line, helical axis, top rotation radius, pitch and helical height as mentioned above, are converted to obtain the profile curve function corresponding to each rotation period.
[0288] Exemplarily, the top spiral surface model is taken as the starting point to obtain a curve function characterizing the starting profile line, where the starting profile line corresponds to the starting period of the spiral surface model.
[0289] After the surface function representing the initial profile line is obtained, the profile curve function calculation of the subsequent rotation periods can be performed based on this surface function to obtain the profile curve function corresponding to each rotation period.
[0290] Therefore, the distance between the profiles of adjacent periods can be obtained by calculating the distance between the profiles of adjacent periods.
[0291] It should be understood that with the acquisition of the starting profile line curve function, the profile line curve function calculation of the next rotation period will be carried out starting from this, and so on, until the profile line curve function calculation of all rotation periods is completed. This is the iterative calculation process of the profile line curve function of adjacent periods, so as to obtain the profile line curve functions corresponding to all rotation periods respectively.
[0292] Furthermore, the curve function operation of the profile lines corresponding to adjacent periods includes: relative to the profile line corresponding to the current period, translating the profile line curve function to obtain the curve function of the profile line corresponding to the adjacent period, the profile line corresponding to the current period includes the starting profile line, and the profile line of the previous period of the iterative operation of the profile line corresponding to the adjacent period.
[0293] That is to say, the curve function calculation of a rotation period profile is performed based on the curve function of the previous period profile corresponding to itself.
[0294] Specifically, according to the parameters defining the spiral surface model, the starting profile line can be obtained, and on this basis, the profile curve function calculation of the next rotation cycle is performed, that is, the balance processing of the profile line corresponding to the current cycle is performed, as shown in the following formula:
[0295]
[0296] in, The profile curve function that characterizes the next rotation period, is the starting profile curve function for constructing the spiral surface model. Any point on , we can get its relationship with the screw axis The intersection point of the perpendicular lines is .
[0297] In addition, in another embodiment, the pitch of the helical surface model increases or decreases in consecutive cycles, and the profile curve function is translated relative to the profile corresponding to the current cycle to obtain the profile curve function corresponding to the adjacent cycle, including:
[0298] The curve function of the profile line corresponding to the current period is deformed and translated to obtain the curve function of the profile line corresponding to the adjacent period. The rotation cycle is the current cycle of the cross-section curve function iteration operation, and the curve function of the cross-section line of the next cycle is calculated. , as shown in the following formula:
[0299]
[0300] in, is a deformation function, which is used to deform the section line corresponding to the current cycle. For example, the deformation function It can be expressed as ;
[0301] The new profile obtained, that is, the profile of the next cycle relative to the current cycle, has a curve function On the spiral axis The intersection point of the perpendicular lines is .
[0302] After obtaining the curve functions of the section lines corresponding to the adjacent periods, the section line distances between two adjacent periods can be calculated, thereby obtaining the section line distances between the adjacent periods.
[0303] For example, for the start cycle and the next cycle, the profile distance between the start profile and the next cycle profile is calculated to obtain and The distance between , and then in step S143b, it is determined whether the two section lines intersect, that is, the following formula is used to determine whether the two section lines intersect. If it is greater than, the two section lines do not intersect, and it can be confirmed that there is no periodic self-intersection in the spiral surface model between the two periods.
[0304] like , then the two section lines intersect, and it can be determined that the spiral surface model between the two periods has periodic self-intersection.
[0305] Similarly, starting from the starting profile line corresponding to the starting cycle, the profile line distance of adjacent cycles is calculated cycle by cycle, and the self-intersection of the profile line in each adjacent cycle is detected until the self-intersection caused by the continuous cycle in all cycles is detected and the corresponding self-intersection point is obtained.
[0306] Therefore, for the spiral surface model that needs to be constructed, the non-periodic contour line and non-contour line self-intersection detection and periodic self-intersection detection of the spiral surface model are completed, and the detection of various types of self-intersection situations on the spiral surface model is realized, thereby ensuring the comprehensiveness and accuracy of the spiral surface model self-intersection detection, and thus effectively avoiding errors in the spiral surface model due to surface self-intersection.
[0307] At this point, with respect to the self-intersection detection of the spiral surface model implemented through steps S120 to S140, the corresponding self-intersection points can be located based on the various types of self-intersections of the spiral surface model, and the self-intersection points include the intersection points on the spiral surface model where non-periodic contour line self-intersections occur as determined by step S120, the intersection points on the spiral surface model where non-periodic non-contour line self-intersections occur as determined by step S130, and the intersection points on the spiral surface model where periodic self-intersections occur as determined by step S140.
[0308] In step S150, all self-intersection points form a self-intersection point set on the spiral surface model to handle the self-intersection of the spiral surface model. For example, the self-intersecting spiral surface can be selectively trimmed according to the self-intersection point set, and errors in the spiral surface model can be corrected by trimming the self-intersecting surface.
[0309] Exemplarily, in one embodiment, step S150 includes: segmenting the self-intersecting helical surface on the helical surface model according to the self-intersecting lines formed by the self-intersecting point set.
[0310] Clipping and segmentation are operations that can be performed on self-intersecting helical surfaces on a helical surface model. Through self-intersection detection, the self-intersecting helical surfaces on the helical surface model are clipped or segmented according to the obtained self-intersection point set, so as to obtain a correct helical surface model.
[0311] In addition, the self-intersection points located can also be used as a basis for visualizing the mapped self-intersection lines, so that users can customize the segmentation of self-intersecting helical surfaces according to the self-intersection lines. For example, the self-intersection lines are highlighted, and users can quickly identify the self-intersecting helical surfaces through the highlighted self-intersection lines, and select and retain them.
[0312] In an exemplary embodiment, the present application further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described above.
[0313] In an exemplary embodiment, the present application further provides a computer program product, including a computer program, wherein the computer program implements the steps of the above-mentioned method when executed by a processor.
[0314] In an exemplary embodiment, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method described above are implemented.
[0315] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0316] In an exemplary embodiment of the present application, a computer program medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the method described in the above method embodiment.
[0317] According to one embodiment of the present application, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0318] The program product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0319] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0320] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0321] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0322] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0323] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0324] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0325] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.
Claims
1. A method for detecting self-intersection of a spiral surface model in a geometry engine, characterized in that: The method comprises: In response to the parametric modeling of the spiral surface model initiated by the geometry engine, a self-intersection detection of the spiral surface model to be constructed is initiated, wherein the self-intersection detection includes a non-periodic self-intersection detection and a periodic self-intersection detection; On the contour line corresponding to the rotation period, the distance between two points is measured to determine the minimum measurement parameter of the mapping; Determine, according to the minimum metric parameter on the contour line, whether there is a self-intersection of the contour line on the spiral surface model, the point on the contour line corresponding to the minimum metric parameter is the located self-intersection point, and the spiral surface model is the model to be constructed and output by the geometric engine for the current parametric modeling; Obtaining a profile expression of the contour line through the contour line in the rotation period and the corresponding spiral axis, wherein the profile expression is a profile line of the spiral surface model where the contour line is located or an approximate representation of the profile line; Performing a self-intersection detection on the cross-sectional expression, and determining the self-intersection of non-contour lines on the spiral surface model based on whether the cross-sectional expression is self-intersecting; The method of performing self-intersection detection in continuous cycles to determine the periodic self-intersection on the spiral surface model comprises: Obtaining a section line corresponding to each rotation period by drawing a spiral surface model corresponding to each rotation period; Calculate the distance between the section lines corresponding to the adjacent periods to obtain the section line distance between the adjacent periods; Determine the periodic self-intersection of the spiral surface model where the intersecting section lines are located according to the section line distances of adjacent periods; The self-intersection points located in the self-intersection detection are obtained to form a self-intersection point set on the spiral surface model, and the self-intersection point set is used for processing the self-intersection situation of the spiral surface model.
2. The method according to claim 1, characterized in that The distance between two points is measured on the contour line corresponding to the rotation period to determine the minimum measurement parameter of the mapping, including: Facing a contour line corresponding to a rotation period, obtaining a curve function of the contour line; Performing measurement calculation between two points on the contour line by using the curve function, thereby obtaining a set of distance measurement values measuring the size of the distance, each distance measurement value corresponding to the two points on the contour line; The minimum value in the set of distance measurement values is taken as the minimum metric parameter on the contour line.
3. The method according to claim 1, characterized in that The profile expression is a profile line, and the profile expression of the contour line is obtained through the contour line in the rotation period and the corresponding spiral axis, including: For all contour lines in the rotation period, a spiral surface model under the rotation period and a cross section in the spiral surface model are generated, wherein the cross section includes a spiral axis of the spiral surface model; An intersection operation is performed on the spiral surface model and the cross section to obtain a section line.
4. The method according to claim 1, characterized in that The profile expression is an approximate representation of the profile line, and the profile expression of the profile line is obtained through the profile line in the rotation period and the corresponding spiral axis, including: Generating a sampling parameter set for the contour line, wherein the sampling parameter set is used to control sampling of the contour line; Sampling the contour line according to the sampling parameter set, and forming a point set with the sampling points obtained by sampling; The sampling points in the point set are converted to the same plane containing the spiral axis to obtain an approximate representation of the section line on the spiral surface model where the contour line is located.
5. The method according to claim 1, characterized in that The self-intersection detection under continuous periods to determine the periodic self-intersection situation on the spiral surface model also includes: For the pre-constructed spiral surface model, obtaining a curve function representing a starting profile line, wherein the curve function represents a profile line of the spiral surface model on a cross section at a starting period of the pre-constructed spiral surface model; The curve function of the starting profile line is iteratively calculated to obtain the curve function of the profile line corresponding to the adjacent period, and the profile line distance calculation of the adjacent period is controlled by the curve function to obtain the profile line distance of the adjacent period; The intersecting section lines are determined according to the section line distances of adjacent periods to determine whether the spiral surface model where the intersecting section lines are located is periodically self-intersecting.
6. The method according to claim 1, characterized in that After obtaining the self-intersection points located in the self-intersection detection to form a set of self-intersection points on the spiral surface model, the method further includes: The self-intersecting helical surfaces on the helical surface model are segmented according to the self-intersecting lines formed by the self-intersecting point set.
7. 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 6 are implemented.
Citation Information
Patent Citations
Method for offsetting combined curved surface
CN108647399A
Complex precise part digital model mass door and application method thereof
CN115310305A