Disclosure of Invention
In view of the above, the present invention aims to provide a method, a device and a medium for extracting parameter lines of a clipping digital die surface, which can avoid the situation of losing the information of an original geometric figure, reduce the complexity of extracting the parameter lines of the clipping geometric figure, and improve the accuracy of extracting the parameter lines of the clipping geometric figure. The specific scheme is as follows:
in a first aspect, the application discloses a parameter line extraction method for cutting a digital die surface, which comprises the following steps:
acquiring a digital model for describing geometric elements of an aircraft, screening and configuring parameters of initial geometric figures in the digital model to obtain the geometric figures, and determining the extraction direction of parameter surfaces;
judging whether the geometric figure is a cutting plane or not, if the geometric figure is the cutting plane, extracting a corresponding parameter line from the geometric figure according to the extracting direction of the parameter plane;
and generating grid lines based on the geometric figure, carrying out intersection detection on the grid lines and the parameter lines, if the grid lines are intersected with the parameter lines, calculating a texture image level value at the intersection, dividing the grid lines by utilizing the texture image level value to obtain the divided grid lines, carrying out midpoint coordinate calculation and screening on the divided grid lines to obtain target midpoint coordinates, and extracting a target parameter line of the cutting geometric figure based on the target midpoint coordinates.
Optionally, the filtering and parameter configuring the initial geometry in the digital model includes:
Selecting an arbitrary initial geometry from the digital model;
Setting a texture image horizontal coordinate and a texture image vertical coordinate for the initial geometry.
Optionally, the generating grid lines based on the geometric figure includes:
and obtaining discrete points of all boundary lines of the geometric figure, and generating grid lines by using the discrete points.
Optionally, the intersecting detection of the grid lines and the parameter lines includes:
and calculating the shortest distance between the grid line and the parameter line, and determining whether the grid line and the parameter line intersect or not by using the shortest distance so as to complete intersection detection.
Optionally, if the grid line and the parameter line intersect, calculating a texture image level value at the intersection includes:
If the grid lines are intersected with the parameter lines, determining the length and the number of the intersected sections of parameter lines, and calculating a texture image level value at the intersection based on the length and the number of the intersected sections of parameter lines.
Optionally, the calculating and screening the midpoint coordinates of the segmented grid lines to obtain target midpoint coordinates includes:
acquiring all the divided grid lines, and performing midpoint coordinate calculation on all the divided grid lines to obtain midpoint coordinates;
And taking the midpoint coordinates meeting preset conditions as target midpoint coordinates.
Optionally, the taking the midpoint coordinate satisfying the preset condition as the target midpoint coordinate includes:
judging whether the midpoint coordinate is in the digital model or not, or judging whether the midpoint coordinate is on the digital model or not;
And if the midpoint coordinate is in the digital model or the midpoint coordinate is on the digital model, taking the midpoint coordinate as a target midpoint coordinate.
In a second aspect, the present application discloses a parameter line extracting device for cutting out a digital model surface, comprising:
The geometric figure determining module is used for acquiring a digital model for describing geometric elements of the aircraft, screening and parameter configuration are carried out on initial geometric figures in the digital model to obtain geometric figures, and the extraction direction of a parameter surface is determined;
The clipping plane judging module is used for judging whether the geometric figure is a clipping plane or not, and if the geometric figure is the clipping plane, extracting a corresponding parameter line from the geometric figure according to the extracting direction of the parameter plane;
and the target parameter line extraction module is used for generating grid lines based on the geometric figure, carrying out intersection detection on the grid lines and the parameter lines, calculating a texture image level value at an intersection position if the grid lines are intersected with the parameter lines, dividing the grid lines by utilizing the texture image level value to obtain the divided grid lines, carrying out midpoint coordinate calculation and screening on the divided grid lines to obtain target midpoint coordinates, and extracting target parameter lines for cutting the geometric figure based on the target midpoint coordinates.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
And the processor is used for executing the computer program to realize the parameter line extraction method for clipping the digital die surface.
In a fourth aspect, the present application discloses a computer storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above disclosed method for extracting a parameter line for clipping a digital die surface.
The application provides a parameter line extraction method for cutting a digital model surface, which comprises the steps of obtaining a digital model for describing geometric elements of an aircraft, screening and parameter configuration of initial geometric figures in the digital model to obtain geometric figures, determining the extraction direction of the parameter surface, judging whether the geometric figures are cutting surfaces, if the geometric figures are cutting surfaces, extracting corresponding parameter lines from the geometric figures according to the extraction direction of the parameter surface, generating grid lines based on the geometric figures, intersecting the grid lines with the parameter lines, calculating a texture image level value at an intersecting position if the grid lines intersect with the parameter lines, dividing the grid lines by utilizing the texture image level value to obtain the divided grid lines, calculating and screening midpoint coordinates of the divided grid lines to obtain target midpoint coordinates, and extracting target parameter lines for cutting the geometric figures based on the target midpoint coordinates. According to the application, the initial geometric figure in the digital model for describing the geometric elements of the aircraft is screened and parameter configuration is carried out to obtain the geometric figure, the parameter plane extraction direction is determined, if the geometric figure is a cutting plane, the corresponding parameter line is extracted, the re-parameterization process of the geometric figure after cutting is avoided, so that the situation that the information of the original geometric figure is lost can be solved, grid lines are generated based on the geometric figure, intersecting detection is carried out on the grid lines and the parameter line, if the grid lines are intersected with the parameter line, the texture image level value at the intersecting position is calculated, the grid lines are divided, midpoint coordinate calculation and screening are carried out on the divided grid lines to obtain the target midpoint coordinate, thereby extracting the target parameter line of the cutting geometric figure, and by a method for intersecting detection of the grid lines and the parameter line, the complexity of parameter line extraction of the cutting geometric figure can be reduced, the calculation cost is reduced, the parameter line is rapidly generated, and the accuracy of the parameter line extraction of the cutting geometric figure is improved.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the related technical scheme, the method for extracting the parameter line of the digital model comprises an isoparameter curve method and a data fitting method, and in addition, some methods aiming at the cut geometric figure comprise a recommendable parameter line method, a parameter range calculation method and a topology structure-based method. Drawbacks of these schemes are that the re-parameterization method may lose information of the original geometry during the re-parameterization, e.g. complex textures, subtle shape changes, resulting in error accumulation, such methods often involve complex mathematical calculations and algorithms, which may be costly, the parametric range calculation method, which is often based on specific digital models or algorithms, which are not able to accurately describe the characteristics of the geometry, so that the parametric range may be inaccurate or non-representative, the topology structure may not accurately describe details and features for geometries with very complex, irregular shapes, resulting in losing some critical local shape information, the topology structure often having a certain fixity and standardability, resulting in the method lacking sufficient flexibility in the face of some special requirements or changes. From the above, how to avoid the situation of losing the information of the original geometric figure, reduce the complexity of extracting the parameter line of the clipping geometric figure, and improve the accuracy of extracting the parameter line of the clipping geometric figure is a problem to be solved in the field.
Referring to fig. 1, an embodiment of the present invention discloses a method for extracting a parameter line for cutting a digital die surface, which specifically includes:
step S11, a digital model for describing geometric elements of the aircraft is obtained, initial geometric figures in the digital model are screened and parameter configuration is carried out, so that geometric figures are obtained, and the extraction direction of the parameter surface is determined.
In this embodiment, a digital model for describing geometric elements of an aircraft is acquired, an arbitrary initial geometric figure is selected from the digital model, a texture image horizontal coordinate and a texture image vertical coordinate are set for the initial geometric figure to obtain a geometric figure, and a parameter face extraction direction is determined.
In CAD (Computer AIDED DESIGN ), a digital model is a model that describes and expresses precisely the geometric, physical, etc. characteristics of an object or system in a digital manner. In the CAD related art, UV values are values that relate to a UV coordinate system, which is a coordinate system for locating colors and details in a two-dimensional texture image, and U and V represent the horizontal and vertical axes of the texture image, respectively, similar to the X and Y axes in a two-dimensional plane. The UV value is a specific coordinate value of a certain point on the U axis and the V axis in the coordinate system, and is used for precisely determining the corresponding position of each point on the texture image on the three-dimensional model surface.
Specifically, a digital model is first imported, then a corresponding initial geometry for generating a parameter line is selected, then UV coordinates (i.e., texture image horizontal coordinates and texture image vertical coordinates) on the geometry are set, and a parameter plane extraction direction is determined.
And step S12, judging whether the geometric figure is a clipping plane, and if the geometric figure is the clipping plane, extracting a corresponding parameter line from the geometric figure according to the parameter plane extraction direction.
In this embodiment, whether the geometric figure is a clipping plane is determined, if the geometric figure is not the clipping plane, the process of extracting the parameter lines of the clipping geometric figure is ended, and if the geometric figure is the clipping plane, the corresponding parameter lines are extracted from the geometric figure according to the extracting direction of the parameter plane.
And S13, generating grid lines based on the geometric figure, carrying out intersection detection on the grid lines and the parameter lines, if the grid lines are intersected with the parameter lines, calculating a texture image level value at the intersection, dividing the grid lines by utilizing the texture image level value to obtain the divided grid lines, carrying out midpoint coordinate calculation and screening on the divided grid lines to obtain target midpoint coordinates, and extracting a target parameter line of the cutting geometric figure based on the target midpoint coordinates.
In this embodiment, discrete points of all boundary lines of the geometric figure are obtained, grid lines are generated by using the discrete points, shortest distances between the grid lines and the parameter lines are calculated, whether the grid lines and the parameter lines intersect or not is determined by using the shortest distances, so that intersection detection is completed, if the grid lines and the parameter lines intersect, the length and the number of sections of the intersecting parameter lines are determined, the texture image level value at the intersection position is calculated based on the length and the number of sections of the intersecting parameter lines, all the divided grid lines are obtained, midpoint coordinates of all the divided grid lines are calculated to obtain midpoint coordinates, the midpoint coordinates meeting preset conditions are used as target midpoint coordinates, and the target parameter lines of the cutting geometric figure are extracted based on the target midpoint coordinates.
The method comprises the steps of taking the midpoint coordinate meeting preset conditions as a target midpoint coordinate, judging whether the midpoint coordinate is in the digital model or not or judging whether the midpoint coordinate is on the digital model or not, and taking the midpoint coordinate as the target midpoint coordinate if the midpoint coordinate is in the digital model or on the digital model.
The specific extraction process of the target parameter line comprises (1) obtaining the discrete points of all boundary lines of the geometric figure, generating a new grid line FC_CON by using the discrete points, wherein the new grid line is shown in figure 2, a circle of discrete points of the digital model form FC_CON, the extracted parameter line CON exists on a part on the non-geometric figure, (2) carrying out intersection detection on a line segment formed by two adjacent discrete points of the FC_CON and the parameter line CON, wherein the intersection detection principle is shown in figure 3, and the principle is that the head and tail points P0 and Q0 of a first line segment and the head and tail points P1 and Q1 of a second line segment are assumed, and the two line segments can be expressed asAndAssume thatAndThe minimum distance between them is set. To seek,Only whenWith the minimum value of the total number of the components,Is perpendicular to at the same time,. I.e.
;
;
Further comprises the following steps:
;
The substitution equation is:
Is provided with ,,,,And is also provided with. The solution of the system of equations is:
;
;
If denominator is a denominator Then,Parallel to each other. By taking at willTo calculate. By arrangingThen. Can calculate,Distance of (2):
;
Can be back calculated by the shortest distance ,Further, whether the line segments are intersected or not can be determined;
Then, the u value (i.e. texture image level value) of the parameter line CON on the grid line is determined by the point on the parameter line CON where the intersecting discrete segment exists, assuming that the nth segment line segment (length lenth _n) of the parameter line CON and FC_CON are intersected, the total segment number N of the parameter line CON and the total length are Lenth, and the u value is
;
All segmentation u values are available:
;
Then, the extracted parameter line CON is divided at the above-mentioned obtained U value by first sorting the set U into:
;
Wherein, the When i >0, there are。
As shown in fig. 3, the parameter line dividing principle is that a is a parameter line CON, and if the parameter line is divided into 3 segments, the division value at a isObtaining segments b and c, then dividing the segment on line c into segmentsObtaining line segments d and e. Dividing by analogy to obtain a plurality of divided grid lines;
Finally, for each grid line, the coordinates of the points are found, if the points are in the digital model or on the digital model, the points are reserved, if the points are located on the clipping plane, the points are deleted, so that the extraction of the parameter lines on the clipping plane is completed, and the result of the extracted target parameter lines is shown in fig. 4.
The method comprises the steps of obtaining a digital model for describing geometric elements of an aircraft, selecting any initial geometric figure, setting horizontal coordinates of a texture image and vertical coordinates of the texture image for the initial geometric figure to obtain the geometric figure, determining the extraction direction of the parameter surface, judging whether the geometric figure is a cutting surface, ending the extraction process if the geometric figure is not the cutting surface, extracting corresponding parameter lines from the geometric figure according to the extraction direction of the parameter surface if the geometric figure is the cutting surface, generating grid lines based on discrete points of all boundary lines of the geometric figure, intersecting the grid lines with the parameter lines, dividing the grid lines by using the horizontal coordinates of the texture image, calculating midpoint coordinates of the divided grid lines, judging whether the midpoint coordinates are in the digital model or on the digital model, and reserving the midpoint coordinates if the midpoint coordinates are in the digital model to extract target parameter lines of the cutting geometric figure.
The initial parameter line is extracted from the geometric figure before the original cutting, and the geometric figure surface after the cutting is not subjected to a re-parameterization process, so that the information of the original geometric figure is not further lost, errors are accumulated, and finally inaccurate simulation factors are generated.
In the embodiment, a digital model for describing geometric elements of an aircraft is obtained, an initial geometric figure in the digital model is screened and parameter configuration is carried out to obtain the geometric figure, a parameter face extraction direction is determined, whether the geometric figure is a cutting face or not is judged, if the geometric figure is the cutting face, a corresponding parameter line is extracted from the geometric figure according to the parameter face extraction direction, grid lines are generated based on the geometric figure, intersecting detection is carried out on the grid lines and the parameter lines, if the grid lines intersect with the parameter lines, a texture image level value at the intersecting position is calculated, the grid lines are segmented by utilizing the texture image level value to obtain the segmented grid lines, midpoint coordinates are calculated and screened on the segmented grid lines to obtain target midpoint coordinates, and a target parameter line of the cutting figure is extracted based on the target midpoint coordinates. According to the application, the initial geometric figure in the digital model for describing the geometric elements of the aircraft is screened and parameter configuration is carried out to obtain the geometric figure, the parameter plane extraction direction is determined, if the geometric figure is a cutting plane, the corresponding parameter line is extracted, the re-parameterization process of the geometric figure after cutting is avoided, so that the situation that the information of the original geometric figure is lost can be solved, grid lines are generated based on the geometric figure, intersecting detection is carried out on the grid lines and the parameter line, if the grid lines are intersected with the parameter line, the texture image level value at the intersecting position is calculated, the grid lines are divided, midpoint coordinate calculation and screening are carried out on the divided grid lines to obtain the target midpoint coordinate, thereby extracting the target parameter line of the cutting geometric figure, and by a method for intersecting detection of the grid lines and the parameter line, the complexity of parameter line extraction of the cutting geometric figure can be reduced, the calculation cost is reduced, the parameter line is rapidly generated, and the accuracy of the parameter line extraction of the cutting geometric figure is improved.
Referring to fig. 6, an embodiment of the present invention discloses a parameter line extraction device for cutting out a digital die surface, which may specifically include:
The geometric figure determining module 11 is used for acquiring a digital model for describing geometric elements of the aircraft, screening and parameter configuration are carried out on initial geometric figures in the digital model to obtain geometric figures, and the extraction direction of a parameter surface is determined;
The clipping plane judging module 12 is configured to judge whether the geometric figure is a clipping plane, and if the geometric figure is a clipping plane, extract a corresponding parameter line from the geometric figure according to the parameter plane extracting direction;
And the target parameter line extraction module 13 is configured to generate a grid line based on the geometric figure, perform intersection detection on the grid line and the parameter line, calculate a texture image level value at an intersection if the grid line and the parameter line intersect, segment the grid line by using the texture image level value to obtain the segmented grid line, perform midpoint coordinate calculation and screening on the segmented grid line to obtain a target midpoint coordinate, and extract a target parameter line for cutting the geometric figure based on the target midpoint coordinate.
In the embodiment, a digital model for describing geometric elements of an aircraft is obtained, an initial geometric figure in the digital model is screened and parameter configuration is carried out to obtain the geometric figure, a parameter face extraction direction is determined, whether the geometric figure is a cutting face or not is judged, if the geometric figure is the cutting face, a corresponding parameter line is extracted from the geometric figure according to the parameter face extraction direction, grid lines are generated based on the geometric figure, intersecting detection is carried out on the grid lines and the parameter lines, if the grid lines intersect with the parameter lines, a texture image level value at the intersecting position is calculated, the grid lines are segmented by utilizing the texture image level value to obtain the segmented grid lines, midpoint coordinates are calculated and screened on the segmented grid lines to obtain target midpoint coordinates, and a target parameter line of the cutting figure is extracted based on the target midpoint coordinates. According to the application, the initial geometric figure in the digital model for describing the geometric elements of the aircraft is screened and parameter configuration is carried out to obtain the geometric figure, the parameter plane extraction direction is determined, if the geometric figure is a cutting plane, the corresponding parameter line is extracted, the re-parameterization process of the geometric figure after cutting is avoided, so that the situation that the information of the original geometric figure is lost can be solved, grid lines are generated based on the geometric figure, intersecting detection is carried out on the grid lines and the parameter line, if the grid lines are intersected with the parameter line, the texture image level value at the intersecting position is calculated, the grid lines are divided, midpoint coordinate calculation and screening are carried out on the divided grid lines to obtain the target midpoint coordinate, thereby extracting the target parameter line of the cutting geometric figure, and by a method for intersecting detection of the grid lines and the parameter line, the complexity of parameter line extraction of the cutting geometric figure can be reduced, the calculation cost is reduced, the parameter line is rapidly generated, and the accuracy of the parameter line extraction of the cutting geometric figure is improved.
In some specific embodiments, the geometric determining module 11 may specifically include:
the model surface selection module is used for selecting any initial geometric figure from the digital model;
And the setting module is used for setting the horizontal coordinate of the texture image and the vertical coordinate of the texture image for the initial geometric figure.
In some specific embodiments, the target parameter line extracting module 13 may specifically include:
And the grid line generating module is used for acquiring the discrete points of all the boundary lines of the geometric figure and generating grid lines by utilizing the discrete points.
In some specific embodiments, the target parameter line extracting module 13 may specifically include:
and the intersection detection module is used for calculating the shortest distance between the grid lines and the parameter lines, and determining whether the grid lines and the parameter lines intersect or not by utilizing the shortest distance so as to finish intersection detection.
In some specific embodiments, the target parameter line extracting module 13 may specifically include:
And the horizontal value calculation module is used for determining the length and the number of the intersected sections of parameter lines if the grid lines are intersected with the parameter lines, and calculating the horizontal value of the texture image at the intersection position based on the length and the number of the intersected sections of parameter lines.
In some specific embodiments, the target parameter line extracting module 13 may specifically include:
The midpoint coordinate calculation module is used for acquiring all the divided grid lines and carrying out midpoint coordinate calculation on all the divided grid lines so as to obtain midpoint coordinates;
and the target midpoint coordinate determining module is used for taking the midpoint coordinate meeting the preset condition as the target midpoint coordinate.
In some specific embodiments, the target parameter line extracting module 13 may specifically include:
The judging module is used for judging whether the midpoint coordinate is in the digital model or not or judging whether the midpoint coordinate is on the digital model or not;
and the target midpoint coordinate determining module is used for taking the midpoint coordinate as a target midpoint coordinate if the midpoint coordinate is in the digital model or the midpoint coordinate is on the digital model.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 20 may include, in particular, at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input-output interface 25, and a communication bus 26. Wherein the memory 22 is configured to store a computer program that is loaded and executed by the processor 21 to implement the relevant steps in the method for extracting a parameter line for clipping a digital profile, which is performed by an electronic device, as disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide working voltages for each hardware device on the electronic device 20, the communication interface 24 is capable of creating a data transmission channel with an external device for the electronic device 20, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein, and the input/output interface 25 is configured to obtain external input data or output data to the external device, and the specific interface type of the input/output interface may be selected according to the specific application needs and is not specifically limited herein.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon include an operating system 221, a computer program 222, and data 223, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the data 223 in the memory 22 by the processor 21, which may be Windows, unix, linux or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the method of extracting the parameter line of clipping the digital die surface performed by the electronic device 20 as disclosed in any of the previous embodiments. The data 223 may include, in addition to data received by the parameter line extracting device for cutting out the digital die surface and transmitted from the external device, data collected by the own input/output interface 25, and the like.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Further, the embodiment of the application also discloses a computer readable storage medium, wherein the storage medium stores a computer program, and when the computer program is loaded and executed by a processor, the method for extracting the parameter line for cutting the digital model surface disclosed in any embodiment is realized.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The above detailed description of a method, an apparatus, a device and a storage medium for extracting a parameter line for clipping a digital molding surface provided by the present invention has been provided, and specific examples are provided herein to illustrate the principles and embodiments of the present invention, and the above examples are only for aiding in understanding of the method and core concept of the present invention, and meanwhile, to those skilled in the art, according to the concept of the present invention, there are variations in the specific embodiments and application ranges, so the disclosure should not be interpreted as limiting the present invention.