Method and device for piecewise developable approximation based on common distortion and genetic algorithm

Through the shardable spreadable approximation method based on common distortion and gene algorithm, the problems of low manufacturing efficiency and high manufacturing cost in the prior art are solved, and efficient and low-cost blockable spreadable approximation results are achieved.

CN116310211BActive Publication Date: 2025-06-10ZHEJIANG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310140899.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-10
Publication Date
2025-06-10
Estimated Expiration
2043-02-10

AI Technical Summary

Technical Problem

The prior art is difficult to effectively reduce manufacturing costs during the manufacturing process, and it takes a lot of time to perform explicit deformation calculations, resulting in low manufacturing efficiency.

Method used

The shardable expansion approximation method based on common distortion and gene algorithm is adopted. By generating the initial segmentation and evolving using the gene algorithm, reasonable blocks are automatically generated and deformation is performed without calculating the explicit deformation, and the final blockable expansion approximation result is obtained.

Benefits of technology

The results of small approximation error and small block count are achieved. At the same time, other manufacturing indicators (such as cut joint length and bending degree) are also better, which significantly saves manufacturing time and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116310211B_ABST
    Figure CN116310211B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for piecewise developable approximation based on common distortion and genetic algorithm. The method includes: obtaining a triangular mesh model that needs to be subjected to developable approximation, and generating N given initial segmentation numbers according to the triangular mesh model initial segmentations; for the N initial initial segmentations, using a genetic algorithm to evolve the initial segmentations to obtain an optimal segmentation: using the optimal segmentation to perform developable deformation on the triangular mesh model to obtain a piecewise developable approximation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of shape design, and particularly relates to a method and device for piecewise developable approximation based on common distortion and genetic algorithm. Background Art

[0002] Shape approximation is a fundamental task in computer graphics and geometric processing. In manufacturing-related applications, since developable surfaces can be fabricated by bending on a flat material without any stretching, computing a good piecewise developable approximation to approximate a given model provides a feasible solution for reducing manufacturing costs.

[0003] Generally speaking, the quality of the developable approximation to the input triangular mesh is usually measured by two metrics, namely the approximation error between the input and output and the number of blocks. Among them, a small approximation error ensures the effectiveness of the approximation, while a small number of blocks reduces the manufacturing cost. However, in the actual manufacturing process, other metrics such as the length and curvature of the cut seams, and the presence of small pieces and narrow regions are also important factors affecting the manufacturing complexity and cost. For example, long cut seams mean more shearing processes and longer splicing materials, while curved cut seams mean cutting the flat material into more small pieces for splicing at the curved parts, which all bring more manufacturing material and time costs for the splicing work, and previous work has considered less in this regard.

[0004] In addition, existing methods need to perform explicit deformation on the segmentation result before calculating the final approximation error. Therefore, in order to obtain a suitable deformation result, existing methods need to spend a lot of time on segmentation and explicit developable deformation. If a large number of models are to be manufactured, a large amount of redundant explicit calculation of developable deformation will bring a very large time cost to manufacturing, greatly reducing the manufacturing efficiency of the entire method. Summary of the Invention

[0005] The purpose of the embodiments of the present application is to provide a method and device for piecewise developable approximation based on common distortion and genetic algorithm. This method can not only obtain results with a relatively small approximation error and a relatively small number of blocks, but also the quality of other metrics of the results is better than those generated by previous methods. For general models, this method can automatically generate reasonable segmentation without calculating explicit deformation first, and then perform deformation after segmentation to obtain the final result, thus saving the time cost of multiple calculations of explicit developable deformation.

[0006] According to the first aspect of the embodiments of the present application, a method for piecewise developable approximation based on common distortion and genetic algorithm is provided, including:

[0007] (1) Obtain a triangular mesh model that needs to be approximated by developable surfaces, and generate a given initial segmentation number N according to the triangular mesh model initialAn initial segmentation;

[0008] (2) Evolve the initial segmentation using a genetic algorithm to obtain an optimal segmentation:

[0009] (2.1) Calculate the fitness values of all initial segmentations and add all segmentations to the archive set;

[0010] (2.2) Sort the segmentations in the archive set in ascending order using the fitness values, and remove the segmentations whose rankings exceed a given ranking threshold N archive If the current iteration step reaches a predetermined step threshold N iter , or all segmentations in the archive set have not been updated in a certain number of rounds of iteration, then take the segmentation ranked first in the archive set as the optimal segmentation; otherwise, go to step (2.3);

[0011] (2.3) Select all segmentations in the archive set whose rankings are less than a given ranking N best as the first type of segmentations, randomly select a given random number N random segmentations as the second type of segmentations, and mutate all segmentations in the two types;

[0012] (2.4) Randomly select two segmentations in the archive set whose rankings are less than N best for crossover until the number of newly generated crossover segmentations reaches a crossover threshold N cross ;

[0013] (2.5) Calculate the fitness values of all new segmentations generated in steps (2.3) and (2.4). If the fitness value of the new segmentation is smaller than that of the corresponding original segmentation and the increase in the distortion value is less than a certain proportion P insert of the distortion value of the original segmentation, then replace the corresponding original segmentation with the new segmentation and go to step (2.2);

[0014] (3) Perform a developable deformation on the triangular mesh model using the optimal segmentation to obtain a piecewise developable approximation result.

[0015] Furthermore, generate a given number N initial of initial segmentations according to the triangular mesh model, including:

[0016] Generate an appropriate number of conical singular points on the triangular mesh model using a sparse optimization method;

[0017] Generate a minimum spanning tree connecting the conical singular points on the triangular mesh model;

[0018] Generate N initial segmentations whose boundaries contain the minimum spanning tree on the triangular mesh model by setting a variational shape approximation method with different numbers of blocks;

