A 3D deformable model reconstruction method based on magic ruler structure
Through the three-dimensional deformable model reconstruction method based on magic ruler structure, the long solution time problem caused by the complexity of the three-dimensional model deformation algorithm in the existing technology is solved, and fast solution and efficient three-dimensional model reconstruction are realized, which is suitable for reorganization Applications of furniture and free form robots.
Patent Information
- Application Number
- CN202111608333.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-12-24
AI Technical Summary
The existing three-dimensional model deformation algorithm has large data volume and complex calculations, which leads to a long time in the solution process and is unable to achieve rapid solution.
The three-dimensional deformable model reconstruction method based on the magic ruler structure is adopted, and the algorithm is simplified, complexity is reduced, and rapid solution is achieved through voxelization, chain configuration solution, folding operation sequence calculation and magic ruler configuration adjustment.
It improves the solution efficiency of the three-dimensional model reconstruction method, simplifies the folding step, and is suitable for the application of recombinant furniture and free-form robots.
Smart Images

Figure CN114332367B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of three-dimensional deformable model reconstruction, and in particular relates to a three-dimensional deformable model reconstruction method based on a magic ruler structure. Background Art
[0002] In recent years, with the maturity of various 3D model deformation algorithms, 3D model deformation technology has been more and more widely used in toys and crafts, folding furniture, robots, etc. However, the existing 3D model deformation algorithm has a large amount of data and complex calculations. Therefore, the 3D model solution process is very long and it is impossible to achieve fast solution of the 3D model. Summary of the invention
[0003] The purpose of the present invention is to provide a three-dimensional deformable model reconstruction method based on a magic ruler structure, which allows users to quickly implement the reconstruction method solution of the input three-dimensional model. The specific technical solution is as follows:
[0004] A method for reconstructing a three-dimensional deformable model based on a magic ruler structure comprises the following steps:
[0005] Step S1: voxelizing the two sets of input target models to be designed;
[0006] Step S2, finding the chain configuration of the model;
[0007] Step S3, calculating the folding operation sequence of the model;
[0008] Step S4, adjusting the number of magic ruler configurations of the two groups of models to be consistent;
[0009] Step S5, outputting the corresponding magic ruler configuration and the complete process of mutual deformation between the magic ruler and the straight chain.
[0010] Furthermore, in the voxelization process, step S1 introduces information encoding for voxels, modules, and chains.
[0011] Furthermore, step S1 includes the following specific steps:
[0012] Step S11, scaling the model:
[0013] First, the input model is scaled. By default, the minimum direction of the bounding box is scaled to 3. The user can manually adjust the scale after input.
[0014] Step S12, solving the voxel storage matrix M vox :
[0015] Round up the lengths of the bounding box cuboid in three directions, so that all the vertex coordinates of the cubes are integers; traverse each cube in the set, perform intersection detection with the input model, and record the three-dimensional coordinate values of the intersecting cubes, i.e., the model voxels; add the 12 triangular prism modules c of the i-th voxel j Perform Boolean operations on the input model M respectively, and convert M into vox Middle 0_i′ ~l 11_i′ The value of is set to 0 or 1; where j∈[0,11]. If they intersect, the ratio of the volume of the intersecting part to the volume of the triangular prism is rat:
[0016]
[0017] Furthermore, step S2 includes the following specific steps:
[0018] Step S21, constructing a connection tree:
[0019] A voxel is selected, and a module with a feasible state is selected from it as the first module. Starting from the first module, the feasible states of the modules are calculated in sequence according to the storage matrix information of the voxel where the module is located;
[0020] Each module may have multiple states relative to the previous module, so the voxel is equivalent to a node in the process of segmentation and connection, and the connection tree is calculated in sequence.
[0021] Step S22, generating a connection forest:
[0022] There are many ways to select the voxel where the first module is located and the specific posture of the module, each of which can generate a new connection tree; trees with different root nodes constitute a "forest".
[0023] Step S23, find the optimal chain:
[0024] Perform a depth-first traversal on each tree, find the longest chain of the tree and calculate the folding sequence to determine whether it can complete the folding without collision. Finally, select the chain configuration that can complete the folding in the longest chain of all trees as the optimal chain.
[0025] Furthermore, step S3 includes the following specific steps:
[0026] Fold the modules one by one in the coding order starting from the first module. If two parts of the chain collide during the folding process, the collision site is avoided by changing the rotation direction or rotating the module at the collision site by a certain angle in advance.
[0027] Further, step S4 includes the following specific steps:
[0028] Step S41, automatically adjusting the number of modules in the chain structure:
[0029] The first method is to adjust the size of the input model, re-voxelize it, and generate a new chain structure; the number of chain modules of the first input model is specified as the target number of modules, and the size of the input model is adjusted by multiplying a certain value of its length, width, height, and height by the scaling factor α scale ; When α scale <1, that is, the model to be adjusted needs to be reduced, then the target to be changed is the one with the largest length, width, and height, otherwise the smallest one is selected; scaling factor α scale The definition is as follows:
[0030]
[0031] Among them, n aim is the target module number; n now is the number of modules of the model to be adjusted.
[0032] The second method is to directly remove several modules at the end of the chain; the chain configuration with the largest number of modules in the two models is selected as the target, and its tail modules are deleted until the number of modules in the two models is equal.
[0033] Step S42, manually adjusting the number of modules in the chain structure.
[0034] The present invention can flexibly realize a variety of configurations of magic rulers as the basic structure, fit the input model with a simple geometric shape, and realize deformation reconstruction between models. With a straight chain structure as the intermediate structure of shape conversion, the modules are connected by a single rotation pair and have only a limited number of relative postures, and are arranged regularly to ensure the tightness of the connection of the entire model. At the same time, the complexity of the algorithm is reduced, the folding steps are simplified, and the reconstruction method of the input three-dimensional model is solved more quickly. The present invention can improve the efficiency of the three-dimensional model reconstruction method solution, and has a good practical application effect in the use of reorganized furniture and free-form robots. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a schematic diagram of the relationship between a single magic ruler module and the connection status of the magic ruler in the present invention.
[0036] Figure 2 It is a schematic diagram of the coding of voxel edges and faces in the present invention.
[0037] Figure 3 Schematic diagram of a rabbit model and its bounding box in an embodiment of the present invention.
[0038] Figure 4 Schematic diagram of calculation of voxel information of a rabbit model in an embodiment of the present invention.
[0039] Figure 5 Schematic diagram of the optimal chain calculation of the rabbit model in an embodiment of the present invention.
[0040] Figure 6 It is a voxel model of the house model after scaling and a chain connection calculation result diagram in an embodiment of the present invention.
[0041] Figure 7 It is a schematic diagram of the voxelized structure, chain configuration and folding process of the test case in the embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to better understand the purpose, structure and function of the present invention, the following is a further detailed description of a three-dimensional deformable model reconstruction method based on a magic ruler structure of the present invention in conjunction with the accompanying drawings.
[0043] The three-dimensional deformable model reconstruction method based on the magic ruler structure of the present invention comprises the following steps:
[0044] Step S1: voxelizing the two sets of input target models to be designed;
[0045] Step S2, finding the chain configuration of the model;
[0046] Step S3, calculating the folding operation sequence of the model;
[0047] Step S4, adjusting the number of magic ruler configurations of the two groups of models to be consistent;
[0048] Step S5, outputting the corresponding magic ruler configuration and the complete process of mutual deformation between the magic ruler and the straight chain.
[0049] In the voxelization process of step S1, since the triangular prism module is regarded as a quadtree node, the different orientations of the module inside the voxel will affect the number of its child nodes. In order to facilitate the marking of the triangular prism orientation and refine the distribution of the target model in the voxel space, information encoding for voxels, modules, and chains is introduced.
[0050] The step S1 specifically includes the following steps:
[0051] Step S11, firstly, the input model M is scaled, and the minimum direction of the bounding box is scaled to 3 by default. The user can manually adjust the scale after input. Figure 3 , the minimum direction of the rabbit model bounding box is the y direction, and the maximum vertex coordinate is (x min ,y min ,z min ) and (x max ,y max ,z max ), determine the scaling ratio sca and the length len after scaling in each direction, as shown in the formula:
[0052]
[0053] Step S12: round up the lengths of the bounding box cuboid in three directions and divide it into a set of cubes of unit length, where all the vertex coordinates of the cubes are integers. Traverse each cube in the set, perform intersection detection with the input model, and record the three-dimensional coordinate values of the intersecting cubes, i.e., the model voxels. The number is n. ′ is the M of the calculation model vox , the edge coding value in the i-th voxel corresponds to the 12 triangular prism modules c of the 12 voxel edge coding values j Perform Boolean operations on the input model M respectively, and convert M into vox Middle 0_i′ ~l 11_i′ The value of is set to 0 or 1. Where j∈[0,11]. If they intersect, but the ratio of the volume of the intersecting part to the volume of the triangular prism is less than 0.1, then it is ignored and the corresponding l j_i′ Take it as 0.
[0054]
[0055] like Figure 4 As shown in the local figure, the intersection of the voxel with three-dimensional coordinates (4,0,3) and the model M is shown. ′ = 10, the pink outline part is the intersection part. Among the 12 triangular prism modules with edge coding values of l1, l2, and l4, the volume ratio of the module is less than 0.1, so l 0_10 ~l 11_10 Middle 1_10 ,l 2_10 ,l 4_10 All are 0, and the others are 1. Voxel storage matrix M vox The corresponding row vector in is:
[0056] m vox_10 =[4 0 1 0 1 0 0 1 0 1 1 1 1 1 1] (3)
[0057] Step S2, obtaining the chain configuration of the model specifically includes the following steps:
[0058] Step S21, as Figure 5 As shown in the figure, the rabbit model starts with the voxel marked with star in the upper left corner of the figure. Starting from the first module, the feasible states of the modules are calculated in sequence according to the storage matrix information of the voxel where the module is located. Each module may have multiple states relative to the previous module, so the voxel is equivalent to a node in the process of segmentation and connection. The connection tree is calculated in sequence, and the tree is generated using the breadth-first algorithm. Since the module has a maximum of four states when the position state of the previous module is determined, the degree of the tree node is less than or equal to 4.
[0059] Step S22: There are many ways to select the voxel where the first module is located and the specific posture of the module, and each method can generate a new connection tree. Figure 5 As shown in Figure 1, if the voxel in the upper right corner is selected as the starting point, a different connection tree is generated. These trees with different root nodes form a "forest".
[0060] Step S23, after obtaining the connection forest, it is necessary to find the longest chain that can be formed by folding straight chains without collision in all the subchains of the quad-connected trees. There may be one or more. Figure 5 As shown, the chain structure is the longest chain connecting the tree, which is used as the target configuration, the relative position matrix M obj =[0 ... 1 3 1 3 2 ... 1]. To obtain the optimal chain, we need to perform a depth-first traversal of each tree, find the longest chain of the tree and calculate the folding sequence to determine whether it can complete the folding without collision. Finally, we need to select the chain configuration that can complete the folding in the longest chain of all trees as the optimal chain.
[0061] Step S3 is as follows: when calculating the folding sequence, it is necessary to start from the first module of the magic ruler and fold them one by one in the coding order. If two parts of the chain collide during the folding process, the collision site is avoided by changing the rotation direction or rotating the module at the collision site by a certain angle in advance.
[0062] Step S4 includes the following specific steps:
[0063] Step S41, automatically adjusting the number of modules in the chain structure:
[0064] There are two ways to automatically adjust the number of modules in the chain structure.
[0065] The first method is to adjust the size of the input model, re-voxelize it, and generate a new chain structure; the number of chain modules of the first input model is specified as the target number of modules, and the size of the next input model is adjusted by multiplying a certain value of its length, width, height, and height by the scaling factor α scale In order to minimize the impact on the overall shape, when α scale <1, that is, the model to be adjusted needs to be reduced, then the target to be changed is the one with the largest length, width, and height, otherwise the one with the smallest value is selected. Scaling factor α scale The definition is as follows:
[0066]
[0067] Among them, n aim is the target module number; n ow is the number of modules of the model to be adjusted.
[0068] The second method is to directly remove several modules at the end of the chain; select the chain configuration with the largest number of modules in the two models as the target, and delete its tail module until the number of modules in the two models is equal.
[0069] Step S42, manually adjust the number of modules of the chain structure:
[0070] Due to the characteristics of the structural design of some models, direct volume scaling cannot achieve good results. In this case, you can make local modifications to the model in an interactive way.
[0071] Step S5 is specifically as follows:
[0072] like Figure 7 As shown, this method calculates a variety of configurations for selection, and generates corresponding simulation folding transformation animations and outputs them locally.
[0073] It is to be understood that the present invention is described by some embodiments, and it is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.
Claims
1. A method for reconstructing a three-dimensional deformable model based on a magic ruler structure, characterized in that: The steps include: Step S1: voxelizing the two sets of input target models to be designed; Step S2, finding the chain configuration of the model; Step S3, calculating the folding operation sequence of the model; Step S4, adjusting the number of magic ruler configurations of the two groups of models to be consistent; Step S5, outputting the corresponding magic ruler configuration and the complete process of mutual deformation between the magic ruler and the straight chain; Step S1 introduces information coding for voxels, modules, and chains during the voxelization process; Step S1 includes the following specific steps: Step S11, scaling the model: First, the input model is scaled. By default, the minimum direction of the bounding box is scaled to 3. The user can manually adjust the scale after input. Step S12, solving the voxel storage matrix M vox : Round up the lengths of the bounding box cuboid in three directions, so that all the vertex coordinates of the cubes are integers; traverse each cube in the set, perform intersection detection with the input model, and record the three-dimensional coordinate values of the intersecting cubes, i.e., the model voxels; The 12 triangular prism modules c of the i-th voxel j Perform Boolean operations on the input model M respectively, and convert M into vox Middle 0_i′ ~l 11_i′ The value of is set to 0 or 1; j∈[0,11]; if they intersect, the ratio of the volume of the intersecting part to the volume of the triangular prism is rat:
2. The method for reconstructing a three-dimensional deformable model based on a magic ruler structure according to claim 1, characterized in that: Step S2 includes the following specific steps: Step S21, constructing a connection tree: A voxel is selected, and a module with a feasible state is selected from it as the first module. Starting from the first module, the feasible states of the modules are calculated in sequence according to the storage matrix information of the voxel where the module is located; Each module may have multiple states relative to the previous module, so the voxel is equivalent to a node in the process of segmentation and connection, and the connection tree is calculated in sequence; Step S22, generating a connection forest: There are many ways to select the voxel where the first module is located and the specific posture of the module, each of which can generate a new connection tree; trees with different root nodes form a "forest"; Step S23, find the optimal chain: Perform a depth-first traversal on each tree, find the longest chain of the tree and calculate the folding sequence to determine whether it can complete the folding without collision. Finally, select the chain configuration that can complete the folding in the longest chain of all trees as the optimal chain.
3. The method for reconstructing a three-dimensional deformable model based on a magic ruler structure according to claim 2, characterized in that: Step S3 includes the following specific steps: Fold the modules one by one in the coding order starting from the first module. If two parts of the chain collide during the folding process, the collision site is avoided by changing the rotation direction or rotating the module at the collision site by a certain angle in advance.
4. The method for reconstructing a three-dimensional deformable model based on a magic ruler structure according to claim 3 is characterized in that: Step S4 includes the following specific steps: Step S41, automatically adjusting the number of modules in the chain structure: The first method is to adjust the size of the input model, re-voxelize it, and generate a new chain structure; the number of chain modules of the first input model is specified as the target number of modules, and the size of the input model is adjusted by multiplying a certain value of its length, width, height, and height by the scaling factor α scale ; When α scale <1, that is, the model to be adjusted needs to be reduced, then the target to be changed is the one with the largest length, width, and height, otherwise the smallest one is selected; scaling factor α scale The definition is as follows: Among them, n aim is the number of target modules; n now is the number of modules of the model to be adjusted; The second method is to directly remove several modules at the end of the chain; select the chain configuration with the largest number of modules in the two models as the target, and delete its chain tail modules until the number of modules in the two models is equal; Step S42, manually adjusting the number of modules in the chain structure.
