Mesh triangulation methods, mesh triangulation systems, electronic devices and storage media

By discretizing and correcting the internal lines of clothing or fabric, the problem of small meshes during triangulation was solved, a stable triangulation process was achieved, and the success and accuracy of the simulation were ensured.

CN117765202BActive Publication Date: 2026-11-10SHANGHAI BAIQIMAI TECH (GRP) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410011475.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-03
Publication Date
2026-11-10
Estimated Expiration
2044-01-03

AI Technical Summary

Technical Problem

In the process of software visualization of clothing or fabrics, existing technologies are prone to generating small meshes during triangulation, leading to simulation failures or numerical explosions.

Method used

By discretizing the internal lines, each internal line is divided into multiple segments that connect end to end. A regional threshold is set, and the positions of discrete points near the intersection are corrected according to different correction rules. Finally, the intersection and the corrected set of discrete points are used as triangulation input data for processing.

Benefits of technology

This effectively avoids the generation of small meshes, improves the stability and accuracy of the triangulation process, and avoids the risks of simulation failure and numerical explosion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117765202B_ABST
    Figure CN117765202B_ABST
Patent Text Reader

Abstract

This invention provides a mesh triangulation method, a mesh triangulation system, an electronic device, and a storage medium. The mesh triangulation method includes: discretizing internal lines so that each internal line is divided into multiple end-to-end line segments by discrete points; setting a region threshold, where each region includes at least one intersection point; when the number of intersection points in a region is one, correcting the discrete point positions of the line segments containing the intersection points according to a first correction rule; when the number of intersection points in a region is greater than one, correcting the discrete point positions of the line segments containing the intersection points according to a second correction rule; and using all intersection points and the corrected set of discrete points as triangulation input data for triangulation processing. This invention corrects the discrete points near the intersection points before triangulation, which can minimize the generation of small meshes during triangulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer graphics technology, specifically to a mesh triangulation method, a mesh triangulation system, an electronic device, and a storage medium. Background Technology

[0002] Software visualization methods for clothing or fabrics can use general triangular meshes. Each garment pattern has an independent mesh (two-dimensional mesh), which can be mapped to a three-dimensional mesh of the same structure for physical simulation.

[0003] The quality of 2D graphic triangulation directly affects the final simulation effect. During the template creation process, it is often necessary to customize some internal graphics, and these internal graphics will participate in the overall template creation effect. At this time, during the template triangulation process, these customized internal graphics need to be added to generate a triangulated mesh with a specific shape.

[0004] Methods for triangulating general template shapes are relatively mature (e.g., the Delaunay meshing method). For the purposes of physical simulation, the template mesh will be kept as uniformly divided as possible. However, when lines within the specified template intersect, direct triangulation can easily result in small meshes because the line segments need to be discretized beforehand, leading to simulation failures, numerical explosions, and other problems.

[0005] Therefore, how to minimize the generation of small meshes during triangulation is a problem that needs to be solved. Summary of the Invention

[0006] The purpose of this invention is to provide a mesh triangulation method, a mesh triangulation system, an electronic device, and a storage medium that can minimize the generation of small meshes during triangulation.

[0007] To achieve the above objectives, the present invention provides a mesh triangulation method, wherein the internal lines involved in the triangulation intersect, the method comprising: Discretize the internal lines so that each internal line is divided into multiple segments that are connected end to end by discrete points. Set a region threshold, ensuring that each region includes at least one intersection point; When there is only one intersection point in the area, the discrete point position of the line segment where the intersection point is located is corrected according to the first correction rule; When the number of intersections in the region is greater than one, the discrete point positions of the line segments to which the intersections are located are corrected according to the second correction rule. All intersection points and the corrected set of discrete points are used as input data for triangulation, and then triangulation is performed.

[0008] In an optional scheme, the first correction rule is: place the discrete point closest to the intersection point in each line segment where the intersection point is located at the intersection point.

[0009] In the optional scheme, the second correction rule is: select a center point in the area, project it onto the line segment where each intersection point is located, and calculate the distance between the center point and the projection point; Set a distance threshold. If the distance between the center point and the projection point is less than the distance threshold, then place the discrete point in the line segment where the projection point is located that is closest to the intersection point at the location of the center point.

[0010] In an optional embodiment, the method further includes: if the discrete points at both ends of a line segment have been corrected, then determining whether it is necessary to add interpolation points, wherein the determination method is as follows: An interpolation point is pre-added at the intersection of the line segment and another line segment. It is determined whether the distance between the interpolation point and the discrete points at both ends is greater than a preset threshold. If it is greater than the preset threshold, an interpolation point is added; if it is less than the preset threshold, no interpolation point is added.

