CN115984442A - Method for generating surface 3D texture through feature array - Google Patents

Method for generating surface 3D texture through feature array Download PDF

Info

Publication number
CN115984442A
CN115984442A CN202310265275.7A CN202310265275A CN115984442A CN 115984442 A CN115984442 A CN 115984442A CN 202310265275 A CN202310265275 A CN 202310265275A CN 115984442 A CN115984442 A CN 115984442A
Authority
CN
China
Prior art keywords
grid
point
points
edge
polygon
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.)
Granted
Application number
CN202310265275.7A
Other languages
Chinese (zh)
Other versions
CN115984442B (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.)
Zhejiang Flashforge 3d Technology Co ltd
Original Assignee
Zhejiang Flashforge 3d Technology 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 Zhejiang Flashforge 3d Technology Co ltd filed Critical Zhejiang Flashforge 3d Technology Co ltd
Priority to CN202310265275.7A priority Critical patent/CN115984442B/en
Publication of CN115984442A publication Critical patent/CN115984442A/en
Application granted granted Critical
Publication of CN115984442B publication Critical patent/CN115984442B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

The invention discloses a method for generating surface 3D texture through a feature array, which generates regular 3D texture features on the surface of a triangular mesh and plays the roles of skid resistance and attractiveness. The edge contour of the feature grid is used as a basic graph, the basic graph is subjected to scaling and array, then the basic graph is intersected with a uv expansion graph of a selected area of a main grid, an intersection result is mapped back to the main grid to obtain a plurality of polygonal areas, then triangular surface patches in all the areas are deleted to form holes, the feature grid is subjected to scaling, rotation and translation to enable the edge contour of the feature grid to be matched with the corresponding holes, and the integrated grid is formed after sewing. When the feature mesh is small, the effect of 3D texture can be achieved. Compared with the defects that the traditional method relies on bitmaps, generates dense grids and only supports 2.5-dimensional features, the grid density of the method depends on the feature grids, the data volume is greatly reduced, and the quasi-3-dimensional features are supported.

Description

