CN115205408A - Automatic texture generation method, system, equipment, storage medium and cloud platform - Google Patents

Automatic texture generation method, system, equipment, storage medium and cloud platform Download PDF

Info

Publication number
CN115205408A
CN115205408A CN202210607123.6A CN202210607123A CN115205408A CN 115205408 A CN115205408 A CN 115205408A CN 202210607123 A CN202210607123 A CN 202210607123A CN 115205408 A CN115205408 A CN 115205408A
Authority
CN
China
Prior art keywords
cell
texture
parameter control
point
offset
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.)
Pending
Application number
CN202210607123.6A
Other languages
Chinese (zh)
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.)
Pera Corp Ltd
Original Assignee
Pera Corp 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 Pera Corp Ltd filed Critical Pera Corp Ltd
Priority to CN202210607123.6A priority Critical patent/CN115205408A/en
Publication of CN115205408A publication Critical patent/CN115205408A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The invention relates to a texture automatic generation method, a system, equipment, a storage medium and a cloud platform, belongs to the field of texture design, and solves the problems that the existing textures are limited in types and cannot be flexibly customized. Obtaining a model to be subjected to texture design; generating a grid based on a plurality of cells on the model according to the selected cell shape and side length; filling corresponding cell texture in each unit cell according to the selected cell texture type; each cell comprises 1 central point and 1 or more parameter control points; the parameter control point is positioned on a straight line determined by the central point and the vertex of the cell or a straight line determined by the adjacent vertex of the cell, and the straight line is used as a motion track to move; and controlling the offset of the parameter control points to enable the parameter control points to move on the motion track according to the corresponding offset, so as to generate the texture design drawing of the model. The texture design based on the appearance of the product is realized.

Description

