A texture automatic generation method, system, device, storage medium and cloud platform
By generating a grid of multiple cells and controlling the offset of control points using parameters, the problem of inflexible customization of texture design is solved, achieving automation of textures and optimization of visual effects.
Patent Information
- Application Number
- CN202210607123.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2042-05-31
AI Technical Summary
Existing texture design methods have fixed texture styles, which cannot be flexibly customized according to product needs, and the texture continuity is affected during application.
By generating a grid based on multiple cells, using parameter control points to move on a motion track, texture graphics are generated, and it supports the combination and adjustment of various cell texture types, including the splitting of mirrored, triangular and hybrid sub-cells, and controlling the offset of parameter control points to achieve the automation and customization of textures.
It automates and customizes texture design, ensures texture continuity, optimizes visual effects, and provides an efficient and low-cost texture customization solution.
Smart Images

Figure CN115205408B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of texture design, and more particularly to a method, system, device, storage medium, and cloud platform for automatic texture generation. Background Technology
[0002] With an ever-increasing variety of products available today, competition among products is becoming increasingly fierce. To avoid convergence caused by technological bottlenecks, texture design has gradually become a crucial factor in the market competition among various products.
[0003] However, traditional texture design uses pre-made patterns with fixed styles and limited variety, making it impossible to adapt and modify them to meet product needs. Furthermore, during application, textures need to be cut according to the product's shape, disrupting the continuity of the texture at the boundaries and significantly impacting the visual effect.
[0004] Therefore, existing texture design methods can no longer meet the growing demands of product design. Current technology lacks a method that automatically generates textures that fit the product's appearance and meet customized requirements. Summary of the Invention
[0005] Based on the above analysis, the embodiments of the present invention aim to provide a method, system, device, storage medium, and cloud platform for automatic texture generation, in order to solve the problem that existing texture types are limited and cannot be flexibly customized.
[0006] On one hand, embodiments of the present invention provide an automatic texture generation method, comprising the following steps:
[0007] Obtain the model to be textured;
[0008] Generate a grid based on multiple cells on the model, according to the selected cell shape and side length;
[0009] Based on the selected cell texture type, fill each cell with the corresponding cell texture to generate the initial texture graphic; each cell includes one center point and one or more parameter control points; the parameter control points are located on the straight line determined by the center point and the cell vertex, or on the straight line determined by the adjacent vertices of the cell, and move along the straight line as the motion track;
[0010] In the initial texture graphic, by controlling the offset of the parameter control points, the parameter control points move on the motion track according to the corresponding offset, thus generating the texture design map of the model.
[0011] Based on further improvements to the above method, cell texture type uses one or more parameter control points, vertices and midpoints of each boundary of the filled cell as a point set, selects points from the point set according to various combination rules, generates straight lines or curves, and combines them to form texture graphics.
[0012] Based on the further improvement of the above method, when the selected cell shape is a quadrilateral, each cell is split into a plurality of sub-cells according to the sub-cell type, and each sub-cell is taken as a cell in the grid.
[0013] The sub-cell type includes mirror type, triangle type and mixed type.
[0014] Based on the further improvement of the above method, when the selected cell shape is a quadrilateral, each cell is split into a plurality of sub-cells according to the sub-cell type, and each sub-cell is taken as a cell in the grid.
[0015] When the sub-cell type is mirror type, the vertices, the center point and the midpoints of the boundaries of the quadrilateral are obtained, and the four vertices of the first sub-cell are taken as the midpoints of each adjacent two boundaries, the vertices intersecting the adjacent two boundaries and the center point, and the four mirror sub-cells are formed by connecting in a mirror relationship.
[0016] When the sub-cell type is triangle type, any two adjacent vertices in the quadrilateral and the midpoint of the boundary opposite to the two vertices are obtained, and the three triangular sub-cells are formed by connecting the midpoint and the two vertices.
[0017] When the sub-cell type is mixed type, the vertices of the quadrilateral and the midpoints of the boundaries are obtained, the three vertices of the third sub-cell are taken as the midpoints of each adjacent two boundaries and the vertices intersecting the adjacent two boundaries, the four vertices of the fourth sub-cell are taken as the midpoints of the boundaries, and the four triangular sub-cells and one quadrilateral sub-cell are formed by connecting.
[0018] Based on the further improvement of the above method, the parameter control point is located on a straight line determined by the center point and the vertices of the cell, or the adjacent vertices of the cell, and the method comprises:
[0019] a point on a straight line where a line segment connecting the center point and any vertex of the filled cell is located is selected as the parameter control point, or
[0020] a point on a straight line where a line segment connecting the center point and each vertex of the filled cell is located is selected as the parameter control point, respectively; or
[0021] a point on a straight line where a line segment connecting each adjacent two vertices of the filled cell is located is selected as the parameter control point, respectively.
[0022] Further improvement based on the above method, taking the straight line as the movement track, including: taking the length of the line segment where the parameter control point is selected as a unit length, when the parameter control point moves between the line segments, the offset is mapped to the interval [0,1]; when the parameter control point moves on the extension line of the starting point of the line segment, the offset is mapped to the interval [negative threshold value, 0]; when the parameter control point moves on the extension line of the ending point of the line segment, the offset is mapped to the interval [1, super threshold value].
[0023] Further improvement based on the above method, controlling the offset of the parameter control point, including:
[0024] Setting the offset of any control point in each cell; and / or,
[0025] Selecting any point on the initial texture pattern 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 cell; and / or,
[0026] Based on the selected horizontal or vertical change direction, the parameter control point offset of each cell in the change direction changes as a function.
[0027] Further improvement based on the above method, calculating the offset of each parameter control point according to the spatial distance from the guide point to the center point of each cell, including:
[0028] Taking the farthest spatial distance and the nearest spatial distance in the spatial distance as the value range boundary, after normalization processing, mapping each spatial distance to the interval [0,1];
[0029] Taking each normalized spatial distance as the offset of each parameter control point of the corresponding cell.
[0030] Further improvement based on the above method, making the parameter control point offset of each cell in the change direction change as a function, including:
[0031] According to the horizontal or vertical change direction, obtaining the x-coordinate value or y-coordinate value of the center point of each cell;
[0032] Taking the coordinate value of each cell in the change direction as the independent variable, and substituting the set offset position into the function, calculating to obtain the function value corresponding to each cell, after normalization processing, mapping the function value to the interval [0,1];
[0033] Taking the normalized function value as the offset of each parameter control point of the corresponding cell.
[0034] The embodiment of the application also provides a texture automatic generation system, the system comprising:
[0035] A model acquisition module is configured to acquire a model to be designed with texture;
[0036] A unit grid generation module is configured to generate a grid based on a plurality of unit cells on the model according to a selected unit cell shape and edge length;
[0037] A texture generation module is configured to fill a corresponding cell texture in each unit cell according to a selected cell texture type to generate an initial texture pattern; each unit cell includes one center point and one or more parameter control points; the parameter control points are located on a straight line determined by the center point and a vertex of the unit cell or on a straight line determined by adjacent vertices of the unit cell and move along the straight line as a movement track;
[0038] A texture change module is configured to generate a texture design of the model by controlling an offset of the parameter control points and moving the parameter control points on the movement track according to the corresponding offset based on the initial texture pattern.
[0039] The embodiment of the present application further provides a texture automatic generation device, and the device comprises a memory configured to store a computer program;
[0040] A processor is configured to implement the steps of any one of the texture automatic generation methods when executing the computer program.
[0041] The embodiment of the present application further provides a readable storage medium configured to store a computer program, and the steps of any one of the texture automatic generation methods are implemented when the processor executes the computer program.
[0042] The embodiment of the present application further provides a texture automatic generation cloud platform, and a texture automatic generation system is embedded in the cloud platform to provide a texture automatic generation service for customers.
[0043] 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 in the client, and the management end is used for a manager to implement background management of the cloud platform.
[0044] Compared with the prior art, the present application can at least achieve one of the following beneficial effects:
[0045] 1. The texture automatic generation method and system directly based on the product appearance are not limited by the texture style, the texture pattern is automatically changed by controlling the offset of the parameter control points, the design efficiency of the texture is improved, and the automation and customization of the texture generation are realized;
[0046] 2. The texture automatic generation method and system support filling different types of cell textures in unit cells of various shapes, realize the diversified combination of the unit cells and the cell textures, always ensure the continuity of the texture, and optimize the visual effect;
[0047] 3. The texture automatic generation method and system can separately adjust the offset of the control point of each cell grid parameter, and can also make the texture pattern quickly and integrally adjust through the change of the guide point and the initial phase position, thereby providing an efficient and low-cost implementation mode for large-scale texture customization service.
[0048] 4. The texture automatic generation cloud platform has the texture automatic generation system embedded therein, can provide the texture automatic generation service for users, and enables the users to obtain the service by logging in to the cloud platform, thereby meeting the demand of the users for customizing the product texture; and the texture is directly generated based on the product model, the exported model can be directly input to the rear-end 3D printing equipment, and the product with the texture is made through 3D printing.
[0049] The technical solutions described above can be combined with each other in the present application to realize more preferred combination solutions. Other features and advantages of the present application will be described in the subsequent specification, and some advantages will become apparent from the specification, or will be understood by implementing the present application. The purposes and other advantages of the present application can be realized and obtained from the contents particularly pointed out in the specification and the drawings. BRIEF DESCRIPTION OF DRAWINGS
[0050] The accompanying drawings are included to provide a further understanding of the embodiments and no limitation on the present application is intended to be represented thereby, it being expressly understood that the drawings are for illustrative purposes and are not meant to be limiting. In the drawings:
[0051] Figure 1 The flow chart of the texture automatic generation method in the embodiment 1 of the present application is shown in the figure;
[0052] Fig. 2(a) and Fig. 2(b) are the splitting into mirror type sub-cell and texture filling schematic diagrams in the embodiment 1 of the present application;
[0053] Fig. 3(a) and Fig. 3(b) are the splitting into triangle type sub-cell and texture filling schematic diagrams in the embodiment 1 of the present application;
[0054] Fig. 4(a) and Fig. 4(b) are the splitting into mixed type sub-cell and texture filling schematic diagrams in the embodiment 1 of the present application;
[0055] Fig. 5(a), Fig. 5(b) and Fig. 5(c) are the generation and change schematic diagrams of the cell texture type 1 in the embodiment 1 of the present application;
[0056] Fig. 6(a), Fig. 6(b) and Fig. 6(c) are the generation and change schematic diagrams of the cell texture type 2 in the embodiment 1 of the present application;
[0057] Fig. 7(a), Fig. 7(b) and Fig. 7(c) are the generation and change schematic diagrams of the cell texture type 3 in the embodiment 1 of the present application;
[0058] Fig. 8(a), Fig. 8(b) and Fig. 8(c) are schematic diagrams of the generation and change of the cell texture type 4 in the embodiment 1 of the present application;
[0059] Fig. 9(a), Fig. 9(b) and Fig. 9(c) are schematic diagrams of the generation and change of the cell texture type 5 in the embodiment 1 of the present application;
[0060] Fig. 10(a), Fig. 10(b) and Fig. 10(c) are schematic diagrams of the generation and change of the cell texture type 6 in the embodiment 1 of the present application;
[0061] Fig. 11(a), Fig. 11(b) and Fig. 11(c) are schematic diagrams of the generation and change of the cell texture type 7 in the embodiment 1 of the present application;
[0062] Figure 12 Fig. 12 is a schematic diagram of the method for controlling the point offset according to the guide point control parameter in the embodiment 1 of the present application;
[0063] Figure 13 Fig. 13 is a schematic diagram of the method for making the texture pattern change as a trigonometric function in the horizontal and vertical directions in the embodiment 1 of the present application;
[0064] Figure 14 Fig. 14 is a schematic diagram of the key design process and effect of the sole texture in the embodiment 2 of the present application. DETAILED DESCRIPTION
[0065] The preferred embodiments of the present application will be described in detail below with reference to the drawings, which form a part of this application. The drawings and the associated descriptions are provided to illustrate the embodiments of the present application and to explain the principles of the present application, and are not intended to limit the scope of the present application.
[0066] Embodiment 1
[0067] In one specific embodiment of the present application, a method for automatically generating a texture is disclosed, as shown in Fig. 1, which comprises the following steps: Figure 1 As shown in Fig. 1, the method comprises the following steps:
[0068] S11: Obtain a model to be designed with a texture.
[0069] It should be noted that the present embodiment does not limit the way of obtaining the model to be designed with a texture, which can be obtained by importing or designing in the system, and the model supports two dimensions and three dimensions. Exemplarily, the model to be designed with a texture can be a model of a sole or a seat.
[0070] S12: Generate a grid based on a plurality of cells on the model according to the selected cell shape and side length.
[0071] It should be noted that, considering the irregularity of the edge of the model, the cell edge length refers to the average edge length, and preferably, the cell edge length is set to be selectable in the range of 1-50 mm. The cell shape includes triangle, quadrilateral, pentagon, hexagon and Thiessen polygon. The present embodiment does not limit the method of generating the grid, and after the grid is generated, the vertex coordinate information corresponding to each cell is obtained.
[0072] Preferably, in order to unify the filling order of the cell texture in each subsequent cell, each generated cell can be sorted according to a certain order rule and the vertex coordinate information corresponding to each cell is obtained.
[0073] Further, three sub-cell types are provided for the quadrilateral cell, i.e. a quadrilateral cell is further split into different sub-cells, thereby expanding more cell shapes.
[0074] Specifically, when the selected cell shape is a quadrilateral, after each cell is split into multiple sub-cells according to the sub-cell type, each sub-cell is taken as a cell in the grid; wherein the sub-cell type includes mirror type, triangle type and mixed type.
[0075] ①When the sub-cell type is mirror type, the vertices, center point and midpoint of each boundary of the quadrilateral are obtained, and the midpoint of each adjacent two boundaries, the vertex at which the adjacent two boundaries intersect and the center point are taken as the four vertices of the first sub-cell, and the four mirror sub-cells are formed by connecting according to the mirror relationship;
[0076] It should be noted that, according to the mirror relationship, four mirror sub-cells are formed, and the vertices of the sub-cells can be extracted according to any mirror relationship, i.e. the vertex order of each sub-cell is sorted according to any mirror relationship and connected.
[0077] Exemplarily, taking a regular quadrilateral as an example, an example process of splitting a quadrilateral into four mirror sub-cells is shown in FIG. 2(a), wherein the connected line with an arrow represents a vertex arrangement order. FIG. 2(b) shows the texture pattern obtained after filling a cell texture example pattern in four mirror sub-cells and four ordinary quadrilateral cells, respectively, and it can be clearly seen that the two texture patterns are obviously different.
[0078] ②When the sub-cell type is triangle type, any two adjacent vertices in the quadrilateral and the midpoint of the side opposite to the side on which the two adjacent vertices are located are obtained, and the midpoint is connected with the two vertices respectively to form three triangle sub-cells;
[0079] Similarly, the vertices of each triangle sub-cell obtained by splitting are extracted according to a certain rule.
[0080] Exemplarily, taking a regular quadrilateral as an example, an example process of splitting one quadrilateral into three triangular sub-cells is shown in FIG. 3(a), and a texture pattern filled in the three triangular sub-cells is shown in FIG. 3(b).
[0081] ③ When the sub-cell type is a mixed type, the vertices of the quadrilateral and the midpoints of the boundaries are obtained, the midpoints of each two adjacent boundaries and the vertices where the two adjacent boundaries intersect are taken as the three vertices of a third sub-cell, and the midpoints of the boundaries are taken as the four vertices of a fourth sub-cell, and the lines are connected to form four triangular sub-cells and one quadrilateral sub-cell.
[0082] Exemplarily, taking a regular quadrilateral as an example, an example process of splitting one quadrilateral into three triangular sub-cells is shown in FIG. 3(a), and a texture pattern filled in the three triangular sub-cells is shown in FIG. 3(b).
[0083] According to the embodiment, the sub-cells are split based on quadrilateral cells, and other polygonal cells can also be split in a similar manner.
[0084] Compared with the prior art, in the embodiment, a plurality of different types of grids are directly generated according to the model, each cell in the grid is used to fill a different type of texture, and the continuity of the texture can be ensured at all times, and the visual effect is optimized.
[0085] S13: Fill the corresponding cell texture in each cell according to the selected cell texture type, to generate an initial texture pattern; each cell includes one center point and one or more parameter control points; the parameter control points are located on a straight line determined by the center point and the vertices of the cell, or on a straight line determined by the adjacent vertices of the cell, and move along the straight line as the motion track.
[0086] It should be noted that the cell in which the corresponding cell texture is filled according to the cell texture type in the embodiment is also called a cell, and after filling, the grid structure formed by a plurality of cells forms an overall texture pattern.
[0087] The design and adjustment of the cell texture are related to the center point and the parameter control points of the filled cell. Each cell includes one center point and one or more parameter control points. The center point is calculated according to the coordinates of the vertices or the midpoints of the boundaries of the filled cell, including: the center of gravity of the filled cell, or a point corresponding to the average of the coordinates of the vertices of the cell, or a point corresponding to the average of the coordinates of the midpoints of the boundaries of the cell.
[0088] It should be noted that the center of gravity of the filled cell can be calculated according to the vertices of the cell, by splitting the cell into a plurality of sub-triangles, and by the center of gravity and area of the sub-triangles.
[0089] The parameter control point is located on a straight line determined by the center point and a vertex of the cell, or on a straight line determined by adjacent vertices of the cell, and specifically includes:
[0090] In 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 the parameter control point, or
[0091] In the straight line where the line segment connecting the center point and each vertex of the filled cell is located, respectively, a point at the same distance from either end of the line segment is selected as the parameter control point; or
[0092] In the straight line where the line segment connecting each adjacent vertex of the filled cell is located, respectively, a point at the same distance from either end of the line segment is selected as the parameter control point.
[0093] It should be noted that in this embodiment, one of the two end points of the line segment can be set as the starting point and the other as the ending point according to actual conditions. The plurality of parameter control points obtained are moved simultaneously by the same offset. When the parameter control points move along the straight line as the movement track, different offsets are generated, including: taking the length of the line segment where the parameter control point is selected as 1 unit length, when the parameter control point moves between the line segments, the offset is mapped to the interval [0, 1]; when the parameter control point moves on the extension line of the starting point of the line segment, the offset is mapped to the interval [negative threshold value, 0]; when the parameter control point moves on the extension line of the ending point of the line segment, the offset is mapped to the interval [1, super threshold value].
[0094] Preferably, the negative threshold value is set to -1 and the super threshold value is set to 2.
[0095] The cell texture type is to take one or more parameter control points, vertices and midpoint of each boundary of the filled cell as a point set, select points from the point set according to a plurality of combination rules, generate a straight line or a curve, and combine to form a texture pattern. Among them, the selection method of the parameter control point, the selection method of the point in the point set, and the connection method between the points will produce different texture patterns, that is, the above different combination rules will form different texture patterns, as long as the texture patterns obtained by combining these methods are involved. The texture pattern belongs to the cell texture type in this embodiment, which is not limited here.
[0096] It should be noted that once a certain combination rule is determined, the points selected from each cell are connected according to the same combination rule to form a texture.
[0097] Several representative combinations are selected below and described in detail.
[0098] 1) Type 1: One parameter control point and one or more vertices in a cell are selected, and a straight line is connected to form a cellular texture pattern.
[0099] Specifically, a point on the straight line of the line segment connecting the center point and any vertex of the filled cell is selected as a parameter control point to obtain one parameter control point. The parameter control point and the vertices of the cell are connected by a straight line, which is not limited to all vertices or part of the vertices, to obtain a cellular texture pattern.
[0100] Exemplarily, in FIG. 5(a), one parameter control point is selected at a position of 0.2 relative to the center point 0 on the line segment L, and four line segments are sequentially formed according to the combination rule of connecting the one parameter control point and the vertices by a straight line to obtain a cellular texture. Once the parameter control point moves along the straight line of the line segment, the cellular texture changes accordingly, as shown in FIG. 5(b), and the offset amounts of the parameter control point are -0.2, 0.5, 1.0 and 1.2, respectively. When the shape of the cell is different, the texture pattern generated in the same way automatically produces adaptive changes, and the cellular textures generated after filling the texture in a triangular cell and a hexagonal cell are shown in FIG. 5(c).
[0101] It should be noted that the moving parameters, negative parameters and overvalue parameters in FIG. 5(b) are all offset amounts.
[0102] 2) Type 2: Any two boundary midpoints and any parameter control point in a cell are selected, and a straight line or a curve is connected to form a cellular texture pattern.
[0103] Specifically, points at the same distance from either end point of the line segment on the straight line of the line segment connecting the center point and each vertex of the filled cell are selected as parameter control points to obtain multiple parameter control points. Each boundary midpoint of the cell is selected and connected by any of the following methods to form a cellular texture pattern:
[0104] Any two boundary midpoints and any parameter control point are connected in the order of the first boundary midpoint, the parameter control point and the second boundary midpoint to pass through the points to form a plurality of straight lines or an interpolation point curve.
[0105] Any two boundary midpoints and any parameter control point are connected in the order of the first boundary midpoint, the parameter control point and the second boundary midpoint to pass through the first boundary midpoint and the second boundary midpoint to form a control point curve.
[0106] Exemplarily, in FIG. 6(a), on the line segments L1-L4, 1 parameter control point is selected on each side of the center point 0.2, to obtain four parameter control points A1-A4 and the middle points M1-M4 of each boundary. The combination rule of the control point curve is determined according to the selected middle points of the adjacent boundaries and the parameter control points on the line segments intersecting the vertices of the adjacent boundaries, then all points are generated according to the rule to form the control point curve. In FIG. 6(a), M1, A1 and M2 form the control point curve M1M2, M2, A2 and M3 form the control point curve M2M3, M3, A3 and M4 form the control point curve M3M4, and M4, A4 and M1 form the control point curve M4M1. Finally, the four curves are combined to obtain a cell texture. In FIG. 6(b), different textures generated by the movement of each parameter control point on the respective motion track are shown, and the offset of the parameter control point is-0.2, 0.5, 1.0 and 1.2, respectively. In FIG. 6(c), the cell texture generated after filling the texture in the triangular and hexagonal cells is shown.
[0107] 3) Type 3: Any two vertices in the cell and any one parameter control point are connected by a straight line or a curve to form a cell texture pattern.
[0108] Specifically, on the straight line where the line segment connecting the center point and each vertex of the filled cell is located, a point with the same distance from either end of the line segment is selected as a parameter control point to obtain a plurality of parameter control points. Each vertex of the cell is connected by any one of the following methods to form a cell texture pattern:
[0109] Any two vertices and any one parameter control point are connected in the order of the first vertex, the parameter control point and the second vertex to form a plurality of straight lines or interpolation point curves.
[0110] Any two vertices and any one parameter control point are connected in the order of the first vertex, the parameter control point and the second vertex to form a control point curve.
[0111] Exemplarily, in FIG. 7(a), on the line segments L1-L4, one parameter control point is selected on the position of 0.2 relative to the center point as the starting point, to obtain four parameter control points A1-A4, and each boundary vertex V1-V4. According to the selection of two vertices of each boundary and the parameter control point on the line segment of any vertex of the boundary, the combination rule of the control point curve is formed, and the V1V2, V2V3, V3V4 and V4V1 curve combination is obtained to form a cell texture. In FIG. 7(b), different textures generated by the movement of each parameter control point on the respective motion track are shown, and the offset of the parameter control point is-0.2, 0.0, 1.0 and 1.2 respectively. In FIG. 7(c), the cell texture generated after filling the texture in the triangular and hexagonal cells is shown.
[0112] 4) Type 4: The cell selects any vertex, boundary midpoint and parameter control point, and connects them with a straight line or a curve to form a cell texture pattern.
[0113] Specifically, on the straight line where the line segment connecting the center point and each vertex of the filled cell is located, a point with the same distance from either end of the line segment is selected as a parameter control point to obtain a plurality of parameter control points. Each vertex of the cell and each boundary midpoint are connected by any of the following methods to form a cell texture pattern:
[0114] Any vertex, boundary midpoint and parameter control point pass through each point in the order of boundary midpoint, parameter control point and vertex to form a plurality of straight lines or interpolation point curves.
[0115] Any vertex, boundary midpoint and parameter control point pass through the boundary midpoint and the vertex in the order of boundary midpoint, parameter control point and vertex to form a control point curve.
[0116] Exemplarily, in FIG. 8(a), on the line segments L1-L4, one parameter control point is selected on the position of 0.2 relative to the center point as the starting point, to obtain four parameter control points A1-A4, each boundary vertex V1-V4 and each boundary midpoint M1-M4. According to the selection of one vertex and one midpoint of each boundary and the parameter control point on the line segment of the vertex, the combination rule of the control point curve is formed, the parameter control point is moved to 0.5 to generate the respective control point curve, and a cell texture is obtained by combination. In FIG. 8(b), different textures generated by the movement of each parameter control point on the respective motion track are shown, and the offset of the parameter control point is-0.2, 0.0, 1.0 and 1.2 respectively. In FIG. 8(c), the cell texture generated after filling the texture in the triangular and hexagonal cells is shown.
[0117] 5) Type 5: Select any 2 parameter control points in a unit cell, connect them with a straight line, and combine to form a unit cell texture pattern.
[0118] Specifically, on the straight line where the line segment connecting the center point and each vertex of the filled unit cell is located, a point at the same distance from either end of the line segment is selected as a parameter control point, and a plurality of parameter control points are obtained. Any 2 parameter control points are connected by a straight line, and a unit cell texture pattern is obtained by combination.
[0119] Exemplarily, in FIG. 9(a), four parameter control points A1-A4 are obtained by selecting one parameter control point on the line segment L1-L4 with respect to the position of 0.2 from the center point, and each boundary vertex V1-V4. According to the combination rule of connecting adjacent 2 parameter control points by a straight line, a unit cell texture is obtained by sequentially forming line segments. In FIG. 9(b), different textures generated by moving each parameter control point on its own track are shown, and the offset of the parameter control point is -0.2, 0.5, 1.0 and 1.2, respectively. In FIG. 9(c), the unit cell texture generated after filling the texture in the triangular unit cell and the hexagonal unit cell is shown.
[0120] 6) Type 6: Select adjacent 2 parameter control points in a unit cell, connect them by a straight line, and each parameter control point is connected by a straight line with the vertex on the same straight line to form a unit cell texture pattern.
[0121] Specifically, on the straight line where the line segment connecting the center point and each vertex of the filled unit cell is located, a point at the same distance from either end of the line segment is selected as a parameter control point, and a plurality of parameter control points are obtained. Any 2 parameter control points are connected by a straight line, and a unit cell texture pattern is obtained by combination.
[0122] Exemplarily, in FIG. 10(a), four parameter control points A1-A4 are obtained by selecting one parameter control point on the line segment L1-L4 with respect to the position of 0.2 from the center point, and each boundary vertex V1-V4. Select adjacent 2 parameter control points to connect by a straight line, and each parameter control point is connected by a straight line with the vertex on the same straight line, and a unit cell texture is obtained by combination. In FIG. 10(b), different textures generated by moving each parameter control point on its own track are shown, and the offset of the parameter control point is -0.2, 0.0, 1.0 and 1.2, respectively. In FIG. 10(c), the unit cell texture generated after filling the texture in the triangular unit cell and the hexagonal unit cell is shown.
[0123] 7) Type 7: Select parameter control points and vertices on every 2 non-adjacent boundaries in a unit cell, connect them by a straight line, and combine to form a unit cell texture pattern.
[0124] Specifically, on the straight line where each adjacent two vertexes of the filled cell are connected, a point with the same distance from either end point of the line segment is selected as a parameter control point, and a plurality of parameter control points are obtained. The parameter control points on every two non-adjacent boundaries are sequentially connected with the vertexes, and a cell texture pattern is obtained.
[0125] Exemplarily, in FIG. 11(a), on the boundary line segments L1-L4, the boundary vertexes V1-V4 are selected as four parameter control points P1-P4, respectively. Two non-adjacent boundaries are selected, and the parameter control points are sequentially connected in the order of the vertex of the current boundary, the parameter control point of the non-adjacent boundary, and the vertex of the non-adjacent boundary. The parameter control points are moved to 0.2, and a cell texture is obtained. In FIG. 11(b), different textures generated by the movement of the parameter control points on their respective motion tracks are shown. The offset of the parameter control points is-0.2, 0.0, 1.0, and 1.2, respectively. In FIG. 11(c), a cell texture generated after the six-sided cell is filled with the texture is shown.
[0126] Compared with the prior art, the embodiment supports filling different types of cell textures in cells of various shapes, realizes diversified combination of cells and cell textures, and meets different customization requirements of users.
[0127] S14: In the initial texture pattern, the offset of the parameter control point is controlled, the parameter control point is moved on the motion track according to the corresponding offset, and a texture design pattern of the model is generated.
[0128] It should be noted that the embodiment provides a plurality of ways to control the offset of the parameter control point, including:
[0129] ① setting the offset of any parameter control point in each cell; and / or,
[0130] ② selecting any point on the initial texture pattern as a guide point, calculating the offset of each parameter control point according to the spatial distance from the guide point to the center point of each cell; and / or,
[0131] It should be noted that any point on the contour line, inside or outside the initial texture pattern can be selected as a guide point. The selected guide point and the center point of each cell are regarded as a space point. According to the position of the defined coordinate system, the (x, y, z) coordinates of each space point are obtained, and the spatial distance is calculated.
[0132] The farthest spatial distance and the nearest spatial distance in the spatial distance are taken as the value range boundary. After normalization processing, each spatial distance is mapped to the interval [0, 1]. The normalized spatial distance is taken as the offset of each parameter control point of the corresponding cell.
[0133] In Figure 12 the first mode, a two-dimensional regular shape model is taken as an example, the initial texture pattern is generated by filling the cell texture type 1 in 12 cells according to the above-mentioned first mode, a 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 normalized. As can be seen from the figure, the distance from point 0 to the guide point A is the farthest, which is mapped to 1, and the parameter control point of the cell where point 0 is located is moved to the end point of the line segment. The distance from point 10 to the guide point A is the closest, which is mapped to 0, and the parameter control point of the cell where point 10 is located is moved to the starting point of the line segment, i.e. the parameter control point coincides with the center point. Other points are moved according to the offset after normalization.
[0134] ③Based on the selected horizontal or vertical change direction, the parameter control point offset of each cell in the change direction is changed as a function.
[0135] It should be noted that the horizontal direction is the x direction and the vertical direction is the y direction. The parameter control point offset of each cell is changed as a function, including:
[0136] According to the selected horizontal or vertical change direction, the x coordinate value or y coordinate value of the center point of each cell is obtained;
[0137] The coordinate value of each cell in the change direction is taken as the independent variable, and the set offset position is substituted into the function to calculate the corresponding function value of each cell. After normalization, the function value is mapped to the interval [0, 1];
[0138] The normalized function value is taken as the offset of each parameter control point of the corresponding cell.
[0139] Specifically, when the horizontal change direction is selected, the x coordinate value of the center point of each cell is taken as the independent variable in the function, and each independent variable is substituted into the function with the set offset position to obtain the corresponding function value for controlling the offset of the parameter control point. Conversely, the y coordinate value of the center point of each cell is taken as the independent variable in the function.
[0140] It should be noted that the function type is determined according to actual needs. For example, the function can be a polynomial function, a trigonometric function, an exponential function, and a logarithmic function, etc.
[0141] Taking a sine trigonometric function as an example, A is the amplitude, k is the offset, ω is the angular velocity, is the initial phase, The phase is set. The offset position corresponds to the initial phase value in the trigonometric function, and the changed phase value can be obtained by combining the coordinate value of the change method of the unit cell, so as to move the phase of the texture pattern. Figure 13 In the embodiment, A and k in the sine trigonometric function are initialized as 1, and ω is 2π, and an example effect of shifting the texture pattern by 180°, 90° and 0° along the horizontal (x) direction and the vertical (y) direction respectively is shown.
[0142] The above three modes can be randomly selected and combined to adjust, thereby providing an efficient and low-cost implementation mode for large-scale texture customization services.
[0143] Compared with the prior art, the texture automatic generation method provided by the embodiment is directly based on the product appearance, is not limited by the texture style, automatically changes the texture pattern by controlling the offset amount of the parameter control point, improves the design efficiency of the texture, and realizes the automation and customization of the texture generation; supports filling different types of cell texture in a unit cell of a plurality of shapes, realizes the diversified combination of the unit cell and the cell texture, always ensures the continuity of the texture, and optimizes the visual effect; the offset amount of each cell grid parameter control point can be adjusted alone, or the texture pattern can be quickly and integrally adjusted by changing the guide point and the initial phase position, thereby providing an efficient and low-cost implementation mode for large-scale texture customization services.
[0144] Embodiment 2
[0145] Another embodiment of the application discloses a texture automatic generation system, so as to realize the texture automatic generation method in the embodiment 1. The specific implementation of each module is referred to the corresponding description in the embodiment 1. The system comprises:
[0146] A model acquisition module is configured to acquire a model to be designed with a texture;
[0147] A unit grid generation module is configured to generate a grid based on a plurality of unit cells on the model according to a selected unit cell shape and a side length;
[0148] A texture generation module is configured to fill a corresponding cell texture in each unit cell according to a selected cell texture type, and generate an initial texture pattern; each unit cell comprises one center point and one or more parameter control points; the parameter control point is located on a straight line determined by the center point and a vertex of the unit cell, or on a straight line determined by adjacent vertices of the unit cell, and moves along the straight line as a motion track;
[0149] A texture change module is configured to change the texture of the model by controlling the offset amount of the parameter control point, and moving the parameter control point on the motion track according to the corresponding offset amount based on the initial texture pattern, to generate a texture design pattern of the model.
[0150] Preferably, a design drawing derivation module is further included for deriving the completed texture design drawing.
[0151] Taking a sole model as an example, the texture design is performed by using the system, Figure 14 The key design process of the sole texture is shown in the system, and finally the texture design drawing can be derived and input to a rear-end 3D printing device to manufacture a sole with texture. Of course, the sole can also be manufactured by using a traditional processing method.
[0152] Since the texture automatic generation system in the embodiment is related to the texture automatic generation method described above, the two can be used as reference to each other, and thus repeated description is not given here. Since the system embodiment has the same principle as the method embodiment described above, the system also has the corresponding technical effects of the method embodiment.
[0153] Embodiment 3
[0154] Another embodiment of the application discloses a texture automatic generation device, which comprises:
[0155] a memory for storing a computer program;
[0156] a processor for implementing the steps of the texture automatic generation method of embodiment 1 when the computer program is executed.
[0157] Embodiment 4
[0158] Another embodiment of the application discloses a readable storage medium for storing a computer program, and when a processor executes the computer program, the steps of the texture automatic generation method of embodiment 1 are implemented.
[0159] Embodiment 5
[0160] Another embodiment of the application discloses a texture automatic generation cloud platform, and the cloud platform is embedded with the texture automatic generation system of embodiment 2 to provide texture automatic generation services for customers.
[0161] Specifically, the cloud platform of the embodiment 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 of the cloud platform.
[0162] 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 implemented by the texture automatic generation system of embodiment 2 to provide texture design services for users; and the customization management module provides texture customization management services for users, and users can input customer information, customization requirements, customization types, upload a model to be designed with texture, etc. in the customization management module.
[0163] After the user logs in successfully, the user can enter the client, generate customization order information based on the customization management module, and subsequent design tasks are based on the customization order. All task data is associated with the customization order. The design task is completed in the texture design module, and finally the texture pattern meeting the customization order is designed.
[0164] The data storage module is used to store the model to be textured, cell parameters, texture type parameters, parameter control point offset, initial phase position parameters, customization order data, etc.
[0165] The management end includes application management, customer management, user management, texture type management, design parameter management, etc., and is used for management personnel to realize the back-end management of the cloud platform.
[0166] The cloud platform embodiment can implement the above-mentioned method embodiments, so the cloud platform also has the corresponding technical effects of the above-mentioned method embodiments. At the same time, the cloud platform embodiment internally embeds the texture automatic generation system, can provide the texture automatic generation service for the user, the user only needs to log in to the cloud platform, can obtain the service, meets the user customization product texture demand; based on the product model directly generates the texture, is convenient for directly inputting the exported model to the back-end 3D printing equipment, and making the product with the texture through the 3D printing.
[0167] Those skilled in the art can understand that all or part of the processes of the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the program can be stored in a computer readable storage medium. The computer readable storage medium is a disk, an optical disk, a read-only memory or a random access memory, etc.
[0168] The above is only a preferred specific embodiment of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.
Claims
1. A method for automatically generating a texture, characterized by, The method comprises the following steps: acquiring a model to be designed with texture; generating a grid based on a plurality of cells on the model according to a selected cell shape and side length; filling a corresponding cell texture in each cell according to a selected cell texture type to generate an initial texture pattern; each cell comprises one center point and one or more parameter control points; the parameter control points are located on a straight line determined by the center point and a vertex of the cell, or on a straight line determined by adjacent vertices of the cell, and move along the straight line as a movement track; the cell texture type is to select points from a point set comprising one or more parameter control points, vertices and midpoint of each boundary of the filled cell according to a plurality of combination rules to generate a straight line or a curve, and combine the generated straight line or curve to form a texture pattern; in the initial texture pattern, the offset of the parameter control point is controlled to move the parameter control point on the movement track according to the corresponding offset to generate a texture design pattern of the model.
2. The method of claim 1, wherein, The method further comprises: when the selected cell shape is a quadrilateral, splitting each cell into a plurality of sub-cells according to a sub-cell type, and taking each sub-cell as a cell in the grid. The sub-cell type comprises: mirror type, triangle type and mixed type.
3. The method of claim 2, wherein, When the selected cell shape is a quadrilateral, splitting each cell into a plurality of sub-cells according to a sub-cell type comprises: when the sub-cell type is mirror type, acquiring the vertices, center point and midpoint of each boundary of the quadrilateral, taking each adjacent two midpoints of the boundaries, the vertices and the center point at which the adjacent two boundaries intersect as four vertices of a first sub-cell, and connecting the four vertices according to a mirror relationship to form four mirror sub-cells; when the sub-cell type is triangle type, acquiring any two adjacent vertices of the quadrilateral and the midpoint of the boundary opposite to the side on which the two vertices are located, and connecting the midpoint and the two vertices to form three triangle sub-cells; when the sub-cell type is mixed type, acquiring the vertices and the midpoint of each boundary of the quadrilateral, taking each adjacent two midpoints of the boundaries and the vertices at which the adjacent two boundaries intersect as three vertices of a third sub-cell, and taking the midpoints of the boundaries as four vertices of a fourth sub-cell, and connecting the vertices to form four triangle sub-cells and one quadrilateral sub-cell.
4. The method of claim 1, wherein, The parameter control points are located on a straight line determined by the center point and a vertex of the cell, or on a straight line determined by adjacent vertices of the cell, and move along the straight line as a movement track, which comprises: selecting any point on a straight line on which a line segment connecting the center point and any vertex of the filled cell is located as a parameter control point, or selecting points at the same distance from either end of a line segment on which a line segment connecting the center point and each vertex of the filled cell is located as parameter control points, or selecting points at the same distance from either end of a line segment on which a line segment connecting each adjacent two vertices of the filled cell is located as parameter control points.
5. The method of claim 4, wherein, The moving along the straight line as the movement track comprises: taking the length of the line segment where the parameter control point is located as a unit length when the parameter control point is selected by the parameter control point, and when the parameter control point moves between the line segments, the offset is mapped to the interval [0, 1]; when the parameter control point moves on the extension line of the starting point of the line segment, the offset is mapped to the interval [negative threshold value, 0]; and when the parameter control point moves on the extension line of the ending point of the line segment, the offset is mapped to the interval [1, super threshold value].
6. The method of claim 1, wherein, The control of the offset of the parameter control point comprises: setting the offset of any parameter control point in each cell; and / or, selecting any point on the initial texture pattern 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 cell; and / or, based on the selected horizontal or vertical change direction, the parameter control point offset of each cell in the change direction changes as a function.
7. The method of claim 6, wherein, The calculation of the offset of each parameter control point according to the spatial distance from the guide point to the center point of each cell comprises: taking the farthest and nearest spatial distances in the spatial distances as the value range boundaries, and after normalization, mapping each spatial distance to the interval [0, 1]; the normalized spatial distances are respectively taken as the offset of each parameter control point of the corresponding cell.
8. The method of claim 6, wherein, The function change of the parameter control point offset of each cell in the change direction comprises: according to the horizontal or vertical change direction, the x-coordinate or y-coordinate of the center point of each cell is obtained; the coordinate value of each cell in the change direction is taken as the independent variable, and the offset position is substituted into the function to calculate the function value corresponding to each cell, and after normalization, the function value is mapped to the interval [0, 1]; the normalized function value is taken as the offset of each parameter control point of the corresponding cell.
9. A system for automatic generation of textures, characterized by The system comprises: a model acquisition module for acquiring a model to be designed; a unit grid generation module for generating a grid based on a plurality of unit cells on the model according to a selected unit cell shape and edge length; a texture generation module for filling a corresponding cellular texture in each unit cell according to a selected cellular texture type to generate an initial texture pattern; each unit cell comprises a center point and one or more parameter control points; the parameter control points are located on a straight line determined by the center point and the vertices of the unit cell, or on a straight line determined by adjacent vertices of the unit cell, and move along the straight line as a movement track; the cellular texture type is to select points from a point set comprising one or more parameter control points, vertices and boundary points of the filled unit cell according to a plurality of combination rules to generate a straight line or a curve, and to combine the generated texture pattern; a texture change module for generating a texture design of the model by controlling the offset of the parameter control point based on the initial texture pattern, and moving the parameter control point on the movement track according to the corresponding offset.
10. An apparatus for automatic generation of texture, characterized by The device comprises: a memory for storing a computer program; A processor is configured to implement the steps of the method for automatically generating textures according to any one of claims 1-8 when executing a computer program.
11. A readable storage medium, characterized by, The storage medium is configured to store a computer program, and the processor is configured to implement the steps of the method for automatically generating textures according to any one of claims 1-8 when executing the computer program.
12. A texture auto-generation cloud platform, characterized in that, The cloud platform is embedded with the system for automatically generating textures according to claim 9 to provide a service of automatically generating textures for customers.
13. The automatic texture generation cloud platform of claim 12, wherein, The cloud platform comprises a client and a management end, and the system for automatically generating textures is embedded in the client, and the management end is used by a manager to implement background management of the cloud platform.
Citation Information
Patent Citations
Clothes making method based on three-dimensional to two-dimensional clothes pattern seamless mapping
CN104036532A
Method for rapidly generating patterns by imitating Art-Deco style
CN108510563A