[0019] For each of the said partitions, cut all the high-genus blocks thereof until all the blocks are topologically homeomorphic to a disk, and take all the partitions as the initial partitions.

[0020] Furthermore, for each partition s, the fitness value f(s) includes an index function f p (s) for representing the number of small blocks, an index function f n (s) for representing the number of narrow regions, an obstacle function f d (s) for representing whether the twist is greater than a given threshold, the weighted length f s (s) of the slit, the boundary smoothness f sm (s), and an index function f pn (s) for representing the number of blocks in the current partition:

[0021] The obstacle function where w exp is the given function rate of change, σ exp is the given twist bound, and the partition twist d(s) is calculated as follows:

[0022]

[0023] where u and k respectively represent the optimized metric and Gaussian curvature, k ori is the Gaussian curvature of the initial mesh vertices, L and A are the Laplacian and diagonal area matrices of the mesh, and k(s) represents the element of the optimized Gaussian curvature k at the position where the slit passes through the vertices;

[0024] The weighted length of the slit represents the set of edges that are the partition boundaries, w e is the weighted edge length, that is where θ is the dihedral angle of the edge, l e is the length of the edge;

[0025] The boundary smoothness where is all the outgoing edge vectors in a neighborhood N(v) of the point v and in the set , represents the set of edges that are the partition boundaries;

[0026] The fitness value f(s) is calculated by the following formula:

[0027]

[0028] where, w p , w n , w d , w s, w sm and w pn are the weight functions f p (s), the weight functions f n (s), the barrier function f d (s), the weighted length of the slot f s (s), the boundary smoothness f sm (s) and the number of sub - blocks f pn (s) corresponding weights.

[0029] Furthermore, the mutations on the segmentation include the following four categories:

[0030] (a) Segmentation merging: Cut the slot with nodes into separate sub - slots and put them into the set Randomly select one from the sub - slots that meet the criteria Merge two adjacent sub - blocks of l, where the node is the vertex in the triangular mesh model where there are more than two adjacent slots. The criteria are divided into the following four types:

[0031] Criterion 1: Normal merging: It does not contain conical singularities inside and its length is not less than a certain proportion P of the perimeter of an adjacent block len ;

[0032] Criterion 2: Small - block merging: At least one of the two adjacent sub - blocks is a small block;

[0033] Criterion 3: Ignoring conical singularities: The length is not less than a certain proportion P of the perimeter of an adjacent block len ;

[0034] Criterion 4: Relaxed merging: Unconstrained, that is, all boundaries in can be randomly selected;

[0035] (b) Slot shortening: Cut the slot with nodes and conical singularities into separate sub - slots, randomly select a sub - slot l 1 , find the shortest path l of its endpoints 2 , and replace the sub - slot l in s 1 with l 2 ;

[0036] (c) Narrow - area elimination: Find all narrow areas in the segmentation, randomly select a narrow area n belonging to the sub - block P 1 , separate n from P 1 and merge it into another sub - block P 1 adjacent to P 2 ;

[0037] (d) Modification of protruding segments: Cut the slot with the vertex with a larger included angle between adjacent slots into separate sub - slots, randomly select one of them l 1 , and use l1 One of the shorter boundaries of the neighborhood of 2 Replace l 1 .

[0038] Furthermore, given a fixed number of steps N iter , different mutation strategies are selected according to the number of iterations t:

[0039] 0 ≤ t ≤ N: If the selected segmentation contains small blocks, randomly select one strategy from normal merging and merging small blocks for mutation; if it does not contain small blocks, randomly select one strategy from normal merging and seam shortening for mutation;

[0040] N < t ≤ 2N: For each segmentation, randomly select one strategy from merging without considering conical singularities and seam shortening for mutation;

[0041] 2N < t ≤ 3N: For each segmentation, randomly select one strategy from merging without considering length and seam shortening for mutation;

[0042] 3N < t ≤ 4N: For each segmentation, randomly select one strategy from narrow area elimination and protruding segment modification for mutation.

[0043] Furthermore, the crossover of two segmentations is to transfer part of the boundary of one segmentation to the other segmentation. The specific process is as follows:

[0044] For segmentations A and B, denote the original block set of B as The set of small blocks obtained by cutting the blocks of B with the segmentation line of A is For all small blocks If Add all the cases to the selection set From all Randomly select one of the cases that meet the validity conditions, and merge the small block p that originally belonged to P i in B into another block P j .

[0045] Furthermore, developable deformation is performed by optimizing the following objective function:

[0046] E(v) = w d E d (v) + w p E p (v) + w s E s (v) + w ss E ss (v) + w b E b (v),

[0047] where E d (v) is the developable energy based on discrete Gaussian curvature:

[0048]

[0049] E d (v) measures the size of all internal vertices i ∈ V int where k i is the Gaussian curvature of the internal vertex at the new position v, and E p (v) is the energy of the distance between the deformed mesh and the vertices of the original mesh, and E s (v) is the smooth energy of all internal vertices, and E ss (v) is the smooth energy of all slit boundaries, while E b (v) is the barrier function for fixing the distance between the deformed mesh and the vertices of the original mesh:

[0050]

[0051] where λ is the change rate of the barrier function, is the vertex position of the input mesh, and σ dis is the given target distance threshold.

[0052] According to the second aspect of the embodiments of the present application, a device for piecewise developable approximation based on common distortion and genetic algorithm is provided, including:

[0053] An acquisition module, configured to acquire a triangular mesh model that needs to be developed and approximated, and generate N initial initial segments according to the triangular mesh model;

[0054] An evolution module, configured to evolve the initial segments using a genetic algorithm to obtain an optimal segment:

[0055] A calculation sub-module, configured to calculate the fitness values of all initial segments and add all segments to the archive set;