[0011] The present invention also provides a mesh triangulation system, comprising: The discrete module is used to discretize the internal lines, so that each internal line is divided into multiple segments that are connected end to end by discrete points. The correction module is used to set a region threshold, where each region includes at least one intersection point; when the number of intersection points in the region is one, the discrete point position of the line segment to which the intersection point is located is corrected according to a first correction rule; when the number of intersection points in the region is greater than one, the discrete point position of the line segment to which the intersection point is located is corrected according to a second correction rule. The triangulation module is used to triangulate all intersection points and the corrected set of discrete points as input data.

[0012] In an optional scheme, the first correction rule is: place the discrete point closest to the intersection point in each line segment where the intersection point is located at the intersection point.

[0013] In the optional scheme, the second correction rule is: select a center point in the area, project it onto the line segment where each intersection point is located, and calculate the distance between the center point and the projection point; Set a distance threshold; if the distance is less than the distance threshold, then place the discrete point in the line segment where the projection point is located that is closest to the intersection point at the location of the center point.

[0014] In an optional embodiment, the system further includes an interpolation module, which is used to: determine whether to add an interpolation point when both discrete points at the ends of a line segment have been corrected, wherein the determination method is as follows: An interpolation point is pre-added at the intersection of the line segment and another line segment. It is determined whether the distance between the interpolation point and the discrete points at both ends is greater than a preset threshold. If it is greater than the preset threshold, an interpolation point is added; if it is less than the preset threshold, no interpolation point is added.

[0015] The present invention also provides an electronic device, the electronic device comprising: Memory, which stores executable instructions; A processor that executes the executable instructions in the memory to implement the above-described mesh triangulation method.

[0016] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described mesh triangulation method.

[0017] The beneficial effects of this invention are as follows: This invention corrects the discrete points near the intersection before triangulation, which can minimize the generation of small meshes during triangulation. Attached Figure Description

[0018] The above and other objects, features and advantages of the present invention will become more apparent from the accompanying drawings, in which like reference numerals generally denote like parts.

[0019] Figure 1 This is a flowchart of a mesh triangulation method according to an embodiment of the present invention.

[0020] Figure 2a This is the original graphic of the internal lines involved in triangulation according to an embodiment of the present invention.

[0021] Figure 2b for Figure 2a The final overall effect of the mesh after triangulation using the method of the present invention.

[0022] Figure 2c for Figure 2a A local view of discrete points without correction for triangulation.

[0023] Figure 2d for Figure 2a A local view of the triangulated discrete points after correction.

[0024] Figure 3a This is the original graphic of the internal lines involved in triangulation according to an embodiment of the present invention.

[0025] Figure 3b for Figure 3a The final overall effect of the mesh after triangulation using the method of the present invention.

[0026] Figure 3c for Figure 3a A local view of discrete points without correction for triangulation.

[0027] Figure 3d for Figure 3a A local view of the triangulated discrete points after correction.

[0028] Figure 4a This is the original graphic of the internal lines involved in triangulation according to an embodiment of the present invention.

[0029] Figure 4b for Figure 4a The final overall effect of the mesh after triangulation using the method of the present invention.

[0030] Figure 4c for Figure 4a A local view of discrete points without correction for triangulation.

[0031] Figure 4d for Figure 4a A local view of the triangulated discrete points after correction.

[0032] Figure 5a This is the original graphic of the internal lines involved in triangulation according to an embodiment of the present invention.

[0033] Figure 5b for Figure 5a The final overall effect of the mesh after triangulation using the method of the present invention.

[0034] Figure 5c for Figure 5a A local view of discrete points without correction for triangulation.

[0035] Figure 5d for Figure 5a A local view of the triangulated discrete points after correction.

[0036] Figure 6a This is the original graphic of the internal lines involved in triangulation according to an embodiment of the present invention.

[0037] Figure 6b for Figure 6a The final overall effect of the mesh after triangulation using the method of the present invention.

[0038] Figure 6c for Figure 6a A local view of discrete points without correction for triangulation.

[0039] Figure 6d for Figure 6a A local view of the triangulated discrete points after correction. Detailed Implementation

[0040] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The advantages and features of the present invention will become clearer from the following description and drawings. However, it should be noted that the concept of the technical solution of the present invention can be implemented in many different forms and is not limited to the specific embodiments described herein. The accompanying drawings are all in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the present invention.

