Assembly method and device based on parameterized model, equipment and storage medium
Through the assembly method based on the parameterized model, the parameterized models in the assembly model design tool are solved, and higher flexibility and accuracy are achieved.
Patent Information
- Application Number
- CN202510234026.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-20
AI Technical Summary
The existing model design tools are limited in assembly capabilities and are difficult to meet personalized needs.
The assembly method based on the parameterized model is adopted, and the protocol that adds the parameterized model, matches its assembly protocol with the existing model in the scene, and assembles based on the matching relationship, and displays it in the appropriate assembly area.
It improves the flexibility and accuracy of parameterized model assembly and can meet users' personalized needs.
Smart Images

Figure CN120180550A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to an assembly method, apparatus, device, and storage medium based on a parametric model. Background Art
[0002] There are various model design tools in the home furnishing field. Some tools support functions such as 3D modeling, animation, and rendering. Some tools can be used not only for home furnishing design but also for indoor layout. However, most of the model design tools have limited assembly capabilities and are difficult to meet personalized needs. Summary of the Invention
[0003] The present disclosure provides an assembly method, apparatus, device, and storage medium based on a parametric model to solve or alleviate one or more technical problems in the prior art.
[0004] In a first aspect, the present disclosure provides an assembly method based on a parametric model, including:
[0005] In response to a first selection command for a candidate parametric model, obtaining a newly added first parametric model;
[0006] Matching the assembly protocol of the first parametric model with the assembly protocol of a second parametric model already existing in the scene to obtain a matching relationship between the first parametric model and the second parametric model;
[0007] Performing assembly based on the matching relationship between the first parametric model and the second parametric model;
[0008] Displaying the first parametric model in the assembly area of the second parametric model.
[0009] In a second aspect, the present disclosure provides an assembly apparatus based on a parametric model, including:
[0010] An obtaining module, configured to obtain a newly added first parametric model in response to a first selection command for a candidate parametric model;
[0011] A matching module, configured to match the assembly protocol of the first parametric model with the assembly protocol of a second parametric model already existing in the scene to obtain a matching relationship between the first parametric model and the second parametric model;
[0012] An assembly module, configured to perform assembly based on the matching relationship between the first parametric model and the second parametric model;
[0013] A display module, configured to display the first parametric model in the assembly area of the second parametric model.
[0014] In a third aspect, there is provided an electronic device, including:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any method in the embodiments of the present disclosure.
[0018] In a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute any method in the embodiments of the present disclosure.
[0019] In a fifth aspect, a computer program product is provided, including a computer program which, when executed by a processor, implements any method in the embodiments of the present disclosure.
[0020] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In the drawings, unless otherwise specified, the same reference numerals throughout the several views denote the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments provided in accordance with the present disclosure and should not be regarded as limiting the scope of the present disclosure.
[0022] Figure 1 is a schematic flowchart of an assembly method based on a parametric model according to an embodiment of the present disclosure;
[0023] Figure 2 is a schematic flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure;
[0024] Figure 3 is a schematic flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure;
[0025] Figure 4 is a schematic flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure;
[0026] Figure 5 is a schematic flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure;
[0027] Figure 6 is a schematic diagram of an assembly area for a newly added model in a scene.
[0028] Figure 7 is a schematic flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure;
[0029] Figure 8 is a schematic diagram of deleting the second parametric model and its child nodes.
[0030] Figure 9 is a schematic flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure;
[0031] Figure 10 is a schematic structural diagram of a model base module;
[0032] Figure 11 is a tree node diagram of the model;
[0033] Figure 12 is a schematic diagram of product package replacement of the model base module;
[0034] Figure 13 is a schematic diagram of the constraint relationship and state of the scene;
[0035] Figure 14 is a schematic diagram of the associated growth of the node relationship of the model;
[0036] Figure 15 is an assembly logic diagram when adding a module to the scene;
[0037] Figure 16 is a schematic diagram of pose calculation of the module;
[0038] Figure 17 is a flowchart of obtaining the absolute pose of the module;
[0039] Figure 18 is a schematic structural diagram of an assembly device based on a parametric model according to an embodiment of the present disclosure;
[0040] Figure 19 is a schematic structural diagram of an assembly device based on a parametric model according to another embodiment of the present disclosure;
[0041] Figure 20 is a block diagram of an electronic device for implementing the embodiments of the present disclosure. Detailed implementation manners
[0042] Hereinafter, the present disclosure will be further described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements having the same or similar functions. Although various aspects of the embodiments are shown in the drawings, the drawings do not have to be drawn to scale unless otherwise specified.
[0043] In addition, for a better illustration of the present disclosure, numerous specific details are given in the following detailed implementation manners. Those skilled in the art should understand that the present disclosure can also be implemented without some specific details. In some instances, methods, means, components, circuits, etc. well-known to those skilled in the art are not described in detail so as to highlight the gist of the present disclosure.
[0044] Figure 1 FIG. 4 is a schematic flowchart of an assembly method based on a parametric model according to an embodiment of the present disclosure. The method may include:
[0045] S110. In response to a first selection command for a candidate parametric model, obtain a newly added first parametric model;
[0046] S120. Match the assembly protocol of the first parametric model with the assembly protocol of a second parametric model already existing in the scene to obtain a matching relationship between the first parametric model and the second parametric model;
[0047] S130. Perform assembly based on the matching relationship between the first parametric model and the second parametric model;
[0048] S140. Display the first parametric model in the assembly area of the second parametric model.
[0049] In an embodiment of the present disclosure, a parametric model is a model constructed based on parameters, geometric relationships, etc., and may also be referred to as a parametric component, a parametric module, etc. The parametric model may include a model of a single finished product, or may include a combination of one or more finished products and components. By adjusting parameters such as the size, proportion, angle, etc. of the basic parametric model, the model can be automatically updated to quickly generate multiple design schemes.
[0050] In the scenario of a user interface, multiple candidate parametric models can be displayed. The user interface can be the human-computer interaction interface of a model design tool. The scenarios of the user interface can include various types such as a living room scenario, a bedroom scenario, an office scenario, etc. After the user selects a certain parametric model from multiple candidate parametric models, a first selection command can be generated. Based on this first selection command, a newly added first parametric model can be obtained. If there are no other models in the scenario of this user interface, the first parametric model can be directly displayed in the scenario of this user interface. If there are already other second parametric models in the scenario of the user interface, the candidate parametric model can be a model related to the other second parametric models. After obtaining the first parametric model to be newly added in response to the first selection command, the assembly protocol of the first parametric model can be matched with the assembly protocols of one or more second parametric models to obtain a matching relationship. This matching relationship can include one or more of the identification, name, connection points, etc. of the second parametric model that matches the first parametric model. If the assembly protocol of the first parametric model matches the assembly protocol of a certain second parametric model, the first parametric model can be displayed in the assembly area of this second parametric model. The assembly protocol can include one or more of the assembly rules, adsorption rules, adaptation rules, and specific assembly rules implemented through an assembly script, etc. of the parametric model. There can be one or multiple assembly areas for the second parametric model. If there are multiple assembly areas, multiple candidate assembly areas can be displayed or prompted first. After the user makes a selection, the first parametric model can be displayed in the final assembly area of the second parametric model.
[0051] According to the embodiments of the present disclosure, a newly added parametric model can be selected according to a selection command, and the assembly method can be determined after protocol matching with the existing parametric models, which can improve the flexibility of parametric model assembly and meet the personalized needs of users.
[0052] Figure 2 It is a schematic flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure. This method can include one or more features of the above-mentioned assembly method based on a parametric model. In one implementation, step S120 matches the assembly protocol of the first parametric model with the assembly protocols of the existing second parametric models in the scenario to obtain the matching relationship between the first parametric model and the second parametric model, including:
[0053] S210. Traverse the second parametric models represented by the nodes in the scenario node tree to obtain the set of idle connection points of the second parametric model;
[0054] S220. Compare the assembly protocols of each connection point in the set of idle connection points with the assembly protocol of the first parametric model to obtain the connection points that match the first parametric model.
[0055] In an embodiment of the present disclosure, the scene node tree may represent various elements and their relationships in the scene through a tree structure. Each node in the scene node tree may represent an element in the scene, and the edges of the node tree represent the relationships between the nodes. For example, a node may represent a parametric model, and the edges between the nodes represent the assembly relationships between the parametric models. When adding the first parametric model, the assembly protocols of all nodes on the scene node tree, such as the assembly protocols attached to the second parametric model, may be traversed first to obtain the assembly protocol paired with the newly added model. In one way, the assembly protocol of the first parametric model may be matched with the assembly protocols of all second parametric models on the scene node tree to find the paired assembly protocol, and the idle assembly points may be found from the corresponding connection points in the paired assembly protocol to obtain a set of idle assembly points. In another way, first, the set of idle connection points of all second parametric models on the scene node tree is found through traversal, and then the assembly protocol of the first parametric model is matched with the assembly protocols of the set of idle connection points to obtain a set of idle assembly points. One parametric model may have one or more connection points, and each connection point may correspond to an assembly protocol. For example, the set of idle connection points of the second parametric model M1 includes connection points P1, P2, P3, and P4. Among them, only the assembly protocol of the connection point P1 does not match the assembly protocol of the first parametric model M2. Then, the connection points P2, P3, and P4 can all be used as the connection points matched with the first parametric model M2.
[0056] According to the embodiment of the present disclosure, by obtaining the set of connection points of the parametric model through the scene node tree, using the idle connection points to match the assembly protocol of the newly added parametric model, and determining the matching connection points, the accuracy and processing efficiency of parametric model assembly can be improved.
[0057] Figure 3 FIG. 9 is a schematic flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure. This method may include one or more features of the above-mentioned assembly method based on a parametric model. In one implementation, step S220 compares the assembly protocols of each connection point in the set of idle connection points with the assembly protocol of the first parametric model to obtain the connection points matching the first parametric model, including:
[0058] S310. When the identifier of the first assembly protocol of the first connection point in the first parametric model is the same as the identifier of the second assembly protocol of the second connection point in the set of idle connection points, the second connection point matching the first connection point is obtained.
[0059] In the embodiments of the present disclosure, the assembly protocol may include types such as a sending protocol, a receiving protocol, etc. The assembly protocol may include a protocol identifier, an adsorption rule, etc. In the case where the identifiers of the assembly protocol match, a second connection point that matches the first connection point of the first parametric model can be obtained from the set of idle connection points. For example, if the sending protocol identifier of the first connection point of model M1 is P1 and the receiving protocol identifier of the second connection point of model M2 is P1, indicating that the identifier of the sending protocol and the identifier of the receiving protocol match, then the first connection point of model M1 and the second connection point of model M2 match.
[0060] According to the embodiments of the present disclosure, by matching the assembly protocol identifiers between connection points, the connection points that can be matched can be determined, and the assembly connection points of the parametric model can be obtained quickly and accurately, improving the accuracy of parametric model assembly.
[0061] Figure 4 FIG. is a flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure. This method may include one or more features of the above-mentioned assembly method based on a parametric model. In one implementation, step S130 performs assembly based on the matching relationship between the first parametric model and the second parametric model, including:
[0062] S410. Assemble the first parametric model and the second parametric model through the first connection point and the second connection point according to one or more of the first parametric model, the first connection point of the first parametric model, the second parametric model, the second connection point of the second parametric model, and the assembly protocol.
[0063] In the embodiments of the present disclosure, a parametric model may have one or more connection points. For example, a sofa model has one connection point on each of the left and right sides. Another example is that a cabinet model has one connection point on each of the top, bottom, left, and right sides. If the assembly protocols of the first connection point of the first parametric model and the second connection point of the second parametric model match, assembly can be performed based on the first parametric model, the second parametric model, their respective corresponding connection points, and the assembly protocol. After assembly, the first parametric model and the second parametric model are connected through the first connection point and the second connection point.
[0064] According to the embodiments of the present disclosure, assembling the parametric model through connection points and an assembly protocol can improve the flexibility of parametric model assembly and increase the accuracy of parametric model assembly.
[0065] Figure 5FIG. 0 is a schematic flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure. This method may include one or more features of the above-mentioned assembly method based on a parametric model. In one implementation, step S410 assembles the first parametric model and the second parametric model through the first connection point and the second connection point according to one or more of the first parametric model, the first connection point of the first parametric model, the second parametric model, the second connection point of the second parametric model, and the assembly protocol, including:
[0066] S510. Obtain the absolute pose of the second connection point according to the absolute pose of the second parametric model and the relative pose of the second connection point of the second parametric model;
[0067] S520. Obtain the absolute pose of the constraint rule according to the absolute pose of the second connection point and the relative pose of the constraint rule in the assembly protocol;
[0068] S530. Obtain the absolute pose of the first connection point according to the absolute pose of the constraint rule and the relative pose of the first connection point;
[0069] S540. Obtain the absolute pose of the first parametric model according to the absolute pose of the first connection point and the relative pose of the first parametric model;
[0070] S550. Assemble the second parametric model and the first parametric model according to the absolute pose of the second parametric model and the absolute pose of the first parametric model.
[0071] In the embodiments of the present disclosure, the pose may include position, angle, etc. The position may include absolute position, relative position, etc. The absolute pose of the second parametric model may include the coordinate position and angle of the second parametric model in the scene, etc.
[0072] In the embodiments of the present disclosure, if it is necessary to assemble and connect the first parametric model and the second parametric model through the first connection point and the second connection point, based on the absolute pose of the second parametric model, and the relative poses of the second connection point, the assembly protocol, the first connection point, and the first parametric model, the absolute pose of the first parametric model can be gradually calculated by superposition. Then, the first parametric model is displayed in the scene according to the absolute pose of the first parametric model.
[0073] In the embodiments of the present disclosure, the absolute pose of the second parametric model can be superimposed with the relative pose of the second connection point to calculate the absolute pose of the second connection point in the assembly scenario. The superimposition can be a direct addition or an addition according to a certain coefficient. For example, the absolute pose of the second parametric model is {S0, A0}, and the relative pose of the second connection point is {s0, a0}, where S0 + s0 = S1 and A0 + a0 = A1. The absolute pose of the constraint rule is {S1, A1}. Here, S0, S1, s0, s1 represent position coordinates, and A0, A1, a0, a1 represent angular values.
[0074] In the embodiments of the present disclosure, the absolute pose of the second connection point in the assembly scenario can be superimposed with the relative pose of the constraint rule in the assembly protocol to calculate the absolute pose of the constraint rule. For example, the relative pose of the constraint rule in the assembly protocol is {s1, a1}, where S1 + s1 = S2 and A1 + a1 = A2. The absolute pose of the constraint rule is {S2, A2}.
[0075] In the embodiments of the present disclosure, the absolute pose of the constraint rule can be superimposed with the relative pose of the first connection point to calculate the absolute pose of the first connection point. For example, the relative pose of the first connection point is {s2, a2}, where S2 + s2 = S3 and A2 + a2 = A3. The absolute pose of the first connection point is {S3, A3}.
[0076] In the embodiments of the present disclosure, the absolute pose of the first connection point can be superimposed with the relative pose of the first parametric model to calculate the absolute pose of the first parametric model. For example, the relative pose of the first parametric model is {s3, a3}, where S3 + s3 = S4 and A3 + a3 = A4. The absolute pose of the first parametric model is {S4, A4}.
[0077] In the embodiments of the present disclosure, based on the absolute pose {S0, A0} of the second parametric model and the absolute pose {S4, A4} of the first parametric model, the placement position of the first parametric model in the assembly scenario can be determined. Then, the second parametric model and the first parametric model can be assembled together. For example, Sofa A can be assembled to the left of Sofa B. Another example is that Cabinet C can be assembled above Cabinet D.
[0078] According to the embodiments of the present disclosure, by deriving the relative and absolute poses of the parametric model and the connection point, the placement position of the model can be obtained, which can improve the accurate placement position of the parametric model in the assembly scenario, and further improve the accuracy of the parametric model assembly.
[0079] In one implementation, displaying the first parametric model in the assembly area of the second parametric model includes one or more of the following steps:
[0080] The first parametric model is displayed in a virtualized manner in one or more candidate assembly regions of the second parametric model;
[0081] In response to a second selection command for selecting a target assembly region from one or more candidate assembly regions, the first parametric model is displayed in an entity manner in the target assembly region of the second parametric model.
[0082] In the embodiments of the present disclosure, the region in the scene where the first parametric model can be assembled can be referred to as a candidate assembly region. There can be multiple candidate assembly regions. For example, as Figure 6 shown, on the left and right sides of the existing model A in the scene, the new model B can be assembled. Then, the model B can be displayed in a virtualized manner in these two candidate assembly regions. Another example is that on the left side of the existing model A1, on the right side of the model A2, and in front of the model A3 in the scene, the new model B can be assembled. Then, the model B has three candidate assembly regions. After determining the candidate assembly region of the first parametric model in the second parametric model, the second parametric model can be first displayed in a virtualized manner in the candidate assembly region. The virtualized display can be a rough pre-display effect or an accurate display effect after adopting steps S510 to S550. The virtualized manner can include Gaussian blur, mean blur, motion blur, radial blur, etc.
[0083] In the embodiments of the present disclosure, the user can select one from multiple candidate assembly regions as the final placement position of the new model. When the user selects a target assembly region from one or more candidate assembly regions, a second selection command can be generated. In response to the second selection command, the first parametric model can be displayed in an entity manner in the target assembly region of the second parametric model. For example, on the left and right sides of the model A, the new model B can be assembled. If the user selects the left side as the target assembly region, then the model B can be assembled on the left side of the model A. Specifically, the accurate assembly can be performed with reference to steps S510 to S550 according to the connection points on the left side of the model A and the connection points on the left side of the model B.
[0084] According to the embodiments of the present disclosure, by responding to the selection command to determine the display manner and display region of the parametric model, the flexibility of parametric model assembly can be improved.
[0085] Figure 7 is a schematic flowchart of an assembly method based on a parametric model according to another embodiment of the present disclosure. This method can include one or more features of the above-mentioned assembly method based on a parametric model. In one implementation manner, this method further includes:
[0086] S710. In response to a deletion command for the second parameterized model, delete the second parameterized model and the first associated parameterized model of the second parameterized model; the node corresponding to the second parameterized model in the scene node tree is the first node, and the nodes corresponding to the first associated parameterized model in the scene node tree are all child nodes of the first node.
[0087] In an embodiment of the present disclosure, during the assembly process, a user may need to delete an existing model. If the user selects to delete a certain second parameterized model, a deletion command for the second parameterized model is generated. Since there is an association relationship between the existing models corresponding to each node in the scene node tree, the node corresponding to the newly added model usually serves as a child node of the existing model node. For example, as Figure 8 shown, if the second parameterized model to be deleted corresponds to the first node c, and its child nodes include g and h, then when deleting the second parameterized model corresponding to the first node c, the second parameterized models corresponding to g and h can be deleted simultaneously.
[0088] According to an embodiment of the present disclosure, when executing the deletion command, associated parameterized models can be deleted based on the scene node tree, reducing the cost of redeploying the parameterized models and improving the editing efficiency of the parameterized models.
[0089] Figure 9 is a flowchart of an assembly method based on a parameterized model according to another embodiment of the present disclosure. This method may include one or more features of the above-mentioned assembly method based on a parameterized model. In one implementation, this method further includes:
[0090] S910. In response to a modification command for the second parameterized model, modify the display forms of the second parameterized model and its second associated parameterized model according to the product package mounted on the second parameterized model; the node corresponding to the second parameterized model in the scene node tree is the first node, and the nodes corresponding to the second associated parameterized model in the scene node tree are the nodes with the same product package mounted as the first node.
[0091] In an embodiment of the present disclosure, during the assembly process, a user may need to delete an existing model. If the user selects to modify a certain second parameterized model, a modification command for the second parameterized model is generated. The modification command may include one or more of modifying the color, size, proportion, angle, position, etc. of the parameterized model. For example, increasing the size of the sofa model in the scene; or, modifying the color and material of the cabinet in the scene from "green, smooth material" to "gray, rough material", etc.
[0092] In the embodiments of the present disclosure, if the second parametric model corresponding to the first node is modified in response to a certain modification command, the second parametric models corresponding to the nodes with the same product package mounted to the first node can be modified accordingly. For example, if the color of node N1 is modified, nodes N2 and N3 with the same product package mounted to N1 are modified to the same color. Here, N1, N2, and N3 can correspond to the same sofa model. Another example is that if the size ratio of node N4 is modified, nodes N3 and N5 with the same product package mounted to N4 are modified to the same size ratio. Here, N3, N4, and N5 can correspond to the same cabinet model.
[0093] According to the embodiments of the present disclosure, when executing a modification command, not only can a single parametric model be modified, but also the remaining parametric models in the corresponding branch of the scene node tree of the parametric model can be modified, which can reduce the cost of redeploying the parametric model and improve the editing efficiency of the parametric model.
[0094] In one implementation, the assembly protocol of the parametric model includes at least one of a sending protocol and a receiving protocol; the assembly rules of the parametric model include at least one of an adsorption rule, an adaptation rule, and an assembly script.
[0095] In the embodiments of the present disclosure, the assembly protocol can include a sending protocol (snaptoken) and a receiving protocol (attachtoken), and each protocol can have a corresponding protocol identifier. For example, if the identifiers of the sending protocol of a model (connection point) and the receiving protocol of another model (connection point) are the same, these two models can be paired.
[0096] In the embodiments of the present disclosure, the adsorption rule can include specific adsorption methods such as point-to-point adsorption, point-to-line adsorption, and point-to-surface adsorption. The adaptation rule can include specific adaptation methods such as size, color, and texture. For example, the parametric model M1 is adapted according to the size of the parametric model M2 so that the size of the parametric model M1 is consistent with that of the parametric model M2. Another example is that the color of the existing model M1 is red, and the newly added model M2 is also adapted to be red. Some assembly relationships of the parametric model can be defined according to a specific script. For example, some special operations are performed on the parametric model after the parametric models are matched through the Kada script, such as merging the edges of two tables to make the two tables into one long table. Another example is to open a closed cabinet door.
[0097] According to the embodiments of the present disclosure, by adjusting the parametric model through the assembly protocol and the assembly rules, the variable parameter ability of the parametric model can be improved, the ability of the parametric model to adapt to different scenarios can be improved, and further the expandability and accuracy of the parametric model assembly can be increased.
[0098] I. Structural composition of the basic module:
[0099] The functional schematic diagram of a basic module is as Figure 10 shown. Each basic module can be regarded as a parametric model (the parametric model can be a single finished product model, or a combined module of multiple finished product models and parametric components), and can also be called a parametric basic module. The parametric basic module has its own positional relationship, constraint relationship, etc., and can assemble the internal structure of the basic module.
[0100] 1. Each basic module can be attached with an assembly protocol and / or constraint rules, including but not limited to adsorption rules, adaptation rules, click (kada) scripts, assembly rules, etc. The assembly protocol can also be called a connector protocol. The assembly protocol can include a sending protocol and a receiving protocol.
[0101] 2. Each basic module has its own replacement product package, including a size range (which can also be a size enumeration), a replacement component product package (or a set of replacement components), and a material package (or a set of materials), etc.
[0102] 3. The basic module can bind protocols, constraint relationships, product packages, spatial positional relationships, etc. Each basic module can be independent of each other, and there is no need to care about the existence of other modules.
[0103] II. Assembly Management of Scenes
[0104] As described above, the various modules in the scene exist independently of each other. Selecting any one module, to achieve automatic assembly and associated expansion in the scene, a global state and node management mechanism is required, which can monitor and calculate the state and data changes of the scene in real time to direct the changes of each independent module and complete the update of the scene.
[0105] (I) Associated Expansion: As Figure 7 shown, after adding a basic module such as a sofa to the scene, according to the current node relationship in the scene, it is automatically calculated where else this module can be placed. For example, a single-person sofa can also be placed on the left and right of the existing three-person sofa.
[0106] As Figure 11 shown, the scene is managed through a tree-like node. Each node represents a single module. Each node can generate a unique node ID when created, and operations such as adding, deleting, modifying, and querying the scene state are completed through the node tree. The logical example of each operation is as follows:
[0107] 1. New addition: Starting from the root node a, traverse the entire node tree in sequence, and check the protocols mounted on the connector connection points of each sub-module. If a protocol that can be paired with the new module is found and the connection point corresponding to this protocol is not occupied, a new node can be created. After completing all traversals, a new list (list) can be obtained, and then the addition logic can be executed. For example, the list can include candidate connection points. The new module can be virtually displayed in the candidate assembly area corresponding to the candidate connection points. Then, according to the user's selection, the new module is physically displayed in the finally determined assembly area.
[0108] 2. Deletion: Locate the position of the node in the node tree through the ID of the node to be deleted, and the node and its mounted sub-nodes can be deleted simultaneously. See Figure 8 。
[0109] 3. Modification: Since each basic module is a parameterized module, through the parameters in the product package, the display form of the basic module can be modified. As Figure 12 shown in the right list, there are two product packages: one is the material, and the other is the replacement part. Different basic modules can mount the same product package, so the product package here can be in a global mode. When switching the material, the scene tree will be traversed, and all basic modules in the scene that use this product package can change the material simultaneously. Similarly, when replacing the part, all basic modules that use this product package can replace the part simultaneously.
[0110] 4. Query: After adding or deleting nodes, the constraint relationships and states of the scene may change. Automatically calculate which modules on the right side (as Figure 13 shown) need to be displayed and which need to be hidden according to the changes in the scene.
[0111] (2) Associated growth: The scene saves the index relationships of each basic module unit in a tree-like node. In the parent-child relationship of the tree-like node, when adding a basic module to the scene, the system will automatically calculate the positions where the basic module can be added according to the existing assembly relationships, and pre-load the basic module at the corresponding positions. See Figure 7 . After the user clicks on the pre-loaded position, the module will calculate all the positions where it can be added in the scene, automatically load into the scene, and continue to grow the assemblable basic modules according to the updated assembly relationships. See Figure 14 .
[0112] The interface will automatically update the assemblable basic units according to the constraint relationships in the scene. If a parameterized basic module can be assembled in the scene, it will be displayed; if it cannot be assembled, it will be automatically hidden.
[0113] III. Specific implementation of assembly management
[0114] Figure 15 It is the assembly logic diagram when adding a module to the scenario.
[0115] Connector: Used to describe the pose relationship between two models and implement the reference geometry for precise adsorption ( Figure 15 The connectors (Connectors) in it are abbreviated as C1, C2... C5).
[0116] Token: The assembly protocol, which is divided into snap token (send protocol) and attach token (receive protocol), similar to the south and north poles of a magnet. Each protocol has its own unique ID identity. Only when the ID of the send protocol and the ID of the receive protocol are the same can two basic modules be paired.
[0117] Rule: The adsorption rule of the assembly protocol, used to implement adsorption such as point-to-point adsorption and point-to-plane adsorption.
[0118] The above are the key data and structural relationships for implementing adsorption.
[0119] As Figure 15 shown, there are already basic module A and module B in the scenario. There are three connectors (connectors) C1, C2, and C3 on module A, and two connectors C4 and C5 on module B. Now, basic module C is added to the scenario, and there are two connectors C1 and C5 on module C.
[0120] Taking C4 of module B and C5 of module C as an example for the automatic matching logic of the scenario, there are send protocol Token_snap1 and receive protocol Token_attach1 on C4. There are send protocol Token_snap3 and receive protocol Token_attach1 on C5. Since two basic modules can be paired when the ID of the send protocol and the ID of the receive protocol are the same, when automatically traversing the assemblable relationships in the scenario, Token_snap1 of C4 and Token_attach1 of C5 can be paired (for example, their IDs are both 1, one is the send protocol and the other is the receive protocol).
[0121] Rules such as Rule1 and Rule2 are mounted under Token_snap1 of C4, and Rules such as Rule1 and Rule2 are also mounted under Token_attach1 of C5. A Rule can represent a specific adsorption rule and can determine the matching method between module C and module B. For example, the matching method can be adsorption (the positional relationship between two by two, such as point-to-point adsorption, point-to-line adsorption, point-to-plane adsorption), adaptation (such as module C adapting according to the size of module B to make the size of module C the same as that of module B), a specific script (customizable), or an assembly relationship (such as when the material of module C is a metal material, the material h of module B will also become a metal accordingly).
[0122] IV. Specific implementation methods for precise adsorption of modules
[0123] Attach additional reference geometries (such as connectors) to each basic module unit to describe the pose relationship between two models, and cooperate with protocols (snap sending protocol and attach receiving protocol) to achieve precise adsorption.
[0124] As Figure 16 shown: Module A loaded into the scene has its own pose in the scene as transform1, and the pose of the connector carried by Module A is transform2. For Module B newly added to the scene, the pose of the connector carried by it is transform4.
[0125] The receiving protocol token attach and the sending protocol token_snap are respectively mounted on connection points C1 and C2, and the same adsorption rule rule is mounted on both of these protocols, and the pose of rule is transform3.
[0126] The steps to obtain the absolute pose of Module B in the scene are as Figure 17 shown:[[]]
[0127] S1701: Starting from a known absolute pose that is transform1 relative to the scene, superimpose the relative pose transform2 of C1 to obtain the absolute pose of C1 in the scene.
[0128] S1702: Based on the absolute pose of C1 in the scene calculated in S1701, superimpose the relative pose tansform3 of the virtual rule to obtain the absolute pose of the rule in the scene.
[0129] S1703: Based on the absolute pose of the rule calculated in S1702, superimpose the transform4 of C2 to obtain the absolute pose of C2 in the scene.
[0130] S1704. Based on the absolute pose of C2 calculated in S1703, and then adding the relative position with module B, the absolute pose transform5 of module B in the scene is obtained. In this way, it can be deduced where module B with a constraint relationship should be accurately placed in the scene.
[0131] Figure 18 FIG. 4 is a schematic flowchart of an assembly device 1800 based on a parametric model according to an embodiment of the present disclosure. The device may include:
[0132] An obtaining module 1810, configured to obtain a newly added first parametric model in response to a first selection command for a candidate parametric model;
[0133] A matching module 1820, configured to match the assembly protocol of the first parametric model with the assembly protocol of a second parametric model already existing in the scene to obtain a matching relationship between the first parametric model and the second parametric model;
[0134] An assembly module 1830, configured to perform assembly based on the matching relationship between the first parametric model and the second parametric model;
[0135] A display module 1840, configured to display the first parametric model in the assembly area of the second parametric model.
[0136] Figure 19 FIG. 5 is a schematic flowchart of an assembly device 1900 based on a parametric model according to another embodiment of the present disclosure. The device may include an obtaining module 1910, a matching module 1920, an assembly module 1930, and a display module 1940. In one implementation, the matching module 1920 includes:
[0137] A traversing sub-module 1921, configured to traverse the second parametric model represented by nodes in a scene node tree to obtain a set of free connection points of the second parametric model;
[0138] A comparing sub-module 1922, configured to compare the assembly protocols of each connection point in the set of free connection points with the assembly protocol of the first parametric model to obtain a connection point that matches the first parametric model.
[0139] In one implementation, the comparing sub-module 1922 is configured to obtain the second connection point that matches the first connection point when the identifier of the first assembly protocol of the first connection point in the first parametric model is the same as the identifier of the second assembly protocol of the second connection point in the set of free connection points.
[0140] In one embodiment, the assembly module 1930 is configured to assemble the first parametric model and the second parametric model through the first connection point and the second connection point according to one or more of the first parametric model, the first connection point of the first parametric model, the second parametric model, the second connection point of the second parametric model, and the assembly protocol.
[0141] In one embodiment, the assembly module 1930 is configured to:
[0142] Obtain the absolute pose of the second connection point according to the absolute pose of the second parametric model and the relative pose of the second connection point of the second parametric model;
[0143] Obtain the absolute pose of the constraint rule according to the absolute pose of the second connection point and the relative pose of the constraint rule in the assembly protocol;
[0144] Obtain the absolute pose of the first connection point according to the absolute pose of the constraint rule and the relative pose of the first connection point;
[0145] Obtain the absolute pose of the first parametric model according to the absolute pose of the first connection point and the relative pose of the first parametric model;
[0146] Assemble the second parametric model and the first parametric model according to the absolute pose of the second parametric model and the absolute pose of the first parametric model.
[0147] In one embodiment, the display module 1940 is configured to implement one or more of the following steps:
[0148] Display the first parametric model in a virtualized manner in one or more candidate assembly regions of the second parametric model;
[0149] In response to a second selection command for selecting a target assembly region from one or more candidate assembly regions, display the first parametric model in an entity manner in the target assembly region of the second parametric model.
[0150] In one embodiment, the device further includes:
[0151] A deletion module 1950, configured to delete the second parametric model and the first associated parametric model of the second parametric model in response to a deletion command for the second parametric model; the node corresponding to the second parametric model in the scene node tree is the first node, and the nodes corresponding to the first associated parametric model in the scene node tree are all child nodes of the first node.
[0152] In one embodiment, the device further includes:
[0153] The modification module 1960 is configured to modify the display forms of the second parameterized model and its second associated parameterized model according to the product package mounted according to the second parameterized model in response to a modification command for the second parameterized model; the node corresponding to the second parameterized model in the scene node tree is the first node, and the node corresponding to the second associated parameterized model in the scene node tree is the same node as the product package mounted to the first node.
[0154] In one implementation, the assembly protocol of the parameterized model includes at least one of a sending protocol and a receiving protocol; the assembly rules of the parameterized model include at least one of an adsorption rule, an adaptation rule, and an assembly script.
[0155] Figure 20 A structural block diagram of an electronic device according to an embodiment of the present disclosure. As Figure 20 shown, the electronic device includes: a memory 2010 and a processor 2020, and a computer program that can run on the processor 2020 is stored in the memory 2010. The number of the memory 2010 and the processor 2020 can be one or more. The memory 2010 can store one or more computer programs, and when the one or more computer programs are executed by the electronic device, the electronic device executes the method provided in the above method embodiment. The electronic device may further include: a communication interface 2030, configured to communicate with external devices and perform data interaction and transmission.
[0156] If the memory 2010, the processor 2020, and the communication interface 2030 are implemented independently, the memory 2010, the processor 2020, and the communication interface 2030 can be connected to each other through a bus and complete communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 20 only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0157] Optionally, in a specific implementation, if the memory 2010, the processor 2020, and the communication interface 2030 are integrated on a chip, the memory 2010, the processor 2020, and the communication interface 2030 can complete communication with each other through an internal interface.
[0158] It should be understood that the above-mentioned processor can be a Central Processing Unit (CPU), or it can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. It is worth noting that the processor can be a processor that supports the Advanced RISC Machines (ARM) architecture.
[0159] Further, optionally, the above-mentioned memory can include a read-only memory and a random access memory, and can also include a non-volatile random access memory. The memory can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can include a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can include a Random Access Memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, Static RAM (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Date SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct RAMBUS RAM (DR RAM).
[0160] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present disclosure are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wirelessly (such as infrared, Bluetooth, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a Digital Versatile Disc (DVD)), or a semiconductor medium (such as a Solid State Disk (SSD)), etc. It should be noted that the computer-readable storage medium mentioned in the present disclosure can be a non-volatile storage medium, in other words, it can be a non-transitory storage medium.
[0161] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, or can be completed by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and the storage medium mentioned above can be a read-only memory, a magnetic disk, an optical disc, or the like.
[0162] In the description of the embodiments of the present disclosure, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples.
[0163] In the description of the embodiments of the present disclosure, unless otherwise specified, " / " means "or". For example, A / B may mean A or B. The "and / or" herein is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone.
[0164] In the description of the embodiments of the present disclosure, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present disclosure, unless otherwise specified, "a plurality of" means two or more.
[0165] The foregoing are only exemplary embodiments of the present disclosure and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included within the protection scope of the present disclosure.
Claims
1. An assembly method based on a parametric model, comprising: In response to a first selection command for a candidate parameterized model, acquiring a newly added first parameterized model; Matching the assembly protocol of the first parametric model with the assembly protocol of the second parametric model already in the scene to obtain a matching relationship between the first parametric model and the second parametric model; Performing assembly based on the matching relationship between the first parameterized model and the second parameterized model; The first parametric model is displayed in an assembly area of the second parametric model.
2. The method according to claim 1, wherein: Matching the assembly protocol of the first parametric model with the assembly protocol of the second parametric model already in the scene to obtain a matching relationship between the first parametric model and the second parametric model includes: Traversing the second parameterized model represented by the nodes in the scene node tree to obtain a set of free connection points of the second parameterized model; The assembly protocol of each connection point in the set of free connection points is compared with the assembly protocol of the first parameterized model to obtain connection points matching the first parameterized model.
3. The method according to claim 2, wherein: Comparing the assembly protocol of each connection point in the set of free connection points with the assembly protocol of the first parameterized model to obtain a connection point matching the first parameterized model includes: When the identifier of the first assembly protocol of the first connection point in the first parameterized model is the same as the identifier of the second assembly protocol of the second connection point in the free connection point set, the second connection point matching the first connection point is obtained.
4. The method according to claim 3, wherein: Assembling based on the matching relationship between the first parameterized model and the second parameterized model includes: According to one or more of the first parameterized model, the first connection point of the first parameterized model, the second parameterized model, the second connection point of the second parameterized model, and the assembly protocol, the first parameterized model and the second parameterized model are assembled through the first connection point and the second connection point.
5. The method according to claim 4, wherein: According to one or more of the first parameterized model, the first connection point of the first parameterized model, the second parameterized model, the second connection point of the second parameterized model, and the assembly protocol, assembling the first parameterized model and the second parameterized model through the first connection point and the second connection point, comprising: Obtaining an absolute pose of the second connection point according to the absolute pose of the second parameterized model and a relative pose of the second connection point of the second parameterized model; Obtaining the absolute pose of the constraint rule according to the absolute pose of the second connection point and the relative pose of the constraint rule in the assembly protocol; Obtaining an absolute pose of the first connection point according to the absolute pose of the constraint rule and the relative pose of the first connection point; Obtaining an absolute pose of the first parameterized model according to the absolute pose of the first connection point and the relative pose of the first parameterized model; The second parameterized model and the first parameterized model are assembled according to the absolute pose of the second parameterized model and the absolute pose of the first parameterized model.
6. The method according to any one of claims 1 to 5, wherein: Displaying the first parametric model in the assembly area of the second parametric model comprises one or more of the following steps: Displaying the first parametric model in a virtual manner on one or more candidate assembly areas of the second parametric model; In response to a second selection command selecting a target assembly area from one or more candidate assembly areas, the first parametric model is displayed in a physical manner in the target assembly area of the second parametric model.
7. The method according to any one of claims 1 to 6, further comprising: In response to a delete command for the second parameterized model, deleting the second parameterized model and a first associated parameterized model of the second parameterized model; The node corresponding to the second parameterized model in the scene node tree is the first node, and the nodes corresponding to the first associated parameterized model in the scene node tree are all child nodes of the first node.
8. The method according to any one of claims 1 to 7, further comprising: In response to a modification command for the second parametric model, modifying the display form of the second parametric model and its second associated parametric model according to a product package mounted on the second parametric model; The node corresponding to the second parameterized model in the scene node tree is the first node, and the node corresponding to the second associated parameterized model in the scene node tree is the same node as the product package mounted on the first node.
9. According to the method described in any one of claims 1 to 8, the assembly protocol of the parameterized model includes at least one of a sending protocol and a receiving protocol; the assembly rules of the parameterized model include at least one of an adsorption rule, an adaptation rule, and an assembly script.
10. An assembly device based on a parametric model, comprising: An acquisition module, configured to acquire a newly added first parameterized model in response to a first selection command for a candidate parameterized model; A matching module, used to match the assembly protocol of the first parametric model with the assembly protocol of the second parametric model already in the scene, so as to obtain a matching relationship between the first parametric model and the second parametric model; An assembly module, used for performing assembly based on the matching relationship between the first parameterized model and the second parameterized model; A display module is used to display the first parametric model in the assembly area of the second parametric model.
11. The device according to claim 10, wherein: The matching module comprises: A traversal submodule, used for traversing the second parameterized model represented by the nodes in the scene node tree to obtain a set of free connection points of the second parameterized model; A comparison submodule is used to compare the assembly protocol of each connection point in the set of free connection points with the assembly protocol of the first parameterized model to obtain a connection point that matches the first parameterized model.
12. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.
13. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9.
14. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.