CN117197397B - Curved surface self-adaptive sampling method and device, storage medium and computer equipment - Google Patents

Curved surface self-adaptive sampling method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN117197397B
CN117197397B CN202311460382.1A CN202311460382A CN117197397B CN 117197397 B CN117197397 B CN 117197397B CN 202311460382 A CN202311460382 A CN 202311460382A CN 117197397 B CN117197397 B CN 117197397B
Authority
CN
China
Prior art keywords
grid
curved surface
sampled
cell
sampling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311460382.1A
Other languages
Chinese (zh)
Other versions
CN117197397A (en
Inventor
史立松
陈曦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zwcad Software Co ltd
Original Assignee
Zwcad Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zwcad Software Co ltd filed Critical Zwcad Software Co ltd
Priority to CN202311460382.1A priority Critical patent/CN117197397B/en
Publication of CN117197397A publication Critical patent/CN117197397A/en
Application granted granted Critical
Publication of CN117197397B publication Critical patent/CN117197397B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T90/00Enabling technologies or technologies with a potential or indirect contribution to GHG emissions mitigation

Landscapes

  • Image Generation (AREA)

Abstract

According to the curved surface self-adaptive sampling method, the device, the storage medium and the computer equipment, after the curved surface to be sampled and the boundary sampling points of the curved surface to be sampled are determined, line sampling can be respectively carried out on the curved surface to be sampled in two directions of a parameter plane, then an initial grid of the curved surface to be sampled in the parameter plane is constructed according to line sampling results, the initial grid consists of a plurality of grid units, so that the grid units in the initial grid can be self-adaptively adjusted based on the curved surface change amplitude of the curved surface to be sampled in each grid unit, internal sampling points are determined according to the adjusted grid units, and finally, the boundary sampling points and the internal sampling points can be combined to calculate a sampling point set of the curved surface to be sampled, so that a discrete point set with excellent geometrical feature expression capability and as few points as possible is selected on the free curved surface is realized.

Description

Curved surface self-adaptive sampling method and device, storage medium and computer equipment
Technical Field
The application relates to the technical field of curved surface part detection, in particular to a curved surface self-adaptive sampling method, a curved surface self-adaptive sampling device, a storage medium and computer equipment.
Background
Geometric errors are important indexes for evaluating the machining quality of mechanical parts, and along with the rapid development of the industrial field in China, higher requirements are put on the manufacturing precision of the mechanical parts. It is thus conceivable to detect and assess geometric errors by means of free-form surface measurements.
Free-form surface measurement refers to the process of obtaining surface geometry information by a selected measurement method using a related measurement device. Under the condition that the surface equation is known, the geometric error of the part can be estimated by comparing the measurement result with a true value, so that the qualification of the part is judged, and compensation measures are taken based on the measurement data. For complex free-form surfaces, the distribution of geometric features in three-dimensional space is non-uniform, and specifically, the surfaces have gentle regions with smaller variation amplitudes and steep regions with larger variation amplitudes. The basic requirement of curved surface sampling is that: under the condition of ensuring the precision, the geometric characteristics of the curved surface are represented by as few sampling points as possible.
Therefore, how to select a discrete point set with excellent geometric feature expression capability and as few points as possible on the free-form surface is a key step in the process of discrete mesh of the curved surface, which directly affects the quality and volume of the subsequent mesh.
Disclosure of Invention
The object of the present application is to solve at least one of the above technical drawbacks, and in particular to solve the technical drawback of the prior art that it is not possible to select a set of discrete points on a free-form surface, which has an excellent geometrical feature expression and as few points as possible.
The application provides a curved surface self-adaptive sampling method, which comprises the following steps:
determining a curved surface to be sampled and boundary sampling points of the curved surface to be sampled;
respectively carrying out line sampling on the curved surface to be sampled in two directions of a parameter plane, and constructing an initial grid of the curved surface to be sampled in the parameter plane according to a line sampling result, wherein the initial grid is composed of a plurality of grid units;
based on the curve surface variation amplitude of the curve surface to be sampled in each grid cell, adjusting the grid cells in the initial grid, and determining internal sampling points in the adjusted grid cells;
and combining the boundary sampling points with the internal sampling points, and calculating a sampling point set of the curved surface to be sampled according to the combined sampling points.
Optionally, the determining the boundary sampling point of the curved surface to be sampled includes:
determining boundary curves of all boundaries of the curved surface to be sampled;
For each boundary curve:
uniformly sampling the boundary curve according to the number of preset sampling points to obtain a plurality of initial sampling points;
calculating the overall energy of the boundary curve, and determining the expected energy of each initial sampling point according to the overall energy;
the positions of the initial sampling points are adjusted according to the expected energy of the initial sampling points, and boundary sampling points corresponding to the boundary curve are obtained;
and taking the boundary sampling points of each boundary curve as the boundary sampling points of the curved surface to be sampled.
Optionally, the line sampling is performed on the curved surface to be sampled in two directions of a parameter plane, and an initial grid of the curved surface to be sampled in the parameter plane is constructed according to a line sampling result, including:
determining a central point of the horizontal direction according to the value range of the curved surface to be sampled in the horizontal direction of the parameter plane, and taking an isoparametric line at the central point of the horizontal direction as a central meridian of the curved surface to be sampled;
determining a center point of the vertical direction according to the value range of the curved surface to be sampled in the vertical direction of the parameter plane, and taking an isoparametric line at the center point of the vertical direction as a central weft of the curved surface to be sampled;
After the central warp and the central weft are sampled respectively, sampling points of the central warp and sampling points of the central weft are obtained;
constructing an initial weft of the curved surface to be sampled through sampling points of the central warp, and constructing the initial warp of the curved surface to be sampled through sampling points of the central weft;
and constructing an initial grid of the curved surface to be sampled on the parameter plane based on the initial weft and the initial warp.
Optionally, before the adjusting the grid cells in the initial grid, the method further includes:
projecting the boundary sampling points to a parameter plane of the curved surface to be sampled to obtain a feasible region of the curved surface to be sampled on the parameter plane;
for each grid cell in the initial grid:
determining the position relation of the grid unit relative to the feasible region;
if the grid cell does not intersect with the feasible region, removing the grid cell from the initial grid;
if the grid unit has an intersection with the feasible region but is not contained by the feasible region, calculating the area ratio between the intersection area and the cell area according to the intersection area between the grid unit and the feasible region and the cell area of the grid unit;
Comparing the area ratio with a preset area ratio threshold;
if the area ratio is greater than the preset area ratio threshold, and the intersection between the grid cell and the feasible region comprises the cell center of the grid cell, reserving the grid cell;
removing the grid cell from the initial grid if the area ratio is not greater than the preset area ratio threshold or if the intersection between the grid cell and the feasible region does not contain the cell center of the grid cell;
if the grid cell is contained by the feasible region, the grid cell is reserved.
Optionally, the adjusting the grid cells in the initial grid based on the curve change amplitude of the curve to be sampled in each grid cell, and determining the internal sampling points in the adjusted grid cells, includes:
calculating the normalized energy of each grid cell, wherein the normalized energy of each grid cell represents the curve surface variation amplitude of the curve surface to be sampled in each grid cell;
homogenizing the grid cells in the initial grid according to the normalized energy of each grid cell, wherein the energy of the grid cells after the homogenizing is between a merging threshold and a subdivision threshold of the energy, and the grid cells after the homogenizing comprise merged grid cells and subdivided grid cells;
Determining the central coordinate and the normalized energy of each grid cell in the combined grid cells, and calculating the internal sampling points of the combined grid cells according to the central coordinate and the normalized energy of each grid cell;
taking the center of the subdivided grid cells as an internal sampling point of the subdivided grid cells.
Optionally, the calculating the normalized energy of each grid cell includes:
calculating the cell energy of each grid cell and the average energy of each grid cell;
the normalized energy of each grid cell is calculated from the cell energy of each grid cell and the average energy.
Optionally, the homogenizing the grid cells in the initial grid according to the normalized energy of each grid cell includes:
merging the grid cells in the initial grid according to preset cell merging conditions and the normalized energy of each grid cell to obtain merged grid cells;
subdividing grid cells with normalized energy larger than the subdivision threshold of the energy in the combined grid cells until the normalized energy of each subdivided sub-grid cell is smaller than the subdivision threshold of the energy, so as to obtain subdivided grid cells;
And removing the grid cells which are in the subdivided grid cells, have normalized energy smaller than the energy merging threshold and do not meet the preset cell merging conditions.
Optionally, the merging the grid cells in the initial grid according to a preset cell merging condition and the normalized energy of each grid cell to obtain a merged grid cell, which includes:
traversing grid cells in the initial grid, combining grid cell sets which are communicated with each other in the initial grid and have Manhattan distances between the grid cells smaller than a given threshold, wherein the normalized energy of each grid cell is smaller than the energy combining threshold, and the total normalized energy of all grid cells is smaller than the energy subdivision threshold, so as to obtain the combined grid cells.
Optionally, the subdividing the grid cells with normalized energy greater than the subdivision threshold of the energy in the combined grid cells until the normalized energy of each sub-grid cell after subdivision is less than the subdivision threshold of the energy, to obtain subdivided grid cells, including:
taking a grid cell with normalized energy larger than the subdivision threshold of the energy in the combined grid cells as a parent grid cell;
Dividing the parent grid unit into four sub grid units, and respectively calculating the normalized energy of each sub grid unit;
and merging the sub-grid cells in the parent grid cells according to the preset cell merging condition and the normalized energy of each sub-grid cell, and continuously subdividing the sub-grid cells with the normalized energy still larger than the subdivision threshold of the energy until the normalized energy of the sub-grid cells is smaller than the subdivision threshold of the energy, so as to obtain subdivided grid cells.
The application also provides a curved surface self-adaptive sampling device, which comprises:
the curved surface and boundary sampling point determining module is used for determining a curved surface to be sampled and boundary sampling points of the curved surface to be sampled;
the initial grid construction module is used for respectively carrying out line sampling on the curved surface to be sampled in two directions of a parameter plane, and constructing an initial grid of the curved surface to be sampled in the parameter plane according to a line sampling result, wherein the initial grid is composed of a plurality of grid units;
the internal sampling point determining module is used for adjusting the grid cells in the initial grid based on the curve surface variation amplitude of the curve surface to be sampled in each grid cell and determining the internal sampling points in the adjusted grid cells;
And the sampling point set calculation module is used for combining the boundary sampling points with the internal sampling points and calculating the sampling point set of the curved surface to be sampled according to the combined sampling points.
The present application also provides a storage medium having stored therein computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the curved surface adaptive sampling method according to any of the above embodiments.
The present application also provides a computer device comprising: one or more processors, and memory;
the memory has stored therein computer readable instructions that, when executed by the one or more processors, perform the steps of the curved surface adaptive sampling method according to any of the above embodiments.
From the above technical solutions, the embodiments of the present application have the following advantages:
after determining a to-be-sampled curved surface and boundary sampling points of the to-be-sampled curved surface, the method, the device, the storage medium and the computer equipment for adaptively sampling curved surfaces can respectively perform line sampling on the to-be-sampled curved surface in two directions of a parameter plane, then construct an initial grid of the to-be-sampled curved surface in the parameter plane according to a line sampling result, wherein the initial grid consists of a plurality of grid units, so that the grid units in the initial grid can be adaptively adjusted based on the curved surface variation amplitude of the to-be-sampled curved surface in each grid unit, for example, the grid units with larger curved surface variation amplitude are subdivided, and the grid units with smaller curved surface variation amplitude are combined, so that the curved surface variation amplitude in the adjusted grid units is relatively uniform, and the uniform grid units mean that an internal sampling point set of the grid units also realizes adaptive distribution according to the curved surface variation amplitude: if the number of sampling points in the area with large variation amplitude is more, the precision is ensured by a sufficient number of sampling points, and the number of sampling points in the area with small variation amplitude is less, the condition that the sampling points are redundant and wasted is avoided, so that the 'local condition' of the sampling points is realized, and under the condition that the number of the sampling points is limited, the better precision is achieved through accurate configuration. Finally, the method and the device can calculate the sampling point set of the curved surface to be sampled by combining the boundary sampling points and the internal sampling points, so that a discrete point set with excellent geometric feature expression capability and as few points as possible is selected on the free curved surface.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive faculty for a person skilled in the art.
Fig. 1 is a schematic flow chart of a curved surface adaptive sampling method provided in an embodiment of the present application;
fig. 2 is a schematic diagram of distribution of sampling points obtained by the sampling method based on the equal parameters according to the embodiment of the present application;
fig. 3 is a schematic diagram of distribution of internal sampling points obtained based on the sampling method of the present application according to the embodiment of the present application;
fig. 4 is a structural display diagram of a sampling point set of a curved surface to be sampled according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a process for constructing an initial grid according to an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating a process of surface boundary point sampling and boundary multi-segment line construction according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a positional relationship between a grid cell and a feasible region according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a process of removing grid cells from an initial grid provided in an embodiment of the present application;
fig. 9 is a process schematic diagram of a merging process of grid cells according to an embodiment of the present application;
fig. 10 is a process schematic diagram of a subdivision process of a grid cell provided in an embodiment of the present application;
fig. 11 is a schematic structural diagram of a curved surface adaptive sampling device according to an embodiment of the present application;
fig. 12 is a schematic diagram of an internal structure of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The expression display of free curved surfaces is not separated from various fields such as industrial part design, building design, game production and the like. When the free-form surface is expressed and displayed, the computer generally disperses the continuous free-form surface into grid data, so that subsequent rendering and display are facilitated. Thus, for a set of sampling points having the same number of sampling points, distinct surface expression results are produced because of the different spatial distributions of the sampling points. Therefore, how to select a discrete point set with excellent geometric feature expression capability and as few points as possible on the free-form surface is a key step in the process of discrete mesh of the curved surface, and will directly affect the quality and volume of the subsequent mesh. Based on this, the following technical scheme is proposed in the present application, see specifically below:
In one embodiment, as shown in fig. 1, fig. 1 is a schematic flow chart of a curved surface adaptive sampling method provided in an embodiment of the present application; the application provides a curved surface adaptive sampling method, which can comprise the following steps:
s110: and determining the boundary sampling points of the curved surface to be sampled.
In this step, when the free-form surface is adaptively sampled, the free-form surface to be sampled can be determined first and used as the free-form surface to be sampled, and then the boundary sampling point and the internal sampling point of the free-form surface to be sampled are determined, so that the sampling point set of the free-form surface to be sampled can be determined together through the boundary sampling point and the internal sampling point.
It is understood that the curved surface to be sampled in the present application may be any parametric curved surface C (u, v), such as a free-form surface expressed by NURBS, or a free-form surface expressed by B-Spline, and the like, which is not limited herein. Further, after determining the curved surface to be sampled, the boundary of the curved surface to be sampled, such as a free curved surface expressed by NURBS, may be determined first, where the boundary includes an inner ring boundary and an outer ring boundary. In the present application, the boundary curve of either the inner ring boundary or the outer ring boundary can be determined by the boundary curve equation.
For example, since the boundary curve is located on the surface to be sampled, it can be expressed as C (u (t), v (t)). From this expression, the relationship of u (t), v (t) can be taken into the above expression to obtain the boundary curve equation. Also, for surfaces where no additional clipping operations exist, the boundaries may be determined by the parameter ranges. For example, u and v are all in the range of [0,1], the boundary of the boundary curve on the parameter plane is a square surrounded by four line segments, and the boundary curve equation can be obtained by taking the square into C (u, v).
After the boundary curve equation of the curved surface to be sampled is obtained, the boundary curve of each boundary can be determined according to the boundary curve equation, and then the corresponding boundary sampling point is determined by utilizing the boundary curve, and the boundary sampling point can be used as a part of a sampling point set of the curved surface to be sampled and can also trim the boundary of the subsequent initial grid. Of course, the boundary sampling points of the curved surface to be sampled can also be obtained by other existing calculation methods, which is not limited herein.
S120: and respectively carrying out line sampling on the curved surface to be sampled in two directions of the parameter plane, and constructing an initial grid of the curved surface to be sampled in the parameter plane according to a line sampling result.
In this step, after the curved surface to be sampled and the boundary sampling points of the curved surface to be sampled are obtained through S110, the present application may perform line sampling on the curved surface to be sampled in two directions of the parameter plane, and construct an initial grid of the curved surface to be sampled in the parameter plane according to the line sampling result.
It will be appreciated that the parameter plane generally contains both u, v directions, i.e. the horizontal direction and the vertical direction. After the curved surface to be sampled is determined, in order to determine the internal sampling points of the curved surface to be sampled, line sampling can be performed on the curved surface to be sampled in two directions of a parameter plane, namely, the u direction and the v direction, so that a plurality of sampling points in the two directions can be obtained, and after the sampling points are connected in the corresponding directions, an initial grid, which is formed by a plurality of grid units, of the curved surface to be sampled in the parameter plane can be formed.
When the line sampling is respectively carried out in the u direction and the v direction, the uniform sampling can be carried out according to the value ranges of the to-be-sampled curved surface in the two directions of the parameter plane, the sampling can also be carried out according to the energy distribution condition of the to-be-sampled curved surface in the two directions, and the sampling can also be carried out according to other sampling modes. After sampling is performed by different sampling modes, the obtained grid cells in the initial grid are different in size. Therefore, the size of the grid cells in the initial grid may be the same or different, and the initial grid is constructed after the corresponding sampling mode is selected according to actual situations, which is not described herein.
S130: based on the curve surface variation amplitude of the curve surface to be sampled in each grid cell, the grid cells in the initial grid are adjusted, and internal sampling points in the adjusted grid cells are determined.
In this step, after the initial grid of the surface to be sampled in the parameter plane is constructed in S120, the change amplitude of the surface to be sampled in each grid cell of the initial grid can be determined first, and then the grid cells in the initial grid are adjusted according to the change amplitude of the surface of each grid cell, so that the internal sampling point can be determined according to the adjusted grid cells.
Specifically, after the initial grid is obtained, if the cell center of each grid cell in the initial grid is directly used as an internal sampling point, the obtained internal sampling point cannot accurately evaluate the curve change degree of the curve to be sampled due to inconsistent curve change amplitude of the curve to be sampled in each grid cell, and the quality and the volume of the subsequent grid are affected due to more internal sampling points.
Therefore, after the initial grid is obtained, the grid cells in the initial grid can be adjusted according to the curve change amplitude of the curve to be sampled in each grid cell. For example, when the change amplitude of the curved surface in the grid unit is larger, the grid unit can be subdivided, when the change amplitude of the curved surface in the grid unit is smaller, the grid unit can be combined with other grid units with smaller change amplitude of the curved surface, and when the change amplitude of the curved surface in the grid unit is too small and can not be combined, the grid unit can be removed, so that the adjusted change amplitude of the curved surface of each grid unit is relatively close, and the self-adaptive layout of the internal sampling points is realized.
Schematically, as shown in fig. 2 and fig. 3, fig. 2 is a schematic diagram of distribution of sampling points obtained by the sampling method based on the equal parameter provided in the embodiment of the present application, and fig. 3 is a schematic diagram of distribution of internal sampling points obtained by the sampling method based on the present application provided in the embodiment of the present application; the black solid line in fig. 2 represents a selected portion of the isoparametric line, and the solid dots represent a portion of the sampling points on the isoparametric line. It is not difficult to find that in order to guarantee the sampling quality within the right rectangular box, the method requires a denser arrangement of iso-lines here, resulting in redundancy of the sampling points within the left rectangular box. If the equal parameter lines are distributed relatively sparsely, the sampling quality in the right rectangular frame range is difficult to ensure, and the equal parameter lines restrict the distribution of sampling points. As can be seen from fig. 3, the method breaks through the limitation of the isoparametric line by performing operations such as subdivision, merging and removal on the grid cells in the initial grid, so that the distribution of the internal sampling points is more reasonable.
Further, since the projection of the boundary portion of the curved surface to be sampled in the present application may be in a regular shape or an irregular shape, the initial grid obtained in the present application is obtained by performing line sampling on the curved surface to be sampled in two directions of the parameter plane, and performing construction according to the line sampling result. Thus, the initial grid of the present application includes the projected portion of the surface to be sampled on the parameter plane, but there may be an excess portion. In order to further optimize the quality and the volume of the grid, the initial grid can be trimmed through the projection part of the curved surface to be sampled on the parameter plane, so that redundant components in the initial grid are eliminated.
S140: and combining the boundary sampling points and the internal sampling points, and calculating a sampling point set of the curved surface to be sampled according to the combined sampling points.
In this step, after the boundary sampling point and the internal sampling point of the to-be-sampled curved surface are obtained through S110-S130, since the boundary sampling point and the internal sampling point are both sampling point sets on the parameter plane, in order to obtain the sampling point set of the to-be-sampled curved surface in the three-dimensional space, the boundary sampling point and the internal sampling point may be combined, and then the sampling point set of the to-be-sampled curved surface may be calculated according to the combined sampling points.
In a specific embodiment, a sampling point set obtained by combining boundary sampling points and internal sampling points in the application may be expressed as { (ui, vi) |i=1, 2.
Schematically, as shown in fig. 4, fig. 4 is a structural representation of a sampling point set of a curved surface to be sampled provided in an embodiment of the present application; as can be seen from fig. 4, by the curved surface adaptive sampling method of the present application, a set of sampling points that better conforms to the curved surface variation amplitude of the curved surface to be sampled can be obtained.
In the above embodiment, after determining the curved surface to be sampled and the boundary sampling points of the curved surface to be sampled, line sampling may be performed on the curved surface to be sampled in two directions of the parameter plane, and then an initial grid of the curved surface to be sampled in the parameter plane is constructed according to the line sampling result, where the initial grid is composed of a plurality of grid units, so that the grid units in the initial grid may be adaptively adjusted based on the curved surface variation amplitude of the curved surface to be sampled in each grid unit, for example, the grid units with larger curved surface variation amplitude are subdivided, and the grid units with smaller curved surface variation amplitude are combined, so that the curved surface variation amplitude in the adjusted grid units is relatively uniform, and the uniform grid units mean that the internal sampling point set of the grid units also implements adaptive distribution according to the curved surface variation amplitude: if the number of sampling points in the area with large variation amplitude is more, the precision is ensured by a sufficient number of sampling points, and the number of sampling points in the area with small variation amplitude is less, the condition that the sampling points are redundant and wasted is avoided, so that the 'local condition' of the sampling points is realized, and under the condition that the number of the sampling points is limited, the better precision is achieved through accurate configuration. Finally, the method and the device can calculate the sampling point set of the curved surface to be sampled by combining the boundary sampling points and the internal sampling points, so that a discrete point set with excellent geometric feature expression capability and as few points as possible is selected on the free curved surface.
In one embodiment, determining the boundary sampling point of the surface to be sampled in S110 may include:
s111: and determining boundary curves of all boundaries of the curved surface to be sampled.
S112: for each boundary curve: and uniformly sampling the boundary curve according to the preset number of sampling points to obtain a plurality of initial sampling points.
S113: the overall energy of the boundary curve is calculated, and the expected energy of each initial sampling point is determined according to the overall energy.
S114: and adjusting the positions of the initial sampling points according to the expected energy of the initial sampling points to obtain the boundary sampling points corresponding to the boundary curve.
S115: and taking the boundary sampling points of each boundary curve as the boundary sampling points of the curved surface to be sampled.
In this embodiment, when determining the boundary sampling points of the curved surface to be sampled, the boundary curve equation of the curved surface to be sampled may be determined first, then the boundary curves of the respective boundaries may be determined according to the boundary curve equation, then the boundary sampling points of the respective boundary curves may be obtained after sampling the respective boundary curves, and the boundary sampling points of the respective boundary curves may be summarized to obtain the boundary sampling points of the curved surface to be sampled. The boundary sampling points can be used as a part of a sampling point set of a curved surface to be sampled, and the boundary of the subsequent initial grid can be trimmed, so that the quality and the volume of the grid are improved, and the accuracy of curved surface sampling is further improved.
Further, when the boundary curves of the boundaries are sampled, the sampling points of the boundary curves can be obtained through a line sampling method of energy average division.
Specifically, for each boundary curve, the present application may first obtain a preset number of sampling points, then uniformly sample the boundary curve according to the number of sampling points, so as to obtain a plurality of initial sampling points, then calculate the overall energy of the boundary curve, determine the expected energy of each initial sampling point according to the overall energy, and then adjust the position of each initial sampling point according to the expected energy of each initial sampling point, so as to obtain the boundary sampling point of the boundary curve.
For example, the present application may give the number n of expected sampling points first, and then equally divide the parameter domain [ vmin, vmax ] to obtain an initial sampling point, for example, the i-th initial sampling point vi=vmin+ (i-1) ×step, step= (vmax-vmin)/n; then, the whole energy E of the whole boundary curve can be calculated by a numerical integration method, and the expected energy corresponding to each initial sampling point is determined according to the whole energy E, for example, the i-th initial sampling point ei=E i/n; finally, the present application may iterate the positions of the initial sampling points until the initial sampling points correctly correspond to the expected energy, so that the boundary sampling points of the boundary curve may be obtained.
In one embodiment, in S120, line sampling is performed on the curved surface to be sampled in two directions of a parameter plane, and an initial grid of the curved surface to be sampled in the parameter plane is constructed according to a line sampling result, which may include:
s121: and determining the center point of the horizontal direction according to the value range of the curved surface to be sampled in the horizontal direction of the parameter plane, and taking the isoparametric line at the center point of the horizontal direction as the central meridian of the curved surface to be sampled.
S122: and determining a center point of the vertical direction according to the value range of the curved surface to be sampled in the vertical direction of the parameter plane, and taking the isoparametric line at the center point of the vertical direction as a central weft of the curved surface to be sampled.
S123: and respectively sampling the central warp and the central weft to obtain sampling points of the central warp and the central weft.
S124: constructing an initial weft of the curved surface to be sampled through sampling points of the central warp, and constructing the initial warp of the curved surface to be sampled through sampling points of the central weft;
s125: and constructing an initial grid of the curved surface to be sampled on the parameter plane based on the initial weft and the initial warp.
In this embodiment, when the curved surface to be sampled is sampled in two directions of the parameter plane, line sampling may be performed according to the above-described boundary curve sampling manner.
Specifically, the method and the device can determine the central warp and the central weft of the curved surface to be sampled according to the value ranges of the curved surface to be sampled in two directions of the parameter plane, and then sample the central warp and the central weft respectively according to the boundary curve sampling mode, so that the sampling points of the central warp and the sampling points of the central weft can be obtained.
The central warp yarn of the curved surface to be sampled is the warp yarn passing through the center of the curved surface to be sampled, the central weft yarn of the curved surface to be sampled is the weft yarn passing through the center of the curved surface to be sampled, and the central warp yarn and the central weft yarn can be determined through the value ranges of the curved surface to be sampled in two directions of the parameter plane. For example, when determining the central meridian, the application can determine the penetration point and the length of the central meridian according to the value range of the curved surface to be sampled in the horizontal direction of the parameter plane; when the central weft is determined, the penetration point and length of the central weft can be determined according to the value range of the curved surface to be sampled in the vertical direction of the parameter plane, so that the central warp and the central weft are obtained.
Specifically, in determining the central meridian of the curved surface to be sampled, the application can determine the value range of the curved surface to be sampled in the horizontal direction of the parameter plane, such asThen determining the centre point in the horizontal direction, e.g.The method can take the isoparametric line at the central point in the horizontal direction as the central meridian of the curved surface to be sampled, and then sample the central meridian within the sampling range of +.>Corresponding curve parameter range.
Similarly, when determining the central weft of the curved surface to be sampled, the central point of the curved surface to be sampled in the vertical direction of the parameter plane is determined, then the isoparametric line at the central point is used as the central weft of the curved surface to be sampled, and then the central weft is sampled with the sampling range ofCorresponding curve parameter range.
When the initial grid of the curved surface to be sampled on the parameter plane is constructed according to the line sampling result, the initial weft and the initial warp of the curved surface to be sampled can be constructed first, and then the initial grid of the curved surface to be sampled on the parameter plane is constructed according to the initial weft and the initial warp.
Specifically, when constructing the initial weft and the initial warp of the curved surface to be sampled, the central warp and the central weft can be sampled respectively according to the boundary curve sampling mode, so that sampling points of the central warp and sampling points of the central weft can be obtained, and the initial weft and the initial warp can be constructed through the sampling points. After the initial weft and the initial warp are obtained, the initial grid of the curved surface to be sampled on the parameter plane is obtained.
Schematically, as shown in fig. 5, fig. 5 is a schematic diagram of a process for constructing an initial grid according to an embodiment of the present application; in fig. 5, the curve corresponding to the u direction of the parameter plane on the curved surface to be sampled is the central meridian, and the curve corresponding to the v direction of the parameter plane is the central latitude, but the central meridian and the central latitude are within the range of the bounding box, but are not within the curved surface to be sampled. By sampling the central warp and central weft, an initial grid as shown in fig. 5 can be obtained.
In one embodiment, before adjusting the grid cells in the initial grid based on the curved surface variation amplitude of the curved surface to be sampled in each grid cell in S130, the method may further include:
s1301: and projecting the boundary sampling points to a parameter plane of the curved surface to be sampled to obtain a feasible region of the curved surface to be sampled on the parameter plane.
S1302: for each grid cell in the initial grid.
S1303: a positional relationship of the grid cell with respect to the feasible region is determined.
S1304: if the grid cell does not intersect the feasible region, the grid cell is removed from the initial grid.
S1305: if the grid cell has an intersection with the feasible region but is not contained by the feasible region, calculating the area ratio between the intersection area and the cell area according to the intersection area between the grid cell and the feasible region and the cell area of the grid cell.
S1306: and comparing the area ratio with a preset area ratio threshold value.
S1307: and if the area ratio is larger than the preset area ratio threshold value and the intersection between the grid cell and the feasible region comprises the cell center of the grid cell, reserving the grid cell.
S1308: and if the area ratio is not greater than the preset area ratio threshold value or the intersection between the grid cell and the feasible region does not contain the cell center of the grid cell, removing the grid cell from the initial grid.
S1309: if the grid cell is contained by the feasible region, the grid cell is reserved.
In this embodiment, before the grid cells in the initial grid are adjusted, the grid cells of the initial grid may be trimmed first, so that meaningless operations may be avoided, and sampling efficiency may be improved.
In terms of expansion, after the boundary sampling points of the curved surface to be sampled are obtained, the boundary sampling points can be projected to the parameter plane of the curved surface to be sampled, so that projection points of a plurality of sampling points can be obtained on the parameter plane, and after the projection points are sequentially connected, boundary multi-line segments can be formed, namely the feasible region of the curved surface to be sampled on the parameter plane in the application.
Schematically, as shown in fig. 6, fig. 6 is a schematic process diagram of curved surface boundary point sampling and boundary multi-section line structure provided in the embodiment of the present application; in fig. 6, after determining the boundary sampling point of the curved surface to be sampled, the boundary sampling point may be projected onto a parameter plane to obtain a boundary expressed by a multi-segment line on the parameter plane. This process is illustrated in fig. 6, where the edge cross of the surface to be sampled represents the sample point of the surface boundary and the multi-segment line of the parameter plane represents the boundary of the surface at the parameter plane.
After obtaining the feasible region of the curved surface to be sampled on the parameter plane, the grid cells in the initial grid can be trimmed according to the feasible region. For example, the feasible region may be compared with the range of the initial grid, if the initial grid exceeds the range of the feasible region, the excess may be trimmed, and if not, the excess may be retained.
Further, when each grid cell in the initial grid is trimmed according to the feasible region, the position relationship of the grid cell relative to the feasible region can be determined, where the position relationship includes: the grid cell has no intersection with the feasible region; the grid cells intersect with, but are not contained by, the feasible region; the grid cells are contained by the feasible region. Fig. 7 shows a positional relationship between a grid cell and a feasible region according to an embodiment of the present application: fig. 7 (1) shows that the grid cell has no intersection with the feasible region; (2) indicating that the grid cell has an intersection with the feasible region, but is not contained by the feasible region; (3) indicating that the grid cell is encompassed by the feasible region. Different pruning measures can be adopted for different position relations.
Specifically, when the grid unit does not intersect with the feasible region, the sampling point is not in the clipping curved surface, and if the grid unit is continuously sampled, the method has no meaning, and the grid unit can be removed from the initial grid at the moment; when the grid cell has an intersection with the feasible region but is not contained by the feasible region, determining whether to remove the grid cell from the initial grid further according to the intersection area between the grid cell and the feasible region, the cell area of the grid cell, and whether the cell center of the grid cell is within the feasible region; if the grid cell is contained by the feasible region, the grid cell is indicated to be within the feasible region, and the grid cell is reserved. Schematically, as shown in fig. 8, fig. 8 is a schematic process diagram of a removed grid cell in an initial grid provided in an embodiment of the present application; in fig. 8, the initial grid is trimmed by the boundary multi-segment line of the surface to be sampled on the parameter plane, where the black grid cells represent the grid cells to be removed in the initial grid.
It will be appreciated that when a grid cell has an intersection with a feasible region, but the intersection area occupies a small area of the grid cell, it makes little sense to add an additional grid cell and increases computational overhead. Therefore, the present application can calculate the area ratio between the intersection area and the cell area according to the intersection area between the grid cell and the feasible region and the cell area of the grid cell, and when the area ratio is greater than the preset area ratio threshold, and the intersection between the grid cell and the feasible region includes the cell center of the grid cell, the grid cell is reserved, and when the area ratio is not greater than the preset area ratio threshold, or the intersection between the grid cell and the feasible region does not include the cell center of the grid cell, the grid cell is removed from the initial grid. Therefore, the calculation cost is reduced, and the sampling efficiency is improved.
It should be noted that, for such grid cells, the obtained grid sampling points should be ensured to be within a feasible domain when the merging and subdivision operations are performed, otherwise, the method has no meaning. Thus, if the merged grid sampling point is not within the feasible region, stopping the merging operation; and removing grids corresponding to the sampling points for the grid sampling points which are not in the feasible domain after subdivision, so as to ensure that the sampling points are all in the feasible domain.
Further, the preset area ratio threshold is typically set to 0.5 in this application, and an alternative range is [0.25, 1 ], taken to 1, indicates that the grid cell is contained by the feasible region. Of course, if the better the level of detail near the boundary is desired, the smaller the preset area ratio threshold may be set, and if the higher efficiency is desired, the higher the preset area ratio threshold may be set, specifically, as the case may be, without limitation.
In one embodiment, adjusting the grid cells in the initial grid based on the curved surface variation amplitude of the curved surface to be sampled in each grid cell in S130, and determining the internal sampling points in the adjusted grid cells may include:
s131: and calculating the normalized energy of each grid cell, wherein the normalized energy of each grid cell characterizes the curve surface variation amplitude of the curve surface to be sampled in each grid cell.
S132: and carrying out homogenization treatment on the grid cells in the initial grid according to the normalized energy of each grid cell, wherein the energy of the grid cells after the homogenization treatment is positioned between a merging threshold value and a subdivision threshold value of the energy, and the grid cells after the homogenization treatment comprise merged grid cells and subdivided grid cells.
S133: and determining the central coordinate and the normalized energy of each grid cell in the combined grid cells, and calculating the internal sampling points of the combined grid cells according to the central coordinate and the normalized energy of each grid cell.
S134: taking the center of the subdivided grid cells as an internal sampling point of the subdivided grid cells.
In this embodiment, when the grid cells in the initial grid are adjusted, the normalized energy of each grid cell may be calculated first, where the normalized energy of each grid cell characterizes the change amplitude of the curved surface to be sampled in each grid cell, so that the grid cells in the initial grid may be homogenized according to the normalized energy of each grid cell, where the energy of the grid cells after homogenization is located between the merging threshold and the subdivision threshold of the energy, so as to ensure that the change amplitude of the curved surface of each grid cell after homogenization is similar.
It should be noted that, before the grid cells in the initial grid are adjusted, if the grid cells in the initial grid are trimmed by the feasible region formed after the boundary sampling points are projected to the parameter plane, the grid cells are the remaining grid cells after trimming when the grid cells in the initial grid are adjusted.
Further, for any point on the free-form surface, generally, the trend of change of the surface in different directions is different. Specifically, geometric measures such as linear velocity, curvature and the like of any point on the free-form surface in different directions have certain differences. Therefore, in order to arrange sampling points in less areas with small curve change amplitude and arrange sampling points in more areas with large curve change amplitude, a reasonable measure is needed to evaluate the local change amplitude of the curve. In addition, the position of the sampling point should be selected as "free" as possible, rather than constrained to the isocenter.
Based on the method, a new energy measure is provided for measuring the local variation amplitude of the curved surface, the measure takes the area factor and the curvature factor of the curved surface into consideration, and accurate variation amplitude evaluation can be realized on the free curved surface without setting any experience parameter. Specifically, the energy measurement is carried out by calculating the normalized energy of each grid cell to evaluate the curve change amplitude of the curve to be sampled in each grid cell, and homogenizing the grid cells in the initial grid according to the evaluation result, so that the curve change amplitude of the local grid cells in the initial grid is relatively similar.
In addition, when the grid cells in the initial grid are subjected to homogenization treatment, the grid cells with larger variation range are mainly subdivided, and the grid cells with smaller variation are combined, so that the energy of the grid cells after the homogenization treatment is positioned between the energy combination threshold and the subdivision threshold, and the local curved surface variation range of the grid cells in the initial grid is ensured to be relatively close.
Further, in determining the internal sampling points in the adjusted grid cells, the present application may calculate the internal sampling points of the combined grid cells according to the center coordinates and the normalized energy of each grid cell in the combined grid cells. And the size of the grid cells in the subdivision process shows geometric grade reduction, so that the center of the subdivided grid cells can be directly used as an internal sampling point of the subdivided grid cells.
For example, after the grid cells are combined, the sampling points before the combination are combined into one point sampling point. The combined plane point coordinates pass through the sampling point coordinates before combination +.>Normalized energy of corresponding grid cell +.>Co-determination, the combined coordinates can be written as . The above conditions ensure that the merging of the grid cells is partial, that the merged grid cells cannot be subdivided, i.e. all merging operations can be completed by traversing the grid cells only once, and that the new sampling points take into account the energy relation between the grid cells.
In one embodiment, calculating the normalized energy for each grid cell in S131 may include:
s1311: the cell energy for each grid cell is calculated, as well as the average energy for each grid cell.
S1312: the normalized energy of each grid cell is calculated from the cell energy of each grid cell and the average energy.
In this embodiment, when calculating the normalized energy of each grid cell, the cell energy of each grid cell and the average energy of each grid cell may be calculated first, so that the normalized energy of each grid cell may be calculated according to the cell energy and the average energy of each grid cell.
In a specific embodiment, the present application proposes an energy density function to measure the magnitude of the change of the surface at each point, which can be expressed as:
wherein,representing curvature energy density, +.>The area energy density is represented, both calculated from the surface equation. From the above energy density function, the cell energy +/for each grid cell can be calculated >And the average energy of the grid cells +.>
Wherein,、/>respectively representing the row number and the column number of the grid cell in the grid, < >>Indicating the number of grid cells remaining after pruning. />The larger the value of the curve surface variation amplitude in the range of the grid unit is, the larger the variation amplitude of the curve surface to be sampled in the current grid unit is, and the more sampling points are needed in the area; the smaller the value, the smaller the change amplitude of the curved surface to be sampled in the current grid unit, and the less sampling points are needed in the area. />Representing the average variation amplitude of the surface to be sampled, the application can therefore be based on the cell energy per grid cell +.>And the average energy of the grid cells +.>The relative energy is obtained by normalization treatment>I.e. normalized energy of the present application:
wherein,exceeding unit 1 indicates that the amplitude of the change in the grid cell exceeds the average level, and conversely indicates that the amplitude is below the average level.
In one embodiment, the homogenizing the grid cells in the initial grid according to the normalized energy of each grid cell in S132 may include:
s1321: and merging the grid cells in the initial grid according to preset cell merging conditions and the normalized energy of each grid cell to obtain merged grid cells.
S1322: and subdividing the grid cells with normalized energy larger than the subdivision threshold of the energy in the combined grid cells until the normalized energy of each subdivided sub-grid cell is smaller than the subdivision threshold of the energy, so as to obtain the subdivided grid cells.
S1323: and removing the grid cells which are in the subdivided grid cells, have normalized energy smaller than the energy merging threshold and do not meet the preset cell merging conditions.
In this embodiment, when the grid cells in the initial grid are normalized, the grid cells in the initial grid may be merged according to a preset cell merging condition and normalized energy of each grid cell, so as to obtain a merged grid cell, where the merged grid cell includes a merged grid cell and other non-merged grid cells in the initial grid. At this time, the grid cells with normalized energy greater than the subdivision threshold of energy in the combined grid cells may be subdivided until the normalized energy of each sub-grid cell after subdivision is less than the subdivision threshold of energy, so as to obtain a subdivided grid cell, where the subdivided grid cell includes both the previously combined grid cell and the subdivided grid cell, and further includes other grid cells in the initial grid that are not combined and not subdivided.
Furthermore, the method and the device can remove the grid cells which are not in accordance with the preset cell merging conditions and have the normalized energy smaller than the merging threshold value of the energy in the subdivided grid cells, so that the number of sampling points is reduced, and the sampling efficiency is improved.
Schematically, as shown in fig. 9 and fig. 10, fig. 9 is a schematic process diagram of a merging process of grid cells provided in an embodiment of the present application, and fig. 10 is a schematic process diagram of a subdivision process of grid cells provided in an embodiment of the present application, and as can be seen from fig. 9 and fig. 10, adjacent grid cells with smaller energy are merged in the present application; continuously subdividing the grid cells with larger energy; after removing the grid cells which have smaller energy and cannot be combined, the grid cells with relatively close energy can be obtained.
In one embodiment, in S1321, according to a preset cell merging condition and normalized energy of each grid cell, merging the grid cells in the initial grid to obtain a merged grid cell, including:
traversing grid cells in the initial grid, combining grid cell sets which are communicated with each other in the initial grid and have Manhattan distances between the grid cells smaller than a given threshold, wherein the normalized energy of each grid cell is smaller than the energy combining threshold, and the total normalized energy of all grid cells is smaller than the energy subdivision threshold, so as to obtain the combined grid cells.
In this embodiment, when merging grid cells in the initial grid, all grid cells may be traversed first, then, the grid cell sets in which the mutually connected manhattan distances are smaller than a given threshold, the normalized energy of each grid cell is smaller than the energy merging threshold, and the total normalized energy of all grid cells is smaller than the energy subdivision threshold are merged, so as to obtain the merged grid cell.
Specifically, after the grid cells are subjected to homogenization treatment, the normalized energy of all the grid cells is locatedWithin the scope, wherein->Representing the combined threshold of the normalized energy,representing a subdivision threshold of normalized energy. Wherein, when merging the grid cells, the grid can be traversed first, and the grid cell set meeting the following conditions is +.>Combining:
(1)is communicated, and can reach any other grid cell in the collection from any grid cell;
(2)is compact, starting from any grid cell, the Manhattan distance to any other grid cell within the collection is less than a given threshold;
(3)meeting the energy conditions for +.>Normalized energy corresponding to each grid cell Require arbitrary->Less than->And total normalized energy->Less than->
It will be readily appreciated that because the necessary condition for performing the mesh cell merge is that the total normalized energy of all mesh cells is less than the subdivision threshold, the merged mesh cells will not participate in the subdivision operation. The mesh cells after the merging described below include mesh cells obtained by merging and other mesh cells not merged in the initial mesh.
In one embodiment, in S1322, subdividing the grid cells with normalized energy greater than the subdivision threshold of energy in the merged grid cell until the normalized energy of each sub-grid cell after subdivision is less than the subdivision threshold of energy, to obtain subdivided grid cells, which may include:
s13221: and taking the grid cells with normalized energy larger than the subdivision threshold of the energy in the combined grid cells as parent grid cells.
S13222: after equally dividing the parent grid unit into four sub-grid units, calculating the normalized energy of each sub-grid unit respectively.
S13223: and merging the sub-grid cells in the parent grid cells according to the preset cell merging condition and the normalized energy of each sub-grid cell, and continuously subdividing the sub-grid cells with the normalized energy still larger than the subdivision threshold of the energy until the normalized energy of the sub-grid cells is smaller than the subdivision threshold of the energy, so as to obtain subdivided grid cells.
In this embodiment, when the combined grid cells are subdivided, the grid cells may be traversed first, and the grid cells in which the normalized energy is greater than the subdivision threshold of energy in the combined grid cells are determined, and then the partial grid cells are subdivided. In the case of subdivision, the grid cells may be subdivided into two, three or four tiles according to the energy distribution of the grid cells until the energy of each sub-grid cell is less than
In a specific embodiment, when determining a subdivided parent grid cell, the parent grid cell may be cut into two pieces, divided into four equal small sub-grid cells, and then the normalized energies e1, e2, e3, e4 of the individual small sub-grid cells may be calculated. If the normalized energy corresponding to the small blocks with the common edges, such as e1 and e2, is smaller than the energy merging threshold, and the normalized energy sum is smaller than the energy subdivision threshold, merging the two, otherwise, keeping the two as independent individuals. If e1, e2 and e3 can be combined, the combination is performed according to the principle of minimum maximum energy after the combination. Thus, after one subdivision, a large parent grid cell may become a 2-small, 3-small, or 4-small child grid cell.
It will be appreciated that since the subdivision operation of the present application is local, the scope of influence is limited to the current grid cell interior. Therefore, efficient parallelism can be completely realized, the size of the grid cells in the subdivision process shows geometric grade reduction, and the condition of stopping subdivision can be reached quickly.
The curved surface adaptive sampling device provided in the embodiments of the present application is described below, and the curved surface adaptive sampling device described below and the curved surface adaptive sampling method described above may be referred to correspondingly.
In one embodiment, as shown in fig. 11, fig. 11 is a schematic structural diagram of a curved surface adaptive sampling device provided in an embodiment of the present application; the application also provides a curved surface self-adaptive sampling device, which can comprise a curved surface and boundary sampling point determining module 210, an initial grid constructing module 220, an internal sampling point determining module 230 and a sampling point set calculating module 240, and specifically comprises the following steps:
the curved surface and boundary sampling point determining module 210 is configured to determine a curved surface to be sampled and a boundary sampling point of the curved surface to be sampled.
The initial grid construction module 220 is configured to perform line sampling on the to-be-sampled curved surface in two directions of a parameter plane, and construct an initial grid of the to-be-sampled curved surface in the parameter plane according to a line sampling result, where the initial grid is composed of a plurality of grid units.
The internal sampling point determining module 230 is configured to adjust the grid cells in the initial grid based on the curved surface variation amplitude of the curved surface to be sampled in each grid cell, and determine the internal sampling points in the adjusted grid cells.
And the sampling point set calculating module 240 is configured to combine the boundary sampling points and the internal sampling points, and calculate a sampling point set of the curved surface to be sampled according to the combined sampling points.
In the above embodiment, after determining the curved surface to be sampled and the boundary sampling points of the curved surface to be sampled, line sampling may be performed on the curved surface to be sampled in two directions of the parameter plane, and then an initial grid of the curved surface to be sampled in the parameter plane is constructed according to the line sampling result, where the initial grid is composed of a plurality of grid units, so that the grid units in the initial grid may be adaptively adjusted based on the curved surface variation amplitude of the curved surface to be sampled in each grid unit, for example, the grid units with larger curved surface variation amplitude are subdivided, and the grid units with smaller curved surface variation amplitude are combined, so that the curved surface variation amplitude in the adjusted grid units is relatively uniform, and the uniform grid units mean that the internal sampling point set of the grid units also implements adaptive distribution according to the curved surface variation amplitude: if the number of sampling points in the area with large variation amplitude is more, the precision is ensured by a sufficient number of sampling points, and the number of sampling points in the area with small variation amplitude is less, the condition that the sampling points are redundant and wasted is avoided, so that the 'local condition' of the sampling points is realized, and under the condition that the number of the sampling points is limited, the better precision is achieved through accurate configuration. Finally, the method and the device can calculate the sampling point set of the curved surface to be sampled by combining the boundary sampling points and the internal sampling points, so that a discrete point set with excellent geometric feature expression capability and as few points as possible is selected on the free curved surface.
In one embodiment, the present application also provides a storage medium having stored therein computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the surface adaptive sampling method according to any of the above embodiments.
In one embodiment, the present application also provides a computer device comprising: one or more processors, and memory.
The memory has stored therein computer readable instructions that, when executed by the one or more processors, perform the steps of the curved surface adaptive sampling method according to any of the above embodiments.
Schematically, as shown in fig. 12, fig. 12 is a schematic internal structure of a computer device provided in an embodiment of the present application, and the computer device 300 may be provided as a server. Referring to fig. 10, a computer device 300 includes a processing component 302 that further includes one or more processors, and memory resources represented by memory 301, for storing instructions, such as applications, executable by the processing component 302. The application program stored in the memory 301 may include one or more modules each corresponding to a set of instructions. Further, the processing component 302 is configured to execute instructions to perform the surface adaptive sampling method of any of the embodiments described above.
The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input output (I/O) interface 305. The computer device 300 may operate based on an operating system stored in memory 301, such as Windows Server TM, mac OS XTM, unix TM, linux TM, free BSDTM, or the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 12 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
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 the element.
In the present specification, each embodiment is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and may be combined according to needs, and the same similar parts may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (11)

1. A method for adaptively sampling a curved surface, the method comprising:
determining a to-be-sampled curved surface of a part model and boundary sampling points of the to-be-sampled curved surface;
respectively carrying out line sampling on the curved surface to be sampled in two directions of a parameter plane, and constructing an initial grid of the curved surface to be sampled in the parameter plane according to a line sampling result, wherein the initial grid is composed of a plurality of grid units;
Based on the curve surface variation amplitude of the curve surface to be sampled in each grid cell, adjusting the grid cells in the initial grid, and determining internal sampling points in the adjusted grid cells, wherein the method comprises the following steps:
calculating the normalized energy of each grid cell, wherein the normalized energy of each grid cell represents the curve surface variation amplitude of the curve surface to be sampled in each grid cell;
homogenizing the grid cells in the initial grid according to the normalized energy of each grid cell, wherein the energy of the grid cells after the homogenizing is between a merging threshold and a subdivision threshold of the energy, and the grid cells after the homogenizing comprise merged grid cells and subdivided grid cells;
determining the central coordinate and the normalized energy of each grid cell in the combined grid cells, and calculating the internal sampling points of the combined grid cells according to the central coordinate and the normalized energy of each grid cell;
taking the center of the subdivided grid cells as an internal sampling point of the subdivided grid cells;
and combining the boundary sampling points with the internal sampling points, and calculating a sampling point set of the curved surface to be sampled according to the combined sampling points.
2. The method for adaptively sampling a curved surface according to claim 1, wherein said determining boundary sampling points of the curved surface to be sampled comprises:
determining boundary curves of all boundaries of the curved surface to be sampled;
for each boundary curve:
uniformly sampling the boundary curve according to the number of preset sampling points to obtain a plurality of initial sampling points;
calculating the overall energy of the boundary curve, and determining the expected energy of each initial sampling point according to the overall energy;
the positions of the initial sampling points are adjusted according to the expected energy of the initial sampling points, and boundary sampling points corresponding to the boundary curve are obtained;
and taking the boundary sampling points of each boundary curve as the boundary sampling points of the curved surface to be sampled.
3. The method for adaptively sampling a curved surface according to claim 1, wherein the line sampling is performed on the curved surface to be sampled in two directions of a parameter plane, and the initial grid of the curved surface to be sampled in the parameter plane is constructed according to the line sampling result, and the method comprises the following steps:
determining a central point of the horizontal direction according to the value range of the curved surface to be sampled in the horizontal direction of the parameter plane, and taking an isoparametric line at the central point of the horizontal direction as a central meridian of the curved surface to be sampled;
Determining a center point of the vertical direction according to the value range of the curved surface to be sampled in the vertical direction of the parameter plane, and taking an isoparametric line at the center point of the vertical direction as a central weft of the curved surface to be sampled;
after the central warp and the central weft are sampled respectively, sampling points of the central warp and sampling points of the central weft are obtained;
constructing an initial weft of the curved surface to be sampled through sampling points of the central warp, and constructing the initial warp of the curved surface to be sampled through sampling points of the central weft;
and constructing an initial grid of the curved surface to be sampled on the parameter plane based on the initial weft and the initial warp.
4. A surface adaptive sampling method according to any one of claims 1-3 and characterized in that said adjusting the grid cells in the initial grid based on the magnitude of the surface variation of the surface to be sampled within each grid cell further comprises:
projecting the boundary sampling points to a parameter plane of the curved surface to be sampled to obtain a feasible region of the curved surface to be sampled on the parameter plane;
for each grid cell in the initial grid:
Determining the position relation of the grid unit relative to the feasible region;
if the grid cell does not intersect with the feasible region, removing the grid cell from the initial grid;
if the grid unit has an intersection with the feasible region but is not contained by the feasible region, calculating the area ratio between the intersection area and the cell area according to the intersection area between the grid unit and the feasible region and the cell area of the grid unit;
comparing the area ratio with a preset area ratio threshold;
if the area ratio is greater than the preset area ratio threshold, and the intersection between the grid cell and the feasible region comprises the cell center of the grid cell, reserving the grid cell;
removing the grid cell from the initial grid if the area ratio is not greater than the preset area ratio threshold or if the intersection between the grid cell and the feasible region does not contain the cell center of the grid cell;
if the grid cell is contained by the feasible region, the grid cell is reserved.
5. The method of adaptive surface sampling according to claim 1, wherein the calculating the normalized energy for each grid cell comprises:
Calculating the cell energy of each grid cell and the average energy of each grid cell;
the normalized energy of each grid cell is calculated from the cell energy of each grid cell and the average energy.
6. The method according to claim 1, wherein the homogenizing the grid cells in the initial grid according to the normalized energy of each grid cell comprises:
merging the grid cells in the initial grid according to preset cell merging conditions and the normalized energy of each grid cell to obtain merged grid cells;
subdividing grid cells with normalized energy larger than the subdivision threshold of the energy in the combined grid cells until the normalized energy of each subdivided sub-grid cell is smaller than the subdivision threshold of the energy, so as to obtain subdivided grid cells;
and removing the grid cells which are in the subdivided grid cells, have normalized energy smaller than the energy merging threshold and do not meet the preset cell merging conditions.
7. The method for adaptive surface sampling according to claim 6, wherein the merging the grid cells in the initial grid according to a preset cell merging condition and normalized energy of each grid cell to obtain a merged grid cell includes:
Traversing grid cells in the initial grid, combining grid cell sets which are communicated with each other in the initial grid and have Manhattan distances between the grid cells smaller than a given threshold, wherein the normalized energy of each grid cell is smaller than the energy combining threshold, and the total normalized energy of all grid cells is smaller than the energy subdivision threshold, so as to obtain the combined grid cells.
8. The method of adaptive surface sampling according to claim 6, wherein the subdividing a grid cell having normalized energy greater than the subdivision threshold of energy from among the combined grid cells until the normalized energy of each sub-grid cell after subdivision is less than the subdivision threshold of energy, to obtain a subdivided grid cell, includes:
taking a grid cell with normalized energy larger than the subdivision threshold of the energy in the combined grid cells as a parent grid cell;
dividing the parent grid unit into four sub grid units, and respectively calculating the normalized energy of each sub grid unit;
and merging the sub-grid cells in the parent grid cells according to the preset cell merging condition and the normalized energy of each sub-grid cell, and continuously subdividing the sub-grid cells with the normalized energy still larger than the subdivision threshold of the energy until the normalized energy of the sub-grid cells is smaller than the subdivision threshold of the energy, so as to obtain subdivided grid cells.
9. The utility model provides a curved surface self-adaptation sampling device which characterized in that includes:
the curved surface and boundary sampling point determining module is used for determining a curved surface to be sampled of the part model and a boundary sampling point of the curved surface to be sampled;
the initial grid construction module is used for respectively carrying out line sampling on the curved surface to be sampled in two directions of a parameter plane, and constructing an initial grid of the curved surface to be sampled in the parameter plane according to a line sampling result, wherein the initial grid is composed of a plurality of grid units;
the internal sampling point determining module is configured to adjust a grid cell in the initial grid based on a curved surface variation amplitude of the curved surface to be sampled in each grid cell, and determine an internal sampling point in the adjusted grid cell, and includes:
calculating the normalized energy of each grid cell, wherein the normalized energy of each grid cell represents the curve surface variation amplitude of the curve surface to be sampled in each grid cell;
homogenizing the grid cells in the initial grid according to the normalized energy of each grid cell, wherein the energy of the grid cells after the homogenizing is between a merging threshold and a subdivision threshold of the energy, and the grid cells after the homogenizing comprise merged grid cells and subdivided grid cells;
Determining the central coordinate and the normalized energy of each grid cell in the combined grid cells, and calculating the internal sampling points of the combined grid cells according to the central coordinate and the normalized energy of each grid cell;
taking the center of the subdivided grid cells as an internal sampling point of the subdivided grid cells;
and the sampling point set calculation module is used for combining the boundary sampling points with the internal sampling points and calculating the sampling point set of the curved surface to be sampled according to the combined sampling points.
10. A computer-readable storage medium, characterized by: the computer-readable storage medium has stored therein computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the surface adaptive sampling method of any of claims 1 to 8.
11. A computer device, comprising: one or more processors, and memory;
stored in the memory are computer readable instructions which, when executed by the one or more processors, perform the steps of the curved surface adaptive sampling method of any of claims 1-8.
CN202311460382.1A 2023-11-06 2023-11-06 Curved surface self-adaptive sampling method and device, storage medium and computer equipment Active CN117197397B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311460382.1A CN117197397B (en) 2023-11-06 2023-11-06 Curved surface self-adaptive sampling method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311460382.1A CN117197397B (en) 2023-11-06 2023-11-06 Curved surface self-adaptive sampling method and device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN117197397A CN117197397A (en) 2023-12-08
CN117197397B true CN117197397B (en) 2024-03-01

Family

ID=88989039

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311460382.1A Active CN117197397B (en) 2023-11-06 2023-11-06 Curved surface self-adaptive sampling method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN117197397B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105069845A (en) * 2015-07-29 2015-11-18 南京信息工程大学 Point cloud simplification method based on curved surface change
CN107273568A (en) * 2017-05-09 2017-10-20 浙江大学 A kind of complex free curved surface Meshing Method based on surface fitting
CN109101741A (en) * 2018-08-27 2018-12-28 武汉大学 A kind of adaptively sampled method of complex-curved detection based on Triangular Mesh Simplification
CN113888720A (en) * 2021-10-26 2022-01-04 清华大学 Method for generating space curved surface woven mesh based on subdivision algorithm
CN116009477A (en) * 2022-12-15 2023-04-25 中国石油大学(华东) Free-form surface scanning path planning method based on self-adaptive sampling
CN116186912A (en) * 2022-11-28 2023-05-30 之江实验室 Error-bounded low-distortion unstructured T spline surface fitting method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105069845A (en) * 2015-07-29 2015-11-18 南京信息工程大学 Point cloud simplification method based on curved surface change
CN107273568A (en) * 2017-05-09 2017-10-20 浙江大学 A kind of complex free curved surface Meshing Method based on surface fitting
CN109101741A (en) * 2018-08-27 2018-12-28 武汉大学 A kind of adaptively sampled method of complex-curved detection based on Triangular Mesh Simplification
CN113888720A (en) * 2021-10-26 2022-01-04 清华大学 Method for generating space curved surface woven mesh based on subdivision algorithm
CN116186912A (en) * 2022-11-28 2023-05-30 之江实验室 Error-bounded low-distortion unstructured T spline surface fitting method and device
CN116009477A (en) * 2022-12-15 2023-04-25 中国石油大学(华东) Free-form surface scanning path planning method based on self-adaptive sampling

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种面向点云制造自由曲面的CMM自适应采样方法;喻明让 等;《制造技术与机床》;第130-134页 *

Also Published As

Publication number Publication date
CN117197397A (en) 2023-12-08

Similar Documents

Publication Publication Date Title
CN110555285B (en) Full-automatic generation method for surface structure grid of complex aircraft
CN110322547B (en) Reservoir self-adaptive tetrahedral subdivision method
CN108171793B (en) Method for probing triangular mesh of laminated area
CN114707254B (en) Two-dimensional boundary layer grid generation method and system based on template construction method
CN110232742A (en) 3D printing hierarchical control algorithm
CN115758938B (en) Adhesive boundary flow field numerical simulation-oriented boundary layer grid generation method
CN104361578B (en) A kind of stratification mesh segmentation method under multiple dimensioned precision controlling
CN114494641B (en) Three-dimensional model light weight method and device
CN107037738B (en) Material removal method based on STL model in geometry Simulation of NC Machining
CN117197397B (en) Curved surface self-adaptive sampling method and device, storage medium and computer equipment
JP2003281201A (en) Mesh generation method
CN114611359A (en) Grid-parameter hybrid model modeling method and system
US7333104B2 (en) Method and program of converting three-dimensional shape data into cell internal data
CN112101438A (en) Left and right eye classification method, device, server and storage medium
Shen et al. A framework from point clouds to workpieces
CN113360716B (en) Logical processing method and system for gas pipe network structure
CN114756974B (en) Wall surface distance calculation method considering object surface normal information
Ji et al. Point cloud segmentation for complex microsurfaces based on feature line fitting
CN112819108B (en) Slice fusion method and system of multi-source heterogeneous model and storage medium
CN113806951A (en) Elastic simulation method for natural adjacent point search based on half-edge data structure
CN105869209A (en) Deformed triangular data processing method in three-dimensional geological surface model
CN102855624A (en) Image segmentation method based on generalized data field and Normalized cut (Ncut) algorithm
Menzel Evolvable free-form deformation control volumes for evolutionary design optimization
Nie Efficient cutter-workpiece engagement determination in multi-axis milling by voxel modeling
CN117197395B (en) Curve triangulation method and device, storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant