A three-dimensional model construction and deformation method based on square module chain
By converting a 3D model into a set of cubic modules and using an undirected graph method to construct a chain of square modules, the problems of complex structure and high degree of freedom between modules in the square module chain are solved, enabling rapid construction and multi-shape deformation of 3D models, which is suitable for architectural and art design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2022-07-19
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, three-dimensional deformable model modules with identical components have high degrees of freedom and no way to fix each other, resulting in low overall structural compactness. In contrast, square module chain structures have complex configurations and large solution spaces, making them difficult to construct and deform quickly.
A 3D model construction method based on square module chains is adopted. The model is converted into a set of cubic modules, connected into a tree structure, and a square module sub-chain is constructed using an undirected graph method. The connection relationship between modules is optimized by combining greedy ideas and backtracking search algorithm.
It enables the rapid construction of any 3D model into a square module chain structure, supports flexible deformation between multiple shapes, and is suitable for architectural structure and artistic design.
Smart Images

Figure CN115359176B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of three-dimensional deformable model reconstruction, and particularly relates to a method for constructing and deforming three-dimensional models based on square module chains. Background Technology
[0002] A 3D deformable model is a 3D model whose configuration can change, and these changes can be achieved by rotating or translating the components. With the development of 3D printing technology, 3D deformable models have become an increasingly active research topic, as they can be used to design objects for various purposes and are of significant research importance.
[0003] In current research, a typical approach for 3D deformable models with dissimilar components is to segment the target model using a 3D skeleton as a reference. This approach often suffers from problems such as complex iterative algorithms and long computation times. 3D deformable models with identical components simplify model representation and computation, but existing research shows that modules have high degrees of freedom and lack mutual fixation methods except for connected modules, resulting in low overall structural tightness.
[0004] The square module chain structure, with its limited number of relative positional relationships between adjacent modules, allows for the design of concave and convex grooves for mutual positioning of adjacent modules. This structure, arranged in a certain regularity, can form a stable model configuration. However, the square module chain structure also suffers from relatively complex configurations and a large solution space. How to quickly construct and transform 3D models based on square module chains remains a research challenge. Summary of the Invention
[0005] The purpose of this invention is to provide a method for constructing and deforming three-dimensional models based on square module chains, so as to solve the above-mentioned technical problems.
[0006] To address the aforementioned technical problems, the present invention provides a specific technical solution for a three-dimensional model construction and deformation method based on a square module chain as follows:
[0007] A method for constructing and deforming a 3D model based on a square module chain includes the following steps:
[0008] Step 1: Divide the input model into a set of cube modules;
[0009] Step 2: Connect the set of cube modules into a tree structure. First, use a hierarchical method to calculate the longest chain that connects as many cube modules as possible, and then connect the remaining modules as tree nodes.
[0010] Step 3: Configure square module chains for each cube module in the cube module tree. Using an undirected graph-based method, construct square module sub-chains and connect them to form a planar module chain configuration.
[0011] Furthermore, in order to obtain the square module chain configuration of the model in step 1, it is first converted into a set of multiple cube modules. Each face of each cube module serves as a reference for placing subsequent square sub-modules. The input model is divided into multiple cubes with an edge length of 1 unit. This process is called model partitioning, and the resulting cube shape is the parent module.
[0012] Furthermore, step 1 includes the following specific steps:
[0013] Step 1-1, Scaling the model:
[0014] First, the input model is scaled. By default, the minimum scaling direction of the model's bounding box is 4. After input, the scale can be manually adjusted using the model controller. Assuming the minimum size direction is the z-direction, and the coordinates of the extreme vertices are... and Determine the scaling ratio :
[0015]
[0016] Step 1-2, Model Partitioning:
[0017] An octree-based voxelization method is used to obtain the cubic module storage matrix. ;
[0018] Let the number of modules in the generated cube module set be . The set is denoted as .in, For the first A cube module, .
[0019] Furthermore, step 2 calculates the tree connections of the cube modules, with the aim of finding the tree that connects the most modules within the cube module set. The method calculates hierarchically. First, the starting point of the first-level cube module chain is selected. Then, using an octree-based search algorithm, the selection criteria for inter-level nodes are defined, and the longest chain of non-repeating connected modules within a layer is calculated. Then, all intra-level chains are connected to form the longest chain of the entire cube module. For any remaining modules that are not connected to the chain, the nearest neighbor modules are searched in the cube module chain path of the same level, and in the cube module chain path of the adjacent upper or lower level, and a connection relationship is established to become a tree node, thus forming a cube module tree.
[0020] Furthermore, step 2 includes the following specific steps:
[0021] Step 2-1: Select nodes between layers of the cube module chain;
[0022] The starting point of the first layer of the cube module chain is directly selected from the first module in the first row of the first layer. The ending point within the layer is selected from any module connected to the next layer of cube modules to connect the two layers of cube module chains. The starting point within the layer is selected from the nine modules connected to the ending point of the previous layer in a clockwise priority order.
[0023] Step 2-2: Calculate the longest non-repeating chain within the layer;
[0024] The longest non-repeating chain is a chain in which each module is connected only once during the chain connection process. For the cube module set, the longest non-repeating chain is calculated for each layer.
[0025] Using an octagonal backtracking search algorithm, let the current level be the h-th level, and the total number of modules in this level be... The module set is denoted as From the selected starting module Begin by expanding the module search in eight adjacent directions to find the longest chain path. The longest chain path contains the number of modules. ;
[0026] Assuming the current module The in-layer coordinates are The termination condition of the backtracking algorithm is that any one of the following is satisfied: ① or Exceeding the module storage matrix range, i.e. or ,or or ; ② Current module Not here Middle; ③ Module Already connected to the current chain; ④ Number of modules in the current chain Equal to the total number of modules in this layer Furthermore, the endpoint module conforms to the intra-layer endpoint selection principle; among which, for Input the length of the model's bounding box along the axis, rounded up. The number of cubic module layers along the axis. for The length of the bounding box of the input model in the z-axis direction is rounded up to the nearest integer, which is the number of cube module layers in the z-axis direction;
[0027] After calculating the longest non-repeating chain path at each level, the start and end of the chains at adjacent levels are connected to obtain the overall longest non-repeating chain path. , The number of cube modules connected to the longest non-repeating chain path;
[0028] Steps 2-3: Legacy module connection method;
[0029] A set of n cube modules Modules that still have not been connected to the longest non-repeating chain are called legacy modules; let denot be the set of legacy modules. The number of legacy modules is n', and the i'th module is For these modules, establish connections between them and their neighboring modules in the same or higher layers.
[0030] Define legacy module storage table Record the correspondence between legacy modules and their adjacent upper-level modules. It contains n' elements, and the i'-th element records the legacy module. Location information and modules connected to it Location information:
[0031]
[0032] in, . ;
[0033] Define a cube module The nearest neighbor module is the 26 modules that are in contact with it, and its encoded value is... In the collection of legacy cube modules Each module in According to the serial numbers marked in the diagram, The order is as follows: find the nearest neighbor modules that have been connected to the cube module tree, and record the first nearest neighbor module that meets the search criteria as the connection object of the legacy module. Record the corresponding relationship in the legacy module storage table. ;
[0034] Legacy module storage table With the longest chain path Together they described the final cube module tree. ,in, , This represents the total number of modules in the cube module tree.
[0035] Furthermore, step 3 involves obtaining the cube module tree. Then, for each cube module in the tree, the face connection relationship within the module is constructed as an undirected graph, and the longest path connecting as many faces as possible is found; then, the face within the module is used as the position for placing the square module, the longest path guides the configuration order of the square module sub-chains, the selection of the intersection point of adjacent modules is determined, the configuration of the square module sub-chains is obtained, and all sub-chains are connected end to end to obtain the square module chain configuration of the model.
[0036] Furthermore, step 3 includes the following specific steps:
[0037] Step 3-1: Construct an undirected graph within a single cube parent module;
[0038] Each face within the cube module is recorded as a node. Connecting edges are set between adjacent face nodes. Faces within the cube module may have been configured by face sub-modules in other modules. Therefore, it is necessary to query the vacancy status of each face and delete the configured face nodes in the graph, thereby constructing an undirected graph describing the connection relationship of faces within the cube module.
[0039] Step 3-2: Search for the longest chain in the undirected graph;
[0040] The chain connection of square modules within a cube module is based on a defined starting face. and the end face In the case of [condition], find the longest non-repeating and collapsible path in an undirected graph;
[0041] Among them, the validity criterion for the connection of the square module chain is whether the tail module of the square module chain has a node that can be connected to the first module of the square module chain in the next cube module. In other words, it verifies whether either of the two possible node options of the tail module of the obtained chain exists in the feasible list of the output node of the endpoint face.
[0042] Step 3-3: Configure the square module sub-chain within the cube parent module;
[0043] By placing square modules on each face within the connection path of the cube module, the chain path is determined. The selection of nodes between two internally connected faces is crucial. If the input node of the square module and the position of its next connected square module on the cube face have been determined, then the connection node between the two is uniquely determined.
[0044] The selection of the output node for the tail module of a square module subchain depends on the given cube module's longest chain path. By listing the matching schemes for faces and intersections with three types of positional relationships between adjacent faces, cube modules can be obtained respectively. The selection of multiple starting faces and input nodes for the inner connection path, and the selection of the output node for the tail module of the square module chain in the next cube module. After calculating the face connections and matching the square module chains, the options are verified until a chain that meets the validity criteria for chain connections is found.
[0045] For the selection of the first module input node of the square module subchain, except for the subchain within the first cube, the first module input node of other cube modules coincides with the tail module output node of the cube module above it.
[0046] Steps 3-4: Method for connecting square modules to a cube parent module;
[0047] Cube Module and the connected cube modules The positional relationships can be divided into three categories: intersecting at points, intersecting at lines, and intersecting at surfaces; under the same positional relationship, the selection schemes for the first and last surfaces and the selection scheme for the intersection points are the same;
[0048] Steps 3-5: Configure and connect the square module chain of the legacy cube module;
[0049] For the legacy cube module set and its legacy module storage table With legacy modules and its connection object module One intersecting node serves as the starting face input node. The square module chain configuration for each cube module is searched, connecting the object modules. The inner square module chain breaks at the selected intersection node and connects to... A square module chain.
[0050] Furthermore, step 3-2 is recorded as the first A cube parent module The longest subchain path of the square module is The search steps are as follows:
[0051] (1) Constructing a cube module An undirected graph; determine Given a square module with six faces already configured, construct an undirected graph of the cube module. ;
[0052] (2) Search for the longest chain in the graph; apply the backtracking search algorithm, starting from the initial face. Begin depth-first search, and denote the current face as... The termination condition of the backtracking algorithm is that any one of the following is satisfied: ① ① There are no connectable face nodes, or all connectable face nodes are already in the current path; ② The number of faces in the current path equals the number of faces in the graph. The number of nodes in the middle, and when the square module chain is configured, the chain can meet the validity criteria of the chain connection.
[0053] Furthermore, the matching schemes for faces and intersections under the three types of positional relationships in steps 3-4 are as follows:
[0054] (1) The case where two cube modules intersect at a point: the first cube module The endpoint of the internal face connection path has a maximum of 3 possibilities; the next cube module The starting face of the inner face connection path can have a maximum of 3 possibilities; the intersection point of the two can only have 1 possibility.
[0055] (2) The case where two cube modules intersect at a line: the first cube module The endpoint of the internal face connection path has a maximum of four possibilities; the next cube module There are a maximum of 4 possible starting faces for the inner face connection path, and two possible intersection points;
[0056] (3) The case where two cube modules intersect at a face: the first voxel The endpoint of the internal face connection path has a maximum of 5 possible endpoints; the next cube module There are a maximum of 5 possible starting faces for the inner face connection path; there are 4 possible intersection points between the two.
[0057] Based on the above method, the cube module can be obtained. The feasible list of the endpoint surface and the endpoint surface output nodes.
[0058] Furthermore, the specific steps of steps 3-5 are as follows:
[0059] (1) Selection of intersecting nodes: Connecting objects For legacy modules The nearest neighbor module, and for the nearest neighbor module, All can find vertices that are in contact with a given vertex. Based on the three types of positional relationships between adjacent modules, the remaining modules can be consulted. Its neighboring and connected object modules The intersection point is used as the input node of the starting surface and the output node of the ending surface of the legacy module;
[0060] (2) Face connection path search and square module chain configuration: The longest face connection path of the module is obtained by the square module chain configuration method based on undirected graph. The configuration of the square module chain within the module is verified. The output node of the tail module of the square module chain can only be selected as... and Intersecting nodes;
[0061] (3) Link this to the Connection Object module At the intersection nodes of the square module chains;
[0062] The selection of intersecting nodes and the starting face of legacy modules may also have multiple options. For these options, the surface connection path calculation and square module chain configuration verification must be performed in sequence until the chain in which the output node of the tail module coincides with the input node of the first module is obtained, which is the final selection of intersecting nodes and starting face.
[0063] The present invention provides a method for constructing and deforming 3D models based on square module chains, which has the following advantages: The present invention can construct any 3D model into a deformable 3D model with square module chains as its basic structure, thereby achieving mutual transformation between multiple shapes. The algorithm proposed in this invention can be applied in fields such as architectural structures and artistic design. Attached Figure Description
[0064] Figure 1 This is a flowchart of the three-dimensional model construction and deformation method of the present invention;
[0065] Figure 2(a) is a basic module design diagram of the present invention;
[0066] Figure 2(b) is a schematic diagram of the chain structure of the present invention;
[0067] Figure 2(c) is a schematic diagram of the grid structure that can be constructed according to the present invention;
[0068] Figure 2(d) is a schematic diagram of the input node of the present invention;
[0069] Figure 3 This is a schematic diagram of the cubic module division of the car model of the present invention;
[0070] Figure 4 This is a schematic diagram illustrating the selection criteria for the end point and start point within a layer in this invention.
[0071] Figure 5 This is a schematic diagram illustrating the calculation of the longest non-repeating chain within a layer according to the present invention;
[0072] Figure 6 This is a schematic diagram illustrating the longest chain calculation for the cube module of the present invention;
[0073] Figure 7 This is a schematic diagram of the nearest neighbor module of the cube module of the present invention;
[0074] Figure 8 This is a schematic diagram of the connection method for the legacy cube module of the present invention;
[0075] Figure 9(a) is an undirected graph of the present invention;
[0076] Figure 9(b) is a schematic diagram of the encoding of the cube module of the present invention;
[0077] Figure 10 This is a schematic diagram of the undirected graph and the longest chain of the cubic module at the tire of the car model of the present invention;
[0078] Figure 11(a) shows two possible schematic diagrams of the output node of the cube-shaped square module with input nodes and faces inside the cube of the present invention.
[0079] Figure 11(b) is a schematic diagram of the planar module sub-chain configuration within the cube module of the present invention;
[0080] Figure 12(a) is a schematic diagram of the intersection of the two cubic modules of the present invention;
[0081] Figure 12(b) is a schematic diagram of the two cubic modules of the present invention intersecting at a line;
[0082] Figure 12(c) is a schematic diagram of the intersection of the two cubic modules of the present invention;
[0083] Figure 13 The steps for configuring the planar module chain of the cube module tree of the present invention;
[0084] Figure 14 This describes the square module chain configuration search process for the automobile model of the present invention. Detailed Implementation
[0085] To better understand the purpose, structure, and function of this invention, the following detailed description, in conjunction with the accompanying drawings, provides a method for constructing and deforming a three-dimensional model based on a square module chain.
[0086] Since the only constraint between modules in a square module chain is the overlap of connection points, modules can be freely folded, resulting in high flexibility in configuration. However, when the number of modules is large, the configuration becomes relatively complex, and the solution space is large. Therefore, a greedy algorithm-based solution for the 3D configuration problem of square module chains is proposed. A parent module is defined as the smallest unit composed of basic square modules—square modules—that can form a regular arrangement. The parent module of the square modules is selected as a cube module. First, the connection tree of the cube parent module is solved. Then, for each parent module, the local square module chains within a single parent module are solved and connected. For solving the basic module sub-chains, to ensure the connectability between sub-chains as much as possible, an undirected graph-based configuration method is proposed. First, the order of placement of the square modules is determined. Then, the specific orientation of the square modules is configured according to the preceding and following square module sub-chains and the cube parent module.
[0087] like Figure 1 As shown, a three-dimensional model construction and deformation method based on a square module chain according to the present invention includes the following steps:
[0088] Step 1: Divide the input model into a set of cube modules, specifically:
[0089] To obtain the square module chain configuration of the model (the basic module design is shown in Figure 2(a), the chain structure is shown in Figure 2(b), and the possible mesh structure is shown in Figure 2(c); the input and output nodes of the module are represented by larger and smaller spheres, respectively, i.e., the nodes connected to the previous and next modules, as shown in Figure 2(d)), it is first converted into a set of multiple cube modules, with each face of each cube module serving as a reference for placing subsequent square sub-modules. The input model is divided into multiple cubes with an edge length of 1 unit; this process is called model partitioning, and the resulting cube shape is the parent module. The specific steps are as follows:
[0090] Step 1-1, scale the model.
[0091] First, the input model is scaled. By default, the minimum scaling direction of the model's bounding box is 4, but this can be manually adjusted using the model controller after input. Assuming the minimum dimension direction is the z-direction, and the coordinates of the extreme vertices are... and Determine the scaling ratio :
[0092]
[0093] Steps 1-2: Model partitioning.
[0094] The resulting unit cubes can also be called voxels, and the process of partitioning the cube modules can be called voxelization. An octree-based voxelization method is used to obtain the cube module storage matrix. Taking a car model as an example, the generation process of a cube module assembly model is as follows: Figure 3 As shown.
[0095] Let the number of modules in the generated cube module set be . The set is denoted as .in, For the first A cube module, .
[0096] Step 2: Connect the set of cube modules into a tree structure. First, use a hierarchical method to calculate the longest chain connecting as many cube modules as possible, then connect the remaining modules as tree nodes. Specifically:
[0097] The goal of calculating the tree connections of cube modules is to find the tree with the most connections within the set of cube modules. The method performs calculations hierarchically. First, the starting point of the first-level cube module chain is selected. Then, using an octree-based search algorithm, with defined criteria for selecting nodes between levels, the longest chain of non-repeating connected modules within a level is calculated. Finally, all intra-level chains are connected to form the longest chain of cube modules in the whole. For any remaining modules not connected to a chain, nearest neighbors are searched within the same level's cube module chain path, and within adjacent upper or lower level cube module chain paths, and connections are established to create tree nodes, thus forming a cube module tree. Specific steps include:
[0098] Step 2-1: Select nodes between layers of the cube module chain.
[0099] The specific location of the starting point in the first layer has little impact on the calculation of subsequent connection paths. Therefore, the first module in the first row of the first layer module is selected as the inter-layer starting point.
[0100] Regarding the selection of endpoints within a layer, the endpoint of a chain of cube modules in one layer must be able to connect to a cube module in the next layer. Since adjacent cube modules are arranged in a regular pattern, the vertices of lower-level modules are connected to a total of 9 higher-level (i.e., the layer below) modules. For modules... The orientation of the 9 modules is as follows Figure 4 As shown in C1~C9. Selecting any module connected to the next layer's cube module will serve as the endpoint within that layer, connecting the upper and lower layers. Furthermore, since the last layer does not have a next-layer module, there are no requirements regarding the selection of its endpoint.
[0101] For selecting the starting point within a layer, except for the first layer, the starting point of the cube module chain in other layers is related to the ending point of the module in the previous layer. Among the nine module orientations connected to the ending point of the previous layer, the cube module is selected as the starting point of the module chain within the layer in priority order C1 to C9.
[0102] Step 2-2: Calculate the longest non-repeating chain within the layer.
[0103] The longest non-repeating chain is a chain in which each module is connected only once during the chain connection process. For the cube module set, the longest non-repeating chain is calculated for each layer.
[0104] An octagonal backtracking search algorithm is used, such as... Figure 5 As shown. Let the current layer be the h-th layer, and the total number of modules in this layer be... The module set is denoted as From the selected starting module Begin by expanding the module search in eight adjacent directions to find the longest chain path. The longest chain path contains the number of modules. .
[0105] Assuming the current module The in-layer coordinates are The termination condition of the backtracking algorithm is that any one of the following is satisfied: ① or Exceeding the module storage matrix range, i.e. or ,or or ② Current module Not here Module ③ It is already connected to the current chain. ④ Number of modules in the current chain. Equal to the total number of modules in this layer Furthermore, the endpoint module conforms to the intra-layer endpoint selection principle. for Input the length of the model's bounding box along the axis, rounded up. The number of cubic module layers along the axis. for The length of the bounding box of the input model along the z-axis is rounded up to the nearest integer, which is the number of cube module layers along the z-axis.
[0106] The validity criterion for a square module chain connection is whether the tail module of the square module chain has a node that can connect to the head module of the square module chain within the next cube module. In other words, it verifies whether either of the two possible node options for the tail module of the resulting chain exists in the feasible list of the output nodes on the endpoint face.
[0107] After calculating the longest non-repeating chain path at each level, the start and end of the chains at adjacent levels are connected to obtain the overall longest non-repeating chain path. . This represents the number of cube modules connected by the longest non-repeating chain path. The longest chain of cube modules in a car model is as follows: Figure 6 As shown.
[0108] Steps 2-3: Legacy module connection method.
[0109] A set of n cube modules Modules that still have not been connected to the longest non-repeating chain are called legacy modules. Let the set of legacy modules be denoted as . The number of legacy modules is n', and the i'th module is For these modules, establish connections between them and their neighboring modules in the same or higher layers.
[0110] Define legacy module storage table Record the correspondence between legacy modules and their adjacent upper-level modules. It contains n' elements, and the i'-th element records the legacy module. Location information and modules connected to it Location information:
[0111]
[0112] in, . .
[0113] Define a cube module The nearest neighbor module is the 26 modules that are in contact with it, and its encoded value is... ,like Figure 7 As shown. In the legacy cube module set Each module in According to the serial numbers marked in the diagram, Following the order of steps, find the nearest neighbor modules already connected to the cube module tree. Record the first matching nearest neighbor module as the connection object of the legacy module. Record the corresponding relationship in the legacy module storage table. .
[0114] like Figure 8 As shown, legacy module storage table With the longest chain path Together they described the final cube module tree. .in, , This represents the total number of modules in the cube module tree.
[0115] Step 3: Configure square module chains for each cube module within the cube module tree. Using an undirected graph-based method, construct square module sub-chains and connect them to form a planar module chain configuration. Specifically:
[0116] In obtaining the cube module tree Next, for each cube module within the tree, the face connections within the module are constructed as an undirected graph, and the longest path connecting as many faces as possible is found. Then, using the faces within the module as the placement positions for the square modules, the longest path guides the configuration order of the square module sub-chains, determining the selection of intersection points between adjacent modules, thus obtaining the square module sub-chain configuration. Connecting all sub-chains end-to-end yields the square module chain configuration of the model.
[0117] Step 3-1: Construction of the undirected graph within a single cube parent module.
[0118] Within the cube module, each face intersects with four other faces. The connections between the faces can be represented by an undirected graph. As shown in Figure 9(a), the six faces of the cube are represented by... The numbering indicates that the 8 vertices of the cube module are encoded. The constructed undirected graph represents a face by each node, and each edge in the graph represents a connection between faces, as shown in Figure 9(b). Faces within a cube module may have already been configured by face submodules in other modules, so it is necessary to check the vacancy status of each face and delete the configured face nodes in the graph.
[0119] Step 3-2: Search for the longest chain in the undirected graph.
[0120] The chain connection of square modules within a cube module is based on a defined starting face. and the end face Given a given condition, find the longest non-repeating and collapsible path in an undirected graph.
[0121] Record No. A cube parent module The longest subchain path of the square module is The search steps are as follows:
[0122] (1) Constructing a cube module An undirected graph. (Confirmed) Given a square module with six faces already configured, construct an undirected graph of the cube module. .
[0123] (2) Search for the longest chain within the graph. Apply the backtracking search algorithm, starting from the initial face. Begin depth-first search. Let the current face be denoted as... The termination condition of the backtracking algorithm is that any one of the following is satisfied: ① ① There are no connectable face nodes, or all connectable face nodes are already in the current path; ② The number of faces in the current path equals the number of faces in the graph. The number of nodes in the middle, and when the square module chain is configured, the chain can meet the validity criteria of the chain connection.
[0124] like Figure 10 As shown, a cubic module at the tire of a car model For example, take As its starting face ,Pick As its final surface , among which Already used by cube module The configuration of the square module subchains. Its undirected graph and the longest chain within the graph. The order of face connection is .
[0125] Step 3-3: Configure the square module sub-chain within the cube parent module.
[0126] For the face connection paths within a cube module, each face needs to be placed using a square module. Within the same cube, two connected faces must have two overlapping nodes. Therefore, the chain path needs to be determined. The selection of nodes between two internally connected surfaces is the same as the selection of output nodes for the square module on the previous surface.
[0127] For a square module with a known face and input node within a cube, its output node has two possibilities, each capable of connecting to square modules with different face positions, as shown in Figure 11(a). Therefore, if the position of the next adjacent square module within the cube is determined, the connection node between them is uniquely determined. Consequently, for a face connection path where the input node position of the first face is known, the connection nodes between faces are determined except for the output node of the tail module. For example, in Figure 11(b), the face connection order can be obtained as [ The first input node is encoded as follows: The matching scheme for the square module chain of the connection path, whose node order is [ The final relative position matrix. for .
[0128] For a cube module with a known longest chain path in a square module. The relative position of the output node of the endpoint module within the square module chain can be chosen in two ways. According to... and The positional relationship between the two cube modules can be determined by referring to the matching schemes for faces and intersections of the three types of positional relationships in steps 3-4, which yields the cube modules respectively. The selection of multiple starting faces and input nodes for the inner connection path. The selection of the output node for the tail module of the square module chain occurs in the next cube module. The surface connection calculation and square module chain matching are then used to determine the result.
[0129] Steps 3-4: Method for connecting square module child chains between cube parent modules.
[0130] Cube Module and the connected cube modules There are multiple possible positional relationships. Depending on the different positional relationships, The endpoint and There are multiple schemes for the starting face and the intersection point of the two. The positional relationship between the two can be divided into three categories: intersection at a point, intersection at a line, and intersection at a plane. Under the same positional relationship, the selection schemes for the first and last faces and the selection scheme for the intersection point are the same. The three types of relationships are shown in Figures 12(a)-12(c). The matching schemes for the faces and intersection points under the three types of positional relationships are as follows:
[0131] (1) The case where two cube modules intersect at a point. The first cube module The endpoint of the internal face connection path has a maximum of 3 possibilities, as shown by the dark gray face in Figure 12(a); the next cube module. The starting face of the inner face connection path can have a maximum of 3 possibilities, as shown by the light gray face in Figure 12(a). The intersection point of the two can only have one possibility.
[0132] (2) The case where two cube modules intersect at a line. The first cube module The endpoint of the internal face connection path has a maximum of 4 possibilities, as shown by the dark gray face in Figure 12(b); the next cube module. The starting face of the inner face connection path can also have up to 4 possibilities, as shown by the light gray face in Figure 12(b). The intersection point of the two can have two possibilities.
[0133] (3) The case where two cube modules intersect at a face. The previous voxel The endpoint of the internal face connection path has a maximum of 5 possibilities, as shown by the dark gray face in Figure 12(b); the next cube module The starting face of the inner face connection path can also have a maximum of 5 possibilities, as shown by the light gray face in Figure 12(b). The intersection point of the two can have four possibilities.
[0134] Based on the above method, the cube module can be obtained. The feasible list of the endpoint surface and the endpoint surface output nodes.
[0135] The method for selecting the output node of the square module's chain tail module is as follows: for the cube module with the known longest chain path of the square module... At most two nodes can exist in the feasible list of the output nodes of the endpoint face. According to and The positional relationship between the two cube modules can be determined by referring to the matching schemes for faces and intersections of the three types of positional relationships, which yields the cube modules respectively. The selection of multiple starting faces and input nodes for the inner connection path. The selection of the output node for the tail module of the square module chain occurs in the next cube module. The surface connection calculation and square module chain matching are then used to determine the result.
[0136] The method for selecting the input node of the head module in a square module chain is as follows: After the previous cube module has been calculated through the square module chain, its tail module still has multiple output node options, corresponding to the starting face of the face connection path of the current cube module. The selection of input nodes for the square module subchain involves multiple choices. Face connection path calculations and square module chain configurations are performed sequentially on these choices until the longest chain meeting the chain connection validity criteria is found, which is then the final selection. For the first module input node within the first cube module in the cube module chain, since its selection has little impact on subsequent chain connection calculations, it is directly selected and encoded as... The node.
[0137] Using the methods described above, the longest chain path is processed sequentially. In the cube module, the selection list of the starting face and input node is determined based on the square module chain connection result of the previous cube module, and the selection list of the ending face and the output node of the ending face is determined based on the positional relationship with the next cube module. Then, a chain connection is constructed from the selection list of the starting face and the node, and the corresponding square module chain configuration is obtained by the square module chain connection path search method. The chain configuration in which the tail module is in the ending face list and the output node of the tail module is in the output node of the ending face is found.
[0138] Steps 3-5: Configure and connect the square module chain of the legacy cube module.
[0139] For the legacy cube module set and its legacy module storage table With legacy modules and its connection object module One intersecting node serves as the starting face input node. The square module chain configuration for each cube module is searched, connecting the object modules. The inner square module chain breaks at the selected intersection node and connects to... A square module chain. The specific steps are as follows:
[0140] (1) Selecting intersecting nodes. Connecting objects For legacy modules The nearest neighbor module, and for the nearest neighbor module, Each vertex can be found to be in contact with a given vertex. Based on the three types of positional relationships between adjacent modules, legacy modules can be consulted. Its neighboring and connected object modules The intersection point. This intersection point serves as the input node for the starting face and the output node for the ending face of the legacy module.
[0141] (2) Face connection path search and square module chain configuration. The longest face connection path of the module is obtained using the square module chain configuration method based on undirected graphs, and the square module chain configuration within the module is verified. The output node of the tail module in the square module chain can only be selected from... and The intersecting nodes.
[0142] (3) Link this to the Connection Object module The intersection nodes of the square module chain.
[0143] The selection of intersecting nodes and the starting face of legacy modules may also have multiple options. These options must be sequentially calculated for surface connection paths and verified for square module chain configuration until a chain is obtained in which the output node of the tail module coincides with the input node of the first module, which is then used as the final selection for intersecting nodes and the starting face.
[0144] Taking the connection of the remaining modules at the bottom of the car model's wheels as an example, the steps are as follows: Figure 13 As shown.
[0145] The search process for the square module chain configuration of the car model is as follows: Figure 14 As shown.
[0146] It is understood that the present invention has been described through some embodiments, and those skilled in the art will recognize that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, under the teachings of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of the present invention.
Claims
1. A method for constructing and deforming a 3D model based on a square module chain, characterized in that, Includes the following steps: Step 1: Input the 3D printing model, divide the input model into a set of cube modules; Step 2: Connect the set of cube modules into a tree structure. First, use a hierarchical method to calculate the longest chain that connects as many cube modules as possible, and then connect the remaining modules as tree nodes. Step 2, which calculates the tree connections of the cube modules, aims to find the tree with the most connections within the cube module set. The method calculates hierarchically. First, the starting point of the first-level cube module chain is selected. Then, an octree-based search algorithm is used to calculate the longest chain of non-repeating connected modules within a layer, based on the selection criteria for inter-layer nodes. All intra-layer chains are then connected to form the longest chain of the entire cube module. For any remaining modules not connected to the chain, the nearest neighbor modules are searched in the cube module chain path of the same layer, and in the cube module chain path of the adjacent upper or lower layers, and a connection relationship is established to form a tree node, thus forming a cube module tree. Step 3: Configure square module chains for each cube module in the cube module tree. Using an undirected graph-based method, construct square module sub-chains and connect them to form a planar module chain configuration. Step 3 involves obtaining the cube module tree. Then, for each cube module in the tree, the face connection relationship within the module is constructed as an undirected graph, and the longest path connecting as many faces as possible is found; then, the face within the module is used as the position for placing the square module, the longest path guides the configuration order of the square module sub-chains, the selection of the intersection point of adjacent modules is determined, the configuration of the square module sub-chains is obtained, and all sub-chains are connected end to end to obtain the square module chain configuration of the model.
2. The method for constructing and deforming a three-dimensional model based on a square module chain according to claim 1, characterized in that, In step 1, in order to obtain the square module chain configuration of the model, it is first converted into a set of multiple cube modules. Each face of each cube module serves as a reference for placing subsequent square sub-modules. The input model is divided into multiple cubes with an edge length of 1 unit. This process is called model partitioning, and the resulting cube shape is the parent module.
3. The method for constructing and deforming a three-dimensional model based on a square module chain according to claim 1, characterized in that, Step 1 includes the following specific steps: Step 1-1, Scaling the model: First, the input model is scaled. By default, the minimum scaling direction of the model's bounding box is scaled to 4. After input, the scale can be manually adjusted using the model controller. Assuming the minimum size direction is the z-direction, and the coordinates of the extreme vertex are... and Determine the scaling ratio : Step 1-2, Model Partitioning: An octree-based voxelization method is used to obtain the cubic module storage matrix. ; Let the number of modules in the generated cube module set be . The set is denoted as ,in, For the first A cube module, .
4. The method for constructing and deforming a three-dimensional model based on a square module chain according to claim 1, characterized in that, Step 2 includes the following specific steps: Step 2-1: Select nodes between layers of the cube module chain; The starting point of the first layer of the cube module chain is directly selected from the first module in the first row of the first layer. The ending point within the layer is selected from any module connected to the next layer of cube modules to connect the two layers of cube module chains. The starting point within the layer is selected from the nine modules connected to the ending point of the previous layer in a clockwise priority order. Step 2-2: Calculate the longest non-repeating chain within the layer; The longest non-repeating chain is a chain in which each module is connected only once during the chain connection process. For the cube module set, the longest non-repeating chain is calculated for each layer. Using an octagonal backtracking search algorithm, let the current level be the h-th level, and the total number of modules in this level be... The module set is denoted as From the selected starting module Begin by expanding the module search in eight adjacent directions to find the longest chain path. The longest chain path contains the number of modules. ; Assuming the current module The in-layer coordinates are The termination condition of the backtracking algorithm is that any one of the following is satisfied: ① or Exceeding the module storage matrix range, i.e. or ,or or ; ② Current module Not here ③ Module It is already connected to the current chain; ④ The number of modules in the current chain. Equal to the total number of modules in this layer Furthermore, the endpoint module conforms to the intra-layer endpoint selection principle; among which, for Input the length of the model's bounding box along the axis, rounded up. The number of cubic module layers along the axis. for The length of the bounding box of the input model in the z-axis direction is rounded up to the nearest integer, which is the number of cube module layers in the z-axis direction; After calculating the longest non-repeating chain path at each level, the start and end of the chains at adjacent levels are connected to obtain the overall longest non-repeating chain path. , The number of cube modules connected to the longest non-repeating chain path; Steps 2-3: Legacy module connection method; A set of n cube modules Modules that still have not been connected to the longest non-repeating chain are called legacy modules; let denot be the set of legacy modules. The number of legacy modules is n', and the i'th module is For these modules, establish connections between them and their neighboring modules in the same or higher layers. Define legacy module storage table Record the correspondence between legacy modules and their adjacent upper-level modules. It contains n' elements, and the i'-th element records the legacy module. Location information and modules connected to it Location information: in, , ; Define a cube module The nearest neighbor module is the 26 modules that are in contact with it, and its encoded value is... In the collection of legacy cube modules Each module in According to the serial numbers marked in the diagram, The order is as follows: find the nearest neighbor modules that have been connected to the cube module tree, and record the first nearest neighbor module that meets the search criteria as the connection object of the legacy module. Record the corresponding relationship in the legacy module storage table. ; Legacy module storage table With the longest chain path Together they described the final cube module tree. ,in, , This represents the total number of modules in the cube module tree.
5. The method for constructing and deforming a three-dimensional model based on a square module chain according to claim 1, characterized in that, Step 3 includes the following specific steps: Step 3-1: Construct an undirected graph within a single cube parent module; Each face within the cube module is recorded as a node. Connecting edges are set between adjacent face nodes. Faces within the cube module may have been configured by face sub-modules in other modules. Therefore, it is necessary to query the vacancy status of each face and delete the configured face nodes in the graph, thereby constructing an undirected graph describing the connection relationship of faces within the cube module. Step 3-2: Search for the longest chain in the undirected graph; The chain connection of square modules within a cube module is based on a defined starting face. and the finish line In the case of [condition], find the longest non-repeating and collapsible path in an undirected graph; Among them, the validity criterion for the connection of the square module chain is whether the tail module of the square module chain has a node that can be connected to the first module of the square module chain in the next cube module. In other words, it verifies whether either of the two possible node options of the tail module of the obtained chain exists in the feasible list of the output node of the endpoint face. Step 3-3: Configure the square module sub-chain within the cube parent module; By placing square modules on each face within the connection path of the cube module, the chain path is determined. The selection of nodes between two internally connected faces is crucial. If the input node of the square module and the position of its next connected square module on the cube face have been determined, then the connection node between the two is uniquely determined. The selection of the output node for the tail module of a square module subchain depends on the given cube module's longest chain path. By listing the matching schemes for faces and intersections with three types of positional relationships between adjacent faces, cube modules can be obtained respectively. The selection of multiple starting faces and input nodes for the inner connection path, and the selection of the output node for the tail module of the square module chain in the next cube module. After calculating the face connections and matching the square module chains, the options are verified until a chain that meets the validity criteria for chain connections is found. For the selection of the first module input node of the square module subchain, except for the subchain within the first cube, the first module input node of other cube modules coincides with the tail module output node of the cube module above it. Steps 3-4: Method for connecting square modules to a cube parent module; Cube Module and the connected cube modules The positional relationships can be divided into three categories: intersecting at points, intersecting at lines, and intersecting at surfaces; under the same positional relationship, the selection schemes for the first and last surfaces and the selection scheme for the intersection points are the same; Steps 3-5: Configure and connect the square module chain of the legacy cube module; For the legacy cube module set and its legacy module storage table With legacy modules and its connection object module One intersecting node serves as the starting face input node. The square module chain configuration for each cube module is searched, connecting the object modules. The inner square module chain breaks at the selected intersection node and connects to... A square module chain.
6. The method for constructing and deforming a three-dimensional model based on a square module chain according to claim 5, characterized in that, Step 3-2 is recorded as follows: A cube parent module The longest subchain path of the square module is The search steps are as follows: (1) Constructing a cube module An undirected graph; determine Given a square module with six faces already configured, construct an undirected graph of the cube module. ; (2) Search for the longest chain within the graph; apply the backtracking search algorithm, starting from the initial face. Begin depth-first search, and denote the current face as... The termination condition of the backtracking algorithm is that any one of the following is satisfied: ① ① There are no connectable face nodes, or all connectable face nodes are already in the current path; ② The number of faces in the current path is equal to the number of faces in the graph. The number of nodes in the middle, and when the square module chain is configured, the chain can meet the validity criteria of the chain connection.
7. The method for constructing and deforming a three-dimensional model based on a square module chain according to claim 5, characterized in that, The matching schemes for faces and intersections under the three types of positional relationships in steps 3-4 are as follows: (1) The case where two cube modules intersect at a point: the first cube module The endpoint of the internal face connection path has a maximum of 3 possibilities; the next cube module The starting face of the inner face connection path can have a maximum of 3 possibilities; the intersection point of the two can only have 1 possibility. (2) The case where two cube modules intersect at a line: the first cube module The endpoint of the internal face connection path has a maximum of four possibilities; the next cube module There are a maximum of 4 possible starting faces for the inner face connection path, and two possible intersection points; (3) The case where two cube modules intersect at a face: the first voxel The endpoint of the internal face connection path has a maximum of 5 possible endpoints; the next cube module There are a maximum of 5 possible starting faces for the inner face connection path; there are 4 possible intersection points between the two. Based on the above method, the cube module can be obtained. The feasible list of the endpoint surface and the endpoint surface output nodes.
8. The method for constructing and deforming a three-dimensional model based on a square module chain according to claim 5, characterized in that, The specific steps of steps 3-5 are as follows: (1) Selection of intersecting nodes: Connecting objects For legacy modules The nearest neighbor module, and for the nearest neighbor module, All can find vertices that are in contact with a given vertex. Based on the three types of positional relationships between adjacent modules, the remaining modules can be consulted. Its neighboring and connected object modules The intersection point is used as the input node of the starting surface and the output node of the ending surface of the legacy module; (2) Face connection path search and square module chain configuration: The longest face connection path of the module is obtained by the square module chain configuration method based on undirected graph. The configuration of the square module chain within the module is verified. The output node of the tail module of the square module chain can only be selected as... and Intersecting nodes; (3) Link this to the Connection Object module At the intersection nodes of the square module chains; The selection of intersecting nodes and the starting face of legacy modules may also have multiple options. For these options, the surface connection path calculation and square module chain configuration verification must be performed in sequence until the chain in which the output node of the tail module coincides with the input node of the first module is obtained, which is the final selection of intersecting nodes and starting face.