[0056] A sorting sub-module, configured to sort the segments in the archive set in ascending order using the fitness values, and remove the segments whose rankings exceed a given ranking threshold N archive If the current iteration step reaches a predetermined step threshold N iter , or all segments in the archive set have not been updated in a certain number of rounds of iteration, then take the segment ranked first in the archive set as the optimal segment; otherwise, go to the mutation sub-module;

[0057] A mutation sub-module, configured to select all segments ranked less than a given ranking N best in the archive set as the first type of segments, and randomly select a given random number Nrandom One segmentation is used as the second type of segmentation, and mutations are performed on all segmentations in the two types;

[0058] A crossover sub-module, configured to randomly select two segmentations with rankings less than N from the archive set best for crossover until the number of newly generated crossover segmentations reaches the crossover threshold N cross ;

[0059] A replacement sub-module, configured to calculate the fitness values of all new segmentations generated by the mutation sub-module and the crossover sub-module. If the fitness value of the new segmentation is smaller than that of the corresponding original segmentation and the increase in the distortion value is less than a certain proportion P of the distortion value of the original segmentation insert , then replace the corresponding original segmentation with the new segmentation and go to the sorting sub-module;

[0060] A developable deformation module, configured to perform developable deformation on the triangular mesh model by using the optimal segmentation to obtain a piecewise developable approximation result.

[0061] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including:

[0062] One or more processors;

[0063] A memory, configured to store one or more programs;

[0064] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the first aspect.

[0065] According to a fourth aspect of an embodiment of the present application, there is provided a computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method as described in the first aspect are implemented.

[0066] The technical solutions provided by the embodiments of the present application may include the following beneficial effects:

[0067] As can be seen from the above embodiments, the present application estimates the approximation error through the distortion of the commonality mapping, avoiding the need for a large number of explicit calculations of developable deformation attempts in the previous methods, thereby significantly shortening the efficiency of generating a piecewise developable result in the entire manufacturing process. Secondly, the present application unifies multiple important indicators affecting manufacturing efficiency and cost through a genetic algorithm, and further makes the generated result easier to manufacture, saving a large amount of time and manufacturing costs for the final manufacturing. At the same time, the algorithm of the present application is applicable to general triangular mesh models. With the progress of today's three-dimensional scanning and mesh reconstruction technologies, we can generate triangular mesh models of various objects in real-life scenes in the computer. Therefore, by using the method of the present application, it is possible to perform piecewise developable approximation on the surface of objects in real life and manufacture a piecewise developable physical object close to it.

[0068] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit this application. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application.

[0070] Figure 1 is a flowchart of a method for piecewise developable approximation based on common distortion and genetic algorithm shown according to an exemplary embodiment.

[0071] Figure 2 is a schematic diagram of the process of a method for piecewise developable approximation based on common distortion and genetic algorithm shown according to an exemplary embodiment, where (a) is a schematic diagram of a triangular mesh model, (b) is a schematic diagram of the initial segmentation, (c) is a schematic diagram of the optimal segmentation, (d) is a schematic diagram of the piecewise developable deformation result, (e) is a schematic diagram of printing the piecewise developable deformation result onto a planar material, and (f) is a schematic diagram of the manufactured physical object.

[0072] Figure 3 is a schematic diagram of a narrow area shown according to an exemplary embodiment.

[0073] Figure 4 is a schematic diagram of the modification of a protruding section shown according to an exemplary embodiment, where (a) is the schematic diagram before modification and (b) is the schematic diagram after modification.

[0074] Figure 5 is a block diagram of a device for piecewise developable approximation based on common distortion and genetic algorithm shown according to an exemplary embodiment, where (a) is the overall block diagram of the device and (b) is the block diagram of the evolution module.

[0075] Figure 6 is a schematic diagram of an electronic device shown according to an exemplary embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0076] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the 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 this application.

[0077] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms "a", "the", and "said" used in this application 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.

[0078] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, 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 a determination".

[0079] Figure 1 is a flowchart of a method for piecewise developable approximation based on common distortion and genetic algorithm shown according to an exemplary embodiment, as Figure 1 shown, this method is applied to a terminal and may include the following steps:

[0080] Step (1): Obtain a triangular mesh model that needs to be developed and approximated, and generate a given initial number of divisions N initial initial divisions according to the triangular mesh model;

[0081] Step (2): Use the genetic algorithm to evolve the N initial initial divisions to obtain an optimal division;

[0082] (2.1) Calculate the fitness values of all initial divisions and add all divisions to the archive set;

[0083] (2.2) Sort the divisions in the archive set in ascending order using the fitness values, and remove the divisions whose rankings exceed a given ranking threshold N archive If the current iteration step reaches a predetermined step threshold N iter , or all divisions in the archive set have not been updated in a certain number of rounds of iteration, then take the division ranked first in the archive set as the optimal division; otherwise, go to step (2.3);

[0084] (2.3) Select all divisions in the archive set whose rankings are less than a given ranking N best as the first type of divisions, randomly select a given random number N random divisions as the second type of divisions, and mutate all divisions in the two types;

[0085] (2.4) Randomly select two partitions with ranks less than N from the set of archives best for crossover until the number of newly generated crossover partitions reaches the crossover threshold N cross ;

[0086] (2.5) Calculate the fitness values of all the new partitions generated in steps (2.3) and (2.4). If the fitness value of the new partition is smaller than that of the corresponding original partition and the increase in the distortion value is less than a certain proportion P of the distortion value of the original partition insert , then replace the corresponding original partition with the new partition and go to step (2.2);

[0087] Step (3): Use the optimal partition to perform a developable deformation on the triangular mesh model to obtain a piecewise developable approximation result.

