Solid model generation method based on plane moving trajectory
Through the solid model generation method based on the plane running trajectory, a three-dimensional model similar to the user input trajectory is automatically generated, which solves the problem of inefficient modeling in the existing technology and realizes fast and efficient model generation.
Patent Information
- Application Number
- CN202510396995.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-04-01
AI Technical Summary
In industrial design, automated manufacturing and robot motion planning, it is difficult to quickly generate three-dimensional models that match dynamic trajectories, and the modeling process relies on manual experience and is inefficient.
The plane mechanism generation module generates the mechanism description file, the trajectory verification module is used to verify the trajectory similarity, the heuristic search module optimizes the mechanism coding, and combines the final optimization module to generate a three-dimensional model that is most similar to the user input trajectory.
It realizes the rapid and automatic generation of three-dimensional models similar to the user input trajectory, reducing the equipment development cycle and cost.
Smart Images

Figure CN120257633A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of model generation, and more particularly to a method for generating a solid model based on a planar motion trajectory. Background Art
[0002] In the fields of industrial design, automated manufacturing, robot motion planning, and computer-aided design (CAD), how to quickly generate a corresponding solid model according to the motion trajectory of an object has always been a research hotspot. Traditional modeling methods usually rely on manual drawing or parametric design tools (such as SolidWorks, AutoCAD), which require users to manually define geometric features and constraint relationships, are time-consuming, and difficult to meet the modeling requirements for complex or dynamic trajectories. With the development of intelligent manufacturing and digital twin technologies, the technical need for automatically generating solid models based on physical motion characteristics has become increasingly urgent.
[0003] The existing technologies mainly face three major bottlenecks: 1) The lack of association between the trajectory and the 3D model, especially the lack of adaptive conversion ability when dealing with variable cross-section and multi-degree-of-freedom trajectories; 2) Insufficient dynamic response, traditional tools cannot adjust the model structure in real time according to the trajectory speed and acceleration; 3) Low level of intelligence, the modeling process depends on manual experience and is inefficient. How to achieve the rapid generation of the device motion trajectory is a technical problem that urgently needs to be solved at present. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method for generating a solid model based on a planar motion trajectory, which directly calculates through a computer the mechanism most similar to the trajectory input by the user, and directly generates an editable 3D model for the user to perform physical verification or subsequent optimization, reducing the device development cycle and cost.
[0005] To solve the above technical problems, the technical solutions adopted by the present invention are as follows.
[0006] A method for generating a solid model based on a planar motion trajectory includes the following steps: S1. Generate a mechanism description file through a planar mechanism generation module; S2. Verify the similarity between the mechanism output trajectory and the expected trajectory input by the user through a trajectory verification module; S3. After completing the maximum number of iterations through a heuristic search module, obtain the optimal n sets of mechanism codes and their performances, and the mechanism codes can uniquely generate mechanisms through the planar mechanism generation module in S1; S4. Optimize the mechanism that can generate the trajectory with the highest similarity to the expected trajectory input by the user through a final optimization module; S5. Generate a 3D solid model from the mechanism description json file through a solid generation module.
[0007] Further optimize the technical solution. In step S1, the following steps are included: S11. Use the configuration generation module to select a syntax number to generate a configuration, produce an institutional description json file according to the rotated link number, rename the mark_link of the existing mechanism to link_x, and connect the links described in the above json file to the original mark_link of the existing mechanism to form a new mechanism; S12. Use the dimension production module to generate using a numbering rule. When connecting the new link to the mark_link of the original mechanism, the center point of the original mark_link is used as the center of the circle. When the hinge point of the new_link_1 of the new mechanism is a point inside the circle, the dimensions of the new mechanism need to be determined by the selection of numbers. Each selection will use the hinge point selected last time as the center of the circle for this selection, and put the hinge point coordinates into the institutional description json file.
[0008] Further optimize the technical solution. In step S2, the following steps are included: S21. Use the simulation module to convert the institutional description json file generated in the planar mechanism generation module into a urdf or mjcf file for storage, and put it into the simulator for simulation to generate the institutional output trajectory; S22. Use the data verification module to compare the coordinate trajectories of each point output by the simulator with the expected trajectory input by the user, and calculate the similarity of the trajectories.
[0009] Further optimize the technical solution. The method for calculating the trajectory similarity: First, perform mirror processing and reverse order processing on the coordinate trajectories of each list to obtain four trajectories: the original trajectory, the mirror trajectory, the reverse order trajectory, and the mirror reverse order trajectory. Calculate the Fourier descriptors of these four trajectories and normalize them to avoid the influence of scaling. Calculate the optimal phase offset of each of these four trajectories with the expected trajectory input by the user. After processing the phase offset respectively, calculate the similarity error between the four trajectories and the expected trajectory based on Procrustes analysis, and take the minimum value as the trajectory similarity of this list.
[0010] Further optimize the technical solution. In step S3, the following steps are included: S31. Use the heuristic search algorithm module to adopt the Monte Carlo tree search algorithm to obtain the optimal n institutional description files during the iteration process; S32. Use the expansion rule module to expand the nodes in the heuristic search algorithm module.
[0011] Further optimize the technical solution. In the Monte Carlo tree search algorithm, each node includes the parent node of the node, the child nodes of the node, the unlocked child nodes of the node, the node order, the node type, the node encoding, the access times of the node, and the reward of the node. The calculation method of the UCT value is as follows: Where: R represents the reward of the node; V represents the access times of the node; C represents the exploration constant, which is a set constant; Pv represents the access times of the parent node of the node; if the access times of the current node is 0, then the UCT is infinite.
[0012] Further optimize the technical solution. The Monte Carlo tree search algorithm is divided into the following steps: S311. Select a node: Starting from the root node, select the corresponding unlocked child node according to the UCT value of each child node, and then repeat the selection process among the unlocked child nodes until the selection of a certain unlocked child node without child nodes stops the node selection process; S312. Expand the node: After selecting the node, expand the node. After the expansion is completed, put it into the configuration generation module through the final node encoding to generate an institution description json file; S313. Evaluate the node: Put the institution description json file generated by expanding the node into the trajectory verification module to obtain the performance of the institution; S314. Data saving: Save the best n institutions, compare the performance of the current institution with the performance of the best n institutions that have been saved, and if the performance is better than one of them, replace the institution encoding with the worst performance with the node encoding of the current node; S315. Backpropagation: Starting from the current node, the reward of the node = the original reward of the node + the performance of the institution, the access times of the node = the original access times of the node + 1, select the parent node of the current node and continue to update the reward and access times of the parent node in the same update manner.
[0013] Further optimize the technical solution. In step S4, the final optimization module will generate a new institution description json file in each iteration, and passing this file to the trajectory verification module in step S2 can obtain the performance evaluation of the current institution. The institution that can finally optimize the trajectory with the highest similarity to the expected trajectory input by the user is saved and sent to the entity generation module in step S5.
[0014] Due to the adoption of the above technical solution, the technical progress achieved by the present invention is as follows.
[0015] A method for generating a solid model based on a planar motion trajectory provided by the present invention can directly calculate, through a computer, the mechanism most similar to the trajectory input by the user, and directly generate an editable three-dimensional model for the user to conduct physical verification or subsequent optimization, greatly reducing the equipment development cycle and cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is the system framework diagram of the present invention; Figure 2 It is the schematic diagram of the dimension generation module of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] The present invention will be further described in detail below with reference to the drawings and specific embodiments.
[0018] A method for generating a solid model based on a planar motion trajectory, in combination with Figure 1 as shown, includes the following steps: S1. Generate a mechanism description file through a planar mechanism generation module.
[0019] S11. Use a configuration generation module to generate a configuration by selecting a syntax number. For example, the number "1" represents an RRR link, and the number "2" represents an RRP link. After selecting a number, assuming the number 1 is selected, the following mechanism description json file will be generated according to the RRR link: { "new_link_1":{ "joint": "R", "parent": "mark_link", "child": None, "equality": true, "rgba": link_rgba }, "mark_link":{ "joint": "R", "parent": "new_link_2", "child": "new_link_1", "equality": false, "rgba": link_rgba }, "new_link_2":{ "joint": "R", "parent": "ground", "child": "mark_link", "equality": false, "rgba": link_rgba } } Rename the mark_link of the existing mechanism to link_x (to avoid link naming conflicts, where x is the number of existing links in the mechanism), and connect the RRR link described in the above json file to the original mark_link of the existing mechanism (the current link_x) to form a new mechanism.
[0020] The initial existing mechanism is { "mark_link":{ "joint": "hinge", "parent": "ground", "child": null, "equality": false, "pos": [0,0], "axis": "0 0 1", "mark_pos": [0,0.15], "rgba": "1 1 0 1" }, "ground":{ "pos": [0,0], "parent": null, "equality": false } } That is, there is only one driving rod.
[0021] S12. Use the dimension production module and adopt a numbering rule for generation. The numbering rule is the numbering of points arranged within a circle with the current point as the center and a radius of R. As shown in the Figure 2 illustration, the number of the topmost point is 1, the numbers of the second row are 2, 3, 4, and so on. This numbering rule should ensure that the points are evenly distributed within the circle to facilitate subsequent heuristic search.
[0022] When connecting the new link to the mark_link of the original mechanism, the center point of the original mark_link is the center of the circle. When the number is 1 and the hinge point of the new_link_1 of the new mechanism is a point within the circle, that is Figure 2the topmost point, and since the new mechanism has 3 sub-links, it is necessary to determine the size of the new mechanism through 3 selections of numbers, such as the selection of (1, 3, 13). Each selection will use the hinge point selected in the previous selection as the center of the circle for this selection, and put the hinge point coordinates into the mechanism description json file.
[0023] S2. Verify the similarity between the output trajectory of the mechanism and the expected trajectory for input through the trajectory verification module.
[0024] S21. Through the simulation module, convert the mechanism description json file generated in the planar mechanism generation module into a urdf or mjcf file for storage, and put it into the simulator for simulation. The drive is set to the first revolute joint. The data at the output end of the simulator is the trajectories of each point within the circle with the center of the current mark_link as the center during the 360° rotation of the first revolute joint. For example, if 50 points are used within the circle, the simulation module will output 50 lists, and each list may contain 36 points, representing the coordinates of each point on the mark_link when the first revolute joint rotates 10°.
[0025] S22. Through the data verification module, compare the coordinate trajectories of each point output by the simulator with the expected trajectory input by the user, and calculate the similarity of the trajectories.
[0026] To calculate the similarity, the data verification module will first perform mirror processing and reverse processing (i.e., reverse the coordinate sequence) on the coordinate trajectories of each list to obtain four trajectories: the original trajectory, the mirror trajectory, the reverse trajectory, and the mirror reverse trajectory. Calculate the Fourier descriptors of these four trajectories and normalize them to avoid the influence of scaling. Calculate the optimal phase offset of each of these four trajectories with the expected trajectory input by the user respectively. After processing the phase offset respectively, calculate the similarity error between the four trajectories and the expected trajectory based on Procrustes analysis, and take the minimum value as the trajectory similarity of this list.
[0027] If the simulation module outputs 50 lists, finally take the minimum value of the trajectory similarities of these 50 lists as the performance evaluation of this mechanism.
[0028] S3. After completing the maximum number of iterations through the heuristic search module, obtain the optimal n sets of mechanism encodings and their performances. The mechanism encoding can uniquely generate a mechanism through the planar mechanism generation module in S1.
[0029] S31. Through the heuristic search algorithm module, use the Monte Carlo tree search algorithm to obtain the optimal n mechanism description files during the iteration process.
[0030] In the Monte Carlo tree search algorithm, each node includes the parent node of the node, the child nodes of the node, the unlocked child nodes of the node, the node order, the node type, the node encoding, the number of visits to the node, and the reward of the node. The calculation method of the UCT value is as follows: Where: R represents the reward of the node; V represents the number of visits to the node; C represents the exploration constant, which is a set constant; Pv represents the number of visits to the parent node of the node; if the number of visits to the current node is 0, then the UCT is infinite.
[0031] The Monte Carlo tree search algorithm is divided into the following steps: S311. Select a node: Starting from the root node, select the corresponding unlocked child node according to the UCT value of each child node, and then repeat the selection process among the unlocked child nodes until the selection of a certain unlocked child node without child nodes stops the node selection process; S312. Expand the node: After selecting the node, expand the node. After the expansion is completed, put it into the configuration generation module through the final node encoding to generate the mechanism description json file; S313. Evaluate the node: Put the mechanism description json file generated by expanding the node into the trajectory verification module to obtain the performance of the mechanism; S314. Data saving: Save the best n mechanisms, compare the performance of the current mechanism with the performance of the best n mechanisms that have been saved, and if the performance is better than one of them, replace the mechanism encoding with the worst performance with the node encoding of the current node; S315. Backpropagation: Starting from the current node, the reward of the node = the original reward of the node + the performance of the mechanism, the number of visits to the node = the original number of visits to the node + 1, select the parent node of the current node and continue to update the reward and number of visits of the parent node in the same update method.
[0032] When the heuristic search algorithm module iterates according to the specified number of iterations, the optimal n sets of mechanism encodings and their performances during the iteration process can be obtained. The mechanism encoding can uniquely generate a mechanism through the planar mechanism generation module.
[0033] S32. Expand the nodes in the heuristic search algorithm module through the expansion rule module. The example rules are as follows: { "0": { "root":{ "child_step": 1, "child_type": "config", "child_num": 5 } }, "1": { "config": { "child_step": 1, "child_type": "size1", "child_num": 29 }, "size1": { "child_step": 1, "child_type": "size2", "child_num": 28 }, "size2": { "child_step": 1, "child_type": "size3", "child_num": 28 }, "size3": { "child_step": 2, "child_type": "config", "child_num": 6 } }, "2": { "config": { "child_step": 2, "child_type": "size1", "child_num": 29 }, "size1": { "child_step": 2, "child_type": "size2", "child_num": 28 }, "size2": { "child_step": 2, "child_type": "size3", "child_num": 28 }, "size3": { "child_step": 3, "child_type": "config", "child_num": 6 } }, "3": { "config":{ "child_step": 3, "child_type": "size1", "child_num": 29 }, "size1":{ "child_step": 3, "child_type": "size2", "child_num": 28 }, "size2":{ "child_step": 3, "child_type": "size3", "child_num": 28 }, "size3":{ "child_step": 4, "child_type": "sim", "child_num": 1 } } } The node order is divided into 0, 1, 2, and 3, where 0 is the root node. When a node is selected in the heuristic search algorithm module, the number of child nodes of the node, as well as the order, type, and encoding that should be set, are determined based on the order and type of the node. Suppose the currently selected node is of order 1 and type size2. Then, according to the above rules, its child nodes should be expanded to 28, and each child node is of order 1 and type size3. The node encoding is the parent node encoding followed by _node number (_1 is added after the first child node, and _28 is added after the 28th child node). If the type of the child node is config, the type of the last config child node is set to sim. This setting is mainly to allow for the appearance of low-order mechanisms. Subsequently, the expansion rule module will randomly select one of the child nodes and continue the above expansion operation. The expansion rule module will stop expanding only when the currently selected node type is sim.
[0034] S32. Expand the nodes in the heuristic search algorithm module through the expansion rule module. The example rules are as follows: { "0": { "root":{ "child_step": 1, "child_type": "config", "child_num": 5 } }, "1": { "config":{ "child_step": 1, "child_type": "size1", "child_num": 29 }, "size1":{ "child_step": 1, "child_type": "size2", "child_num": 28 }, "size2":{ "child_step": 1, "child_type": "size3", "child_num": 28 }, "size3":{ "child_step": 2, "child_type": "config", "child_num": 6 } }, "2": { "config":{ "child_step": 2, "child_type": "size1", "child_num": 29 }, "size1":{ "child_step": 2, "child_type": "size2", "child_num": 28 }, "size2":{ "child_step": 2, "child_type": "size3", "child_num": 28 }, "size3":{ "child_step": 3, "child_type": "config", "child_num": 6 } }, "3": { "config":{ "child_step": 3, "child_type": "size1", "child_num": 29 }, "size1":{ "child_step": 3, "child_type": "size2", "child_num": 28 }, "size2":{ "child_step": 3, "child_type": "size3", "child_num": 28 }, "size3":{ "child_step": 4, "child_type": "sim", "child_num": 1 } } } The node order is divided into 0, 1, 2, and 3, where 0 is the root node. When a node is selected in the heuristic search algorithm module, the number of its child nodes, as well as their order, type, and encoding, will be determined based on the order and type of the node. Suppose the currently selected node is of type size2 with order 1. According to the above rules, its child nodes should be expanded to 28, each of which is of type size3 with order 1. The node encoding is the parent node encoding appended with _node number ( _1 is appended to the first child node, and _28 is appended to the 28th child node). If the type of the child node is config, the type of the last config child node is set to sim. This setting is mainly to allow for the emergence of low-order mechanisms. Subsequently, the expansion rule module will randomly select one of the child nodes and continue the above expansion operation. The expansion rule module will stop expanding only when the currently selected node type is sim.
[0035] After stopping the expansion, the expansion module will lock the current node, that is, remove the current node from the unlocked child nodes of its parent node. If the number of unlocked child nodes of its parent node becomes 0 after the operation, the expansion module will continue to lock its parent node. The locking operation is mainly to avoid repeated verification of the same mechanism.
[0036] S4. The mechanism that can generate the trajectory with the highest similarity to the expected trajectory input by the user through the final optimization module.
[0037] The final optimization module is mainly used to optimize the optimal n mechanisms generated in the heuristic search module. Since the sizes in the heuristic search module are generated based on the numbers of the points arranged in a circle, the selection is rather rough and requires final size optimization.
[0038] The final optimization module can optimize the mechanism sizes based on genetic / Bayesian optimization algorithms, and the optimization objective is the performance evaluation output by the trajectory verification module.
[0039] In each iteration, the final optimization module will generate a new mechanism description json file. Passing this file to the trajectory verification module can obtain the current mechanism performance evaluation. The mechanism that can generate the trajectory with the highest similarity to the expected trajectory input by the user and is finally optimized is saved and sent to the entity generation module.
[0040] S5. Generate a three-dimensional entity model from the mechanism description json file through the entity generation module.
[0041] Since the mechanism generated by the present invention is a linkage mechanism, its composition has strong regularity, and the connecting rods can be divided into specific types. By separately writing corresponding macro files in 3D modeling software, an editable 3D structure can be directly generated according to the hinge positions, connecting rod lengths, number of hinges, hinge types, etc. of the connecting rods. This structure can be directly processed by 3D printing.
[0042] The present invention can directly calculate, through the computer itself, the mechanism most similar to the trajectory input by the user, and directly generate an editable 3D model for the user to conduct physical verification or subsequent optimization, greatly reducing the equipment development cycle and cost.
Claims
1. A method for generating an entity model based on a planar running trajectory, characterized in that: It includes the following steps: S1. Generate an institution description file through a planar mechanism generation module; S2. Verify the similarity between the institution output trajectory and the expected trajectory for input through a trajectory verification module; S3. After completing the maximum number of iterations through a heuristic search module, obtain the optimal n sets of institution codes and their performances. The institution code can uniquely generate an institution through the planar mechanism generation module in S1; S4. Optimize the institution that can generate the trajectory with the highest similarity to the expected trajectory input by the user through a final optimization module; S5. Generate a three-dimensional entity model from the institution description json file through an entity generation module.
2. The entity model generation method based on a planar running trajectory according to claim 1, wherein: In the step S1, it includes the following steps: S11. Use a configuration generation module to select a syntax number to generate a configuration, generate an institution description json file according to the rotated link number, rename the mark_link of the existing institution to link_x, and connect the links described in the above json file to the original mark_link of the existing institution to form a new institution; S12. Use a dimension production module to generate according to a numbering rule. When connecting the new link to the mark_link of the original institution, the center point of the original mark_link is the center of the circle. When the hinge point of the new_link_1 of the new institution is a point inside the circle, the size of the new institution needs to be determined by the selection of the number. Each selection will use the hinge point selected last time as the center of the circle for this selection, and put the hinge point coordinates into the institution description json file.
3. A method for generating an entity model based on a planar running trajectory according to claim 1, characterized in that: In the step S2, it includes the following steps: S21. Convert the institution description json file generated in the planar mechanism generation module into a urdf or mjcf file through a simulation module for storage, and put it into a simulator for simulation to generate an institution output trajectory; S22. Compare the coordinate trajectories of each point output by the simulator with the expected trajectory input by the user through a data verification module to calculate the similarity of the trajectories.
4. A method for generating a solid model based on a planar running trajectory according to claim 3, characterized in that: Method for calculating trajectory similarity: First, perform mirror processing and reverse order processing on the coordinate trajectories of each list to obtain four trajectories: the original trajectory, the mirror trajectory, the reverse order trajectory, and the mirror reverse order trajectory. Calculate the Fourier descriptors of these four trajectories and normalize them to avoid the influence of scaling. Calculate the optimal phase shift of these four trajectories with the expected trajectory input by the user respectively. After processing the phase shift respectively, calculate the similarity error between the four trajectories and the expected trajectory based on Procrustes analysis, and take the minimum value as the trajectory similarity of this list.
5. A method for generating an entity model based on a planar running trajectory according to claim 1, characterized in that: In the step S3, it includes the following steps: S31. Through a heuristic search algorithm module, adopt the Monte Carlo tree search algorithm to obtain the optimal n institution description files during the iteration process; S32. Expand the nodes in the heuristic search algorithm module through an expansion rule module.
6. A method for generating a solid model based on a planar running trajectory according to claim 5, characterized in that: In the Monte Carlo tree search algorithm, each node includes the parent node of the node, the child nodes of the node, the un-locked child nodes of the node, the node order, the node type, the node code, the access times of the node, the reward of the node. The calculation method of the UCT value is as follows: Where: R represents the reward of a node; V represents the number of visits of a node; C represents an exploration constant, which is a pre-set constant; Pv represents the number of visits of the parent node of a node; if the number of visits of the current node is 0, then UCT is infinite.
7. A method for generating an entity model based on a planar running trajectory according to claim 5, characterized in that: The Monte Carlo tree search algorithm is divided into the following steps: S311. Select a node: Starting from the root node, select the corresponding unlocked child node according to the UCT value of each child node. Then repeat the selection process among the unlocked child nodes until the selection of nodes stops when an unlocked child node has no child nodes; S312. Expand a node: After selecting a node, expand the node. After expansion, put the final node encoding into the configuration generation module to generate an institutional description json file; S313. Evaluate a node: Put the institutional description json file generated by expanding the node into the trajectory verification module to obtain the performance of the institution; S314. Data saving: Save the best n institutions. Compare the performance of the current institution with the performance of the best n institutions that have been saved. If the performance is better than one of them, replace the encoding of the institution with the worst performance among them with the node encoding of the current node; S315. Backpropagation: Starting from the current node, the reward of the node = the original reward of the node + the performance of the institution, and the number of node visits = the original number of node visits + 1. Select the parent node of the current node and continue to update the reward and the number of visits of the parent node in the same update manner.
8. A method for generating an entity model based on a planar running trajectory according to claim 1, characterized in that: In step S4, the final optimization module generates a new institutional description json file in each iteration. Pass this file to the trajectory verification module in step S2 to obtain the performance evaluation of the current institution. The institution that can finally optimize the trajectory with the highest similarity to the expected trajectory input by the user is saved and sent to the entity generation module in step S5.
Citation Information
Patent Citations
Generative design method for planar mechanism with given motion trail
CN110427672A
Human body lower limb rehabilitation robot construction method
CN117912633A
Method and system for optimizing turning tool path of large vertical lathe
CN118276507A