Automatic texture generation method, system, equipment, storage medium and cloud platform
Technical Field
The invention relates to the field of texture design, in particular to a method, a system, equipment, a storage medium and a cloud platform for automatically generating textures.
Background
Nowadays, the variety of products is increasingly abundant, the competition among the products is also increasingly violent, and in order to avoid the convergence phenomenon generated under the technical bottleneck, the texture design gradually becomes an important winner in various product markets.
However, the traditional texture design is a prefabricated pattern, the texture pattern is fixed and the variety is limited, and the texture cannot be adaptively modified according to the product requirements. Meanwhile, in the application process, the texture needs to be cut based on the product appearance, so that the continuity of the texture of the boundary part is interrupted, and the visual effect is greatly influenced.
Therefore, the existing texture design method can not meet the increasing product design requirement. In the prior art, a method for automatically generating textures which are attached and meet customization requirements based on product appearance is lacked.
Disclosure of Invention
In view of the foregoing analysis, embodiments of the present invention provide an automatic texture generation method, system, device, storage medium, and cloud platform, so as to solve the problems that the existing textures are limited in types and cannot be flexibly customized.
In one aspect, an embodiment of the present invention provides an automatic texture generation method, including the following steps:
obtaining a model to be subjected to texture design;
generating a grid based on a plurality of unit grids on the model according to the selected unit grid shape and the side length;
filling corresponding cell texture in each unit cell according to the selected cell texture type to generate an initial texture graph; each cell comprises 1 central point and 1 or more parameter control points; the parameter control point is positioned on a straight line determined by the central point and the vertex of the cell or a straight line determined by the adjacent vertex of the cell, and the straight line is used as a motion track to move;
in the initial texture graph, the offset of the parameter control points is controlled, so that the parameter control points move on the motion track according to the corresponding offset, and a texture design graph of the model is generated.
Based on the further improvement of the method, the cell texture type is a texture graph formed by combining 1 or more parameter control points, vertexes and boundary midpoints of the filled unit cells as a point set, selecting points from the point set according to various combination rules, and generating a straight line or a curve.
Based on the further improvement of the method, the method further comprises the following steps: when the selected cell shape is a quadrangle, splitting each cell into a plurality of sub-cells according to the type of the sub-cells, and then respectively using each sub-cell as one cell in the grid;
the sub-cell types include: mirror, triangular and hybrid.
Based on a further improvement of the above method, when the selected cell shape is a quadrilateral, splitting each cell into a plurality of sub-cells according to the sub-cell type includes:
when the sub-cell type is a mirror image type, acquiring vertexes, central points and middle points of boundaries of a quadrangle, connecting lines according to a mirror image relationship by taking the middle points of every two adjacent boundaries, the vertexes where the two adjacent boundaries intersect and the central points as 4 vertexes of a first sub-cell to form 4 mirror image sub-cells;
when the sub-cell type is a triangle, acquiring any two adjacent vertexes in the quadrangle and the middle points on the sides opposite to the sides where the two adjacent vertexes are located, and respectively connecting the middle points with the two vertexes to form 3 triangular sub-cells;
when the sub-cell type is a mixed type, the vertexes of the quadrangle and the midpoints of the boundaries are obtained, the midpoints of every two adjacent boundaries and the vertexes where the two adjacent boundaries intersect are used as 3 vertexes of a third sub-cell, the midpoints of the boundaries are used as 4 vertexes of a fourth sub-cell, and 4 triangular sub-cells and 1 quadrangular sub-cell are formed by connecting lines.
Based on the further improvement of the method, the parameter control point is positioned on a straight line defined by the central point and the vertex of the cell or the adjacent vertex of the cell, and the method comprises the following steps:
on the straight line where the line segment connecting the center point and any vertex of the filled cell is located, any point is selected as a parameter control point, or,
respectively selecting points with the same distance from any end point of the line segment as parameter control points on a straight line where the line segment with the central point connected with each vertex of the filled cell is located; or,
and respectively selecting points with the same distance from any end point of the line segment as parameter control points on the straight line of the line segment connected with every two adjacent vertexes of the filled cell.
Based on the further improvement of the method, the straight line is used as a motion track to move, and the method comprises the following steps: taking the length of the line segment where the parameter control point is located when the parameter control point is selected as 1 unit length, and mapping the offset to a [0,1] interval when the parameter control point moves between the line segments; when the parameter control point moves on the extension line of the starting point of the line segment, the offset is mapped to a [ negative value threshold, 0] interval; when the parameter control point moves on the extension line of the line segment end point, the offset is mapped to the [1, over threshold ] interval.
Based on the further improvement of the method, the offset of the control point of the control parameter comprises the following steps:
setting the offset of any control point in each cell; and/or the presence of a gas in the gas,
selecting any point on the initial texture graph as a guide point, and calculating the offset of each parameter control point according to the spatial distance from the guide point to the center point of each unit; and/or the presence of a gas in the gas,
based on the selected horizontal or vertical direction of change, the parameter control point offset of each cell in the direction of change is made to vary functionally.
Based on the further improvement of the method, the offset of each parameter control point is calculated according to the space distance from the guide point to the center point of each unit, and the method comprises the following steps:
taking the farthest spatial distance and the nearest spatial distance in the spatial distances as value domain boundaries, and mapping each spatial distance to a [0,1] interval after normalization processing;
and respectively taking each spatial distance after the normalization processing as the offset of each parameter control point of the corresponding cell.
Based on the further improvement of the method, the parameter control point offset of each cell in the change direction is changed in a function manner, and the method comprises the following steps:
acquiring an x coordinate value or a y coordinate value of a center point of each unit according to the horizontal or vertical change direction;
the coordinate value of each cell in the change direction is used as an independent variable and substituted into a function together with the set offset position, a function value corresponding to each cell is obtained through calculation, and after normalization processing, the function value is mapped to a [0,1] interval;
and taking the function value after the normalization processing as the offset of each parameter control point of the corresponding cell.
An embodiment of the present invention further provides an automatic texture generation system, where the system includes:
the model acquisition module is used for acquiring a model to be subjected to texture design;
the unit grid generating module is used for generating grids based on a plurality of unit grids on the model according to the selected unit grid shape and side length;
the texture generation module is used for filling corresponding cell texture in each unit cell according to the selected cell texture type to generate an initial texture graph; each cell comprises 1 central point and 1 or more parameter control points; the parameter control point is positioned on a straight line determined by the central point and the vertex of the cell or a straight line determined by the adjacent vertex of the cell, and the straight line is used as a motion track to move;
and the texture change module is used for enabling the parameter control points to move on the motion track according to the corresponding offset by controlling the offset of the parameter control points based on the initial texture graph so as to generate a texture design graph of the model.
An embodiment of the present invention further provides an apparatus for automatically generating a texture, where the apparatus includes: a memory for storing a computer program;
and the processor is used for realizing the steps of any texture automatic generation method when executing the computer program.
The embodiment of the invention also provides a readable storage medium, which is used for storing a computer program, and when a processor executes the computer program, the steps of any texture automatic generation method are realized.
The embodiment of the invention also provides a texture automatic generation cloud platform, wherein the cloud platform is embedded with a texture automatic generation system to provide texture automatic generation service for customers.
Based on the further improvement of the cloud platform, the cloud platform comprises a client and a management end, the texture automatic generation system is embedded into the client, and the management end is used for management personnel to realize background management of the cloud platform.
Compared with the prior art, the invention can realize at least one of the following beneficial effects:
1. according to the automatic texture generation method and system, the texture graph is automatically changed by controlling the offset of the parameter control point based on the product appearance without being limited by the texture style, so that the design efficiency of the texture is improved, and the automation and customization of texture generation are realized;
2. according to the automatic texture generation method and system, different types of cell textures are filled in unit lattices with various shapes, diversified combination of the unit lattices and the cell textures is realized, the continuity of the textures is always ensured, and the visual effect is optimized;
3. according to the automatic texture generation method and the automatic texture generation system, the offset of each cell element grid parameter control point can be independently adjusted, and the texture graph can be quickly and integrally adjusted through the change of the positions of the guide point and the initial phase, so that an efficient and low-cost implementation mode is provided for large-scale texture customization services;
4. according to the automatic texture generation cloud platform, the automatic texture generation system is embedded inside, so that automatic texture generation service can be provided for a user, the user can obtain the service only by logging in the cloud platform, and the requirement of the user for customizing the texture of a product is met; directly generating texture based on the product model, being convenient for directly input the model of deriving into rear end 3D printing apparatus, print the product of making and having the texture through 3D.
In the invention, the technical schemes can be combined with each other to realize more preferable combination schemes. Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and drawings.
Drawings
The drawings are only for purposes of illustrating particular embodiments and are not to be construed as limiting the invention, wherein like reference numerals are used to designate like parts throughout.
Fig. 1 is a flowchart of an automatic texture generation method according to embodiment 1 of the present invention;
fig. 2 (a) and 2 (b) are schematic diagrams of splitting into mirror image type sub-cells and texture filling in embodiment 1 of the present invention;
FIGS. 3 (a) and 3 (b) are schematic diagrams of the splitting into triangular sub-cells and the texture filling in example 1 of the present invention;
fig. 4 (a) and 4 (b) are schematic diagrams of splitting into mixed sub-cells and texture filling in example 1 of the present invention;
fig. 5 (a), fig. 5 (b) and fig. 5 (c) are schematic diagrams illustrating generation and variation of the cell texture type 1 in embodiment 1 of the present invention;
fig. 6 (a), fig. 6 (b) and fig. 6 (c) are schematic diagrams illustrating generation and variation of cell texture type 2 in embodiment 1 of the present invention;
fig. 7 (a), fig. 7 (b) and fig. 7 (c) are schematic diagrams illustrating generation and variation of the cell texture type 3 in embodiment 1 of the present invention;
fig. 8 (a), fig. 8 (b) and fig. 8 (c) are schematic diagrams illustrating generation and variation of the cell texture type 4 in embodiment 1 of the present invention;
fig. 9 (a), fig. 9 (b) and fig. 9 (c) are schematic diagrams illustrating generation and variation of the cell texture type 5 in embodiment 1 of the present invention;
fig. 10 (a), fig. 10 (b) and fig. 10 (c) are schematic diagrams illustrating generation and variation of the cell texture type 6 according to embodiment 1 of the present invention;
fig. 11 (a), fig. 11 (b) and fig. 11 (c) are schematic diagrams illustrating generation and variation of the cell texture type 7 in embodiment 1 of the present invention;
FIG. 12 is a schematic diagram of a method for controlling a point offset according to a guidance point control parameter in embodiment 1 of the present invention;
FIG. 13 is a schematic diagram showing how texture patterns are changed in a trigonometric function in the horizontal and vertical directions in embodiment 1 of the present invention;
fig. 14 is a schematic diagram of the key design process and effect of the sole texture in embodiment 2 of the present invention.
Detailed Description
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate preferred embodiments of the invention and together with the description, serve to explain the principles of the invention and not to limit the scope of the invention.
Example 1
A specific embodiment of the present invention discloses an automatic texture generation method, as shown in fig. 1, including the following steps:
s11: and obtaining a model to be subjected to texture design.
It should be noted that the present embodiment does not limit the obtaining manner of the model to be texture-designed, and the model can be obtained by importing or designing in a system, and supports two dimensions and three dimensions. For example, the model to be textured may be a model of a shoe sole or a vehicle seat.
S12: and generating a grid based on a plurality of cells on the model according to the selected cell shape and the side length.
It should be noted that, in consideration of the irregularity of the model edge, the cell side length refers to the average side length, and it is preferable to set the selectable range of the cell side length to 1 to 50mm. The cell shape includes: triangles, quadrilaterals, pentagons, hexagons and Thiessen polygons. The present embodiment is not limited to the method for generating the mesh, and after the mesh is generated, vertex coordinate information corresponding to each cell is acquired.
Preferably, in order to unify the filling order of the cell texture in each subsequent cell, the generated cells may be sorted according to a certain order rule and vertex coordinate information corresponding to each cell may be obtained.
Further, 3 sub-cell types are provided for the quad cells, i.e., one quad cell is split into different sub-cells, thereby expanding more cell shapes.
Specifically, when the selected cell shape is a quadrangle, splitting each cell into a plurality of sub-cells according to the type of the sub-cells, and then respectively taking each sub-cell as one cell in the grid; wherein the sub-cell type includes: mirror, triangular and hybrid.
(1) When the sub-cell type is a mirror image type, acquiring vertexes, central points and middle points of boundaries of a quadrangle, connecting lines according to a mirror image relationship by taking the middle points of every two adjacent boundaries, the vertexes where the two adjacent boundaries intersect and the central points as 4 vertexes of a first sub-cell to form 4 mirror image sub-cells;
it should be noted that 4 mirror image sub-cells are formed according to the mirror image relationship, and the vertices of the sub-cells can be extracted according to any mirror image relationship, that is, the vertices of each sub-cell are sorted according to any mirror image relationship and connected in parallel.
Exemplarily, taking a regular quadrangle as an example, an exemplary process of splitting a quadrangle into 4 mirror image sub-cells is shown in fig. 2 (a), wherein a line with an arrow represents an arrangement order of vertices. Fig. 2 (b) shows texture patterns obtained by filling an example pattern of a cell texture into 4 mirror image sub-cells and 4 ordinary quadrilateral sub-cells, respectively, and it can be clearly seen that the two texture patterns are obviously different.
(2) When the sub-cell type is a triangle, acquiring any two adjacent vertexes in the quadrangle and the middle points on the sides opposite to the sides where the two adjacent vertexes are located, and respectively connecting the middle points with the two vertexes to form 3 triangular sub-cells;
similarly, the vertex of each triangle sub-cell obtained by splitting is extracted according to a certain rule.
Illustratively, taking a regular quadrangle as an example, an exemplary process of splitting a quadrangle into 3 triangular sub-unit cells is shown in fig. 3 (a), and a texture pattern obtained by filling a cell texture exemplary pattern into 3 triangular sub-unit cells is shown in fig. 3 (b).
(3) And when the sub-cell types are mixed, acquiring vertexes of quadrangles and midpoints of boundaries, taking the midpoints of every two adjacent boundaries and vertexes where two adjacent boundaries intersect as 3 vertexes of a third sub-cell, taking the midpoints of the boundaries as 4 vertexes of a fourth sub-cell, and connecting lines to form 4 triangular sub-cells and 1 quadrangular sub-cell.
Exemplarily, taking a regular quadrangle as an example, an exemplary process of splitting a quadrangle into hybrid sub-cells is shown in fig. 4 (a), and a texture pattern obtained by filling a cell texture exemplary pattern into the hybrid sub-cells is shown in fig. 4 (b).
In this embodiment, sub-cells are split based on the quadrilateral cells, and other polygonal cells can also be split in a similar manner.
Compared with the prior art, in the embodiment, various different types of grids are directly generated according to the model, and each unit grid in the grids is used for filling different types of textures, so that the continuity of the textures can be always ensured, and the visual effect is optimized.
S13: filling corresponding cell texture in each unit cell according to the selected cell texture type to generate an initial texture graph; each cell comprises 1 central point and 1 or more parameter control points; the parameter control point is positioned on a straight line determined by the central point and the vertex of the cell or a straight line determined by the adjacent vertex of the cell, and the straight line is used as a motion track to move.
In the present embodiment, the unit cell with the corresponding cell texture filled according to the cell texture type is also referred to as a cell, and after filling, the mesh structure formed by a plurality of cells forms an overall texture pattern.
The design and adjustment of cell texture is related to the center point and parameter control point of the populated cell. Each cell includes 1 center point, and 1 or more parameter control points. Wherein, the central point is calculated according to the point coordinates of each vertex or each boundary of the filled cells, and the method comprises the following steps: the gravity center point of the filled cell, or a point corresponding to the average value of the coordinates of each vertex of the cell, or a point corresponding to the average value of the coordinates of points in each boundary of the cell.
It should be noted that the gravity center point of the filled cell may be calculated by splitting the cell into a plurality of sub-triangles according to the vertex of each cell and then obtaining the gravity center point of the cell through the gravity center point and the area of the sub-triangles.
The parameter control point is located on a straight line determined by the central point and the vertex of the cell or a straight line determined by the adjacent vertex of the cell, and the method specifically comprises the following steps:
selecting any point as a parameter control point on a straight line where a line segment connected with the center point and any vertex of the filled cell is positioned, or,
respectively selecting points with the same distance from any end point of the line segment as parameter control points on a straight line where the line segment with the central point connected with each vertex of the filled cell is located; or,
and respectively selecting points with the same distance from any end point of the line segment as parameter control points on the straight line of the line segment connected with every two adjacent vertexes of the filled cell.
It should be noted that, in this embodiment, one of the two end points of the line segment may be set as a starting point and the other end point as an end point according to actual situations. The obtained plurality of parameter control points are moved simultaneously by the same offset amount. When the parameter control point moves by taking the straight line as the motion track, different offsets can be correspondingly generated, including: taking the length of the line segment where the parameter control point is located when the parameter control point is selected as 1 unit length, and mapping the offset to a [0,1] interval when the parameter control point moves between the line segments; when the parameter control point moves on the extension line of the starting point of the line segment, the offset is mapped to a [ negative value threshold, 0] interval; when the parameter control point moves on the extension line of the line segment end point, the offset is mapped to the [1, over threshold ] interval.
Preferably, the negative threshold is set to-1 and the excess threshold is set to 2.
The cell texture type is a texture pattern formed by combining 1 or more parametric control points, vertices, and boundary midpoints of filled cells as a point set, selecting points from the point set according to a plurality of combination rules, and generating a straight line or a curve. Different texture patterns are generated by different selection modes of the parameter control points, selection modes of points in the point set and connection modes of lines between the points, that is, different texture patterns are formed by the different combination rules, and the texture patterns obtained by combining the modes are all of the cell texture types in the embodiment, which is not limited herein.
It is noted that once a certain combination rule is determined, the points selected from each cell are connected according to the same combination rule, and combined to form the texture.
In the following, representative combinations will be selected and described in detail.
1) Type 1: and selecting 1 parameter control point and 1 or more vertexes from the unit grids, and combining to form a cell texture graph after adopting straight line connection.
Specifically, on a straight line where a line segment connecting the center point and any vertex of the filled cells is located, any point is selected as a parameter control point to obtain 1 parameter control point, and the parameter control point and the vertices of the cells are connected through the straight line, so that the cell texture graph is obtained without being limited to all vertices or part of the vertices.
For example, in fig. 5 (a), on the line segment L, the central point is taken as the starting point, 1 parameter control point is selected at a position relative to the central point of 0.2, and 4 line segments are sequentially formed according to the combination rule that the 1 parameter control point is linearly connected with each vertex, and a cell texture is obtained by combination. Once the parametric control point moves along the straight line of the line segment, the cell texture changes, and the offsets of the parametric control point are-0.2, 0.5, 1.0 and 1.2, respectively, as shown in fig. 5 (b). When the shapes of the cells are different, the texture pattern generated in the same manner automatically generates an adaptive change, and the texture of the cell generated after the triangular cells and the hexagonal cells are filled with the texture is shown in fig. 5 (c).
Note that the shift parameter, the negative value parameter, and the over-value parameter in fig. 5 (b) all belong to the offset amount.
2) Type 2: and selecting any 2 boundary middle points and any parameter control point from the unit cells, connecting the boundary middle points and any parameter control point by adopting a straight line or a curve, and combining to form a cell texture graph.
Specifically, on a straight line where a line segment with a central point connected with each vertex of the filled cells is located, points with the same distance from any endpoint of the line segment are selected as parameter control points respectively to obtain a plurality of parameter control points, the midpoints of each boundary of the cells are selected and connected in any one of the following modes to form a cell texture graph in a combined mode:
passing through each point by any 2 boundary midpoints and any parameter control point according to the sequence of the first boundary midpoint, the parameter control point and the second boundary midpoint to form a multi-section straight line or an interpolation point curve;
and (3) passing through the first boundary midpoint and the second boundary midpoint according to the sequence of the first boundary midpoint, the parameter control point and the second boundary midpoint by using any 2 boundary midpoints and any parameter control point to form a control point curve.
Exemplarily, in fig. 6 (a), on a line L1-L4, the central point is taken as a starting point, and 1 parameter control point is selected at a position corresponding to the central point 0.2, respectively, to obtain four parameter control points A1-A4, and points M1-M4 in each boundary. Determining the parameter control points on the line segment where the midpoints of the adjacent boundaries and the vertexes of the adjacent boundaries are located, and forming a combination rule of control point curves, then all the points generate respective control point curves according to the rule, in fig. 6 (a), M1, A1, and M2 form control point curves M1M2, A2, and M3 form control point curves M2M3, A3, and M4 form control point curves M3M4, A4, and M1 form control point curves M4M1, and finally, combining 4 curves to obtain a cell texture. In fig. 6 (b), different textures generated by moving the parameter control points on the respective motion tracks are shown, and the offsets of the parameter control points are-0.2, 0.5, 1.0 and 1.2, respectively. The cell texture generated after the triangular and hexagonal cells fill the texture is shown in fig. 6 (c).
3) Type 3: and selecting any 2 vertexes and any parameter control point from the unit grids, and combining to form a cell texture graph after adopting straight line or curve connection.
Specifically, on a straight line where a line segment with a central point connected with each vertex of the filled cells is located, points with the same distance from any endpoint of the line segment are selected as parameter control points respectively to obtain a plurality of parameter control points, each vertex of the cells is selected and connected in any one of the following modes to form a cell texture graph in a combined mode:
any 2 vertexes and any parameter control point pass through each point according to the sequence of the first vertex, the parameter control point and the second vertex to form a multi-section straight line or an interpolation point curve;
and the random 2 vertexes and any parameter control point pass through the first vertex and the second vertex according to the sequence of the first vertex, the parameter control point and the second vertex to form a control point curve.
Exemplarily, in fig. 7 (a), on the line segments L1 to L4, the central point is taken as the starting point, and 1 parameter control point is selected at the position corresponding to the central point 0.2, respectively, to obtain four parameter control points A1 to A4, and each boundary vertex V1 to V4. And forming a combination rule of control point curves according to 2 vertexes of each boundary and the parameter control point on the line segment where any vertex of the boundary is located, and forming V1V2, V2V3, V3V4 and V4V1 curves to obtain a cell texture. In fig. 7 (b), different textures generated by moving the parameter control points on the respective motion tracks are shown, and the offsets of the parameter control points are-0.2, 0.0, 1.0 and 1.2, respectively. The cell texture generated after the triangular and hexagonal cells fill the texture is shown in fig. 7 (c).
4) Type 4: and selecting any vertex, the middle point of the boundary and the parameter control point of the cell, and combining to form a texture graph of the cell after adopting straight lines or curves for connection.
Specifically, on a straight line where a line segment with a central point connected with each vertex of the filled cell is located, points with the same distance from any endpoint of the line segment are selected as parameter control points respectively to obtain a plurality of parameter control points, each vertex of the cell and the midpoint of each boundary are selected and connected in any one of the following modes to form a cell texture graph in a combined mode:
any vertex, the boundary midpoint and the parameter control point penetrate through each point according to the sequence of the boundary midpoint, the parameter control point and the vertex to form a multi-section straight line or an interpolation point curve;
and any vertex, the boundary midpoint and the parameter control point pass through the boundary midpoint and the vertex according to the sequence of the boundary midpoint, the parameter control point and the vertex to form a control point curve.
Exemplarily, in fig. 8 (a), on the line segments L1 to L4, the central point is taken as the starting point, and 1 parameter control point is selected at the position corresponding to the central point 0.2, respectively, to obtain four parameter control points A1 to A4, each boundary vertex V1 to V4, and each boundary midpoint M1 to M4. And forming a combination rule of control point curves according to the selection of 1 vertex and 1 midpoint of each boundary and the parameter control point on the line segment where the vertex is located, moving the parameter control point to 0.5, generating respective control point curves, and combining to obtain the cell texture. In fig. 8 (b), different textures generated by moving the parameter control points on the respective motion tracks are shown, and the offsets of the parameter control points are-0.2, 0.0, 1.0 and 1.2, respectively. The cell texture generated after the triangular and hexagonal cells fill the texture is shown in fig. 8 (c).
5) Type 5: and selecting any 2 parameter control points from the cells, and combining to form a cell texture graph after adopting straight line connection.
Specifically, on a straight line where a line segment with a central point connected with each vertex of the filled cell is located, points with the same distance from any endpoint of the line segment are selected as parameter control points, a plurality of parameter control points are obtained, any 2 parameter control points are connected in a straight line, and a cell texture graph is obtained through combination.
Exemplarily, in fig. 9 (a), on the line segments L1 to L4, the central point is taken as the starting point, and 1 parameter control point is selected at the position corresponding to the central point 0.2, respectively, to obtain four parameter control points A1 to A4, and each boundary vertex V1 to V4. And sequentially forming line segments according to a combination rule of selecting the straight line connection of the adjacent 2 parameter control points, and combining to obtain the cell texture. In fig. 9 (b), different textures generated by moving the parameter control points on the respective motion tracks are shown, and the offsets of the parameter control points are-0.2, 0.5, 1.0 and 1.2, respectively. The resulting cell texture after the triangular and hexagonal cells have been filled with the texture is shown in fig. 9 (c).
6) Type 6: and 2 adjacent parameter control points are selected from the unit cells and are linearly connected, and after each parameter control point is linearly connected with a vertex on the same straight line, the parameter control points are combined to form a cell texture graph.
Specifically, on a straight line where a line segment with a central point connected with each vertex of the filled cell is located, points with the same distance from any endpoint of the line segment are selected as parameter control points respectively to obtain a plurality of parameter control points, every two adjacent parameter control points are connected in a straight line, and each parameter control point is connected with the vertex on the same straight line in a straight line to obtain a cell texture graph through combination.
Exemplarily, in fig. 10 (a), on the line segments L1 to L4, the central point is taken as the starting point, and 1 parameter control point is selected at the position corresponding to the central point 0.2, respectively, to obtain four parameter control points A1 to A4, and each boundary vertex V1 to V4. And respectively selecting 2 adjacent parameter control points to be in linear connection, and connecting each parameter control point with the vertex of the same straight line to obtain a cell texture by combination. In fig. 10 (b), different textures generated by moving the parameter control points on the respective motion tracks are shown, and the offsets of the parameter control points are-0.2, 0.0, 1.0 and 1.2, respectively. The resulting cell texture after the triangular and hexagonal cells have been filled with the texture is shown in fig. 10 (c).
7) Type 7: and selecting parameter control points and vertexes on every 2 non-adjacent boundaries from the unit cells, and combining to form a cell texture graph after straight line connection.
Specifically, on a straight line where a line segment connected with every two adjacent vertexes of the filled cell is located, points with the same distance from any end point of the line segment are respectively selected as parameter control points to obtain a plurality of parameter control points, and the parameter control points on every 2 non-adjacent boundaries are sequentially connected with the vertexes to be combined to obtain the cell texture graph.
Exemplarily, in fig. 11 (a), on the boundary line segment L1-L4, 1 parameter control point is selected for each boundary vertex V1-V4 at the same position relative to each vertex, respectively, to obtain four parameter control points P1-P4. Respectively selecting 2 non-adjacent boundaries, linearly connecting the vertex and the parameter control point of the current boundary, the parameter control point and the vertex of the non-adjacent boundary in sequence, moving the parameter control point to 0.2, and combining to obtain a cell texture. In fig. 11 (b), different textures generated by moving the parameter control points on the respective motion tracks are shown, and the offsets of the parameter control points are-0.2, 0.0, 1.0 and 1.2, respectively. The cell texture generated after the hexagonal cells fill the texture is shown in fig. 11 (c).
Compared with the prior art, the embodiment supports filling different types of cell textures in the unit cells with various shapes, realizes diversified combination of the unit cells and the cell textures, and meets different customization requirements of users.
S14: in the initial texture graph, the offset of the parameter control points is controlled, so that the parameter control points move on the motion track according to the corresponding offset, and a texture design graph of the model is generated.
It should be noted that, this embodiment provides various ways to implement the offset of the control point of the control parameter, including:
(1) setting the offset of any parameter control point in each cell; and/or the presence of a gas in the gas,
(2) selecting any point on the initial texture graph as a guide point, and calculating the offset of each parameter control point according to the spatial distance from the guide point to the center point of each unit; and/or the presence of a gas in the gas,
it should be noted that any point on, inside or outside the contour line of the initial texture map may be selected as a guide point, the selected guide point and the center point of each cell are all regarded as a spatial point, and respective (x, y, z) coordinates are obtained according to the defined coordinate system position, and the spatial distance is calculated.
Taking the farthest spatial distance and the nearest spatial distance in the spatial distances as value domain boundaries, and mapping each spatial distance to a [0,1] interval after normalization processing; and respectively taking each spatial distance after normalization processing as the offset of each parameter control point of the corresponding cell.
In fig. 12, taking a two-dimensional regular-shaped model as an example, the cell texture type 1 generated in the above-mentioned manner 1) is filled in 12 cells to generate an initial texture pattern, one guide point a is selected on the boundary, the distance value from the center point of each cell to the guide point a is calculated, and normalization processing is performed. As can be seen from the figure, the distance from the point 0 to the guidance point a is farthest and is mapped to 1, the parameter control point of the cell where the point 0 is located is moved to the end point of the line segment, the distance from the point 10 to the guidance point a is closest and is mapped to 0, and the parameter control point of the cell where the point 10 is located is moved to the start point of the line segment, that is, the parameter control point coincides with the center point. And other points are moved according to the offset after the normalization processing.
(3) Based on the selected horizontal or vertical direction of change, the parameter control point offset of each cell in the direction of change is made to vary functionally.
The horizontal direction is the x direction, and the vertical direction is the y direction. Functionally varying the parametric control point offsets for each cell, comprising:
acquiring an x coordinate value or a y coordinate value of a center point of each unit according to the selected horizontal or vertical change direction;
the coordinate value of each cell in the change direction is used as an independent variable and substituted into a function together with the set offset position, a function value corresponding to each cell is obtained through calculation, and after normalization processing, the function value is mapped to a [0,1] interval;
and taking the function value after the normalization processing as the offset of each parameter control point of the corresponding cell.
Specifically, when the horizontal change direction is selected, the x coordinate value of the center point of each unit is used as an independent variable in the function, and each independent variable and the set offset position are substituted into the function to obtain a corresponding function value for controlling the offset of the parameter control point. And conversely, the y coordinate value of the center point of each unit cell is used as an independent variable in the function.
It should be noted that the function type is determined according to actual requirements, and the function may be a polynomial function, a trigonometric function, an exponential function, a logarithmic function, and the like.
By a sine trigonometric function
Figure BDA0003671791300000171
For example, A is the amplitude, k is the offset, ω is the angular velocity,
Figure BDA0003671791300000172
is used as an initial phase of the reaction,
Figure BDA0003671791300000173
is the phase. The set offset position corresponds to an initial phase value in the trigonometric function, and a changed phase value can be obtained by combining coordinate values of the change method of the cells, so that the phase of the texture graph is moved. In FIG. 13, A, k is 1 and ω is 2 π in the initialized sine trigonometric function, showing the exemplary effect of shifting the texture pattern by 180, 90, and 0 along the horizontal (x) and vertical (y) directions, respectively.
The three modes can be selected and combined and adjusted at will, and an efficient and low-cost implementation mode is provided for large-scale texture customization services.
Compared with the prior art, the automatic texture generation method provided by the embodiment is directly based on the product appearance, is not limited by the texture style, automatically changes the texture graph by controlling the offset of the parameter control points, improves the design efficiency of the texture, and realizes the automation and customization of the texture generation; different types of cell textures are filled in the unit grids in various shapes, so that diversified combination of the unit grids and the cell textures is realized, continuity of the textures is always ensured, and the visual effect is optimized; the offset of each cell element grid parameter control point can be independently adjusted, and the texture graph can be quickly and integrally adjusted through the change of the positions of the guide point and the initial phase, so that an efficient and low-cost implementation mode is provided for large-scale texture customization services.
Example 2
The other embodiment of the invention discloses an automatic texture generation system, thereby realizing the automatic texture generation method in the embodiment 1. The concrete implementation of each module refers to the corresponding description in embodiment 1. The system comprises:
the model acquisition module is used for acquiring a model to be subjected to texture design;
the unit grid generating module is used for generating grids based on a plurality of unit grids on the model according to the selected unit grid shape and side length;
the texture generation module is used for filling corresponding cell texture in each unit cell according to the selected cell texture type to generate an initial texture graph; each cell comprises 1 central point and 1 or more parameter control points; the parameter control point is positioned on a straight line determined by the central point and the vertex of the cell or a straight line determined by the adjacent vertex of the cell, and the straight line is used as a motion track to move;
and the texture change module is used for enabling the parameter control points to move on the motion track according to the corresponding offset by controlling the offset of the parameter control points based on the initial texture graph so as to generate a texture design graph of the model.
Preferably, a design drawing derivation module is further included for deriving a finished texture design drawing.
Taking a sole model as an example, the system is utilized to carry out texture design, the key design process of sole texture is shown in fig. 14, and finally, the obtained texture design drawing can be exported and input into rear-end 3D printing equipment to manufacture a sole with texture, and the sole with texture can also be manufactured by using a traditional processing mode.
Since the relevant parts of the texture automatic generation system and the texture automatic generation method in the present embodiment can be referred to each other, they are described repeatedly herein, and thus are not described herein again. Since the principle of the embodiment of the system is the same as that of the embodiment of the method, the system also has the corresponding technical effect of the embodiment of the method.
Example 3
In another embodiment of the present invention, an apparatus for automatically generating a texture is disclosed, the apparatus comprising:
a memory for storing a computer program;
a processor for implementing the steps of the automatic texture generation method of embodiment 1 when executing the computer program.
Example 4
In another embodiment of the present invention, a readable storage medium for storing a computer program which, when executed by a processor, implements the steps of the automatic texture generation method of embodiment 1 is disclosed.
Example 5
The invention further discloses a cloud platform for automatically generating textures, wherein the cloud platform is embedded with the automatic texture generation system in the embodiment 2 and provides automatic texture generation service for customers.
Specifically, the cloud platform of the embodiment includes a client and a management end, the texture automatic generation system is embedded in the client, and the management end is used for a manager to implement background management on the cloud platform.
The client comprises a texture design unit and a data storage unit; the texture design unit comprises a texture design module and a customization management module; the texture design module is realized by the texture automatic generation system in the embodiment 2, and provides texture design service for users; the customization management module provides texture customization management service for users, and the users can input client information, customization requirements, customization types, upload models to be textured and the like in the customization management module.
After the user logs in successfully, the user can enter the client, the customized sheet information is generated based on the customized management module, the subsequent design tasks are all based on the customized sheet, and all task data are associated with the customized sheet. The design task is completed in a texture design module, and finally, a texture graph meeting the customization list is designed.
The data storage module is used for storing a model to be textured, cell parameters, texture type parameters, parameter control point offset, initial phase position parameters, custom single data and the like.
The management end comprises application management, customer management, user management, texture type management, design parameter management and the like, and is used for realizing the back-end management of the cloud platform by management personnel.
The cloud platform embodiment can realize the method embodiment, so the cloud platform also has the corresponding technical effect of the method embodiment. Meanwhile, the texture automatic generation system is embedded in the cloud platform embodiment, so that the texture automatic generation service can be provided for a user, the user can obtain the service only by logging in the cloud platform, and the requirement of the user for customizing the texture of a product is met; directly generate the texture based on the product model, be convenient for directly input the model of deriving into rear end 3D printing apparatus, print the product that makes to have the texture through 3D.
Those skilled in the art will appreciate that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program, which is stored in a computer readable storage medium, to instruct related hardware. The computer readable storage medium is a magnetic disk, an optical disk, a read-only memory or a random access memory, etc.
While the invention has been described with reference to specific preferred embodiments, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the following claims.