[0088] As can be seen from the above embodiments, the present application estimates the approximation error through the distortion of the commonality mapping, avoiding the need for a large number of explicit calculations of developable deformation attempts in the previous methods, thereby significantly shortening the efficiency of generating a piecewise developable result in the entire manufacturing process. Secondly, the present application unifies multiple important indicators that affect manufacturing efficiency and cost through a genetic algorithm, making the generated result easier to manufacture and saving a large amount of time and manufacturing costs for the final manufacturing. At the same time, the algorithm of the present application is applicable to general triangular mesh models. With the progress of today's three-dimensional scanning and mesh reconstruction technologies, we can generate triangular mesh models of various objects in the living scene in the computer. Thus, using the method of the present application, it is possible to perform a piecewise developable approximation on the surface of an object in real life and manufacture a piecewise developable physical object close to it.

[0089] In the specific implementation of step (1), obtain the triangular mesh model that needs to be approximated developably, and generate a given initial number of partitions N initial initial partitions according to the triangular mesh model;

[0090] Specifically, the user first inputs the triangular mesh model that wants to be approximated developably (such as Figure 2 (a) in). When manufacturing a product, it is first necessary to establish a triangular mesh model of the product. Given a real-world model, first scan the point cloud through a three-dimensional scanning device, and then obtain the triangular mesh model through surface reconstruction technology. In this embodiment, the partition is represented by a Boolean function S on each edge of the mesh, that is

[0091]

[0092] In one embodiment, generate N initial initial partitions (such as Figure 2 (b) in) according to the triangular mesh model, including:

[0093] (1.1) Generate an appropriate number of conical singular points on the triangular mesh model using a sparse optimization method;

[0094] In specific implementation, different methods can be used to generate conical singular points, such as three methods: manual selection, greedy calculation, and optimization. To generate conical singular points with as few as possible and minimal distortion more efficiently, we obtain an appropriate number of conical singular points on the input triangular mesh by optimizing a constrained sparse optimization problem.

[0095] (1.2) Generate a minimum spanning tree connecting the conical singular points on the triangular mesh model;

[0096] (1.3) Generate N initial divisions on the triangular mesh model with boundaries containing the minimum spanning tree by setting the variational shape approximation method with different numbers of blocks;

[0097] In the specific implementation of steps (1.2)-(1.3), to generate divisions with very small distortion values and boundaries containing this minimum spanning tree, we generate N initial divisions on the triangular mesh model with boundaries containing the minimum spanning tree by setting the VSA (Variational Shape Approximation) method with different numbers of blocks. N initial The number of the initial population. Generally, it can be set as an integer greater than zero. But to maintain the diversity of the population and avoid waste of redundant populations, we set N initial = 120.

[0098] (1.4) For each of the divisions, cut all its high-genus sub-blocks until all its sub-blocks are topologically homeomorphic to a disk, and take all the divisions as the initial divisions.

[0099] In specific implementation, for the N initial divisions, if the validity condition is not met, cut the high-genus sub-blocks in the division until the validity condition is satisfied, and take all the divisions as the initial divisions;

[0100] In the specific implementation of step (2), use the genetic algorithm to evolve the initial divisions to obtain the optimal division (such as (c) in Figure 2 );

[0101] Specifically, the genetic algorithm generally includes three important core concepts, namely the validity condition, fitness, and genetic operation. The validity condition is the condition that an individual must satisfy to be a candidate result. Fitness is the quantitative criterion for us to evaluate the quality of each segmentation. Genetic operation is an operation to select individuals for appropriate modification to create new segmentations. To make the new segmentation have a better fitness value relative to its original segmentation, it includes mutation and crossover. In this embodiment, step (2) may include:

[0102] (2.1) Calculate the fitness values of all segmentations and add all segmentations to the archive set;

[0103] In one embodiment, to enable the segmentation to determine a developable approximation of a patch that is easier to manufacture and has a smaller approximation error, for each segmentation s, the fitness value f(s) includes an index function f p (s) representing the number of small blocks, an index function f n (s) representing the number of narrow regions, an obstacle function f d (s) for indicating whether the twist is greater than a given threshold, the weighted length f s (s) of the cut, the boundary smoothness f sm (s), and an index function f pn (s) representing the number of sub-blocks in the current segmentation.

[0104] In a specific implementation, we use the common mapping twist of the segmentation result as an estimate of the approximation error of the final developable result of the sub-blocks. If the common mapping twist of the segmentation result is greater than the given threshold, the obstacle function value is very large, otherwise it is very small. The obstacle function is expressed as where w exp is the given function change rate, σ exp is the given twist bound, and the calculation of the segmentation twist d(s_) is as follows:

[0105]

[0106] where u and k respectively represent the optimized metric and Gaussian curvature, k ori is the Gaussian curvature of the initial mesh vertex, L and A are the Laplacian and diagonal area matrices of the mesh, and k(s) represents the element of the optimized Gaussian curvature k at the position where the cut passes through the vertex.

[0107] In a specific implementation, the weighted length of the cut represents the set of edges that are the boundaries of the segmentation, w e is the weighted edge length of the edge, that is where θ is the dihedral angle of the edge, le is the length of the side.

[0108] In a specific implementation, the smoothness of the boundary where is a neighborhood N(v) of point v and in the set of all outgoing edge vectors, represents the set of edges that divide the boundary.

[0109] In a specific implementation, the number of divided blocks f pn (s) is calculated by directly determining the number of divided blocks in the current segmentation.

[0110] In a specific implementation, the fitness function f(s) is calculated by the following formula:

[0111] f(s) = w p f p (s) + w n f n (s) + w d f d (s) + w s f s (s) + w sm f sm (s) + w pn f pn (s)

