A method for generating solid models based on plane running trajectory
By automatically generating a mechanism similar to the user input trajectory, the complex trajectory processing problem of solid model generation in the existing technology is solved, the rapid generation and editable three-dimensional model is achieved, and the equipment development cost is reduced.
Patent Information
- Application Number
- CN202510396995.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-04-01
AI Technical Summary
When generating solid models, existing technologies have difficulty processing complex or dynamic trajectories, lack adaptive conversion capabilities, have a low level of intelligence, and are unable to adjust the model structure in real time to adapt to trajectory speed and acceleration.
Through the planar mechanism generation module, trajectory verification module, heuristic search module and final optimization module, a mechanism similar to the user input trajectory is automatically generated, and an editable three-dimensional model is generated through the entity generation module.
It achieves the rapid generation of equipment motion trajectory, reduces equipment development cycle and cost, and provides editable 3D models for users to verify and optimize.
Smart Images

Figure CN120257633B_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 plane running trajectory. Background Art
[0002] In the fields of industrial design, automated manufacturing, robotic motion planning, and computer-aided design (CAD), rapidly generating solid models based on an object's motion trajectory has long been a hot topic of research. Traditional modeling methods typically rely on manual drawing or parametric design tools (such as SolidWorks and AutoCAD), requiring users to manually define geometric features and constraints. This is time-consuming and difficult to adapt to the modeling needs of complex or dynamic trajectories. With the development of intelligent manufacturing and digital twin technology, the demand for technologies that automatically generate solid models based on physical motion features is becoming increasingly urgent.
[0003] Existing technologies face three major bottlenecks: 1) a lack of correlation between trajectories and 3D models, particularly when dealing with trajectories with varying cross-sections and multiple degrees of freedom. 2) insufficient dynamic response, with traditional tools unable to adjust the model structure in real time based on trajectory velocity and acceleration. 3) a low level of intelligence, with the modeling process relying on manual experience and inefficiency. Rapid generation of device motion trajectories is a pressing technical challenge. 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 running trajectory, which directly calculates the mechanism most similar to the trajectory input by the user through computer, and directly generates an editable three-dimensional model for the user to perform physical verification or subsequent optimization, thereby reducing the equipment development cycle and cost.
[0005] In order 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 plane running trajectory includes the following steps:
[0007] S1. Generate a mechanism description file through a planar mechanism generation module;
[0008] S2. The similarity between the output trajectory of the mechanism and the desired trajectory for input is verified by the trajectory verification module;
[0009] S3. After completing the maximum number of iterations through the heuristic search module, the optimal n sets of mechanism codes and their performance are obtained. The mechanism codes can be uniquely generated by the planar mechanism generation module in S1;
[0010] S4. The mechanism that can generate the trajectory with the highest similarity to the user input desired trajectory is optimized by the final optimization module;
[0011] S5. Generate a three-dimensional entity model from the structure description json file through the entity generation module.
[0012] To further optimize the technical solution, step S1 includes the following steps:
[0013] S11. Use the configuration generation module to select a syntax number to generate a configuration. Generate a mechanism description json file based on the rotated link number. Rename the mark_link of the existing mechanism to link_x. Then connect the link described in the json file to the original mark_link of the existing mechanism to form a new mechanism.
[0014] S12. Use the size production module and the numbering rules to generate. When the new connecting rod is connected to the mark_link of the original mechanism, the center point of the original mark_link is the center of the circle. When the new_link_1 hinge point of the new mechanism is a point within the circle, it is necessary to determine the size of the new mechanism by selecting the number. Each selection will use the hinge point selected last as the center of the circle for this selection, and the hinge point coordinates will be placed in the mechanism description json file.
[0015] To further optimize the technical solution, step S2 includes the following steps:
[0016] S21. The planar mechanism generation module generates a mechanism description json file that is converted into a urdf or mjcf file for storage through the simulation module and placed in the simulator for simulation to generate the mechanism output trajectory;
[0017] S22. The data verification module compares the coordinate trajectory of each point output by the simulator with the expected trajectory input by the user, and calculates the similarity of the trajectories.
[0018] To further optimize the technical solution and calculate trajectory similarity, we first mirrored and reversed the coordinate trajectory of each list to obtain four trajectories: the original trajectory, the mirrored trajectory, the reversed trajectory, and the mirrored reversed trajectory. We then calculated the Fourier descriptors of these four trajectories and normalized them to avoid scaling effects. We then calculated the optimal phase offset between these four trajectories and the desired trajectory input by the user. After processing the phase offsets, we calculated the similarity errors between the four trajectories and the desired trajectory based on Procrustes analysis, and took the minimum value as the trajectory similarity for the list.
[0019] Further optimizing the technical solution, the step S3 includes the following steps:
[0020] S31. Using the heuristic search algorithm module and the Monte Carlo tree search algorithm, the optimal n organization description files are obtained during the iteration process;
[0021] S32. Expand the nodes in the heuristic search algorithm module by expanding the rule module.
[0022] To further optimize the technical solution, in the Monte Carlo tree search algorithm, each node includes the node's parent node, the node's child nodes, the node's unlocked child nodes, the node order, the node type, the node code, the node's visit count, and the node's reward. The UCT value calculation method is:
[0023]
[0024] 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 node's parent node; if the number of visits to the current node is 0, UCT is infinite.
[0025] To further optimize the technical solution, the Monte Carlo tree search algorithm is divided into the following steps:
[0026] 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 on the unlocked child node until an unlocked child node with no child nodes is selected, then stop the node selection process;
[0027] S312. Extended Node: After selecting a node, the node is extended. After the extension is completed, the final node code is placed in the configuration generation module to generate a mechanism description json file;
[0028] S313 evaluation node: the mechanism description json file generated by the extension node is put into the trajectory verification module to obtain the performance of the mechanism;
[0029] S314. Data preservation: Save the best n institutions and compare the performance of the current institution with the best n institutions saved. If the performance is better than one of them, replace the worst performing institution code with the node code of the current node;
[0030] S315. Backward propagation: Starting from the current node, the node reward = the node's original reward + the organization's performance, the node visit count = the node's original visit count + 1, select the parent node of the current node and continue to update the parent node's reward and visit count in the same way.
[0031] To further optimize the technical solution, in step S4, the final optimization module generates a new mechanism description json file each iteration, and passes the file to the trajectory verification module in step S2 to obtain the current mechanism performance evaluation. The final optimized mechanism that can generate the trajectory with the highest similarity to the user input expected trajectory is saved and sent to the entity generation module in step S5.
[0032] Due to the adoption of the above technical solution, the technical progress achieved by the present invention is as follows.
[0033] The present invention provides a method for generating a solid model based on a planar running trajectory. This method can directly calculate, through a computer, the mechanism that is most similar to the trajectory input by the user, and directly generate an editable three-dimensional model for the user to perform physical verification or subsequent optimization, greatly reducing the equipment development cycle and cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a system framework diagram of the present invention;
[0035] Figure 2 Schematic diagram of the size generation module of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0037] A method for generating a solid model based on plane running trajectory, combined with Figure 1 As shown, it includes the following steps:
[0038] S1. Generate a mechanism description file through the planar mechanism generation module.
[0039] S11. Use the configuration generation module to generate a configuration by selecting a syntax number. For example, number "1" represents the RRR connecting rod and number "2" represents the RRP connecting rod. After selecting a number, assuming number 1 is selected, the following mechanism description json file will be generated based on the RRR connecting rod:
[0040] {
[0041] "new_link_1":{
[0042] "joint": "R",
[0043] "parent": "mark_link",
[0044] "child": None,
[0045] "equality": True,
[0046] "rgba": link_rgba
[0047] },
[0048] "mark_link":{
[0049] "joint": "R",
[0050] "parent": "new_link_2",
[0051] "child": "new_link_1",
[0052] "equality": False,
[0053] "rgba": link_rgba
[0054] },
[0055] "new_link_2":{
[0056] "joint": "R",
[0057] "parent": "ground",
[0058] "child": "mark_link",
[0059] "equality": False,
[0060] "rgba": link_rgba
[0061] }
[0062] }
[0063] 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 (now link_x) to form a new mechanism.
[0064] The initial existing organization is {
[0065] "mark_link":{
[0066] "joint": "hinge",
[0067] "parent": "ground",
[0068] "child": None,
[0069] "equality": False,
[0070] "pos": [0,0],
[0071] "axis": "0 0 1",
[0072] "mark_pos": [0,0.15],
[0073] "rgba": "1 1 0 1"
[0074] },
[0075] "ground":{
[0076] "pos": [0,0],
[0077] "parent": None,
[0078] "equality": False
[0079] }
[0080] }
[0081] That is, there is only one drive rod.
[0082] S12. Use the size production module and use the numbering rule to generate the points. The numbering rule is to number the points arranged in a circle with a radius of R and the current point as the center, as shown in the figure. Figure 2 In the example, the top point is numbered 1, the second row is numbered 2, 3, 4, and so on. This numbering rule ensures that the points are evenly distributed within the circle to facilitate subsequent heuristic search.
[0083] When the new link is connected 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, the hinge point of the new mechanism new_link_1 is a point inside the circle, that is, Figure 2 The top point of the new mechanism, and because the new mechanism has 3 pairs, it is necessary to determine the size of the new mechanism through 3 numbering, such as (1, 3, 13). Each selection will use the hinge point of the previous selection as the center of the circle of this selection, and put the hinge point coordinates into the mechanism description json file.
[0084] S2. Verify the similarity between the mechanism output trajectory and the expected trajectory used for input through the trajectory verification module.
[0085] S21. The mechanism description json file generated in the planar mechanism generation module is converted into a urdf or mjcf file for storage through the simulation module, and is placed in the simulator for simulation. The drive is set to the first rotary joint, and the simulator output data is the trajectory of each point in the circle with the current mark_link center point as the center point during the 360° rotation of the first rotary joint. If 50 points are used in the circle, the simulation module will output 50 lists, each of which may contain 36 points, representing the coordinates of each point on the mark_link every 10° rotation of the first rotary joint.
[0086] S22. The data verification module compares the coordinate trajectory of each point output by the simulator with the expected trajectory input by the user, and calculates the similarity of the trajectories.
[0087] To calculate similarity, the data verification module first mirrors and reverses the coordinate trajectory of each list (i.e., reverses the coordinate sequence), resulting in four trajectories: the original trajectory, the mirrored trajectory, the reversed trajectory, and the mirrored reversed trajectory. Fourier descriptors are then calculated for these four trajectories and normalized to minimize scaling effects. The optimal phase offset is then calculated for each of these four trajectories relative to the user-entered desired trajectory. After processing the phase offsets, the Procrustes analysis is used to calculate the similarity error between the four trajectories and the desired trajectory, and the minimum value is taken as the trajectory similarity for the list.
[0088] If the simulation module outputs 50 lists, the minimum value of the trajectory similarity of these 50 lists will be taken as the performance evaluation of the mechanism.
[0089] S3. After completing the maximum number of iterations through the heuristic search module, the optimal n sets of mechanism codes and their performance are obtained. The mechanism codes can be uniquely generated through the planar mechanism generation module in S1.
[0090] S31. Through the heuristic search algorithm module, the Monte Carlo tree search algorithm is used to obtain the optimal n organization description files in the iterative process.
[0091] In the Monte Carlo tree search algorithm, each node includes the node's parent node, the node's child nodes, the node's unlocked child nodes, the node order, the node type, the node code, the node's visit count, and the node's reward. The UCT value is calculated as follows:
[0092]
[0093] 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 node's parent node; if the number of visits to the current node is 0, UCT is infinite.
[0094] The Monte Carlo tree search algorithm is divided into the following steps:
[0095] 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 on the unlocked child node until an unlocked child node with no child nodes is selected, then stop the node selection process;
[0096] S312. Extended Node: After selecting a node, the node is extended. After the extension is completed, the final node code is placed in the configuration generation module to generate a description of the mechanism in the json file;
[0097] S313 evaluation node: the mechanism description json file generated by the extension node is put into the trajectory verification module to obtain the performance of the mechanism;
[0098] S314. Data preservation: Save the best n institutions and compare the performance of the current institution with the best n institutions saved. If the performance is better than one of them, replace the worst performing institution code with the node code of the current node;
[0099] S315. Backward propagation: Starting from the current node, the node reward = the node's original reward + the organization's performance, the node visit count = the node's original visit count + 1, select the parent node of the current node and continue to update the parent node's reward and visit count in the same way.
[0100] When the heuristic search algorithm module completes the iteration according to the prescribed number of iterations, the optimal n groups of mechanism codes and their performances in the iteration process can be obtained, and the mechanism codes can be uniquely generated by the planar mechanism generation module.
[0101] S32. Expand the nodes in the heuristic search algorithm module through the expansion rule module. Example rules are as follows:
[0102] {
[0103] "0": {
[0104] "root":{
[0105] "child_step": 1,
[0106] "child_type": "config",
[0107] "child_num": 5
[0108] }
[0109] },
[0110] "1": {
[0111] "config":{
[0112] "child_step": 1,
[0113] "child_type": "size1",
[0114] "child_num": 29
[0115] },
[0116] "size1":{
[0117] "child_step": 1,
[0118] "child_type": "size2",
[0119] "child_num": 28
[0120] },
[0121] "size2":{
[0122] "child_step": 1,
[0123] "child_type": "size3",
[0124] "child_num": 28
[0125] },
[0126] "size3":{
[0127] "child_step": 2,
[0128] "child_type": "config",
[0129] "child_num": 6
[0130] }
[0131] },
[0132] "2": {
[0133] "config":{
[0134] "child_step": 2,
[0135] "child_type": "size1",
[0136] "child_num": 29
[0137] },
[0138] "size1":{
[0139] "child_step": 2,
[0140] "child_type": "size2",
[0141] "child_num": 28
[0142] },
[0143] "size2":{
[0144] "child_step": 2,
[0145] "child_type": "size3",
[0146] "child_num": 28
[0147] },
[0148] "size3":{
[0149] "child_step": 3,
[0150] "child_type": "config",
[0151] "child_num": 6
[0152] }
[0153] },
[0154] "3": {
[0155] "config":{
[0156] "child_step": 3,
[0157] "child_type": "size1",
[0158] "child_num": 29
[0159] },
[0160] "size1":{
[0161] "child_step": 3,
[0162] "child_type": "size2",
[0163] "child_num": 28
[0164] },
[0165] "size2":{
[0166] "child_step": 3,
[0167] "child_type": "size3",
[0168] "child_num": 28
[0169] },
[0170] "size3":{
[0171] "child_step": 4,
[0172] "child_type": "sim",
[0173] "child_num": 1
[0174] }
[0175] }
[0176] }
[0177] Node orders are 0, 1, 2, and 3, with 0 being the root node. When a node is selected in the heuristic search algorithm module, the number of child nodes and their corresponding order, type, and encoding are determined based on the node's order and type. For example, if the currently selected node is a 1st-order, size 2 node, then according to the above rules, its child nodes should be expanded to 28, each of which is a 1st-order, size 3 node. The node encoding is the parent node encoding followed by the node number (_1 after the first child node and _28 after the 28th child node). If the child node type is config, the type of the last config child node is set to sim. This setting is primarily to allow for the appearance of lower-order structures. The expansion rule module then randomly selects one of the child nodes to continue the above expansion operation. The expansion rule module only stops expanding if the currently selected node type is sim.
[0178] The code after stopping expansion may be 0_1_3_15_23_6, where 0 represents the root node (meaningless), 1 represents the configuration code 1 (representing the RRR connecting rod type), and the size codes are 3, 15, and 23. 3 represents that the third number is selected from the 29 numbers in the circle, and 15 and 23 represent that the 15th and 23rd numbers are selected from the 28 numbers in the circle (the 28 numbers do not include the center of the circle. If the center of the circle is selected for the last two connecting rods, the mechanism simulation will fail).
[0179] When the expansion stops, the expansion module will lock the current node, that is, remove the current node from its parent node's unlocked child nodes. If the number of unlocked child nodes of its parent node is 0 after the operation is completed, the parent node will be locked again. The locking operation is mainly to avoid repeated verification of the same mechanism.
[0180] S4. The mechanism that can generate the trajectory with the highest similarity to the expected trajectory input by the user is optimized by the final optimization module.
[0181] The final optimization module is mainly used to optimize the optimal n mechanisms generated in the heuristic search module. Since the size in the heuristic search module is generated according to the number of points arranged in the garden, its selection is very rough and requires final size optimization.
[0182] The final optimization module can optimize the mechanism size based on the genetic / Bayesian optimization algorithm, and the optimization target is the performance evaluation output by the trajectory verification module.
[0183] The final optimization module generates a new mechanism description JSON file at each iteration. This file is passed to the trajectory verification module to obtain the current mechanism performance evaluation. The final optimized mechanism that can produce the trajectory with the highest similarity to the user input expected trajectory is saved and sent to the entity generation module.
[0184] S5. Generate a three-dimensional entity model from the structure description json file through the entity generation module.
[0185] Because the mechanism created by the present invention is a connecting rod mechanism, its composition is highly regular, and the connecting rods can be classified into several specific types. By programming corresponding macro files in 3D modeling software, an editable 3D structure can be directly generated based on the connecting rod's hinge position, length, number of hinges, and type of hinges. This structure can then be directly 3D printed.
[0186] The present invention can directly calculate the mechanism that is most similar to the trajectory input by the user through a computer, and directly generate an editable three-dimensional model for the user to perform physical verification or subsequent optimization, greatly reducing the equipment development cycle and cost.
Claims
1. A method for generating a solid model based on a plane running trajectory, characterized by: It includes the following steps: S1. Generate a mechanism description file through a planar mechanism generation module; S2. The similarity between the output trajectory of the mechanism and the desired trajectory for input is verified by the trajectory verification module; S3. After completing the maximum number of iterations through the heuristic search module, the optimal n sets of mechanism codes and their performance are obtained. The mechanism codes can be uniquely generated by the planar mechanism generation module in S1; S4. The mechanism that can generate the trajectory with the highest similarity to the user input desired trajectory is optimized by the final optimization module; S5. Generate a three-dimensional entity model from the structure description json file through the entity generation module.
2. The method for generating a solid model based on a plane running trajectory according to claim 1, characterized in that: The step S1 includes the following steps: S11. Use the configuration generation module to select a syntax number to generate a configuration. Generate a mechanism description json file based on the rotated link number. Rename the mark_link of the existing mechanism to link_x. Then connect the link described in the json file to the original mark_link of the existing mechanism to form a new mechanism. S12. Use the size production module and the numbering rules to generate. When the new connecting rod is connected to the mark_link of the original mechanism, the center point of the original mark_link is the center of the circle. When the new_link_1 hinge point of the new mechanism is a point within the circle, it is necessary to determine the size of the new mechanism by selecting the number. Each selection will use the hinge point selected last as the center of the circle for this selection, and the hinge point coordinates will be placed in the mechanism description json file.
3. The method for generating a solid model based on a plane running trajectory according to claim 1, characterized in that: The step S2 includes the following steps: S21. The planar mechanism generation module generates a mechanism description json file that is converted into a urdf or mjcf file for storage through the simulation module and placed in the simulator for simulation to generate the mechanism output trajectory; S22. The data verification module compares the coordinate trajectory of each point output by the simulator with the expected trajectory input by the user, and calculates the similarity of the trajectories.
4. The method for generating a solid model based on a plane running trajectory according to claim 3, characterized in that: Method for calculating trajectory similarity: First, mirror and reverse the coordinate trajectory of each list to obtain four trajectories: original trajectory, mirrored trajectory, reversed trajectory, and mirrored reversed trajectory. Fourier descriptors are calculated for these four trajectories and normalized to avoid the effects of scaling. The optimal phase offset is calculated for each of these four trajectories and the desired trajectory input by the user. After processing the phase offsets, the similarity errors between the four trajectories and the desired trajectory are calculated based on Procrustes analysis. The minimum value is taken as the trajectory similarity for the list.
5. The method for generating a solid model based on a plane running trajectory according to claim 1, characterized in that: The step S3 includes the following steps: S31. Using the heuristic search algorithm module and the Monte Carlo tree search algorithm, the optimal n organization description files are obtained during the iteration process; S32. Expand the nodes in the heuristic search algorithm module by expanding the rule module.
6. The method for generating a solid model based on a plane running trajectory according to claim 5, characterized in that: In the Monte Carlo tree search algorithm, each node includes the node's parent node, the node's child nodes, the node's unlocked child nodes, the node order, the node type, the node code, the node's visit count, and the node's reward. The UCT value is calculated 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 node's parent node; if the number of visits to the current node is 0, UCT is infinite.
7. The method for generating a solid model based on a plane 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, and then repeat the selection process on the unlocked child node until an unlocked child node with no child nodes is selected, then stop the node selection process; S312. Extended Node: After selecting a node, the node is extended. After the extension is completed, the final node code is placed in the configuration generation module to generate a mechanism description json file; S313 evaluation node: the mechanism description json file generated by the extension node is put into the trajectory verification module to obtain the performance of the mechanism; S314. Data preservation: Save the best n institutions and compare the performance of the current institution with the best n institutions saved. If the performance is better than one of them, replace the worst performing institution code with the node code of the current node; S315. Backward propagation: Starting from the current node, the node reward = the node's original reward + the organization's performance, the node visit count = the node's original visit count + 1, select the parent node of the current node and continue to update the parent node's reward and visit count in the same way.
8. The method for generating a solid model based on a plane running trajectory according to claim 1, characterized in that: In step S4, the final optimization module generates a new mechanism description json file each iteration, and passes this file to the trajectory verification module in step S2 to obtain the current mechanism performance evaluation. The final optimized mechanism that can produce the trajectory with the highest similarity to the user input expected trajectory 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