Claims (14)

1. An automatic texture generation method is characterized by comprising the following steps:
obtaining a model to be subjected to texture design;
generating a grid based on a plurality of cells on the model according to the selected cell shape and side length;
filling corresponding cell texture in each unit cell according to the selected cell texture type to generate an initial texture graph; each unit cell comprises 1 central point and 1 or more parameter control points; the parameter control point is positioned on a straight line determined by the central point and the top point of the cell or a straight line determined by the adjacent top points of the cell, and the straight line is used as a motion track to move;
and in the initial texture graph, controlling the offset of the parameter control points to enable the parameter control points to move on a motion track according to the corresponding offset, and generating a texture design graph of the model.
2. The method of claim 1, wherein the cell texture type is a texture pattern formed by combining 1 or more parametric control points, vertices, and boundary midpoints of the filled cells as a point set, and selecting points from the point set according to a plurality of combination rules to generate a straight line or a curved line.
3. The method of claim 1 or 2, wherein the method further comprises: when the selected cell shape is a quadrangle, splitting each cell into a plurality of sub-cells according to the sub-cell type, and then respectively using each sub-cell as one cell in the grid;
the sub-cell type includes: mirror, triangular and hybrid.
4. The method according to claim 3, wherein the splitting each cell into a plurality of sub-cells according to a sub-cell type when the selected cell shape is a quadrangle comprises:
when the sub-cell type is a mirror image type, acquiring vertexes, central points and middle points of all boundaries of the quadrangle, connecting lines according to a mirror image relationship by taking the middle points of every two adjacent boundaries, the intersected vertexes of the two adjacent boundaries and the central point as 4 vertexes of a first sub-cell to form 4 mirror image sub-cells;
when the sub-cell type is a triangle, acquiring any two adjacent vertexes in the quadrangle and the middle points on the sides opposite to the sides where the two adjacent vertexes are located, and respectively connecting the middle points with the two vertexes to form 3 triangular sub-cells;
and when the sub-cell types are mixed, acquiring vertexes of the quadrangle and midpoints of the boundaries, taking the midpoints of every two adjacent boundaries and the vertex where the two adjacent boundaries intersect as 3 vertexes of a third sub-cell, taking the midpoints of the boundaries as 4 vertexes of a fourth sub-cell, and connecting lines to form 4 triangular sub-cells and 1 quadrangular sub-cell.
5. The method of claim 1 or 2, wherein the parameter control point is located on a straight line defined by a central point and a cell vertex or a straight line defined by adjacent cell vertices, and the method comprises:
selecting any point as a parameter control point on a straight line where a line segment connected with the center point and any vertex of the filled cell is positioned, or,
respectively selecting points with the same distance from any end point of the line segment as parameter control points on a straight line where the line segment with the central point connected with each vertex of the filled cell is located; or,
and respectively selecting points with the same distance from any end point of the line segment as parameter control points on the straight line of the line segment connected with every two adjacent vertexes of the filled cell.
6. The method of claim 5, wherein the moving with the straight line as a motion trajectory comprises: taking the length of the line segment where the parameter control point is located when the parameter control point is selected as 1 unit length, and mapping the offset to a [0,1] interval when the parameter control point moves between the line segments; when the parameter control point moves on the extension line of the starting point of the line segment, the offset is mapped to a [ negative value threshold, 0] interval; when the parameter control point moves on the extension line of the line segment end point, the offset is mapped to the [1, over threshold ] interval.
7. The method according to claim 1 or 2, wherein the controlling the offset of the parameter control point comprises:
setting the offset of any parameter control point in each cell; and/or the presence of a gas in the gas,
selecting any point on the initial texture graph as a guide point, and calculating the offset of each parameter control point according to the spatial distance from the guide point to the center point of each unit; and/or the presence of a gas in the atmosphere,
based on the selected horizontal or vertical direction of change, the parameter control point offset of each cell in the direction of change is made to vary as a function.
8. The method of claim 7, wherein the calculating the offset of each parameter control point according to the spatial distance from the guide point to the center point of each unit comprises:
taking the farthest spatial distance and the nearest spatial distance in the spatial distances as value domain boundaries, and mapping each spatial distance to a [0,1] interval after normalization processing;
and respectively taking each spatial distance after the normalization processing as the offset of each parameter control point of the corresponding cell.
9. The method according to claim 7, wherein the causing the parameter control point offset of each cell in the variation direction to vary as a function comprises:
acquiring an x coordinate value or a y coordinate value of a center point of each unit according to the horizontal or vertical change direction;
the coordinate value of each cell in the change direction is used as an independent variable, the independent variable and the set offset position are substituted into a function, a function value corresponding to each cell is obtained through calculation, and after normalization processing, the function value is mapped to a [0,1] interval;
and taking the function value after the normalization processing as the offset of each parameter control point of the corresponding cell.
10. An automatic texture generation system, the system comprising:
the model acquisition module is used for acquiring a model to be subjected to texture design;
the unit grid generating module is used for generating grids based on a plurality of unit grids on the model according to the selected unit grid shape and side length;
the texture generation module is used for filling corresponding cell texture in each unit cell according to the selected cell texture type to generate an initial texture graph; each unit cell comprises 1 central point and 1 or more parameter control points; the parameter control point is positioned on a straight line determined by the central point and the vertex of the cell or a straight line determined by the adjacent vertex of the cell, and the straight line is used as a motion track to move;
and the texture change module is used for controlling the offset of the parameter control points based on the initial texture graph to enable the parameter control points to move on a motion track according to the corresponding offset so as to generate a texture design graph of the model.
11. An apparatus for automatic texture generation, the apparatus comprising:
a memory for storing a computer program;
processor for implementing the steps of the automatic texture generation method according to any one of claims 1 to 9 when executing a computer program.
12. A readable storage medium, characterized in that the storage medium is used for storing a computer program which, when being executed by a processor, carries out the steps of the automatic texture generation method according to any one of claims 1 to 9.
13. A texture auto-generation cloud platform, characterized in that the cloud platform is embedded with the texture auto-generation system as claimed in claim 10, and provides a texture auto-generation service for customers.
14. The cloud platform of claim 13, wherein the cloud platform comprises a client and a management end, the texture automatic generation system is embedded in the client, and the management end is used for a manager to implement background management on the cloud platform.
CN202210607123.6A 2022-05-31 2022-05-31 Automatic texture generation method, system, equipment, storage medium and cloud platform Pending CN115205408A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210607123.6A CN115205408A (en) 2022-05-31 2022-05-31 Automatic texture generation method, system, equipment, storage medium and cloud platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210607123.6A CN115205408A (en) 2022-05-31 2022-05-31 Automatic texture generation method, system, equipment, storage medium and cloud platform