[0112] where, w p 、w n 、w d 、w s 、w sm and w pn are the weights corresponding to the index function f p (s), the index function f n (s), the obstacle function f d (s), the weighted length f s (s) of the slit, the smoothness of the boundary f sm (s) and the number of divided blocks f pn (s).

[0113] (2.2) Sort the segmentations in the archive set in ascending order using the fitness value, and remove the segmentations whose rankings exceed the given ranking threshold N initial If the current iteration step reaches the predetermined step threshold N iter , or all the segmentations in the archive set have not been updated in a certain number of rounds of iteration, then take the segmentation ranked first in the archive set as the optimal segmentation; otherwise, go to step (2.3);

[0114] (2.3) Select all the segmentations in the archive set whose rankings are less than the given ranking N bestThe division is regarded as the first type of division, and a given random number N is randomly selected random divisions as the second type of division, and all the divisions in the two types are mutated;

[0115] In the above operations, in order to iterate sufficiently, we set N iter = 1000. And N nest and N random are the number of individuals selected from the current archive set. In order to reduce the calculation of fitness values while maintaining the diversity of the population, we set N best and N random to 10, and the threshold of the iteration rounds can be set according to actual requirements. For example, in one embodiment, it is set to 10 times.

[0116] Specifically, the mutation operation is an operation to modify a single division. The mutations performed on the division include the following four types:

[0117] (a) Division merging: Cut the slit with nodes into separate sub-slits and put them into the set Randomly select one (the probability of each edge being selected is proportional to its weighted edge length) from the sub-slits that meet the criteria (select the current applicable criteria from Criteria 1 - Criteria 4 according to the actual situation) Then merge the two adjacent blocks of l. Wherein the node is the vertex where more than two adjacent slits meet; and the criteria are divided into the following four types:

[0118] Criterion 1 (normal merging): It does not contain conical singularities inside and its length is not less than a certain proportion P of the perimeter of an adjacent block len ;

[0119] Criterion 2 (small block merging): At least one of the two adjacent blocks is a small block;

[0120] Criterion 3 (not considering conical singularities): Its length is not less than a certain proportion P of the perimeter of an adjacent block len ;

[0121] Criterion 4 (relaxed merging): There is no constraint, that is all the boundaries in can be randomly selected.

[0122] (b) Slit shortening: Cut the slit with nodes and conical singularities into separate sub-slits, randomly select a sub-slit l 1 , find the shortest path l 2 of its endpoints, and replace the sub-slit l 1 in s with l 2 ;

[0123] (c) Narrow area elimination: Find all the narrow areas in the division, and randomly select one belonging to the block P1 from the narrow area n of, separate n from P 1 and then merge it into another block P 1 adjacent to P 2 ;

[0124] (d) Modification of the protruding segment: Cut the slit at the vertex with a larger included angle between adjacent slits into separate sub-slits, and randomly select one of them as l 1 , and use l 1 to replace l 2 with the shorter one of the neighborhood boundaries of l 1 .

[0125] As Figure 3 shown, if there is more than one simply connected boundary path (the path in the dotted frame in the figure) in the neighborhood (the dotted area in the figure) of a triangle, we call it a narrow-channel triangle. Intuitively, near the narrow-channel triangle, multiple boundaries will form a narrow channel near the triangle (the area enclosed by the current triangle neighborhood and all the simply connected boundary paths in this neighborhood), that is, the narrow area.

[0126] As Figure 4 shown, the operation of the modified part of the protruding segment smooths the boundary path of the trapezoidal shape to reduce the length of the block boundary. First, as Figure 4 shown in (a) of, we randomly select a trapezoidal boundary path with equal probability. Then, as Figure 4 shown in (b) of, we replace the base and two sides of the trapezoid with another base to form a new block boundary.

[0127] To select more merging strategies in the early stage and more modification strategies in the later stage, we divide the entire evolutionary iteration process into several stages, and the mutation strategies that can be randomly selected in each stage will be different. In our experiment, we divide the entire process into four stages and let N = N iter / 4.

[0128] Given a fixed number of steps N, different mutation strategies will be selected according to the iteration number t:

[0129] 0 ≤ t ≤ N: If the selected segmentation contains small blocks, randomly select one strategy from normal merging and merging small blocks for mutation; if it does not contain small blocks, randomly select one strategy from normal merging and slit shortening for mutation,

[0130] N < t ≤ 2N: For each segmentation, randomly select one strategy from non-conical singularity merging and slit shortening for mutation,

[0131] 2N < t ≤ 3N: For each individual, randomly select one strategy from non - considering length merging and slit shortening for mutation; 3N < t ≤ 4N: For each individual, randomly select one strategy from narrow - area elimination and protruding - segment modification for mutation.

[0132] (2.4) Randomly select two partitions with ranks less than a given value from the archive set for crossover until the number of newly generated crossover partitions reaches a given threshold;

[0133] Specifically, performing crossover on two partitions means migrating part of the boundary of one partition to the other. The process is as follows:

[0134] For partitions A and B, denote the original block set of B as The set of small blocks obtained by cutting the blocks of B with the dividing line of A is For all small blocks p ∈ P s , if All cases are added to the selection set From all cases that meet the validity condition, randomly select one, and merge the small block p that originally belonged to P in B i into another block P j .

[0135] (2.5) Calculate the fitness values of all new partitions generated in steps (2.3) and (2.4). If the new partition has a smaller fitness value than the corresponding original partition and the distortion (i.e., the value of the partition distortion d(s)) is less than a given threshold, then replace the corresponding original partition with the new partition and go to step (2.2);

[0136] Specifically, this step is Elitist Reinsertion. According to the iteration number t, select different conditions for replacing the original partition with the new partition in Elitist Reinsertion:

[0137] 0 ≤ t ≤ N: The new partition has a smaller fitness value than its original partition;