Method for generating surface 3D texture through feature array
Technical Field
The invention belongs to the field of graphic processing, and particularly relates to a method for generating a surface 3D texture through a feature array.
Background
In order to generate 3D texture features, two existing methods exist, wherein one method is to extract height information from a 2D texture image and map the height information into a three-dimensional space through parameterization, the method generates rich grid details, and the grid needs to be encrypted generally, so that the data volume is huge, or extra time needs to be spent on simplifying the grid; secondly, such methods can only generate 2.5-dimensional features, and cannot generate quasi-3-dimensional feature structures.
The other 3D texture is more regular, mainly repeating the basic features. Theoretically, this feature requires fewer triangular patches to express, but actually requires a 2D image to represent, and cannot generate a more complex spatial structure.
Therefore, in view of the shortcomings of the two methods, a method capable of generating a surface 3D texture of a complex spatial structure is required, the processing speed is high, and the generated model data volume is small.
Disclosure of Invention
The invention aims to provide a method for generating a surface 3D texture through a feature array, which has the advantages of small data volume, support of a quasi 3-dimensional feature structure and high processing speed.
In order to achieve the technical purpose, the invention adopts the following technical scheme:
a method of generating a 3D texture of a surface from an array of features, comprising the steps of:
(a) Establishing a topological connection relation of a main model, namely the main grid M by adopting a half-edge structure, and calculating the unit normal directions of all triangles f;
(b) Selecting a region on the surface of the main grid M, creating a sub-grid N according to vertexes in the region and a triangle f, constructing a mapping relation R, mapping the vertexes in the sub-grid N to corresponding vertexes in the main grid M one by one and recording, identifying the boundary of the sub-grid N, and unfolding the sub-grid N to a uv plane through a parameterization method to form a parameterized grid;
(c) Marking the bottom surface edge profile of the feature grid as a polygon Pi, then completely covering the parameterized grid area of the submesh N according to a set mode and interval array polygons Pi, and reserving the polygons completely in the parameterized grid area to form a set { S };
(d) Intersecting the polygons Pi in the set { S } with the parameterized meshes, mapping the intersection points to a main mesh M, inserting new vertexes into the intersection points on the main mesh, mapping the polygons in the set { S } to the main mesh to obtain a series of closed areas surrounded by half sides, recording the closed areas as { Loop }, and inserting new sides according to the boundaries of the areas;
(e) Triangularizing the surfaces with more than 3 sides in the main grid M, and deleting triangles f inside each closed area in the { Loop } to obtain a series of holes;
(f) And scaling the feature grids according to the sizes of the holes, rotating and translating the feature grids, adjusting edge points of the feature grids to corresponding points on the holes, aligning hole positions, and sewing the main grid M and each transformed feature grid into a whole.
The edge contour of the feature grid is used as a basic graph, the basic graph is subjected to scaling and array, intersection with a uv expansion diagram of a selected area of a main grid is obtained, intersection results are mapped back to the main grid to obtain a plurality of polygonal areas, triangular surface patches in the areas are deleted to form holes, the feature grid is scaled, rotated and translated to enable the edge contour of the feature grid to be matched with the corresponding holes, and the integrated grid is formed after sewing. When the feature mesh is small, the effect of 3D texture can be achieved.
Further, in the step (d), the specific method for intersecting the polygon Pi with the parameterized mesh is as follows: for any polygon Pi in the set { S }, a vertex P0 completely inside a triangle f is found from the serial number 0, a series of intersection points of the Pi and the parameterized grid are calculated from P0, wherein an intersection point coordinate pt is recorded, the half side h0 where the intersection points are located, the ratio t between the distance from the intersection point to the starting point of the half side and the half side length is recorded, after the intersection points are inserted, the half side where the points are located is divided into two, the starting point of h0 is unchanged, the end point points to the point pt, the total length is shortened, the rest part forms a new half side h1, and o1 is the opposite half side of h 1.
The main grid M or the sub-grid N thereof is bent in space, and needs to be flattened on a uv plane through parameterization, so that the parameterized grid can be intersected with a plane pattern formed by the edge outline of the feature grid after being obtained.
The polygon Pi and the parameterized mesh are intersected, and different intersection point information needs to be recorded according to whether the intersection point is in the triangle or on the side, so that the intersection point information can be conveniently mapped back to the corresponding position of the main mesh M.
Further, in the step (d), the vertices of the polygon Pi are also processed as intersections, and when the vertices are completely inside the triangle f, t = -1, h0 is the half h pointed by the triangle f; when the vertex is on the f side of the triangle, the vertex is judged to be on the mesh side.
The vertices of the polygon Pi are also processed as intersections for recording the shape of the polygon Pi.
Further, in step (d), the specific method for mapping the polygons in the set { S } to the primary mesh is as follows: according to the mapping relation R, mapping the intersection point information from the parameterized grid of the sub-grid N to the main grid M, namely mapping the end point of the edge where the intersection point information is located back, and then calculating the intersection point coordinate on the mapping edge according to the proportion value t of the intersection point; for points in the triangle f, firstly, calculating a centroid coordinate on the sub-grid N parameterized grid, and then calculating a coordinate of a corresponding point in the main grid M by using the centroid coordinate; at the same time, the half h0 where the intersection points are located also points to the corresponding half in the main grid M.
For the intersection points on the parameterized grid, mapping to the main grid M according to the proportion values t of the intersection points; for points within triangle f, they are mapped to primary mesh M according to their centroid coordinates.
Further, in step (d), a specific method for obtaining a series of enclosed areas surrounded by half sides is as follows: classifying the intersection points with the t value not being-1 according to the edges, recording two half edges of any edge as he0 and he1 if the intersection points exist on the edge, and replacing the corresponding t with 1.0-t when the half edge of the intersection point is he1 by taking he0 as a reference; and sequencing the intersection points on the edge from large to small according to the value of t, sequentially inserting the intersection points into the half he0, and updating h0 and o1 in the intersection point information.
And after the intersection points are inserted, recording the half sides capable of forming the closed area, wherein the closed area can correspond to the bottom surface edge outline of the characteristic grid.
Further, in the step (d), the specific method for inserting new edges according to the boundaries of the regions comprises: dividing a polygon set { S } into two types of { S1} and { S2}, wherein t values of intersections of polygons in the { S2} and a sub-grid N parameterized grid are all-1 or a vertex is judged to be on a grid side, the { S1} is a part except the { S2} in the { S }, finding all intersection serial numbers of t ≠ -1 for intersections of any polygon in the set { S1}, and inserting edges into a triangular grid for any two front and back adjacent serial numbers i and j according to conditions:
when i and j are on the same side, o1 of the intersection point i and o1 of the intersection point j are on the same side, at the moment, a new side ji is inserted according to h0 of the intersection point j and o1 of the intersection point i, wherein a half newH pointing to i from j points to an original face f0, the other half of newH points to a newly created face f1, then points i1, i2, i3 and i4 are sequentially inserted into the half newH, and the starting point of newH is unchanged when each point is inserted, and the end point shrinks towards j;
when i and j are not on the same side, a new side ij is inserted according to o1 of the intersection point i and h0 of the intersection point j, wherein a half newH pointing to j from i points to an original face f0, the opposite half of newH points to a newly created face f1, then points i3, i2 and i1 are sequentially inserted into the half newH, and the starting point of newH is unchanged every time one point is inserted, and the end point shrinks towards i.
And aiming at whether the intersection points of i and j are on the same side, inserting the side into the triangular mesh according to the situation, thereby obtaining a polygon corresponding to the edge outline of the characteristic mesh on the main mesh.
Further, in the step (e), the specific method for triangulating the surface of more than 3 sides in the main grid M is as follows: finding out a surface F0 of a polygon Pi in a set { S2}, adding the F0 into a set { F }, then finding out a polygon set { Poly } completely in the polygon set { S0 for any surface Fi in the set { F }, determining a normal n of the surface Fi through backtracking, rotating the Fi and the { Poly } to enable the normal n to be parallel to + Z, setting a rotation matrix as R, enabling the Fi and the { Poly } to be on the same horizontal plane, taking the edge of the Fi as a zone boundary, taking the edge of the { Poly } as a constraint edge to perform triangulation, and then rotating back the points in the zone according to the triangulation result, wherein the rotation matrix is R -1 And inserted into the main mesh M, and then the triangle f in the region is added to the main mesh M.
And rotating the spatial plane area to be triangulated to a horizontal position, and rotating the spatial plane area back through inverse transformation after the plane triangulation is finished, thereby realizing the triangulation of the spatial area on the main grid M.
Further, in step (e), recording half of the advancing polygon intersecting with the grid edge to form a closed ring; recording half sides corresponding to all polygons in the set { Poly }, and forming a closed ring; placing the closed loops in a set { Loop }, all halves on each closed Loop pointing to adjoining triangles within an area enclosed by the closed loops; mesh subdivision is carried out on the surface with the number of sides being more than 3 in the main mesh, so that the surface is formed by a series of triangles; and finding out and deleting triangles in the area enclosed by the L for any closed ring L in the set { Loop }, and forming a series of holes which are recorded as { H }.
Triangles in the closed loop L need to be deleted to create holes corresponding to the bottom edge profile of the feature mesh.
Further, in the step (f), the concrete method for aligning the hole sites comprises: calculating the characteristic size of any hole in the set { H }, such as the perimeter of the hole, simultaneously calculating the perimeter of a polygon P formed by the edges of the characteristic mesh, zooming the characteristic mesh to ensure that the perimeter of the polygon P is equal to the perimeter of the hole, subdividing the polygon at the edge of the characteristic mesh to ensure that the number of vertexes is the same as that of the holes and corresponds to the holes one by one according to the length proportion, and then rotating and translating the characteristic mesh to ensure that the polygon on the characteristic mesh is aligned with the hole.
Further, in step (f), aligning the openings of the main grid M with the corners of the polygon P formed by the edges of the feature grid, aligning the grids by minimizing the sum of squared distances of the points, and minimizing the following function:
Figure SMS_2
wherein p is i And q is i Respectively being a point on the edge of the characteristic grid and a matching point on the edge of the M holes of the main grid, R and t respectively being an integral rotation matrix and an integral translation vector, and the values of R and t being unequal for each hole on the main grid M; to minimize f (R, t), R and t are given by: />
Figure SMS_5
Wherein, in the process,
Figure SMS_9
,/>
Figure SMS_3
,/>
Figure SMS_4
is VU -T Is orthogonal to V, from the covariance matrix S = XY -T Singular value decomposition of>
Figure SMS_8
Wherein the matrix X = [ X ] 1 x 2 … x n ]Matrix Y = [ Y = 1 y 2 … y n ],
Figure SMS_10
And is->
Figure SMS_1
,/>
Figure SMS_6
,/>
Figure SMS_7
(ii) a For any point p on the feature grid i Calculating p i =Rp i + t, after the transformation, the distance between the point on the edge of the feature grid and the matching point on the corresponding hole of the main grid M is the minimum in the least square sense, but the point is not completely overlapped, and the coordinate of the edge point of the feature grid is replaced by the coordinate of the matching point on the corresponding hole of the main grid M.
The openings in the master mesh M are generally not in the same plane, but the polygons formed by the edges of the feature mesh are in the same plane, so that the points on the edges of the feature mesh need to be adjusted appropriately to match the openings in the master mesh M.
Due to the adoption of the technical scheme, the invention has the following beneficial effects:
1. the polygons formed by the edge contours of the feature meshes are used as basic patterns for array, a 3D texture library can be constructed by only preparing corresponding feature mesh models, the feature mesh files are far smaller than bitmaps, and finally generated model files with 3D texture effects are relatively small.
2. The matching of the edge points of the feature grids and the corresponding points of the holes on the main grids can match the feature grids to the aligned holes only by calculation once, and the calculation speed is high.
3. The traditional bitmap-based method is only a height field, the invention can use a quasi-3-dimensional feature grid, and the feature grid can have a complex spatial structure.
Drawings
The invention is further illustrated below with reference to the accompanying drawings.
FIG. 1 is a flow chart of a method of generating a 3D texture of a surface by an array of features.
Fig. 2 is a schematic diagram of intersection point information change before and after intersection between an edge of a polygon Pi and a parameterized mesh and insertion of an intersection point.
FIG. 3 is a schematic diagram of an intersection of a polygon array with a parameterized mesh.
Fig. 4 is a schematic diagram of the case where the vertices of the polygon Pi are on the mesh edges.
Fig. 5 is a schematic diagram of the insertion of an intersection point on one side of a polygon Pi.
FIG. 6 is a schematic diagram of polygon Pi and two adjacent intersection points i, j with t value different from-1 in the intersection points of the parameterized mesh on the same edge.
Fig. 7 is a schematic diagram of intersection points i, j on different sides of a polygon Pi with two adjacent intersection points i, j of the parameterized mesh whose t values are different from-1.
Fig. 8 is a schematic diagram of a region where a triangle f0 is divided by a polygon array and the intersection of the triangle f0 with each polygon is removed, and the region is triangulated.
Fig. 9 is a schematic illustration of a pyramidal, top-balled feature grid scaled to not fully align the apertures.
Fig. 10 is a schematic view of a pyramidal feature grid with an open bottom aligned with an opening in a curved surface.
FIG. 11 is a schematic diagram of vertex position change after feature mesh scaling, edge subdivision, and point matching.
FIG. 12 is an array of pyramidal and truncated pyramidal feature meshes generated on the curved and cylindrical surfaces of a handle using the method of the present invention.
Fig. 13 shows a honeycomb array formed by two adjacent rows of intersecting hexagonal arrangements.
Fig. 14 shows two circumferential arrays of four-pointed stars that are enlarged in the radial direction.
Fig. 15 is a rectangular array of elementary cells consisting of two differently shaped polygons.
Detailed Description
A method of generating a 3D texture of a surface by an array of features as shown in figure 1, comprising the steps of:
(a) Establishing a topological connection relation of a main model, namely the main grid M by adopting a half-edge structure, and calculating the unit normal directions of all triangles f;
(b) Selecting an area on the surface of the main grid M, creating a sub-grid N according to vertexes in the area and the triangle f, constructing a mapping relation R, mapping the vertexes in the sub-grid N to corresponding vertexes in the main grid M one by one and recording, identifying the boundary of the sub-grid N, and unfolding the sub-grid N to a uv plane through a parameterization method;
(c) Marking the bottom surface edge profile of the feature grid as a polygon Pi, then completely covering a parameterized grid area of the sub-grid N according to a set mode and interval array polygons Pi, and reserving polygons completely in the parameterized grid area to form a set { S };
(d) As shown in fig. 2, for any polygon Pi in the set { S }, starting from the number 0, a vertex P0 completely inside the triangle f is found, and starting from P0, a series of intersections of Pi with the parameterized mesh are calculated, wherein the intersection coordinates pt, the half h0 where the intersection is located, and the ratio t of the distance from the intersection to the half start to the half length are recorded. If the polygon vertex is inside the triangle, such as P0, the value of t takes on the value of-1. If the polygon vertex is on the triangle edge, the vertex is judged to be on the mesh edge. These two types of points are called "feature points". After the intersection point is inserted, the half side of the point is divided into two, the starting point of h0 is unchanged, the end point points to the point pt, the total length is shortened, and the rest is leftThe lower part constitutes the new half h1, o1 being the opposite half of h 1. In FIG. 2, the value t of the 1 st intersection pt is 0.5, and the 2 nd intersectionptIstHas a value of0.25At the 2 nd intersection pointptRelated informationh0h1o1Are shown in bold italics to distinguish homonymous information associated with the 1 st intersection pt.
As shown in fig. 3, the parameterized mesh has only two triangles (indicated by thick solid lines) and the set S is made up of a series of squares (indicated by thin solid lines), each square intersecting the parameterized mesh at 4 points, with the remaining squares being completely inside one of the triangles, except the squares that intersect the diagonal lines.
The vertex of the polygon Pi is also treated as an intersection point, when the vertex is in a certain triangle f, t = -1, h0 is made to take the half h pointed by f, and f can be found through h; as shown in FIG. 4, when the vertex is on the side of a triangle, the next line segment of the polygon Pi may continue to enter the next adjacent triangle and may be folded back, as shown in FIG. 4, the end points of the line segments i1-i2 and i4-i5 on the surface f0 are on the grid side, so that the intersection point is determined as the end point of the current line segment, the next line segment i2-i3 enters the adjacent surface f1, and the line segments i5-i6 are folded back and returned to the surface f0, in both cases, the intersection points i2 and i5 are only calculated 1 time.
According to the mapping relation R, mapping the intersection point information from the sub-grid N parameterized grid to the main grid M, namely mapping the end point of the edge where the intersection point information is located back, and then calculating the intersection point coordinate on the mapping edge according to the proportion value t of the intersection point; for points in the triangle f, firstly, calculating the coordinates of the mass center on the parameterized grid of the sub grid N, and then calculating the coordinates of the corresponding points in the main grid M by using the coordinates of the mass center; at the same time, the half h0 where the intersection points are located also points to the corresponding half in the main grid M.
The specific method for obtaining a series of closed areas surrounded by half sides is as follows: classifying the intersection points with the t value not being-1 according to the edges (a certain half edge and the opposite half edge belong to the same edge), thereby knowing which intersection points exist on one edge; for any one edge, if an intersection point exists, recording two half edges of the edge as he0 and he1 respectively, taking he0 as a reference, and when the half edge of the intersection point is he1, replacing corresponding t with 1.0-t; and (3) sequencing the intersection points on the edge from large to small according to the value of t, then sequentially inserting the intersection points into the half-edge he0 (in the process, the starting point of he0 is unchanged, the end point points to the newly inserted point every time, and the length is continuously reduced), and updating h0 and o1 in the intersection point information.
Taking fig. 5 as an example, h0 of the intersection points a and C is he0, h0 of the intersection points B and D is he1, t values of the intersection points B and D need to be replaced by 1.0-t, then the intersection points are arranged from large to small according to t to obtain a sequence D, C, B, A, a point D, C, B, A is inserted on the half he0 in sequence, finally, h0 of the intersection point a is he1, h0 of the intersection point B is o3, h0 of the intersection point C is the half opposite side of o3, h0 of the intersection point D is o1, then o1 of 4 points is calculated, the half opposite side of the next half of each h0 is taken, for example, o1 of the intersection point D is the half opposite side of o2 in fig. 5. The specific method for inserting new edges according to the zone boundaries comprises the following steps: dividing a polygon set { S } into two types of { S1} and { S2}, wherein t values of intersections of polygons in the { S2} and a submesh N parameterized mesh are all-1 or are judged as an end point of a current line segment, { S1} is a part except the { S2} in the { S }, finding all intersection serial numbers of t ≠ -1 for intersections of any polygon in the set { S1}, and inserting edges into the triangular mesh for any two front and back adjacent serial numbers i and j according to conditions:
as shown in FIG. 6, when i is associated withjWhen on the same edge, o1 of the intersection point i and the intersection pointjIs/are as followso1On the same side, in this case according to the intersectionjIs/are as followsh0O1 with intersection i inserts a new edgeji, wherein fromjThe half newH pointing to i points to the original face f0, the opposite half of newH points to the newly created face f1, then points i1, i2, i3 and i4 are inserted into the half newH in sequence, the starting point of newH is unchanged when each point is inserted, and the end point is towardjAnd (4) shrinking. In FIG. 6, withjRelated toh0o1Bold italics are used to distinguish the homonymous information associated with i.
When i and j are not on the same side, o1 from the intersection point i and the intersection pointjIsh0Insert new edge ijWherein pointing from ijnewH points to the original face f0, the opposite half of newH points to the newly created face f1, and then half points toThe points i3, i2 and i1 are inserted into the newH in sequence, and the starting point of the newH is unchanged and the end point shrinks towards i when each point is inserted. In FIG. 7, withjIn connection withh0o1Bold italics are used to distinguish the homonymous information associated with i.
(e) Finding out a surface F0 of a polygon Pi in a set { S2}, adding the F0 into a set { F }, then finding out a polygon set { Poly } completely in the polygon set { S0 for any surface Fi in the set { F }, determining a normal n of the surface Fi through backtracking, rotating the Fi and the { Poly } to enable the normal n to be parallel to + Z, setting a rotation matrix as R, enabling the Fi and the { Poly } to be on the same horizontal plane, taking the edge of the Fi as a zone boundary, taking the edge of the { Poly } as a constraint edge to perform triangulation, and then rotating back the points in the zone according to the triangulation result, wherein the rotation matrix is R -1 And inserted into the main mesh M, and then the triangle f in the region is added to the main mesh M. Taking fig. 8 as an example, the original triangular region f0 is divided into 10 new faces f0 (corresponding to Fi) and f1 to f9, where the new f0 includes a polygon Poly _ i completely inside f0 as shown in the middle diagram of fig. 8, and the Poly _ i is the only element constituting the { Poly } set. The right subgraph of fig. 8 shows the triangularization result with the new f0 as the region boundary and Poly _ i as the constraint edge.
Recording half edge of the advancing polygon intersected with the edge of the grid to form a closed ring; recording the half corresponding to each polygon in the set { Poly }, also forming a closed loop (v 0-v1-v2-v3 in FIG. 8); placing the closed loops in a set { Loop }, all halves on each closed Loop pointing to adjoining triangles within an area enclosed by the closed loops; mesh subdivision is carried out on the surface with the number of sides being more than 3 in the main mesh, and the main mesh is formed by a series of triangles; and finding out and deleting triangles in the area enclosed by the L for any closed ring L in the set { Loop }, and forming a series of holes which are recorded as { H }.
(f) Calculating the characteristic size of any hole in the set { H }, such as the perimeter of the hole, simultaneously calculating the perimeter of a polygon P formed by the edges of the characteristic mesh, zooming the characteristic mesh to ensure that the perimeter of the polygon P is equal to the perimeter of the hole, subdividing the polygon at the edge of the characteristic mesh to ensure that the number of vertexes is the same as that of the holes and corresponds to the holes one by one according to the length proportion, and then rotating and translating the characteristic mesh to ensure that the polygon on the characteristic mesh is aligned with the hole.
FIG. 9 the lower graph of the case after zooming but without full alignment, the alignment method is as follows:
first, the correspondence relationship between the feature points is determined, and as shown in fig. 10, the large and small squares indicated by the thick solid lines correspond to the polygons P formed by the openings in the main mesh M and the edges of the feature mesh, respectively. The 4 corner points of the large square have been marked as "feature points" in the previous step, and it is assumed that these points are aligned with the 4 adjacent corner points in the small square one by one;
secondly, the large square has other points besides 4 corner points, and in order to perfectly match the small square, corresponding points need to be inserted into the small square, so that the two points have the same number and the positions correspond to each other one by one, as shown by the arrow in the right-side subgraph of fig. 10.
In addition, the openings in the main grid M are not generally in the same plane, but the polygons formed by the edges of the feature grid are in the same plane, so that the points on the edges of the feature grid need to be adjusted appropriately to match the holes in the main grid M.
Fig. 11 is a case after the feature mesh edge is subdivided and point matching is implemented, where the left-side feature mesh is scaled, translated, rotated, subdivided by the top edge contour, and matched with the hole to obtain the right-side mesh. The top edge profile is originally a square on the same plane, and after the holes are matched, the top edge profile becomes a space closed fold line.
Aligning the openings in the master grid M with the corners of a polygon P formed by the edges of the feature grid, aligning the grid by minimizing the sum of the squared distances of the point pairs, minimizing the function:
Figure SMS_13
wherein p is i And q is i Respectively being a point on the edge of the characteristic grid and a matching point on the edge of the M holes of the main grid, R and t respectively being an integral rotation matrix and an integral translation vector, and the values of R and t being unequal for each hole on the main grid M; to minimize f (R, t)R and t are valued according to the following formula:
Figure SMS_14
wherein is present>
Figure SMS_17
,/>
Figure SMS_12
,/>
Figure SMS_15
Is VU -T Is orthogonal to V, from the covariance matrix S = XY -T Singular value decomposition of>
Figure SMS_18
Wherein the matrix X = [ X ] 1 x 2 … x n ]The matrix Y = [ Y = [) 1 y 2 … y n ],/>
Figure SMS_20
And is->
Figure SMS_11
,/>
Figure SMS_16
Figure SMS_19
(ii) a For any point p on the feature grid i Calculating p i =Rp i + t, after the transformation, the distance between the point on the edge of the feature grid and the matching point on the corresponding hole of the main grid M is the minimum in the least square sense, but the point is not completely overlapped, and the coordinate of the edge point of the feature grid is replaced by the coordinate of the matching point on the corresponding hole of the main grid M.
Finally, the three-dimensional model M is stitched together with the feature grid in the vicinity of each hole to form a unified whole.
The method is used for generating a pyramid and a characteristic grid array of a pyramid with a sphere at the top on the surface of the cube master model.
In addition to generating feature arrays on a flat surface, feature mesh arrays can be generated on arbitrary curved surfaces as well as cylindrical surfaces. Fig. 12 shows the generation of a pyramid and truncated pyramid feature grid array on a handle using the method of the present invention. Wherein the top features are not of the same size as the parametric warping.
Secondly, the feature grid can contain a very complex spatial structure, a feature grid array, and the feature grid contains 4 struts which are intersected at the top, and a round hole is arranged in the middle of the top, so that the feature grid is a quasi-three-dimensional structure different from a 2.5-dimensional structure.
Third, the edge profile of the feature grid is not limited to a quadrilateral, and the edge profile of the feature grid is a concave decagon in a five-pointed star array generated in the local area of the surface.
In addition, the embodiment of fig. 12 uses a rectangular array, but the pattern of the array is not limited, and other arrays or mathematical transformations are possible, and a combination of a plurality of different feature grid arrays is also possible, such as those shown in fig. 13-15.
The above is only a specific embodiment of the present invention, but the technical features of the present invention are not limited thereto. Any simple changes, equivalent substitutions or modifications made on the basis of the present invention to solve the same technical problems and achieve the same technical effects are all covered in the protection scope of the present invention.