[0041] It should be understood that when an element or layer is referred to as "on," "adjacent to," "connected to," or "coupled to" other elements or layers, it may be directly on, adjacent to, connected to, or coupled to other elements or layers, or there may be intervening elements or layers. Conversely, when an element is referred to as "directly on," "directly adjacent to," "directly connected to," or "directly coupled to" other elements or layers, there are no intervening elements or layers. It should be understood that although the terms first, second, third, etc., may be used to describe various elements, components, areas, layers, and / or portions, these elements, components, areas, layers, and / or portions should not be limited by these terms. These terms are only used to distinguish one element, component, area, layer, or portion from another element, component, area, layer, or portion. Therefore, without departing from the teachings of this invention, the first element, component, area, layer, or portion discussed below may be referred to as the second element, component, area, layer, or portion.

[0042] Spatial relation terms such as “below,” “under,” “below,” “under,” “above,” “above,” etc., are used herein for convenience of description to describe the relationship between one element or feature shown in the figure and other elements or features. It should be understood that, in addition to the orientation shown in the figure, spatial relation terms are intended to also include different orientations of the device in use and operation. For example, if the device in the figure is flipped, then the element or feature described as “below” or “under” the other element or feature will be oriented “above” the other element or feature. Therefore, the exemplary terms “below” and “under” can include both upper and lower orientations. The device may be otherwise oriented (rotated 90 degrees or otherwise) and the spatial descriptive terms used herein will be interpreted accordingly.

[0043] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. When used herein, the singular forms “a,” “an,” and “the” are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising” and / or “including,” when used in this specification, identify the presence of the stated features, integers, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups. When used herein, the term “and / or” includes any and all combinations of the associated listed items.

[0044] Example 1 Reference Figure 1 This embodiment provides a mesh triangulation method where the internal lines involved in the triangulation intersect. The method includes: Discretize the internal lines so that each internal line is divided into multiple segments that are connected end to end by discrete points. Set a region threshold, ensuring that each region includes at least one intersection point; When there is only one intersection point in the area, the discrete point position of the line segment where the intersection point is located is corrected according to the first correction rule; When the number of intersections in the region is greater than one, the discrete point positions of the line segments to which the intersections are located are corrected according to the second correction rule. All intersection points and the corrected set of discrete points are used as input data for triangulation, and triangulation is performed. The set of discrete points consists of all discrete points on the inner line, including both uncorrected and corrected discrete points.

[0045] In this embodiment, the first correction rule is: place the discrete point closest to the intersection point in each line segment containing the intersection point at the location of the intersection point. The second correction rule is: select a center point within the region, project it onto each line segment containing the intersection point, calculate the distance between the center point and the projected point; set a distance threshold, and if the distance is less than the distance threshold, place the discrete point closest to the intersection point in the line segment containing the projected point at the location of the center point.

[0046] In this implementation, if the discrete points at both ends of a line segment have been corrected, it is determined whether an interpolation point needs to be added. The method for determining this is as follows: the interpolation point is pre-added at the intersection of the line segment and another line segment. It is determined whether the distance between the interpolation point and the discrete points at both ends is greater than a preset threshold. If it is greater than the preset threshold, the interpolation point is added; if it is less than the preset threshold, the interpolation point is not added.

[0047] Reference Figures 2a to 6d The following describes this method with specific examples.