[0138] N < t ≤ 2N: The new partition has a smaller fitness value than its original partition and the increase in distortion is less than a certain proportion (0.1) of the original distortion;

[0139] 2N < t ≤ 3N: The new partition has a smaller fitness value than its original partition and the increase in distortion is less than a certain proportion (0.05) of the original distortion;

[0140] 3N < t ≤ 4N: The new partition has a smaller fitness value than its original partition and the increase in distortion is less than a certain proportion (0.01) of the original distortion.

[0141] The above ratio range is [0, 1]. The decreasing setting is because subsequent operations (highlight segment modification) will rapidly increase the distortion, so the control of the distortion will be stronger and the ratio will be smaller.

[0142] In the specific implementation of step (3), the optimal segmentation is used to perform developable deformation on the triangular mesh model to obtain a segmented developable approximation result.

[0143] Specifically, the developable deformation is performed by optimizing the following objective function:

[0144] E(v) = w d E d (v) + w p E p (v) + w s E s (v) + w ss E ss (v) + w b E b (v),

[0145] where E d (v) is the developable energy based on the discrete Gaussian curvature:

[0146]

[0147] E d (v) measures the size of all internal vertices i ∈ C int where k i is the Gaussian curvature of the internal vertex at the new position v. E p (v) is the energy of the distance between the deformed mesh and the original mesh vertices, E s (v) is the smooth energy of all internal vertices, E ss (v) is the smooth energy of all seam boundaries, and E b (v) is the barrier function for the distance between the fixed deformed mesh and the original mesh vertices:

[0148]

[0149] where λ is the change rate of the barrier function, is the vertex position of the input mesh, and σ dis is the given target distance threshold.

[0150] The entire optimization iteration process is as follows:

[0151] (3.1) Use an optimization method (such as gradient descent in first-order methods or quasi-Newton methods in second-order methods. To achieve faster convergence, we use the Gauss-Newton method) to perform optimization for a fixed number of times (50 in one embodiment). If the current internal maximum curvature is less than a certain threshold (we select a suitable value of 5e-4), stop the optimization and output the deformation result (such as Figure 2 in (d)). Otherwise, go to (3.2).

[0152] (3.2) Increase the coefficients of developable energy, smoothness, and boundary smoothness (w d , w s , w ss ), go to (3.3).

[0153] (3.3) If the reduction in the maximum curvature inside the new mesh compared to the previous iteration is less than a certain proportion of the maximum curvature (which can be any value between [0, 1], and we default it to 0.01), we remesh around the vertex with the maximum curvature and go to (3.1).

[0154] After generating the piecewise developable surface, our manufacturing is divided into the following steps:

[0155] Perform local injective isometric parameterization on each piece. Find the overlapping parts of each piece and cut them so that there is no overlap.

[0156] For each parameterized piece, we merge two adjacent edges in the original three-dimensional mesh with a small angle to make the boundary of each piece as smooth as possible.

[0157] For each smoothed piece, add small trapezoids connected to each edge to generate new planar pieces.

[0158] For the piecewise developable approximation result, if it needs to be manufactured, each piece of the result is parameterized to a plane, and then the parameterized result is printed onto a planar material for manufacturing. To make the material be utilized as much as possible to reduce the manufacturing cost, we use a packing algorithm to place the new planar pieces in several rectangles and then print them onto the planar material (such as Figure 2 in (e)), so as to perform manufacturing (such as Figure 2 in (f)).

[0159] It should be noted that the above parameters that are not specifically described (such as weights, thresholds, ratios, etc.) can be set by those skilled in the art according to experience and no additional explanation is required.

[0160] The present invention discloses a piecewise developable approximation method based on common distortion and genetic algorithm. The method includes: when receiving an input mesh, first generating a plurality of initial partitions that contain conical singularities on the boundary, and then evolving the partitions using the genetic algorithm. After the evolution ends, then using a non-linear optimization method to deform the initial mesh into a piecewise developable mesh. The above method is mainly applicable to the piecewise developable problem where the input is a triangular mesh. Compared with other methods, the final result achieves better effects in terms of approximation error, number of blocks, and seam length, etc.

[0161] Corresponding to the embodiment of the piecewise developable approximation method based on common distortion and genetic algorithm described above, the present application also provides an embodiment of a device for piecewise developable approximation based on common distortion and genetic algorithm.

[0162] Figure 5 It is a block diagram of a device for piecewise developable approximation based on common distortion and genetic algorithm shown according to an exemplary embodiment. Referring to Figure 5 in (a) and Figure 5 in (b), the device may include:

[0163] An acquisition module 11, configured to acquire a triangular mesh model that needs to be developed and approximated, and generate N initial initial partitions according to the triangular mesh model;

[0164] An evolution module 12, configured to evolve the initial partitions using the genetic algorithm to obtain an optimal partition:

[0165] A calculation sub-module 121, configured to calculate the fitness values of all initial partitions and add all partitions to the archive set;

[0166] A sorting sub-module 122, configured to sort the partitions in the archive set in ascending order using the fitness values, and remove the partitions whose rankings exceed a given ranking threshold N archive . If the current iteration step reaches a predetermined step threshold N iter , or all partitions in the archive set have not been updated in a certain number of rounds of iteration, then take the partition ranked first in the archive set as the optimal partition; otherwise, go to the mutation sub-module;

[0167] A mutation sub-module 123, configured to select all partitions in the archive set whose rankings are less than a given ranking N best as the first type of partitions, randomly select a given random number N random partitions as the second type of partitions, and mutate all partitions in the two types;

[0168] A crossover sub-module 124, configured to randomly select from the archive set partitions whose rankings are less than N bestThe two partitions are crossed until the number of newly generated crossed new partitions reaches the crossing threshold N cross ;