Claims (10)

1. A method of generating a 3D texture of a surface from an array of features, comprising the steps of:
(a) Establishing a main model, namely a topological connection relation of the main grid M by adopting a half-edge structure, and calculating the unit normal directions of all triangles f;
(b) In the selected area on the surface of the main grid M, creating a sub-grid N according to vertexes in the area and a triangle f, constructing a mapping relation R, mapping the vertexes in the sub-grid N to corresponding vertexes in the main grid M one by one and recording, identifying the boundary of the sub-grid N, and unfolding the sub-grid N to a uv plane through a parameterization method to form a parameterized grid;
(c) Marking the bottom surface edge profile of the feature grid as a polygon Pi, then completely covering a parameterized grid area of the sub-grid N according to a set mode and interval array polygons Pi, and reserving polygons completely in the parameterized grid area to form a set { S };
(d) Intersecting the polygons Pi in the set { S } with the parameterized meshes, mapping the intersection points to a main mesh M, inserting new vertexes into the intersection points on the main mesh, mapping the polygons in the set { S } to the main mesh to obtain a series of closed areas surrounded by half sides, recording the closed areas as { Loop }, and inserting new sides according to the boundaries of the areas;
(e) Triangularizing the faces with more than 3 sides in the main grid M, and deleting triangles f inside each closed area in the { Loop } to obtain a series of holes;
(f) And scaling the feature grids according to the sizes of the holes, rotating and translating the feature grids, adjusting edge points of the feature grids to corresponding points on the holes, aligning hole positions, and sewing the main grid M and each transformed feature grid into a whole.
2. A method of generating a 3D texture of a surface from an array of features as claimed in claim 1, wherein: in the step (d), the specific method for intersecting the polygon Pi and the parameterized mesh is as follows: for any polygon Pi in the set { S }, a vertex P0 completely inside a triangle f is found from the serial number 0, a series of intersection points of the Pi and the parameterized grid are calculated from P0, wherein an intersection point coordinate pt is recorded, the half side h0 where the intersection points are located, the ratio t between the distance from the intersection point to the starting point of the half side and the half side length is recorded, after the intersection points are inserted, the half side where the intersection points are located is divided into two, the starting point of h0 is unchanged, the end point points to point pt, the total length is shortened, the rest part forms a new half side h1, and o1 is the opposite half side of h 1.
3. A method of generating a 3D texture of a surface by an array of features according to claim 2, wherein: in the step (d), the vertex of the polygon Pi is also treated as an intersection point, when the vertex is completely inside the triangle f, t = -1, and h0 is the half h pointed by the triangle f; when the vertex is on the f side of the triangle, the vertex is judged to be on the mesh side.
4. A method of generating a 3D texture of a surface from an array of features as claimed in claim 2, wherein: in step (d), the specific method for mapping the polygon Pi in the set { S } to the main mesh M is as follows: according to the mapping relation R, mapping the intersection point information from the parameterized grid of the sub-grid N to the main grid M, namely mapping the end point of the edge where the intersection point information is located back, and then calculating the intersection point coordinate on the mapping edge according to the proportion value t of the intersection point; for points in the triangle f, firstly, calculating a centroid coordinate on the sub-grid N parameterized grid, and then calculating a coordinate of a corresponding point in the main grid M by using the centroid coordinate; at the same time, the half h0 where the intersection points are located also points to the corresponding half in the main grid M.
5. A method of generating a 3D texture of a surface by an array of features according to claim 4, wherein: in the step (d), a specific method for obtaining a series of closed areas surrounded by half sides is as follows: classifying the intersection points with the t value not being-1 according to the edges, recording two half sides of any edge as he0 and he1 if the intersection point exists on any edge, and replacing the corresponding t with 1.0-t when the half side of the intersection point is he1 by taking he0 as a reference; and sequencing the intersection points on the edge from large to small according to the value t, then sequentially inserting the intersection points into the half he0, and updating h0 and o1 in the intersection point information.
6. A method of generating a 3D texture of a surface from an array of features as claimed in claim 1, wherein: in the step (d), the specific method for inserting new edges according to the zone boundaries comprises the following steps: dividing a polygon set { S } into two types of { S1} and { S2}, wherein t values of intersections of polygons in the { S2} and a sub-grid N parameterized grid are all-1 or a vertex is judged to be on a grid side, the { S1} is a part except the { S2} in the { S }, finding all intersection serial numbers of t ≠ -1 for intersections of any polygon in the set { S1}, and inserting edges into a triangular grid for any two front and back adjacent serial numbers i and j according to conditions:
when i and j are on the same side, o1 of the intersection point i and o1 of the intersection point j are on the same side, at the moment, a new side ji is inserted according to h0 of the intersection point j and o1 of the intersection point i, wherein a half newH pointing to i from j points to an original face f0, the other half of newH points to a newly created face f1, then points i1, i2, i3 and i4 are sequentially inserted into the half newH, and the starting point of newH is unchanged when each point is inserted, and the end point shrinks towards j;
when i and j are not on the same side, inserting a new side ij according to o1 of the intersection point i and h0 of the intersection point j, wherein a half newH pointing to j from i points to an original face f0, an opposite half of newH points to a newly created face f1, then sequentially inserting points i3, i2 and i1 into the half pointed by newH, and after each point is inserted, the starting point of newH is unchanged, and the end point shrinks towards i.
7. A method of generating a 3D texture of a surface by an array of features according to claim 1, wherein: in the step (e), the specific method for triangularizing the surface with more than 3 sides in the main grid M comprises the following steps: finding out a surface F0 of a polygon Pi in a set { S2}, adding the F0 into a set { F }, then finding out a polygon set { Poly } completely in the polygon set { S0 for any surface Fi in the set { F }, determining a normal n of the surface Fi through backtracking, rotating the Fi and the { Poly } to enable the normal n to be parallel to + Z, setting a rotation matrix as R, enabling the Fi and the { Poly } to be on the same horizontal plane, taking the edge of the Fi as a zone boundary, taking the edge of the { Poly } as a constraint edge to perform triangulation, and then rotating back the points in the zone according to the triangulation result, wherein the rotation matrix is R -1 And inserted into the main mesh M, and then the triangle f in the region is added to the main mesh M.
8. A method of generating a 3D texture of a surface from an array of features as claimed in claim 7, wherein: in the step (e), recording half edge of the advancing polygon intersected with the grid edge to form a closed ring; recording the half corresponding to each polygon in the set { Poly } to form a closed ring; placing the closed loops in a set { Loop }, all halves on each closed Loop pointing to adjoining triangles within an area enclosed by the closed loops; mesh subdivision is carried out on the surface with the number of sides being more than 3 in the main mesh, and the main mesh is formed by a series of triangles; and finding out and deleting triangles in the area enclosed by the L for any closed ring L in the set { Loop }, and forming a series of holes which are recorded as { H }.
9. A method of generating a 3D texture of a surface by an array of features according to claim 8, wherein: in the step (f), the concrete method for aligning the hole sites comprises the following steps: calculating the characteristic size of any hole in the set { H }, calculating the perimeter of a polygon P formed by the edges of the characteristic mesh, zooming the characteristic mesh to ensure that the perimeter of the polygon P is equal to the perimeter of the hole, subdividing the polygon at the edges of the characteristic mesh to ensure that the number of vertexes is the same as that of the hole and corresponds to the holes one by one according to the length proportion, and then rotating and translating the characteristic mesh to ensure that the polygon on the characteristic mesh is aligned with the hole.
10. A method of generating a 3D texture of a surface by an array of features according to claim 9, wherein: in step (f), aligning the holes on the main grid M with the corner points of a polygon P formed by the edges of the feature grid, aligning the grid by minimizing the sum of squared distances of the point pairs, and minimizing the following function:
Figure QLYQS_3
wherein p is i And q is i Respectively being a point on the edge of the characteristic grid and a matching point on the edge of the M holes of the main grid, R and t respectively being an integral rotation matrix and an integral translation vector, and the values of the R and the t being unequal for each hole on the main grid M; to minimize f (R, t), R and t are given by:
Figure QLYQS_4
wherein is present>
Figure QLYQS_7
,/>
Figure QLYQS_2
,/>
Figure QLYQS_6
Is VU -T Is orthogonal to V, from the covariance matrix S = XY -T Singular value decomposition->
Figure QLYQS_8
Wherein the matrix X = [ X ] 1 x 2 … x n ]The matrix Y = [ Y = [) 1 y 2 … y n ],/>
Figure QLYQS_10
And is->
Figure QLYQS_1
,/>
Figure QLYQS_5
,/>
Figure QLYQS_9
(ii) a For any point p on the feature grid i Calculating p i =Rp i + t, after the transformation, the distance between the point on the edge of the feature grid and the matching point on the corresponding hole of the main grid M is the minimum in the least square sense, but the point is not completely overlapped, and the coordinate of the edge point of the feature grid is replaced by the coordinate of the matching point on the corresponding hole of the main grid M. />
CN202310265275.7A 2023-03-20 2023-03-20 Method for generating surface 3D texture through feature array Active CN115984442B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310265275.7A CN115984442B (en) 2023-03-20 2023-03-20 Method for generating surface 3D texture through feature array

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310265275.7A CN115984442B (en) 2023-03-20 2023-03-20 Method for generating surface 3D texture through feature array