Publications (1)

Publication Number Publication Date
CN115205408A true CN115205408A (en) 2022-10-18

Family

ID=83577120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210607123.6A Pending CN115205408A (en) 2022-05-31 2022-05-31 Automatic texture generation method, system, equipment, storage medium and cloud platform

Country Status (1)

Country Link
CN (1) CN115205408A (en)

Similar Documents

Publication Publication Date Title
CN109377561A (en) A kind of digital-to-analogue surface mesh generation method based on conformal geometry
CN102314711B (en) Three-dimensional visualization method and device for mineral resource evaluation information
CN105336003B (en) The method for drawing out three-dimensional terrain model with reference to the real-time smoothness of GPU technologies
Kobbelt et al. A shrink wrapping approach to remeshing polygonal surfaces
JP4467267B2 (en) Image processing method, image processing apparatus, and image processing system
CN109523631B (en) Contour line generation method and device based on B spline fitting
WO2022121525A1 (en) Method and device for rendering three-dimensional scene data, storage medium, and electronic device
US5774124A (en) Finite element modeling method and computer system for converting a triangular mesh surface to a quadrilateral mesh surface
CN103559374B (en) A kind of method carrying out face disintegrated type surface subdivision on plurality of subnets lattice model
CN101609564B (en) Method for manufacturing three-dimensional grid model by draft input
CN101110126A (en) Method for re-establishing three-dimensional model gridding
CN102306396A (en) Three-dimensional entity model surface finite element mesh automatic generation method
CN105654552B (en) A kind of quick Delaunay network construction methods towards Arbitrary distribution large-scale point cloud data
CN109636889B (en) Large-scale three-dimensional terrain model rendering method based on dynamic sewing belt
CN102509339A (en) Method for simplifying vertex clustering of three-dimensional models with texture constraint
CN102831648A (en) Fixed node discharge curve approximation and curved surface mesh generation optimizing technology
CN110378992A (en) Towards large scene model web terminal dynamic rendering LOD processing method
CN113468286A (en) Three-dimensional pyramid construction method based on triangular patch number division
CN117036567A (en) Three-dimensional scene model rendering method
CN118262580A (en) Airspace pre-conflict resolution method and system based on subdivision grid model
CN114611359A (en) Grid-parameter hybrid model modeling method and system
CN103679814A (en) Processing method and device for triangle mesh model
Zhou et al. Fast generation method of 3D scene in Chinese landscape painting
CN115205408A (en) Automatic texture generation method, system, equipment, storage medium and cloud platform
CN113763563B (en) Three-dimensional point cloud geometric grid structure generation method based on plane recognition

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