[0169] Replacement sub-module 125 is used to calculate the fitness values of all new partitions generated by the mutation sub-module and the crossover sub-module. If the fitness value of the new partition is smaller than that of the corresponding original partition and the increase in the distortion value is less than a certain proportion P of the distortion value of the original partition insert , then replace the corresponding original partition with the new partition and go to the sorting sub-module;

[0170] The developable deformation module 13 is used to perform developable deformation on the triangular mesh model by using the optimal partition to obtain a segmented developable approximation result.

[0171] Regarding the device in the above embodiments, the specific ways in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0172] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are only illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this application. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0173] Correspondingly, the present application also provides an electronic device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method for segmented developable approximation based on common distortion and genetic algorithm as described above. As Figure 6 shown, it is a hardware structure diagram of a device with any data processing ability where the method for segmented developable approximation based on common distortion and genetic algorithm provided by the embodiment of the present invention is located. Except for Figure 6 the processors, memory, and network interfaces shown, any device with data processing ability where the device in the embodiment is located usually also includes other hardware according to the actual functions of the device with any data processing ability, which will not be elaborated here.

[0174] Correspondingly, the present application also provides a computer-readable storage medium, on which computer instructions are stored. When the instructions are executed by a processor, the method of piecewise developable approximation based on common distortion and genetic algorithm as described above is implemented. The computer-readable storage medium may be an internal storage unit of any device with data processing capabilities described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium may also be an external storage device, such as a plug-in hard disk, a Smart Media Card (SMC), an SD card, a Flash Card, etc. equipped on the device. Further, the computer-readable storage medium may also include both an internal storage unit of any device with data processing capabilities and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and may also be used to temporarily store data that has been output or is to be output.

[0175] After considering the specification and practicing the content disclosed herein, those skilled in the art will readily conceive of other embodiments of the present application. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include common general knowledge or conventional technical means in the technical field not disclosed in the present application.

[0176] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A method for piecewise developable approximation based on common distortion and genetic algorithm, Characterized in that, Comprising: (1) Obtain a triangular mesh model that needs to be approximated by unfolding, and generate a given initial number of divisions according to the triangular mesh model initial divisions; (2) Using the genetic algorithm to evolve the initial segmentation to obtain the optimal segmentation: (2.1) Calculate the fitness values of all initial segmentations and add all segmentations to the archive set; (2.2) Ascendingly sort the partitions in the archive set using the fitness value, and remove the partitions whose ranking exceeds a given ranking threshold if the current iteration step reaches a predetermined step threshold , or if all the partitions in the archive set have not been updated in a certain number of rounds of iterations, then take the partition ranked first in the archive set as the optimal partition; Otherwise, go to step (2.3); (2.3) Select all the segments with rankings less than the given ranking from the said archive set as the first type of segments, randomly select a given random number of segments as the second type of segments, and mutate all the segments in the two types; (2.4) Randomly select two partitions with ranks less than from the set of archives for crossover until the number of newly generated crossover partitions reaches the crossover threshold ; (2.5) Calculate the fitness values of all newly split segments generated in steps (2.3) and (2.4). If the fitness value of the new split segment is smaller than that of the corresponding original split segment and the increase in the distortion value is less than a certain proportion of the distortion value of the original split segment , then replace the corresponding original split segment with the new split segment and go to step (2.2); (3) Using the optimal segmentation to perform developable deformation on the triangular mesh model to obtain a piecewise developable approximation result; Among them, for each segmentation , the fitness value includes an index function for representing the number of small blocks , an index function for representing the number of narrow regions , an obstacle function for representing whether the distortion is greater than a given threshold , the weighted length of the slit , the smoothness of the boundary and an index for representing the number of sub - blocks in the current segmentation : The obstacle function where is the given function rate of change, is the given distortion bound that partitions the distortion is calculated as follows: , where and represent the optimized metric and the Gaussian curvature respectively, is the Gaussian curvature of the initial mesh vertices, and are the Laplacian and diagonal area matrices of the mesh, represents the optimized Gaussian curvature in the element where the slit passes through the vertex position; The weighted length of the slit , represents the set of edges that are the dividing boundaries, is the weighted edge length, that is , where is the dihedral angle of the edge, is the length of the edge; The smoothness of the boundary where is in a neighborhood of the point and for all outgoing edge vectors in the set and in the set of all outgoing edge vectors, denotes the set of edges that make up the segmentation boundary; The fitness value is calculated by the following formula: , Among them, , , , and are the index functions , index function , barrier function , weighted length of the slits , boundary smoothness and the number of divided blocks corresponding weights.

2. The method according to claim 1, Characterized in that, Generate a given initial number of segments according to the triangular mesh model initial segments, including: Using the sparse optimization method to generate an appropriate number of cone singularities on the triangular mesh model; Generate a minimum spanning tree connecting the cone singularities on the triangular mesh model; Generate, on the triangular mesh model, a segmentation with boundaries containing the minimum spanning tree by setting a variational shape approximation method with different numbers of blocks where the boundaries contain the minimum spanning tree For each of the segmentations, cut all its high-genus sub-blocks until all its sub-blocks are topologically homeomorphic to a disk, and use all segmentations as the initial segmentation.