Publications (2)

Publication Number Publication Date
CN115984442A true CN115984442A (en) 2023-04-18
CN115984442B CN115984442B (en) 2023-06-23

Family

ID=85958191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310265275.7A Active CN115984442B (en) 2023-03-20 2023-03-20 Method for generating surface 3D texture through feature array

Country Status (1)

Country Link
CN (1) CN115984442B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020050988A1 (en) * 2000-03-28 2002-05-02 Michael Petrov System and method of three-dimensional image capture and modeling
US20060066613A1 (en) * 2004-09-27 2006-03-30 Elshishiny Hisham E E Method and system for partitioning the surface of a three dimentional digital object model in order to map a texture
CN102306396A (en) * 2011-09-15 2012-01-04 山东大学 Three-dimensional entity model surface finite element mesh automatic generation method
CN103080984A (en) * 2010-06-30 2013-05-01 巴里·林恩·詹金斯 System and method of from-region visibility determination and delta-pvs based content streaming using conservative linearized umbral event surfaces
US20130307848A1 (en) * 2012-05-17 2013-11-21 Disney Enterprises, Inc. Techniques for processing reconstructed three-dimensional image data
CN107909650A (en) * 2017-10-23 2018-04-13 浙江大学 One kind is based on surface fitting and geodesic complex free curved surface Meshing Method
CN108682043A (en) * 2018-02-08 2018-10-19 大连理工大学 A kind of complex-curved measure planning method based on parameter mapping
US20190304161A1 (en) * 2018-04-03 2019-10-03 Vangogh Imaging, Inc. Dynamic real-time texture alignment for 3d models
CN114840926A (en) * 2022-04-27 2022-08-02 哈尔滨工业大学 Method for generating three-dimensional finite element grid with complex tire patterns

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020050988A1 (en) * 2000-03-28 2002-05-02 Michael Petrov System and method of three-dimensional image capture and modeling
US20060232583A1 (en) * 2000-03-28 2006-10-19 Michael Petrov System and method of three-dimensional image capture and modeling
US20060066613A1 (en) * 2004-09-27 2006-03-30 Elshishiny Hisham E E Method and system for partitioning the surface of a three dimentional digital object model in order to map a texture
CN103080984A (en) * 2010-06-30 2013-05-01 巴里·林恩·詹金斯 System and method of from-region visibility determination and delta-pvs based content streaming using conservative linearized umbral event surfaces
CN102306396A (en) * 2011-09-15 2012-01-04 山东大学 Three-dimensional entity model surface finite element mesh automatic generation method
US20130307848A1 (en) * 2012-05-17 2013-11-21 Disney Enterprises, Inc. Techniques for processing reconstructed three-dimensional image data
CN107909650A (en) * 2017-10-23 2018-04-13 浙江大学 One kind is based on surface fitting and geodesic complex free curved surface Meshing Method
CN108682043A (en) * 2018-02-08 2018-10-19 大连理工大学 A kind of complex-curved measure planning method based on parameter mapping
US20190304161A1 (en) * 2018-04-03 2019-10-03 Vangogh Imaging, Inc. Dynamic real-time texture alignment for 3d models
CN114840926A (en) * 2022-04-27 2022-08-02 哈尔滨工业大学 Method for generating three-dimensional finite element grid with complex tire patterns

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
SOJI YAMAKAWA: "Polygon crawling: feature edge extraction from a general polygonal surface for mesh generation", 《万方数据库》 *
万燕;王慧洁;鲁俊;: "基于三角网格模型的纹理映射研究", 计算机应用与软件, no. 04 *
来元: "一种用于表面重建的网格点生成算法", 《计算机工程与应用》, no. 3 *

