Method, device and equipment for simulating cross-edition pattern on three-dimensional clothing model and medium
By deforming the grids on all the plates that the patterns pass through on the three-dimensional clothing model, the adjacent plates are connected together, and the patterns are mapped on the deformed three-dimensional clothing model, the problem of unnatural cross-section pattern simulation effect is solved, and the effect of smooth edge transition is achieved.
Patent Information
- Application Number
- CN202311771288.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-06-20
AI Technical Summary
When simulating cross-section patterns on a three-dimensional clothing model, the simulation effect obtained is not natural, especially the transition between adjacent panels is not smooth enough.
By importing each piece of clothing and preparing the set pattern, the posture information of the pattern is obtained based on the user's operation information, and all the pieces that pass by when the pattern is set according to the posture are obtained. Then, the grids on all plates are deformed, so that the grids on adjacent plates where the pattern passes meet the preset conditions, and the grids on the three-dimensional clothing model are deformed simultaneously, and the pattern is mapped on the deformed three-dimensional clothing model.
The effect of smooth transition of edges when simulating cross-section patterns on a three-dimensional clothing model is achieved, improving the naturalness of the simulation effect.
Smart Images

Figure CN120182472A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of three-dimensional clothing design, and particularly to a method, apparatus, device, and storage medium for simulating cross-panel patterns on a three-dimensional clothing model. Background Art
[0002] In the digital clothing industry, designers can use software to create two-dimensional clothing patterns and perform virtual sewing on the pattern pieces through simulation to generate a three-dimensional clothing model, enabling designers to visually see the designed clothing effect.
[0003] During the clothing design process, different patterns are usually set on the clothing to increase its individuality, and the positions of the patterns on the clothing are also diverse. For the case where the same pattern is set across multiple pattern pieces, when simulating the pattern on a three-dimensional clothing model, the obtained simulation effect is not natural. Summary of the Invention
[0004] To overcome the problems existing in the related art, the present disclosure provides a method, apparatus, device, and storage medium for simulating cross-panel patterns on a three-dimensional clothing model.
[0005] According to a first aspect of the present disclosure, there is provided a method for simulating cross-panel patterns on a three-dimensional clothing model, the method including:
[0006] Importing each pattern piece of the clothing and the pattern to be set on the clothing; obtaining pose information of the pattern according to operation information of the user on the pattern; acquiring all the pattern pieces passed by the pattern when set in the pose indicated by the pose information; deforming the meshes on all the pattern pieces so that the meshes on adjacent pattern pieces passed by the pattern meet a preset condition; synchronously deforming the meshes on the three-dimensional clothing model corresponding to the clothing, and mapping the pattern onto the deformed three-dimensional clothing model.
[0007] In some embodiments, the acquiring all the pattern pieces passed by the pattern when set in the pose indicated by the pose information includes: determining a first pattern piece where the pattern is currently located according to the pose information; if a sewing line intersecting with the pattern is obtained on the first pattern piece, obtaining a second pattern piece passed by the pattern when set in the pose indicated by the pose information according to the sewing relationship corresponding to the sewing line; until no sewing line intersecting with the pattern is obtained on the pattern pieces passed by the pattern, and obtaining all the pattern pieces passed by the pattern when set in the pose indicated by the pose information.
[0008] In some embodiments, deforming the grids on all the panels so that the grids on adjacent panels through which the pattern passes meet a preset condition includes: deforming the triangular grids in all the panels according to the preset condition by using a grid deformation algorithm so that the triangular grids on the panel through which the pattern passes are spliced together.
[0009] In some embodiments, deforming the triangular grids in all the panels according to the preset condition by using a grid deformation algorithm so that the triangular grids on the panel through which the pattern passes are spliced together includes: determining the panel where the pattern is currently located as a constraint region, and determining the other panels through which the pattern passes as deformation regions; on adjacent panels connected by sewing lines, under the constraint condition that the coordinate values of adjacent grid vertices on the sewing line are the same, using a constrained grid deformation algorithm to splice the triangular grids on the constraint region and the triangular grids on the deformation regions together.
[0010] In some embodiments, mapping the pattern onto the deformed 3D clothing model includes: setting the pattern on the spliced panels according to the posture indicated by the posture information; cutting the area covered by the pattern into multiple sub-patterns; obtaining the 3D coordinates of each sub-pattern in the 3D view; and mapping the pattern onto the deformed 3D clothing model according to the 3D coordinates of all the sub-patterns in the 3D view.
[0011] In some embodiments, cutting the area covered by the pattern into multiple sub-patterns includes: cutting the area covered by the pattern along the triangular grids to obtain multiple sub-patterns.
[0012] In some embodiments, obtaining the 3D coordinates of each sub-pattern in the 3D view includes:
[0013] For each vertex P of each sub-pattern, determining the triangular grid to which the vertex P belongs on the spliced panel; calculating the barycentric coordinates of the vertex P relative to the triangular grid according to the 2D coordinates of the vertex P and the 2D coordinates of the three vertices of the triangular grid; and calculating the 3D coordinates of the vertex P in the 3D clothing model according to the barycentric coordinates and the 3D coordinates corresponding to the three vertices of the triangular grid.
[0014] According to a second aspect of the present disclosure, there is provided an apparatus for simulating a pattern on a 3D clothing model, the apparatus including:
[0015] An importing unit for importing each panel of the clothing and a pattern to be set on the clothing;
[0016] An acquisition unit, configured to obtain the pose information of the pattern according to the operation information of the user on the pattern, and acquire all the plates passed by the pattern when the pattern is set in the pose indicated by the pose information;
[0017] A deformation unit, configured to deform the grids on all the plates, so that the grids on adjacent plates passed by the pattern meet a preset condition;
[0018] A mapping unit, configured to synchronously deform the grids on the three-dimensional clothing model corresponding to the clothing, and map the pattern on the deformed three-dimensional clothing model.
[0019] According to a third aspect of the present disclosure, there is provided an electronic device, including: a processor; and a memory for storing processor-executable instructions to execute the method according to any one of the embodiments of the present disclosure.
[0020] According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method according to any one of the embodiments of the present disclosure is implemented.
[0021] The technical solution provided by the present disclosure may include the following beneficial effects: according to the operation information of the user on the pattern to be set on the clothing, the present disclosure obtains the pose information of the pattern; acquires all the plates passed by the pattern when the pattern is set in the pose indicated by the pose information; deforms the grids on all the plates, so that the grids on adjacent plates passed by the pattern meet a preset condition, that is, all the plates passed by the pattern are spliced together along the sewing edge intersecting with the pattern, synchronously deforms the grids on the three-dimensional clothing model corresponding to the clothing, and maps the pattern on the deformed three-dimensional clothing model. By deforming the grids on all the plates passed by the pattern, the adjacent plates passed by the pattern are connected together, so as to achieve the effect of smooth transition at the edge during three-dimensional clothing simulation.
[0022] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present disclosure. Brief Description of the Drawings
[0023] The drawings here are incorporated into the specification and constitute a part of the specification, showing the embodiments consistent with the present disclosure, and are used together with the specification to explain the technical solution of the present disclosure.
[0024] Figure 1a It is a schematic diagram showing that the sewing boundary between adjacent plates is a curve according to an exemplary embodiment of the present disclosure.
[0025] Figure 1bIt is a schematic diagram showing that the sewing boundary lengths of adjacent plates are inconsistent according to an exemplary embodiment of the present disclosure.
[0026] Figure 2 It is a flowchart of a method for simulating a cross-plate pattern on a three-dimensional clothing model according to an exemplary embodiment of the present disclosure.
[0027] Figure 3 It is a schematic diagram of a two-dimensional view according to an exemplary embodiment of the present disclosure.
[0028] Figure 4 It is a schematic diagram showing the sewing lines intersecting with the pattern in the plate where the pattern is located according to an exemplary embodiment of the present disclosure.
[0029] Figure 5 It is a schematic diagram of a plate with a grid according to an exemplary embodiment of the present disclosure.
[0030] Figure 6 It is an enlarged schematic diagram of the grid at the sewing line according to an exemplary embodiment of the present disclosure.
[0031] Figure 7 It is a schematic diagram showing the spliced-together grids after deformation according to an exemplary embodiment of the present disclosure.
[0032] Figure 8 It is a schematic diagram showing the setting of a pattern on the spliced plate according to an exemplary embodiment of the present disclosure.
[0033] Figure 9 It is a schematic diagram of the simulated three-dimensional clothing model according to an exemplary embodiment of the present disclosure.
[0034] Figure 10a It is a schematic diagram of a plate with a curved sewing boundary according to an exemplary embodiment of the present disclosure.
[0035] Figure 10b It is a schematic diagram of a plate to be meshed according to an exemplary embodiment of the present disclosure.
[0036] Figure 10c It is a schematic diagram of the spliced-together plates after grid deformation according to an exemplary embodiment of the present disclosure.
[0037] Figure 10d It is a schematic diagram of the simulated three-dimensional clothing model according to an exemplary embodiment of the present disclosure.
[0038] Figure 11 It is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Detailed implementation
[0039] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0040] The terms used in this disclosure are for the purpose of describing particular embodiments only and are not intended to limit the present disclosure. The singular forms "a", "the", and "said" used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0041] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".
[0042] In design, the pattern on the garment can be extended from one panel to another. In this embodiment, the setting of the same pattern across multiple panels is simply referred to as cross-panel setting, and the pattern is called a cross-panel pattern. When simulating the cross-panel pattern on a three-dimensional garment model, the obtained simulation effect is not natural. For example, the transition of the pattern between adjacent panels is not smooth enough.
[0043] After research, the inventors found that one of the reasons for the poor simulation effect is that when the sewing line between two adjacent panels through which the pattern passes is a curve, the patterns on the two adjacent panels are not aligned, so the pattern splicing in the three-dimensional simulation appears unnatural. Figure 1a is a schematic diagram showing the sewing boundary between adjacent panels as a curve according to an exemplary embodiment of the present disclosure, as Figure 1a shown, the sewing boundary between adjacent panels 101 and 102 is a curve, which will cause the patterns passing through panel 101 and panel 102 not to be aligned, easily resulting in an unnatural simulation effect.
[0044] In addition, in the presence of folds, the lengths of the sewing boundaries of adjacent panels may be inconsistent, which will also cause the patterns on the two adjacent panels not to be aligned. Figure 1bIt is a schematic diagram showing that the sewing boundary lengths of adjacent panels are inconsistent according to an exemplary embodiment of the present disclosure. As Figure 1b shown, the sewing boundary lengths between adjacent panels 103 and 104 are inconsistent, which will cause the patterns passing through panels 103 and 104 not to be aligned, and also easily lead to an unnatural simulation effect.
[0045] When the two panels through which the pattern passes are not aligned, there will be a gap between the two panels. After the pattern is laid down, part of the pattern falls on the gap between the adjacent panels, resulting in a poor simulation effect.
[0046] In view of this, the present disclosure provides a method for simulating a cross-panel pattern on a three-dimensional clothing model, which can be applied to three-dimensional clothing design software. By deforming the meshes on all the panels through which the pattern passes according to the present disclosure, the deformed panels can be spliced together at the sewing boundaries intersecting with the pattern. When the pattern passes through adjacent panels, the entire pattern can be located on the panels, thereby improving the simulation effect of the cross-panel pattern on the three-dimensional clothing model.
[0047] The following embodiments will introduce the method provided by the present disclosure in conjunction with the accompanying drawings.
[0048] Figure 2 It is a flowchart of a method for simulating a cross-panel pattern on a three-dimensional clothing model according to an exemplary embodiment of the present disclosure. As Figure 2 shown, the method may include the following steps 201 to step 205.
[0049] In step 201, each panel of the clothing and the pattern to be set on the clothing are imported.
[0050] Obtain the clothing file to be simulated imported by the user. The clothing file to be simulated includes each panel constituting the clothing to be simulated and the sewing relationship between the panels. Given the sewing relationship between the panels, another panel having a sewing relationship with one of the panels can be determined. In this embodiment, the panels having a sewing relationship are referred to as adjacent panels. Display each panel of the imported clothing and the pattern to be set on the clothing in a two-dimensional view.
[0051] Figure 3 It is a schematic diagram of a two-dimensional view according to an exemplary embodiment of the present disclosure. As Figure 3 shown, taking a T-shirt as an example, each panel of the clothing and the pattern 301 that the user is going to set on the clothing are displayed in a two-dimensional view.
[0052] In step 202, according to the operation information of the user on the pattern, the pose information of the pattern is obtained.
[0053] The operation information may include setting parameters of the width, height, position, and orientation of the pattern by the user, and / or rotation operations, scaling operations, moving operations, etc. performed by the user on the pattern.
[0054] According to the operation information of the user on the pattern, the pose information of the pattern can be obtained. The pose information includes the width, height, position, and orientation of the pattern. Among them, the width and height of the pattern refer to the space size occupied by the pattern, and specific numerical values or relative proportions can be used to describe the width and height of the pattern. For example, the width of the pattern can be set to 10 cm and the height to 15 cm. The position of the pattern refers to the position of the rectangular frame where the pattern is located on the plate. Specific coordinate values or relative positions can be used to determine the position where the pattern is expected to be placed. The orientation of the pattern refers to the rotation angle of the pattern relative to the plate where it is located. The orientation of the pattern can be determined using specific angle values. For example, the orientation of the pattern can be set to 0 degrees to indicate that the pattern is not rotated, or set to 45 degrees to indicate that the pattern is rotated 45 degrees clockwise.
[0055] In step 203, all the plates passed by the pattern when set according to the pose information indicated are obtained.
[0056] All the plates passed by the pattern when set according to the pose information indicated can be obtained based on the sewing relationship between the plates.
[0057] That is, in the case of knowing the pose information of the pattern set by the user, based on the sewing lines intersecting with the pattern on the plate where the pattern is located and the corresponding sewing relationship, all the plates passed by the pattern after being set according to the user's settings can be found.
[0058] In step 204, the grids on all the plates are deformed so that the grids on the adjacent plates passed by the pattern meet the preset conditions.
[0059] The preset conditions may include that the grid vertices on the adjacent plates passed by the pattern are located on the same sewing line. The grids on all the plates are deformed so that after deformation, the plates passed by the pattern are spliced together along the sewing lines intersecting with the pattern.
[0060] By deforming the grids on all the plates passed by the pattern so that the adjacent plates passed by the pattern are spliced together, the problem that the pattern is broken during cross-plate simulation due to the gap between the adjacent plates on both sides of the sewing line, resulting in uneven pattern transition in the plate connection area, can be solved.
[0061] In step 205, the grids on the three-dimensional clothing model corresponding to the clothing are synchronously deformed, and the pattern is mapped onto the deformed three-dimensional clothing model.
[0062] A three-dimensional clothing model corresponding to the clothing can be displayed in a three-dimensional view, and the same deformation operation performed on the meshes on the three-dimensional clothing model as on the meshes on the pattern pieces is synchronized, that is, the deformation operation performed on the meshes on all the pattern pieces is synchronously mapped into the three-dimensional clothing model.
[0063] By deforming all the pattern pieces through which the pattern passes in a two-dimensional coordinate system so that all the pattern pieces through which the pattern passes are spliced together, when the pattern is mapped onto the deformed three-dimensional clothing model, a smooth transition effect is achieved.
[0064] The present disclosure obtains the pose information of the pattern according to the operation information of the pattern that the user is going to set on the clothing; according to the sewing relationship between the respective pattern pieces that make up the clothing, obtains all the pattern pieces through which the pattern passes when set in the pose indicated by the pose information; deforms the meshes on all the pattern pieces so that the pattern pieces through which the pattern passes after deformation are spliced together, that is, all the pattern pieces through which the pattern passes are spliced together along the sewing edge intersecting with the pattern. By deforming the meshes on all the pattern pieces through which the pattern passes, all the pattern pieces through which the pattern passes are spliced at the position of the sewing line intersecting with the pattern. In this way, when the pattern passes through adjacent pattern pieces, the entire pattern can be located on the pattern piece, thereby achieving a smooth transition effect at the edge during three-dimensional clothing simulation.
[0065] In actual design, the pattern can span two pattern pieces, that is, extend from the first pattern piece to the second pattern piece; the pattern can also span three pattern pieces, that is, first extend from the first pattern piece to the second pattern piece, and then from the second pattern piece to the third pattern piece. This embodiment does not limit this.
[0066] In some embodiments, all the pattern pieces through which the pattern passes after being set in the pose set by the user can be obtained in the following manner, that is, the step of obtaining all the pattern pieces through which the pattern passes when set in the pose indicated by the pose information according to the sewing relationship between the respective pattern pieces can include: determining the first pattern piece where the pattern is currently located according to the pose information; if a sewing line intersecting with the pattern is obtained on the first pattern piece, obtaining the second pattern piece through which the pattern passes when set in the pose indicated by the pose information according to the sewing relationship corresponding to the sewing line; until no sewing line intersecting with the pattern is obtained on the pattern pieces through which the pattern passes, obtaining all the pattern pieces through which the pattern passes when set in the pose indicated by the pose information.
[0067] By determining whether there is a sewing line intersecting with the pattern in the plate where the pattern is located, it can be determined whether the pattern extends beyond the current plate. If there is a sewing line intersecting with the pattern in the plate where the pattern is located, it can be indicated that the pattern extends beyond the current plate and enters another plate adjacent to the plate where the pattern is located. In this case, the other plate to which the pattern extends can be obtained through the sewing relationship corresponding to the sewing line. By analogy, all the plates passed by the pattern can be obtained.
[0068] In this embodiment, the vector method or the parametric equation method can be used to determine whether the pattern intersects with the sewing line. Taking the vector method as an example, the line segment is represented as the coordinate vector of the starting point and the ending point, and the cross product operation is used to determine whether two line segments intersect. If the cross product signs of two line segments are opposite, they intersect; if the cross product is 0, the line segments are collinear; otherwise, they do not intersect.
[0069] In an example, the first plate where the pattern is currently located can be determined according to the position information in the attitude information; if a sewing line intersecting with the pattern is obtained on the first plate, then according to the sewing relationship corresponding to the sewing line, the second plate passed by the pattern can be obtained. If a sewing line intersecting with the pattern is obtained on the second plate, then according to the sewing relationship corresponding to the sewing line, the third plate passed by the pattern can be obtained. Then, if a sewing line intersecting with the pattern is obtained on the third plate, and so on, until no sewing line intersecting with the pattern is obtained on the plates passed by the pattern, all the plates passed by the pattern when set according to the attitude indicated by the attitude information are obtained.
[0070] Figure 4 This is a schematic diagram showing the sewing line intersecting with the pattern in the plate where the pattern is located according to an exemplary embodiment of the present disclosure, as Figure 4 shown, a sewing line 401 intersecting with the pattern is obtained on the first plate 402 where the pattern is currently located. According to the sewing relationship corresponding to the sewing line, the second plate 403 passed by the pattern when set according to the attitude indicated by the attitude information can be obtained. In Figure 4 it, the total number of plates passed by the pattern is 2, namely the first plate 402 and the second plate 403.
[0071] In another example, in step 1, a target queue is created, and the plate where the pattern is currently located is added to the target queue.
[0072] In step 2, if the target queue is empty, the algorithm ends; otherwise, step 3 is executed.
[0073] In step 3, extract a plate from the target queue, take out the sewing thread intersecting with the pattern in the plate, obtain another plate corresponding to the sewing thread according to the sewing relationship, if the other plate has not been added to the target queue before, add the other plate to the target queue, and jump to step 2.
[0074] All the plates passed by the pattern can be obtained through the above steps 1 to 3.
[0075] The number of all the plates can be one, two or more than two. In the case where the number of all the plates is one, the process can be carried out in a conventional manner; in the case where the number of all the plates is two or more than two, deform the grids on all the plates.
[0076] Figure 5 It is a schematic diagram of a plate with a grid shown by the present disclosure according to an exemplary embodiment. As Figure 5 shown, grid the plates imported in Figure 3 according to the pre-designed rules. Triangular grids or quadrilateral grids can be used. The present embodiment does not limit this. In the following embodiments, the present disclosure will be introduced taking triangular grids as an example.
[0077] In the present embodiment, the grid deformation algorithm can be used to deform the triangular grids in all the plates so that the triangular grids on the plates passed by the pattern are spliced together. The grid deformation algorithm can include a constrained grid deformation algorithm, curve deformation and lattice region deformation.
[0078] The following embodiments will take the constrained grid deformation algorithm as an example to illustrate the process of deforming the grid.
[0079] In the present embodiment, determine the plate where the pattern is currently located as the constraint region, and determine the other plates passed by the pattern as the deformation region; on the adjacent plates connected by the sewing thread, under the constraint condition that the coordinate values of the adjacent grid vertices on the sewing thread are the same, use the constrained grid deformation algorithm to splice the triangular grid on the constraint region with the triangular grid on the deformation region.
[0080] When the shape of the triangular grid in the deformation region changes, keep the initial shape of the constraint region unchanged through the constraint condition.
[0081] In one example, deform all the grids passed by the pattern in the following manner:
[0082] a. For the plates connected by the sewing thread, add the condition that the uv values of the corresponding sewing vertices are the same;
[0083] b. Use the grid deformation algorithm to piece together all the plate grids to generate a complete plate.
[0084] Figure 6 FIG. is an enlarged schematic view of the grid at the sewing thread shown by the present disclosure according to an exemplary embodiment. As Figure 6 shown, the triangular grid vertices on the first plate located on the sewing thread include 601a, 602a, 603a, and 604a, and the triangular grid vertices on the second plate located on the sewing thread include 601b, 602b, 603b, and 604b. In this embodiment, the purpose of deforming the grid is to make the grid vertices at the connection of the sewing thread on the first plate and the second plate meet the set conditions. For example, the set conditions can be close to coincidence. In this case, the coordinates of the triangular grid vertex 601a on the first plate located on the sewing thread are the same as the coordinates of the triangular grid vertex 601b on the second plate located on the sewing thread. Therefore, in this embodiment, a new coordinate system is constructed, named the uv coordinate system. In this uv coordinate system, the coordinate values of adjacent grid vertices located on the sewing thread are set to be the same. Through this constraint condition, the triangular grid vertices on adjacent plates connected by the sewing thread can be made to coincide, so as to realize the splicing of adjacent plates at the sewing thread position.
[0085] In one example, an equation system with equal coordinates of corresponding vertices located on the sewing thread in adjacent plates can be constructed, and the uv coordinates of each triangular grid vertex can be obtained by solving the equation system.
[0086] When constructing the equation system, if the vertex 601a is located in the middle of the vertices 601b and 602b, then x 601a =(x 601b +x 602b ) / 2, y 601a =(y 601b +y 602b ) / 2. That is to say, according to the proportion of the grid vertex on the first plate located on the sewing thread in the line segment formed by adjacent grid vertices on the second plate located on the sewing thread, the relationship between the grid vertex coordinates on the first plate and the grid vertex coordinates on the second plate is determined.
[0087] Figure 7 FIG. is a schematic view of the spliced grids after deformation shown by the present disclosure according to an exemplary embodiment. As Figure 7 shown, the grid vertices at the sewing thread in adjacent plates coincide after deformation.
[0088] After deforming and splicing together the grids of all the plates through which the pattern passes, the pattern can be set on the spliced plates according to the posture indicated by the posture information. Then, the area covered by the pattern is cut along the triangular grid to obtain a plurality of sub-patterns. Obtain the three-dimensional coordinates of each sub-pattern in the three-dimensional view; according to the three-dimensional coordinates of all the sub-patterns in the three-dimensional view, map the pattern onto the deformed three-dimensional clothing model.
[0089] For each plate, after the pattern is laid down according to the position and orientation set by the user, grid cutting is performed to cut out the position where the pattern is located. That is, the pattern is laid on the spliced plates according to the posture set by the user, and the area where the pattern is located is subjected to grid cutting, that is, the area covered by the rectangular frame of the pattern is cut into a plurality of sub-patterns according to the grid in this area.
[0090] Figure 8 It is a schematic diagram showing the setting of the pattern on the spliced plates according to an exemplary embodiment of the present disclosure. As Figure 8 shown, the pattern is set on the spliced plates according to the posture set by the user, and the area covered by the pattern is cut along the triangular grid to obtain a plurality of sub-patterns 801, 802, 803, 804, 805, 806, etc.
[0091] Mapping the sub-patterns onto the deformed three-dimensional clothing model can achieve the effect of smooth transition of the patterns on the sewing boundary of the three-dimensional clothing model.
[0092] After obtaining a plurality of sub-patterns, the three-dimensional coordinates of each sub-pattern in the three-dimensional view can be obtained in the following manner:
[0093] For each vertex P of each sub-pattern, determine the triangular grid to which the vertex P belongs on the spliced plate; according to the two-dimensional coordinates of the vertex P and the two-dimensional coordinates of the three vertices of the triangular grid, calculate the barycentric coordinates of the vertex P relative to the triangular grid; according to the barycentric coordinates and the three-dimensional coordinates corresponding to the three vertices of the triangular grid, calculate the three-dimensional coordinates of the vertex P in the three-dimensional clothing model.
[0094] Any point inside a triangle can be described by the barycentric coordinates of the triangle. In addition, in the conversion between two-dimensional coordinates and three-dimensional coordinates, if the three vertices of a triangle and the barycentric coordinates of an internal point in the two-dimensional coordinate system are known, the three-dimensional coordinates of this internal point in the three-dimensional coordinate system can be calculated.
[0095] Exemplarily, for a vertex P on a sub-pattern, the triangular mesh T{a0, a1, a2} to which the vertex P belongs on the plate is determined. The vertex P divides the triangular mesh T into three small triangles T0, T1, and T2, where T = T0 + T1 + T2. The vertex P can be expressed as a linear combination of the three vertices {a0, a1, a2} of the triangular mesh T:
[0096] P = b0a0 + b1a1 + b2a2
[0097] where b0 = T0 / T, b1 = T1 / T, b2 = T2 / T, and b0 + b1 + b2 = 1. {b0, b1, b2} is defined as the barycentric coordinates of point P with respect to the triangular mesh T.
[0098] Since the barycentric coordinates of point P in the two-dimensional plate and the three-dimensional clothing model remain unchanged, therefore, based on the three vertices {c0, c1, c2} of the triangular mesh T in the three-dimensional clothing model and the barycentric coordinates (b0, b1, b2) of point P, the three-dimensional coordinates of point P' in the three-dimensional clothing model can be determined.
[0099] In the above calculation process, the coordinates of point P are the coordinates in the uv coordinate system. Since the plate where the pattern is located is fixed and does not change during the deformation process, the uv coordinates of each vertex of the sub-pattern are consistent with the original two-dimensional coordinates.
[0100] Figure 9 is a schematic diagram of the simulated three-dimensional clothing model shown by the present disclosure according to an exemplary embodiment. As Figure 9 shown, it is the effect presented by mapping the pattern on the three-dimensional clothing model according to the three-dimensional coordinates of all sub-patterns in the three-dimensional view.
[0101] Figure 10a is a schematic diagram of a plate with a curved sewing boundary shown by the present disclosure according to an exemplary embodiment, Figure 10b is a schematic diagram of a plate to be meshed shown by the present disclosure according to an exemplary embodiment, Figure 10c is a schematic diagram of plates spliced together after mesh deformation shown by the present disclosure according to an exemplary embodiment, Figure 10d is a schematic diagram of a simulated three-dimensional clothing model shown by the present disclosure according to an exemplary embodiment. Through Figures 10a to 10d , it can be seen that in this embodiment, by deforming the mesh, the effect of smooth transition at the edge after three-dimensional simulation can be achieved, and the purpose of generating a very natural visual effect is achieved.
[0102] As can be seen from the above embodiments, in order to achieve the effect of aligning patterns on the sewing boundary in a three-dimensional clothing model, the present disclosure stitches all the plates through which the pattern passes into a complete plate, then cuts the complete plate into sub-patterns according to a triangular mesh, calculates the position coordinates of the sub-patterns in the 3D model based on the centroid coordinates, and then simulates the pattern display effect in the 3D model according to the position coordinates of the sub-patterns in the 3D model. Since the sub-patterns are aligned, after mapping the sub-patterns to the 3D model, the overall pattern composed of all the sub-patterns is also aligned.
[0103] Corresponding to the embodiments of the foregoing method, the present disclosure also provides embodiments of an apparatus and a terminal to which the apparatus is applied.
[0104] This embodiment also provides an apparatus for simulating a pattern on a three-dimensional clothing model. The apparatus includes:
[0105] An importing unit, configured to import each plate of the clothing and a pattern to be set on the clothing;
[0106] An obtaining unit, configured to obtain the pose information of the pattern according to the operation information of the user on the pattern, and obtain all the plates through which the pattern passes when set in the pose indicated by the pose information;
[0107] A deforming unit, configured to deform the meshes on all the plates so that the meshes on adjacent plates through which the pattern passes meet a preset condition;
[0108] A mapping unit, configured to synchronously deform the meshes on the three-dimensional clothing model corresponding to the clothing, and map the pattern on the deformed three-dimensional clothing model.
[0109] The specific implementation manners of the units in the apparatus have been introduced in the foregoing embodiments, and will not be elaborated herein.
[0110] Figure 11 Schematic diagram of the structure of an electronic device provided by at least one embodiment of the present disclosure. As Figure 11 shown, the electronic device includes a memory and a processor. The memory is configured to store computer instructions that can be run on the processor, and the processor is configured to implement a method for simulating a cross-plate pattern on a three-dimensional clothing model according to any embodiment of the present disclosure when executing the computer instructions.
[0111] At least one embodiment of the present disclosure also proposes a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements a method for simulating a cross-plate pattern on a three-dimensional clothing model according to any one of the present disclosures.
[0112] Those skilled in the art should understand that one or more embodiments of the present disclosure may be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0113] "And / or" in the present disclosure means at least one of the two. For example, "A and / or B" includes three scenarios: A, B, and "A and B".
[0114] The above are only the preferred embodiments of one or more embodiments of the present disclosure, and are not intended to limit one or more embodiments of the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of one or more embodiments of the present disclosure shall be included within the scope of protection of one or more embodiments of the present disclosure.
Claims
1. A method for simulating cross-panel patterns on a three-dimensional clothing model, characterized in that, The method includes: Importing each piece of the garment and preparing a pattern to be set on the garment; Obtaining pose information of the pattern according to the operation information of the user on the pattern; Obtaining all the pieces passed by the pattern when set in the pose indicated by the pose information; deforming the meshes on all the pieces so that the meshes on adjacent pieces passed by the pattern meet a preset condition; Synchronously deforming the meshes on the three-dimensional garment model corresponding to the garment, and mapping the pattern onto the deformed three-dimensional garment model.
2. The method according to claim 1, characterized in that, The obtaining all the pieces passed by the pattern when set in the pose indicated by the pose information includes: Determining a first piece where the pattern is currently located according to the pose information; If a sewing line intersecting with the pattern is obtained on the first piece, obtaining a second piece passed by the pattern when set in the pose indicated by the pose information according to the sewing relationship corresponding to the sewing line; Until no sewing line intersecting with the pattern is obtained on the pieces passed by the pattern, obtaining all the pieces passed by the pattern when set in the pose indicated by the pose information.
3. The method according to claim 1, characterized in that, The deforming the meshes on all the pieces so that the meshes on adjacent pieces passed by the pattern meet a preset condition includes: Using a mesh deformation algorithm to deform the triangular meshes in all the pieces according to the preset condition so that the triangular meshes on the pieces passed by the pattern are joined together.
4. The method according to claim 3, characterized in that, The using a mesh deformation algorithm to deform the triangular meshes in all the pieces according to the preset condition so that the triangular meshes on the pieces passed by the pattern are joined together includes: Determining the piece where the pattern is currently located as a constraint region, and determining the other pieces passed by the pattern as deformation regions; On adjacent pieces connected by a sewing line, under the constraint condition that the coordinate values of adjacent mesh vertices on the sewing line are the same, using a constrained mesh deformation algorithm to join the triangular meshes on the constraint region and the triangular meshes on the deformation regions together.
5. The method according to claim 3, characterized in that, The mapping the pattern onto the deformed three-dimensional garment model includes: Setting the pattern in the pose indicated by the pose information on the joined pieces; Cutting the area covered by the pattern into multiple sub-patterns; Obtaining the three-dimensional coordinates of each sub-pattern in a three-dimensional view; Mapping the pattern onto the deformed three-dimensional garment model according to the three-dimensional coordinates of all the sub-patterns in the three-dimensional view.
6. The method according to claim 5, characterized in that, The cutting the area covered by the pattern into multiple sub-patterns includes: Cutting the area covered by the pattern along the triangular meshes to obtain multiple sub-patterns.
7. The method according to claim 6, characterized in that, The obtaining the three-dimensional coordinates of each sub-pattern in a three-dimensional view includes: For each vertex P of each sub-pattern, determining the triangular mesh to which the vertex P belongs on the joined piece; Calculating the barycentric coordinates of the vertex P relative to the triangular mesh according to the two-dimensional coordinates of the vertex P and the two-dimensional coordinates of the three vertices of the triangular mesh; Calculate the three-dimensional coordinates of vertex P in the three-dimensional clothing model according to the barycentric coordinates and the three-dimensional coordinates corresponding to the three vertices of the triangular mesh.
8. A device for simulating patterns on a three-dimensional clothing model, characterized in that, The device includes: An import unit for importing each piece of the clothing and a pattern to be set on the clothing; An acquisition unit for obtaining the pose information of the pattern according to the operation information of the user on the pattern, and acquiring all the pieces passed by the pattern when set in the pose indicated by the pose information; A deformation unit for deforming the meshes on all the pieces so that the meshes on the adjacent pieces passed by the pattern meet the preset conditions; A mapping unit for synchronously deforming the meshes on the three-dimensional clothing model corresponding to the clothing and mapping the pattern on the deformed three-dimensional clothing model.
9. An electronic device, characterized in that, The device includes: A processor; A memory for storing processor-executable instructions to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.