[0048] First, define the outline and inner lines ( Figure 2a , Figure 3a , Figure 4a , Figure 5a , Figure 6a Discretize the black lines (inner lines) to obtain a triangulated discrete point set ( Figure 2c , Figure 3c , Figure 4c , Figure 5c , Figure 6c (Green dots). Each internal line is divided into multiple segments by discrete points, and adjacent segments are represented by red and blue lines for easy distinction.

[0049] 1. Pre-mark each internal line that needs to be triangulated, and record all relevant intersections on these line segments, for example: Figure 2c The three internal lines shown intersect at three points: {P1, P2, P3}. A region threshold is set according to the specific situation, and each intersection point is used to divide the region. Each intersection point can be a separate region, or a region can include two intersection points, depending on the design requirements. In this embodiment, a rectangular region enclosed by a plane is used as the intersection point to divide the region, and the diagonal length of the rectangular region is used as the region threshold d. Each intersection point is then used to divide the region. Figure 2c In the diagram, intersection points P1, P2, and P3 are all within the same area. Figure 4c In the diagram, intersection points P1 and P2 are in the same region, while intersection points P3, P4, P5, and P6 each form a separate region.

[0050] 2. Correction for areas with only a single intersection point (e.g.) Figure 4c (Points P3, P4, P5, and P6 in the diagram) Find the segmented intervals on each internal line (a segment is determined by two adjacent discrete points; see the red and blue lines in the related example diagram, where one color represents a segmented interval); correct the coordinates of the end (discrete point) closest to the intersection point to the intersection point (e.g., ...). Figure 4c In the interval Q1-Q2 where P4 is located, the discrete point Q1 (Q1 is closer to the intersection point than Q2) is placed at the intersection point P4. Similarly, for the interval Q3-Q4, the discrete point Q3 is placed at the intersection point P4. A processing identifier is set for the intersection points that meet the correction conditions (this processing is done here to avoid interference in subsequent operations).

[0051] 3. Correct for regions with multiple intersections. This involves correcting for multiple intersections within a region (generally referring to a set of intersections generated by two or more lines, for example...). Figure 2c In {P1, P2, P3}, Figure 4c The {P1, P2} method calculates the center position of the intersection set (e.g., the geometric center of the bounding box, such as...). Figure 4cPoint M1 is projected onto the line segment containing each intersection point to obtain a projection point P. The distance between the center point and the projection point P is calculated. A distance threshold t between the center point and the projection point is designed. If the distance between the center point and the projection point is less than the distance threshold t, the discrete point in the line segment containing the projection point that is closest to the intersection point is corrected to the position of the center point. For example... Figure 4c In the intervals Q5-Q6 and Q7-Q10, discrete points Q5 and Q7 are placed at M1. However, in the interval Q8-Q9, since the distance between the center point and the projection point is greater than the threshold t, discrete points Q8 and Q9 are not corrected.

[0052] 4. If the discrete points at both ends of a line segment have been corrected, it means that the new line segment lacks an intersection point, such as... Figure 5c In the process, discrete points Q1 and Q2 have been corrected (discrete points Q4 and Q1 will be placed at intersection P1, and discrete point Q2 will be placed at intersection P3). The new line segment Q1-Q2 and the line segment containing Q3 do not intersect. At this point, it is necessary to determine whether to add an interpolation point. The determination method is as follows: first, pre-add an interpolation point P2 at the intersection of the line segment containing Q1-Q2 and Q3. Then, determine whether the distance between the interpolation point P2 and the two discrete points Q1 and Q2 is greater than a preset threshold. If it is greater than the preset threshold, add the interpolation point; if it is less than the preset threshold, do not insert a new interpolation point. Introducing this threshold ensures that the inserted interpolation point has a certain distance from the discrete points at both ends, avoiding the reappearance of small grids due to the distance being too close to the discrete points at both ends.

[0053] This invention preprocesses discrete points near the intersection before triangulation, which can minimize the generation of small meshes during triangulation.

[0054] Example 2 This embodiment provides a mesh triangulation system, including: The discrete module is used to discretize the internal lines, so that each internal line is divided into multiple segments that are connected end to end by discrete points. The correction module is used to set a region threshold, where each region includes at least one intersection point; when the number of intersection points in the region is one, the discrete point position of the line segment to which the intersection point is located is corrected according to a first correction rule; when the number of intersection points in the region is greater than one, the discrete point position of the line segment to which the intersection point is located is corrected according to a second correction rule. The triangulation module is used to triangulate all intersection points and the corrected set of discrete points as input data.

[0055] In this embodiment, the first correction rule is: place the discrete point closest to the intersection point in each line segment containing the intersection point at the location of the intersection point. The second correction rule is: select a center point within the region, project it onto each line segment containing the intersection point, calculate the distance between the center point and the projected point; set a distance threshold, and if the distance is less than the distance threshold, place the discrete point closest to the intersection point in the line segment containing the projected point at the location of the center point.

[0056] The system also includes an interpolation module, which is used to: determine whether to add an interpolation point when both discrete points at the two ends of a line segment have been corrected, wherein the method for determination is as follows: An interpolation point is pre-added at the intersection of the line segment and another line segment. It is determined whether the distance between the interpolation point and the discrete points at both ends is greater than a preset threshold. If it is greater than the preset threshold, an interpolation point is added; if it is less than the preset threshold, no interpolation point is added.

[0057] Example 3 This embodiment provides an electronic device including: a memory storing executable instructions; and a processor executing the executable instructions in the memory to implement the above-described mesh triangulation method.

[0058] An electronic device according to an embodiment of the present disclosure includes a memory and a processor.

[0059] This memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc.

[0060] The processor may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. In one embodiment of this disclosure, the processor is used to execute computer-readable instructions stored in the memory.

[0061] Those skilled in the art will understand that, in order to solve the technical problem of how to achieve a good user experience, this embodiment may also include well-known structures such as communication buses and interfaces, and these well-known structures should also be included within the protection scope of this disclosure.

[0062] Example 4 This disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described mesh triangulation method.

[0063] A computer-readable storage medium according to embodiments of the present disclosure stores non-transitory computer-readable instructions. When these non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the methods described in the foregoing embodiments of the present disclosure are performed.

[0064] The aforementioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or portable hard drive), media with built-in rewritable non-volatile memory (e.g., memory card), and media with built-in ROM (e.g., ROM cartridge).

[0065] The above description is merely a description of preferred embodiments of the present invention and is not intended to limit the scope of the present invention in any way. Any changes or modifications made by those skilled in the art based on the above disclosure shall fall within the protection scope of the claims.

Claims

1. A mesh triangulation method, characterized in that, The internal lines involved in triangulation intersect, and these internal lines are the internal lines of the garment pattern. These internal lines are used to generate a triangulated mesh together with the pattern outline during the triangulation process. The method includes: Discretize the internal lines so that each internal line is divided into multiple segments that are connected end to end by discrete points. Set a region threshold, ensuring that each region includes at least one intersection point; When there is only one intersection point in the area, the discrete point position of the line segment where the intersection point is located is corrected according to the first correction rule. The first correction rule is: place the discrete point closest to the intersection point in each line segment where the intersection point is located at the position of the intersection point. When the number of intersections within the region is greater than one, the discrete point positions of the line segments containing the intersections are corrected according to the second correction rule. The second correction rule is as follows: select a center point within the region, project it onto the line segment containing each intersection, and calculate the distance between the center point and the projected point. Set a distance threshold. If the distance between the center point and the projected point is less than the distance threshold, then place the discrete point in the line segment containing the projected point that is closest to the intersection at the position of the center point. All intersection points and the corrected set of discrete points are used as triangulation input data, and triangulation processing is performed to obtain a triangular mesh for physical simulation of clothing patterns.

2. The mesh triangulation method as described in claim 1, characterized in that, The method further includes: if the discrete points at both ends of a line segment have been corrected, then determining whether it is necessary to add interpolation points, wherein the method for determining this is as follows: An interpolation point is pre-added at the intersection of the line segment and another line segment. It is determined whether the distance between the interpolation point and the discrete points at both ends is greater than a preset threshold. If it is greater than the preset threshold, an interpolation point is added; if it is less than the preset threshold, no interpolation point is added.

3. A grid triangulation system, characterized in that, include: The discrete module is used to discretize the internal lines, so that each internal line is divided into multiple segments that are connected end to end by discrete points. The internal lines involved in triangulation are the internal lines of the garment pattern. These internal lines are used to generate a triangulated mesh together with the pattern outline during the process of triangulating the pattern. The correction module is used to set the region threshold, and each region must include at least one intersection point; When there is one intersection point in the region, the discrete point positions of the line segments containing the intersection point are corrected according to the first correction rule. The first correction rule is to place the discrete point closest to the intersection point in each line segment containing the intersection point at the intersection point's location. When there is more than one intersection point in the region, the discrete point positions of the line segments containing the intersection points are corrected according to the second correction rule. The second correction rule is to select a center point in the region, project it onto each line segment containing the intersection point, and calculate the distance between the center point and the projected point. A distance threshold is set. If the distance between the center point and the projection point is less than the distance threshold, then the discrete point in the line segment where the projection point is located that is closest to the intersection point is placed at the location of the center point. The triangulation module is used to take all intersection points and the corrected set of discrete points as input data for triangulation, and perform triangulation processing to obtain a triangular mesh for physical simulation of clothing patterns.

4. The mesh triangulation system as described in claim 3, characterized in that, The system also includes an interpolation module, which is used to: determine whether to add an interpolation point when both discrete points at the two ends of a line segment have been corrected, wherein the determination method is as follows: An interpolation point is pre-added at the intersection of the line segment and another line segment. It is determined whether the distance between the interpolation point and the discrete points at both ends is greater than a preset threshold. If it is greater than the preset threshold, an interpolation point is added; if it is less than the preset threshold, no interpolation point is added.

5. An electronic device, characterized in that, The electronic device includes: Memory, which stores executable instructions; A processor that executes the executable instructions in the memory to implement the mesh triangulation method of claim 1 or 2.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the mesh triangulation method of claim 1 or 2.

Citation Information

Patent Citations

  • Division algorithm for performing map gridding by using triangles

    CN112991529A

  • Program, information processing unit, and mesh correction method

    JP2013050871A