3. The method according to claim 1, Characterized in that, The mutations performed on the segmentation include the following four categories: (a) Splitting and merging: Cut the slits with nodes into separate sub-slits and put them into a set , randomly select one from the sub-slits that meet the criteria , and merge two adjacent blocks, where the nodes are the vertices in the triangular mesh model where more than two adjacent slits meet, and the criteria are divided into the following four types: Criterion 1: Normal merging: It does not contain conical singularities inside and its length is not less than a certain proportion of the perimeter of a certain adjacent block ; Criterion 2 small-block merging: At least one small block for two adjacent sub-blocks; Criterion 3 does not consider conical singularities: the length is not less than a certain proportion of the perimeter of a neighboring piece ; Criterion 4 Relaxed Merging: Unconstrained, i.e., any of the boundaries in (b)Slit shortening: Cut the slit into separate sub-slits using nodes and conical singularities, and randomly select one sub-slit , find the shortest path of its endpoints , and replace the sub-slit in with ; (c)Narrow area elimination: Find all narrow areas in the segmentation and randomly select one narrow area belonging to the block ; Separate it from and merge it into another block adjacent to ; ; ​ (d)Modification of the protruding section: Cut the slits at the vertices with a larger included angle between adjacent slits into separate sub-slits, and randomly select one of them , and use the shorter one among the boundaries of a neighborhood of to replace .

4. The method according to claim 3, Characterized in that, Given a fixed number of steps , different mutation strategies are selected according to the number of iterations : : If the selected split contains small blocks, randomly select one strategy from normal merging and merging small blocks for mutation; if it does not contain small blocks, randomly select one strategy from normal merging and seam shortening for mutation; : For each segmentation, randomly select one strategy from not considering the merging of conical singular points and the shortening of slits for mutation; : For each segmentation, randomly select one strategy from length merging without consideration and seam shortening for mutation; : For each segmentation, randomly select one strategy from eliminating segments from narrow regions and salient segment modification for mutation.

5. The method according to claim 1, Characterized in that, The crossover of two segmentations is to migrate part of the boundary of one segmentation to the other segmentation, and the process is as follows: For splitting A and B, denote the original block set of B as , and the set of small blocks obtained by cutting the blocks of B with the splitting lines of A as . For all small blocks , if , add all cases of to the selection set . Randomly select one case from all cases that meet the validity condition, and merge the small blocks that originally belonged to B in into another block .

6. The method according to claim 1, Characterized in that, Perform developable deformation by optimizing the following objective function: , wherein is the developable energy based on discrete Gaussian curvature: , Measure the size of all interior vertices of the partitions where is the Gaussian curvature of the interior vertices at the new positions and is the energy of the distance between the deformed mesh and the vertices of the original mesh is the smooth energy of all interior vertices is the smooth energy of all slit boundaries, and is the barrier function that fixes the distance between the deformed mesh and the vertices of the original mesh: , wherein is the change rate of the obstacle function, is the vertex position of the input grid, is the given target distance threshold.

7. An apparatus for piecewise developable approximation based on common distortion and genetic algorithm, Characterized in that, Comprising: An acquisition module, configured to acquire a triangular mesh model that needs to be approximated by unfolding, and generate a given initial number of segments according to the triangular mesh model initial segments; An evolution module for using the genetic algorithm to evolve the initial segmentation to obtain the optimal segmentation: A calculation sub-module for calculating the fitness values of all initial segmentations and adding all segmentations to the archive set; A sorting sub-module, which is used to perform ascending sorting on the segments in the archive set by using the fitness value, and remove the segments whose rankings exceed a given ranking threshold If the current iteration step reaches a predetermined step threshold or all the segments in the archive set have not been updated in a certain number of rounds of iterations, then the segment ranked first in the archive set is used as the optimal segment; Otherwise, go to the mutation sub-module; A mutation sub-module, configured to select all segments with rankings less than a given ranking from the set of archives as the first type of segments, randomly select a given random number of segments as the second type of segments, and mutate all segments in the two types; A crossover sub-module, which is used to randomly select two splits with ranks less than from the archive set for crossover until the number of newly generated crossover splits reaches the crossover threshold ; Replacement sub-module, used to calculate the fitness values of all newly segmented parts generated by the mutation sub-module and the crossover sub-module. If the fitness value of the new segmentation is smaller than that of the corresponding original segmentation and the increase in the distortion value is less than a certain proportion of the distortion value of the original segmentation , then replace the corresponding original segmentation with the new segmentation and go to the sorting sub-module; A developable deformation module for using the optimal segmentation to perform developable deformation on the triangular mesh model to obtain a piecewise developable approximation result; Among them, for each segmentation , the fitness value includes an index function for indicating the number of small blocks , an index function for indicating the number of narrow areas , an obstacle function for indicating whether the distortion is greater than a given threshold , the weighted length of the slit , the smoothness of the boundary and an index for indicating the number of divided blocks in the current segmentation : The obstacle function where is the given function rate of change, is the given distortion bound, splitting the distortion is calculated as follows: , where and represent the optimized metric and the Gaussian curvature respectively, is the Gaussian curvature of the initial mesh vertices, and are the Laplacian and diagonal area matrices of the mesh, represents the optimized Gaussian curvature for the elements where the slit passes through the vertex positions; The weighted length of the slit , represents the set of edges that are the segmentation boundaries, is the weighted edge length, that is , where is the dihedral angle of the edge, is the length of the edge; The smoothness of the boundary where is in a neighborhood of the point and all the outgoing edge vectors in the set and in the set of all outgoing edge vectors, denotes the set of edges that partition the boundary; The fitness value is calculated by the following formula: , Among them, , , , and are the index functions , index functions , barrier functions , the weighted length of the slots , the boundary smoothness and the number of divided blocks corresponding weights.

8. An electronic device, Characterized in that, Comprising: One or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-6.

9. A computer-readable storage medium having computer instructions stored thereon, Characterized in that, When the instructions are executed by a processor, the steps of the method according to any one of claims 1-6 are implemented.

Citation Information

Patent Citations

  • Fast point cloud boundary extraction technique combined with improved particle swarm algorithm

    CN108320293A

  • Methods and systems for generating polycube segmentations from input meshes of objects

    US20160240001A1