Also Published As

Publication number Publication date
CN115984442B (en) 2023-06-23

Similar Documents

Publication Publication Date Title
Gregory et al. Interactive surface decomposition for polyhedral morphing
Mirante et al. The radial sweep algorithm for constructing triangulated irregular networks
CN107330903B (en) Skeleton extraction method of human point cloud model
EP1710720B1 (en) Method of computer-aided design of a modeled object having several faces
CN109377561A (en) A kind of digital-to-analogue surface mesh generation method based on conformal geometry
CN103761397B (en) Three-dimensional model slice for surface exposure additive forming and projection plane generating method
CN106683167A (en) Automatic modeling approach for high precision model of complex building
CN104504760B (en) The method and system of real-time update 3-D view
CN108830776A (en) The visible entity watermark copyright anti-counterfeiting mark method of three-dimensional towards 3D printing model
CN108230452B (en) Model hole filling method based on texture synthesis
US5644688A (en) Boolean trajectory solid surface movement method
CN106709171B (en) A kind of decalcomania generation method based on repeat pattern discovery
Pavić et al. High‐resolution volumetric computation of offset surfaces with feature preservation
CN110032771A (en) A kind of accurate method of cutting out of open coal mine DEM for taking local detail feature into account
Parent Shape transformation by boundary representation interpolation: a recursive approach to establishing face correspondences
CN105894553B (en) A kind of Street Space form layout method based on grid selection
Plantinga et al. Isotopic meshing of implicit surfaces
CN116433794B (en) Processing method and system for three-dimensional model in CAE software
McMains et al. A coherent sweep plane slicer for layered manufacturing
CN109685844B (en) Method and device for optimizing marking and direction calibration of woven grids
CN115984442A (en) Method for generating surface 3D texture through feature array
Yoo Three-dimensional morphing of similar shapes using a template mesh
US6930682B1 (en) Subdivision operation and user interface for volume sculpting
CN107248163B (en) Automatic generation method of texture development diagram for rotationally symmetric porcelain
Bao et al. Interactive 3D morphing

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