CN117611767B - Method and device for determining curved surface contour line - Google Patents
Method and device for determining curved surface contour line Download PDFInfo
- Publication number
- CN117611767B CN117611767B CN202311624161.3A CN202311624161A CN117611767B CN 117611767 B CN117611767 B CN 117611767B CN 202311624161 A CN202311624161 A CN 202311624161A CN 117611767 B CN117611767 B CN 117611767B
- Authority
- CN
- China
- Prior art keywords
- curved surface
- grid
- contour
- initial
- determining
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 239000013598 vector Substances 0.000 claims description 33
- 238000013507 mapping Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001172 regenerating effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/20—Finite element generation, e.g. wire-frame surface description, tesselation
- G06T17/205—Re-meshing
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Generation (AREA)
Abstract
The invention discloses a method and a device for determining a curved surface contour line, which relate to the technical field of curved surface contour line determination, and are characterized in that a parameter domain of a curved surface to be determined is initially divided to obtain a plurality of initial grids, normal cones of partial curved surfaces corresponding to the initial grids are regenerated, whether contour points are contained in the initial grids is judged according to the view field direction and the normal cones, and if so, the initial grids are divided again until the preset division precision is reached. And then determining contour points in the grid to be processed containing contour points reaching the preset division precision, and connecting all the contour points to obtain the contour line of the curved surface to be determined in the view field direction. The method judges whether the contour points are contained based on the normal cone, and only divides the grids containing the contour points again, compared with the prior art, the method directly divides the curved surface once, and judges and selects the contour points of each grid obtained by division, so that the purpose of considering both calculation precision and calculation efficiency can be achieved.
Description
Technical Field
The present invention relates to the field of curved surface contour line determination technologies, and in particular, to a method and an apparatus for determining a curved surface contour line.
Background
There are many occasions where it is necessary to determine the contour line of a curved surface in a certain view field direction, for example, when a line width mode of CAD is used, it is necessary to determine the contour line of the curved surface first to further display/hide the line width. However, the conventional method for determining the contour line of the curved surface is to divide the curved surface into a plurality of grids at a time, determine and select contour points for each grid to determine the contour line of the curved surface, if the grids obtained by dividing are too many, the calculated amount is large, and if the grids obtained by dividing are too few, the calculated accuracy is low. Based on this, a new technique for determining the contour line of a curved surface is needed to achieve both the calculation accuracy and the calculation efficiency.
Disclosure of Invention
The invention aims to provide a method and a device for determining a curved surface contour line, which can simultaneously consider calculation precision and calculation efficiency.
In order to achieve the above object, the present invention provides the following solutions:
a method for determining a curved surface contour line, the method comprising:
Preliminary dividing a parameter domain of a to-be-determined curved surface to obtain a plurality of initial grids; the to-be-determined curved surface is a spline curved surface; the parameter domain is a rectangular area determined based on uv coordinates of each point on the curved surface to be determined;
for each initial grid, generating a normal cone of a part of curved surfaces corresponding to the initial grid; judging whether the initial grid contains contour points or not according to the view field direction and the normal cone;
if yes, carrying out secondary division on the initial grids to obtain a plurality of divided grids, taking the divided grids as initial grids of the next cycle, and returning to the step of generating normal cones of partial curved surfaces corresponding to the initial grids until the preset division precision is reached;
the initial grid containing contour points reaching the preset dividing precision is recorded as a grid to be processed; for each grid to be processed, determining contour points in the grid to be processed; and connecting all the contour points to obtain the contour line of the to-be-determined curved surface in the view field direction.
In some embodiments, the generating a normal cone of a part of the curved surface corresponding to the initial grid specifically includes:
generating a control grid of a part of curved surfaces corresponding to the initial grid;
for each grid in the control grids, determining a triangular surface based on two adjacent sides of the grid, and determining normal vectors of the triangular surface to obtain 4 normal vectors corresponding to the grid;
and (3) placing the starting points of the 4 normal vectors corresponding to all the grids in a superposition manner, and generating a normal cone.
In some embodiments, the determining whether the initial grid contains contour points according to the field direction and the normal cone specifically includes:
Determining a dividing plane according to the view field direction and the axis direction of the normal cone;
performing intersection operation on the dividing plane and the normal cone to obtain two intersection lines;
For each intersection line, calculating the point multiplication of the direction vector corresponding to the intersection line and the direction vector corresponding to the view field direction, and obtaining a point multiplication result corresponding to the intersection line;
and judging whether the initial grid contains contour points or not based on the point multiplication result corresponding to the intersection lines.
In some embodiments, the determining whether the initial mesh includes a contour point based on a point multiplication result corresponding to the intersection line includes:
And calculating a first product of point multiplication results corresponding to the two intersection lines, wherein if the first product is smaller than 0, the initial grid contains contour points, and if the first product is larger than or equal to 0, the initial grid does not contain contour points, so as to judge whether the initial grid contains contour points.
In some embodiments, the determining the contour point in the grid to be processed specifically includes:
For each edge of the grid to be processed, calculating a normal vector of each of two vertexes of the edge; calculating the point multiplication of the normal vector of the vertex and the direction vector corresponding to the view field direction, and obtaining a point multiplication result corresponding to the vertex; judging whether the edge contains contour points or not based on point multiplication results corresponding to the two vertexes; if the edge contains contour points, taking point multiplication results corresponding to the two vertexes as input, and determining a point with the point multiplication result of 0 on the edge by using a linear interpolation method, wherein the point with the point multiplication result of 0 is the contour point of the edge; the contour points of all the edges constitute contour points in the grid to be processed to determine contour points in the grid to be processed.
In some embodiments, the determining whether the edge contains a contour point based on the dot multiplication results corresponding to the two vertices specifically includes:
And calculating a second product of point multiplication results corresponding to the two vertexes, wherein if the second product is smaller than 0, the edge contains contour points, and if the second product is larger than or equal to 0, the edge does not contain contour points, so as to judge whether the edge contains contour points.
In some embodiments, if the curved surface portion to be determined is blocked, the determining method further includes: determining the contour line of the part of the curved surface which is not shielded in the curved surface to be determined based on the contour line of the curved surface to be determined in the view field direction, specifically comprising:
Calculating the contour line of the to-be-determined curved surface in the view field direction and the boundary of the partial parameter domain of the partial curved surface which is not shielded in the to-be-determined curved surface to obtain a plurality of intersection points;
Dividing the contour line into a plurality of line segments based on the intersection points;
for each line segment, determining whether the line segment is within the partial parameter domain by using a ray method; the line segment in the partial parameter domain is the contour line of the partial curved surface which is not shielded in the curved surface to be determined.
In some embodiments, the determining, by using a ray method, whether the line segment is within the partial parameter domain specifically includes:
taking a point on the line segment at will, and taking the point as a ray along any direction;
And determining the number of intersection points of the ray and the partial parameter domain, wherein if the number is even, the line segment is positioned outside the partial parameter domain, and if the number is odd, the line segment is positioned in the partial parameter domain so as to determine whether the line segment is in the partial parameter domain.
In some embodiments, before determining the number of intersections of the ray with the partial parametric domain, the determining method further comprises:
Judging whether the ray passes through the vertexes of the partial parameter domain; if so, the point is irradiated in the other direction.
A device for determining a curved profile, the device comprising:
The initial dividing module is used for carrying out initial division on the parameter domain of the curved surface to be determined to obtain a plurality of initial grids; the to-be-determined curved surface is a spline curved surface; the parameter domain is a rectangular area determined based on uv coordinates of each point on the curved surface to be determined;
the repartitioning module is used for generating a normal cone of a part of curved surfaces corresponding to each initial grid; judging whether the initial grid contains contour points or not according to the view field direction and the normal cone; if yes, carrying out secondary division on the initial grids to obtain a plurality of divided grids, taking the divided grids as initial grids of the next cycle, and returning to the step of generating normal cones of partial curved surfaces corresponding to the initial grids until the preset division precision is reached;
The contour line generation module is used for marking an initial grid containing contour points reaching the preset dividing precision as a grid to be processed; for each grid to be processed, determining contour points in the grid to be processed; and connecting all the contour points to obtain the contour line of the to-be-determined curved surface in the view field direction.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
The invention provides a method and a device for determining a curved surface contour line, which are used for initially dividing a parameter domain of a curved surface to be determined to obtain a plurality of initial grids, regenerating normal cones of partial curved surfaces corresponding to the initial grids, judging whether contour points are contained in the initial grids according to the view field direction and the normal cones, and if so, dividing the initial grids again until the predetermined dividing precision is reached. And then determining contour points in the grid to be processed containing contour points reaching the preset division precision, and connecting all the contour points to obtain the contour line of the curved surface to be determined in the view field direction. The method judges whether the contour points are contained based on the normal cone, and only divides the grids containing the contour points again, compared with the prior art, which carries out one-time direct division on the curved surface, and carries out judgment and selection of the contour points on each grid obtained by division, the method can remarkably reduce the calculated amount under the condition of the same calculation precision, improve the calculation efficiency, and remarkably improve the calculation precision under the condition of the same calculation amount, thereby achieving the purpose of considering both the calculation precision and the calculation efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for determining a method according to embodiment 1 of the present invention;
FIG. 2 is a schematic view of triangular surfaces according to embodiment 1 of the present invention;
FIG. 3 is a schematic diagram illustrating the connection of contour lines according to embodiment 1 of the present invention;
Fig. 4 is a block diagram of a determination apparatus provided in embodiment 2 of the present invention.
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.
The invention aims to provide a method and a device for determining a curved surface contour line, which can simultaneously consider calculation precision and calculation efficiency.
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
Example 1:
The present embodiment is used to provide a method for determining a curved surface contour line, as shown in fig. 1, where the determining method includes:
S1: preliminary dividing a parameter domain of a to-be-determined curved surface to obtain a plurality of initial grids; the to-be-determined curved surface is a spline curved surface; the parameter domain is a rectangular area determined based on uv coordinates of each point on the surface to be determined.
In this embodiment, each point on the curved surface to be determined has a uv coordinate, the uv coordinate includes a horizontal u coordinate and a vertical v coordinate, the horizontal direction is used as a transverse direction, the vertical direction is used as a longitudinal direction, a rectangular area can be determined based on the uv coordinates of all points, the left boundary of the rectangular area is the minimum value of the u coordinates of all points, the right boundary is the maximum value of the u coordinates of all points, the lower boundary is the minimum value of the v coordinates of all points, the upper boundary is the maximum value of the v coordinates of all points, and the determined rectangular area is the parameter domain of the curved surface to be determined. It is particularly pointed out that points in the parameter domain and points in the surface to be determined form a one-to-one mapping.
The preliminary division of the parameter domain of the surface to be determined may be performed in various manners, for example, the parameter domain is uniformly divided, and the parameter domain is divided into 2 initial grids, 4 initial grids, 6 initial grids, and 8 initial grids, so as to obtain a plurality of initial grids. It should be noted that, the initial mesh size obtained by the preliminary division herein differs by several orders of magnitude from the mesh size corresponding to the predetermined division accuracy.
S2: for each initial grid, generating a normal cone of a part of curved surfaces corresponding to the initial grid; and judging whether the initial grid contains contour points or not according to the view field direction and the normal cone.
Because the points in the parameter domain and the points in the surface to be determined form a one-to-one mapping relationship, the initial grid corresponds to a part of the surface to be determined.
The generating the normal cone of the partial curved surface corresponding to the initial grid may include: and generating a control grid of a part of curved surface corresponding to the initial grid, wherein the control grid is used for controlling the shape of the curved surface and has an equivalent relationship with the part of curved surface. For each grid in the control grid, a triangular surface is determined based on two adjacent sides of the grid, as shown in fig. 2, taking two adjacent sides as an a side and a b side as examples, the triangular surface at this time includes two adjacent sides (a side and b side) and a connecting line (c side) of two free vertexes of the two adjacent sides, and a normal vector of the triangular surface is determined, and the normal vector refers to a vector represented by a straight line perpendicular to the triangular surface, which is determined according to a part of curved surfaces corresponding to the grid, and the determination mode is the prior art, and is not repeated herein, because one grid includes 4 groups of two adjacent sides, each group of two adjacent sides can determine a triangular surface, and further determine a normal vector, so that 4 normal vectors corresponding to the grid can be obtained. And (3) placing the starting points of the 4 normal vectors corresponding to all the grids in a superposition manner to generate a normal cone, wherein the normal cone refers to a cone surrounded by the directions of all the normal vectors after placing the starting points of all the normal vectors in a superposition manner.
The contour point of the curved surface to be determined is a point perpendicular to the view field direction, so that according to the view field direction and the normal cone, judging whether the initial grid contains the contour point or not can comprise: a dividing plane is determined according to the view field direction and the axis direction of the normal cone, and two straight lines determine a plane, so that the dividing plane can be determined based on the straight line corresponding to the view field direction and the straight line corresponding to the axis direction of the normal cone. And carrying out intersection operation on the dividing plane and the normal cone to obtain two intersection lines, wherein the two intersection lines are the intersection lines of the normal cone and the dividing plane. For each intersection line, calculating the point multiplication of the direction vector corresponding to the intersection line and the direction vector corresponding to the view field direction, obtaining the point multiplication result corresponding to the intersection line, and judging whether the initial grid contains contour points or not based on the point multiplication result corresponding to the two intersection lines.
The determining whether the initial grid contains the contour point based on the point multiplication result corresponding to the two intersecting lines may include: and calculating a first product of point multiplication results corresponding to the two intersection lines, wherein if the first product is smaller than 0, the initial grid contains contour points, and if the first product is larger than or equal to 0, the initial grid does not contain contour points, so as to judge whether the initial grid contains contour points.
S3: if yes, the initial grids are divided again to obtain a plurality of divided grids, the divided grids are used as initial grids of the next cycle, and the step of generating normal cones of partial curved surfaces corresponding to the initial grids is returned to each initial grid until the preset dividing precision is achieved.
The predetermined division accuracy of the present embodiment means that the size of the obtained divided mesh reaches a predetermined value, which is determined according to the user's demand. In this embodiment, the number of grids obtained by the preliminary division and the secondary division is also determined according to the user's needs, such as 2,4, 6, 8, etc.
In this embodiment, the surface parameter domain is subdivided, and whether a contour line passes through the surface patch (i.e., whether the surface patch contains contour points or not is determined according to normal cone information of the surface patch (i.e., initial grid obtained by subdivision), and if the contour line passes through, the surface patch is continuously subdivided until the size of the surface patch meets the predetermined division precision. Then traversing all the patches with contour lines passing through and with the patch sizes meeting the preset dividing precision, and constructing the contour lines passing through the patches in a linear interpolation mode. And finally, connecting the contour lines of the adjacent surface patches to obtain the complete contour line of the curved surface.
S4: the initial grid containing contour points reaching the preset dividing precision is recorded as a grid to be processed; for each grid to be processed, determining contour points in the grid to be processed; and connecting all the contour points to obtain the contour line of the to-be-determined curved surface in the view field direction.
The initial mesh containing contour points up to the predetermined division accuracy refers to an initial mesh containing contour points, the mesh size obtained by the last division being the same as the predetermined division accuracy.
Determining contour points in the grid to be processed may include: for each edge of the grid to be processed, calculating the normal vector of each of the two vertices of the edge, wherein the calculation vector is the existing method and is not described herein. And calculating the dot product of the normal vector of the vertex and the direction vector corresponding to the view field direction, obtaining the dot product result corresponding to the vertex, and judging whether the edge contains contour points or not based on the dot product results corresponding to the two vertexes. If the edge contains contour points, taking point multiplication results corresponding to two vertexes as input, and determining a point with the edge point multiplication result of 0 by using a linear interpolation method, wherein the point with the point multiplication result of 0 is the contour point of the edge. The contour points of all the edges constitute contour points in the grid to be processed to determine contour points in the grid to be processed.
The determining whether the edge contains the contour point based on the point multiplication result corresponding to the two vertexes may include: and calculating a second product of the dot multiplication results corresponding to the two vertexes, wherein if the second product is smaller than 0, the edge contains the contour dot, and if the second product is larger than or equal to 0, the edge does not contain the contour dot, so as to judge whether the edge contains the contour dot.
After determining the contour points in each grid to be processed, generating contour lines based on all the obtained contour points, and when generating the contour lines, since the starting point and the end point of the contour lines can only be boundary points, the boundary points refer to points positioned at the boundary of the parameter domain, and the contour lines are necessarily continuous, connecting two contour points in each grid to be processed to obtain partial contour lines, and sequentially connecting all the partial contour lines to generate the contour lines. However, if the surface to be determined contains a plurality of contour lines, one to-be-processed grid may contain 3 contour points or 4 contour points, and at this time, if the to-be-processed grid containing 3 contour points or 4 contour points is an initial grid containing starting points, the initial grid needs to be further divided until the divided grid only includes one starting point and one contour point; if the mesh to be processed containing 3 contour points or 4 contour points is an intermediate mesh without a starting point or an ending point, determining the contour point of the next connection according to the trend of the connected contour line, as shown in fig. 3, wherein the trend of the connected contour line is lower, and the contour points (i.e. two ellipses in fig. 3) which need to be connected at the moment are one upper boundary and one lower boundary, and the contour point at the lower boundary is selected as the contour point of the next connection.
Because the points in the surface to be determined and the points in the parameter domain have a one-to-one mapping relationship, after the contour points of each grid to be processed are connected, the contour line in the parameter domain is generated, namely the contour line of the surface to be determined is generated.
When the to-be-determined curved surface is in the three-dimensional model, other curved surfaces in the three-dimensional model may cause shielding of the to-be-determined curved surface, that is, the to-be-determined curved surface is partially shielded, and the method for determining the to-be-determined curved surface belongs to an incomplete curved surface, and further includes: determining the contour line of a part of the curved surface to be determined, which is not shielded, based on the contour line of the curved surface to be determined in the view field direction, specifically comprising: carrying out intersection operation on the contour line of the to-be-determined curved surface in the view field direction and the boundary of the partial parameter domain of the part of the to-be-determined curved surface which is not shielded to obtain a plurality of intersection points, particularly indicating that the intersection operation is carried out in the parameter domain, and the contour line of the to-be-determined curved surface in the view field direction refers to the contour line in the parameter domain. The contour line is divided into a plurality of line segments based on the intersections. For each line segment, determining whether the line segment is in a partial parameter domain by using a ray method, wherein the line segment in the partial parameter domain is the contour line of the partial curved surface which is not shielded in the curved surface to be determined.
The partial parameter domain of the partial curved surface which is not blocked in the curved surface to be determined refers to a rectangular area determined based on uv coordinates of each point in the partial curved surface which is not blocked in the curved surface to be determined, and in order to distinguish the rectangular area from the parameter domain of the curved surface to be determined, the rectangular area is defined as the partial parameter domain in the embodiment.
Wherein, determining whether the line segment is in the partial parameter domain by using a ray method can comprise: taking a point on the line segment at will, and taking the point as a ray along any direction; and determining the number of intersection points of the ray and the partial parameter domain, wherein if the number is even, the line segment is positioned outside the partial parameter domain, and if the number is odd, the line segment is positioned in the partial parameter domain so as to determine whether the line segment is positioned in the partial parameter domain.
If the ray coincides with the vertex of the partial parameter domain, the judgment result obtained by the ray method is inaccurate, so before determining the number of intersections between the ray and the partial parameter domain, the determining method of the embodiment further includes: judging whether the ray passes through the top points of part of the parameter domain; if so, the point is taken as a ray along the other direction so as to remove the influence of the vertexes of part of the parameter domain and improve the judgment precision.
According to the method for determining the contour line of the curved surface, the parameter domain of the curved surface to be determined is initially divided, whether contour points are contained in the initial grid is judged based on the normal cone of the initial grid obtained through division, and if yes, the initial grid is divided again until the preset division precision is achieved. And then determining contour points in the grid to be processed containing contour points reaching the preset division precision, and connecting all the contour points to obtain the contour line of the curved surface to be determined in the view field direction. According to the method, whether the contour points are contained or not is judged based on the normal cone, and only grids containing the contour points are subdivided, compared with the mode that the curved surface is directly divided once in the prior art, and the contour points are judged and selected for each grid obtained through division, the calculation amount can be obviously reduced under the condition that the calculation accuracy is the same, the calculation efficiency is improved, the calculation accuracy is obviously improved under the condition that the calculation amount is the same, and therefore the purpose of considering both the calculation accuracy and the calculation efficiency is achieved.
In particular, the direction vector and the normal vector in this embodiment are unit vectors.
Example 2:
The present embodiment is used to provide a determining device for a curved contour line, as shown in fig. 4, where the determining device includes:
The initial dividing module M1 is used for initially dividing the parameter domain of the curved surface to be determined to obtain a plurality of initial grids; the to-be-determined curved surface is a spline curved surface; the parameter domain is a rectangular area determined based on uv coordinates of each point on the curved surface to be determined;
The repartitioning module M2 is used for generating a normal cone of a part of curved surface corresponding to each initial grid; judging whether the initial grid contains contour points or not according to the view field direction and the normal cone; if yes, carrying out secondary division on the initial grids to obtain a plurality of divided grids, taking the divided grids as initial grids of the next cycle, and returning to the step of generating normal cones of partial curved surfaces corresponding to the initial grids until the preset division precision is reached;
a contour line generating module M3, configured to record an initial mesh containing contour points that reaches the predetermined division precision as a mesh to be processed; for each grid to be processed, determining contour points in the grid to be processed; and connecting all the contour points to obtain the contour line of the to-be-determined curved surface in the view field direction.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to assist in understanding the methods of the present invention and the core ideas thereof; also, it is within the scope of the present invention to be modified by those of ordinary skill in the art in light of the present teachings. In view of the foregoing, this description should not be construed as limiting the invention.
Claims (7)
1. A method for determining a curved surface contour line, the method comprising:
Preliminary dividing a parameter domain of a to-be-determined curved surface to obtain a plurality of initial grids; the to-be-determined curved surface is a spline curved surface; the parameter domain is a rectangular area determined based on uv coordinates of each point on the curved surface to be determined;
for each initial grid, generating a normal cone of a part of curved surfaces corresponding to the initial grid; judging whether the initial grid contains contour points or not according to the view field direction and the normal cone;
if yes, carrying out secondary division on the initial grids to obtain a plurality of divided grids, taking the divided grids as initial grids of the next cycle, and returning to the step of generating normal cones of partial curved surfaces corresponding to the initial grids until the preset division precision is reached;
the initial grid containing contour points reaching the preset dividing precision is recorded as a grid to be processed; for each grid to be processed, determining contour points in the grid to be processed; connecting all the contour points to obtain a contour line of the to-be-determined curved surface in the view field direction;
the generating the normal cone of the partial curved surface corresponding to the initial grid specifically comprises the following steps:
generating a control grid of a part of curved surfaces corresponding to the initial grid;
for each grid in the control grids, determining a triangular surface based on two adjacent sides of the grid, and determining normal vectors of the triangular surface to obtain 4 normal vectors corresponding to the grid;
overlapping and placing starting points of 4 normal vectors corresponding to all the grids to generate a normal cone;
judging whether the initial grid contains contour points or not according to the view field direction and the normal cone, wherein the method specifically comprises the following steps:
Determining a dividing plane according to the view field direction and the axis direction of the normal cone;
performing intersection operation on the dividing plane and the normal cone to obtain two intersection lines;
For each intersection line, calculating the point multiplication of the direction vector corresponding to the intersection line and the direction vector corresponding to the view field direction, and obtaining a point multiplication result corresponding to the intersection line;
Judging whether the initial grid contains contour points or not based on point multiplication results corresponding to the two intersection lines;
the determining the contour points in the grid to be processed specifically comprises the following steps:
For each edge of the grid to be processed, calculating a normal vector of each of two vertexes of the edge; calculating the point multiplication of the normal vector of the vertex and the direction vector corresponding to the view field direction, and obtaining a point multiplication result corresponding to the vertex; judging whether the edge contains contour points or not based on point multiplication results corresponding to the two vertexes; if the edge contains contour points, taking point multiplication results corresponding to the two vertexes as input, and determining a point with the point multiplication result of 0 on the edge by using a linear interpolation method, wherein the point with the point multiplication result of 0 is the contour point of the edge; the contour points of all the edges constitute contour points in the grid to be processed to determine contour points in the grid to be processed.
2. The method according to claim 1, wherein the determining whether the initial mesh contains the contour point based on the dot multiplication result corresponding to the intersection line comprises:
And calculating a first product of point multiplication results corresponding to the two intersection lines, wherein if the first product is smaller than 0, the initial grid contains contour points, and if the first product is larger than or equal to 0, the initial grid does not contain contour points, so as to judge whether the initial grid contains contour points.
3. The method according to claim 1, wherein the determining whether the edge contains a contour point based on the dot multiplication results corresponding to the two vertices, specifically comprises:
And calculating a second product of point multiplication results corresponding to the two vertexes, wherein if the second product is smaller than 0, the edge contains contour points, and if the second product is larger than or equal to 0, the edge does not contain contour points, so as to judge whether the edge contains contour points.
4. The determination method according to claim 1, wherein if the curved surface portion to be determined is blocked, the determination method further comprises: determining the contour line of the part of the curved surface which is not shielded in the curved surface to be determined based on the contour line of the curved surface to be determined in the view field direction, specifically comprising:
Calculating the contour line of the to-be-determined curved surface in the view field direction and the boundary of the partial parameter domain of the partial curved surface which is not shielded in the to-be-determined curved surface to obtain a plurality of intersection points;
Dividing the contour line into a plurality of line segments based on the intersection points;
for each line segment, determining whether the line segment is within the partial parameter domain by using a ray method; the line segment in the partial parameter domain is the contour line of the partial curved surface which is not shielded in the curved surface to be determined.
5. The method of determining as claimed in claim 4, wherein determining whether the line segment is within the partial parameter domain by using a ray method specifically comprises:
taking a point on the line segment at will, and taking the point as a ray along any direction;
And determining the number of intersection points of the ray and the partial parameter domain, wherein if the number is even, the line segment is positioned outside the partial parameter domain, and if the number is odd, the line segment is positioned in the partial parameter domain so as to determine whether the line segment is in the partial parameter domain.
6. The determination method according to claim 5, wherein before determining the number of intersections of the ray with the partial parameter domain, the determination method further comprises:
Judging whether the ray passes through the vertexes of the partial parameter domain; if so, the point is irradiated in the other direction.
7. A curved surface contour line determining apparatus for implementing the determining method according to any one of claims 1 to 6, characterized in that the determining apparatus includes:
The initial dividing module is used for carrying out initial division on the parameter domain of the curved surface to be determined to obtain a plurality of initial grids; the to-be-determined curved surface is a spline curved surface; the parameter domain is a rectangular area determined based on uv coordinates of each point on the curved surface to be determined;
the repartitioning module is used for generating a normal cone of a part of curved surfaces corresponding to each initial grid; judging whether the initial grid contains contour points or not according to the view field direction and the normal cone; if yes, carrying out secondary division on the initial grids to obtain a plurality of divided grids, taking the divided grids as initial grids of the next cycle, and returning to the step of generating normal cones of partial curved surfaces corresponding to the initial grids until the preset division precision is reached;
The contour line generation module is used for marking an initial grid containing contour points reaching the preset dividing precision as a grid to be processed; for each grid to be processed, determining contour points in the grid to be processed; and connecting all the contour points to obtain the contour line of the to-be-determined curved surface in the view field direction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311624161.3A CN117611767B (en) | 2023-11-30 | 2023-11-30 | Method and device for determining curved surface contour line |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311624161.3A CN117611767B (en) | 2023-11-30 | 2023-11-30 | Method and device for determining curved surface contour line |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117611767A CN117611767A (en) | 2024-02-27 |
CN117611767B true CN117611767B (en) | 2024-09-03 |
Family
ID=89947838
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311624161.3A Active CN117611767B (en) | 2023-11-30 | 2023-11-30 | Method and device for determining curved surface contour line |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117611767B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105261024A (en) * | 2015-10-22 | 2016-01-20 | 四川航天系统工程研究所 | Remote sensing image complex water body boundary extraction method based on improved T-Snake model |
CN110415352A (en) * | 2019-07-23 | 2019-11-05 | 成都理工大学 | 3D Closed Surface Construction Algorithm Based on Closed Contour |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100340080B1 (en) * | 1999-11-15 | 2002-06-10 | 박인규 | Automatic CAD Model Synthesis From Unorganized 3-D Range Data |
JP6049272B2 (en) * | 2012-02-24 | 2016-12-21 | キヤノン株式会社 | Mesh generating apparatus, method and program |
CN111079353B (en) * | 2019-12-17 | 2020-10-09 | 广东工业大学 | Method and device for fast and uniform meshing applied to complex fluid analysis |
CN111666643B (en) * | 2020-06-16 | 2024-01-26 | 重庆大学 | Method for determining contact performance of complex tooth surface |
-
2023
- 2023-11-30 CN CN202311624161.3A patent/CN117611767B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105261024A (en) * | 2015-10-22 | 2016-01-20 | 四川航天系统工程研究所 | Remote sensing image complex water body boundary extraction method based on improved T-Snake model |
CN110415352A (en) * | 2019-07-23 | 2019-11-05 | 成都理工大学 | 3D Closed Surface Construction Algorithm Based on Closed Contour |
Also Published As
Publication number | Publication date |
---|---|
CN117611767A (en) | 2024-02-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5890105B2 (en) | Designing parts modeled by parallel geodesic lines | |
CN106648510B (en) | The display methods and device of a kind of display resolution | |
CN111444573B (en) | Ship symmetric segment model generation method and device, storage medium and terminal | |
CN110914869B (en) | Method and system for automated generation of constraint curves in computer graphics | |
CN111859763A (en) | Finite element simulation method, system and medium | |
US7152017B2 (en) | Numerical analysis system using hybrid grid adaptation method | |
CN116310048A (en) | Method for calculating intersection point of ray tracing and NURBS curved surface based on curvature subdivision | |
MXPA02006452A (en) | Mesh generator for and method of generating meshes in an extrusion process. | |
EP2546799B1 (en) | Method of aligning and three-dimensional profile evaluating system | |
CN117611767B (en) | Method and device for determining curved surface contour line | |
CN106682366A (en) | Method for extracting finite element node coordinates based on image processing | |
JPH05250480A (en) | Method for generating free form stroke | |
CN118779939B (en) | A mesh quality adjustment method and system based on geometry optimization and topology optimization | |
CN104915053A (en) | Position determining method and device for interface controls | |
CN111210520A (en) | Reverse forming method and system for physical model | |
CN114429535A (en) | Smooth cutting method and device for triangular mesh curved surface | |
JP3786410B2 (en) | Fillet creation method and 3D CAD program | |
CN112231801A (en) | BIM-based hole protection generation method, device and computer storage medium | |
CN117818054A (en) | Automatic generation method, system and equipment for supporting 3D printing and forming support structure | |
JPH0636013A (en) | Topographic data creation method and device | |
JPH04679A (en) | Method and device for supporting coordinate grid preparation | |
CN108763744B (en) | The appraisal procedure of gear tooth profile smoothness and the correction method of gear tooth profile | |
JP2002207777A (en) | Method for generating neutral plane model | |
CN115272594A (en) | Iso-surface generation method based on geotools | |
CN113902887A (en) | Three-dimensional visual edge generation method, system, computer and readable storage medium |
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 |