Constraint reconstruction method and device, computing equipment and storage medium
By determining the constraint coordinate points and their types in the coordinate system of the first model in the CAE simulation software and importing them into the coordinate system of the second model, the problem of lack of constraint replication function in the prior art is solved, automatic reconstruction of constraints is realized, and the efficiency and accuracy of server modeling and simulation are improved.
Patent Information
- Application Number
- CN202510202714.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-05-27
AI Technical Summary
The existing CAE simulation software lacks the constraint copy function, which causes the constraints of the imported model to disappear when merging different models. It is necessary to manually add constraints between various components, reducing the processing efficiency of server modeling and simulation.
By determining the constraint coordinate points and their types in the coordinate system of the first model and importing them into the coordinate system of the second model, corresponding constraints are established in the second model based on the same coordinates and constraint types, thereby realizing the reconstruction of the constraints.
There is no need to manually add constraints between individual components, which improves the processing efficiency of server modeling and ensures the accuracy and reliability of the model.
Smart Images

Figure CN120046355A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technologies, and in particular, to a constraint reconstruction method, apparatus, computing device, and storage medium. Background Art
[0002] With the development of technology, the development of the server industry has become more diversified, and various server architectures have emerged in an endless stream. Therefore, before various servers are put into use, it is necessary to perform computer-aided engineering (CAE) modeling and simulation on the servers to ensure the reliability of the server structure.
[0003] Due to the increasing complexity of the server structure model, if multiple people can process the structure model of a server simultaneously, the efficiency of server modeling and simulation will be greatly improved. However, the current CAE simulation software lacks the function of constraint replication. During the process of merging different models, the constraints of the imported model will disappear, resulting in an incorrect model, and relevant personnel need to manually add the constraints between each component, reducing the processing efficiency of server modeling and simulation. Summary of the Invention
[0004] To solve the above problems in the prior art, embodiments of the present application provide a constraint reconstruction method, apparatus, computing device, and storage medium, which can avoid the problem of manually adding the constraints between each component when importing the model.
[0005] In a first aspect, an embodiment of the present application provides a constraint reconstruction method, including:
[0006] Based on the positions of the components of the first model in the first coordinate system, importing the components of the first model into the second coordinate system where the second model is located; the first model and the second model are models generated based on the components of different parts of the target physical object and the constraints between adjacent components;
[0007] Determining at least one target coordinate point in the second coordinate system whose coordinates are the same as those of at least one constraint coordinate point in the first coordinate system; the constraint coordinate point is used to represent the position of the constraint in the first model in the first coordinate system; the target coordinate point is used to represent the position of the constraint in the first model in the second coordinate system;
[0008] Based on the constraint type corresponding to each constraint coordinate point in the first coordinate system, determining the constraint type corresponding to each target coordinate point in the second coordinate system; the constraint type corresponding to each target coordinate point is the same as the constraint type corresponding to the constraint coordinate point with the same coordinates;
[0009] Establish corresponding constraints in the second model based on the at least one target coordinate point and the constraint types corresponding to each target coordinate point.
[0010] After importing the components of the first model into the second model, determine at least one target coordinate point in the second coordinate system where the second model is located based on the coordinates of at least one constraint coordinate point in the first coordinate system where the first model is located, and determine the constraint type corresponding to each target coordinate point based on the constraint type corresponding to each constraint coordinate point. Corresponding constraints can be established in the second model through the coordinates of the target coordinate points and the constraint types of the corresponding constraints. Through the above method, the constraints included in the imported model can be reconstructed in the target model, eliminating the need for relevant personnel to manually add constraints between various components, and improving the processing efficiency of server modeling and simulation.
[0011] In a possible implementation manner, before importing the components of the first model into the second coordinate system where the second model is located based on the positions of the components of the first model in the first coordinate system, the method further includes:
[0012] Screen out target models that contain any component of the target physical object from multiple models, and display the target models to the user;
[0013] In response to the user's selection operation, determine the first model and the second model from the target models.
[0014] Through the above method, target models related to the target physical object can be pre-screened and displayed to the user, and the first model and the second model can be determined based on the user's selection. Through the pre-screening, the workload of the user in the process of selecting the first model and the second model can be reduced, and the efficiency of the process of selecting the first model and the second model is improved.
[0015] In a possible implementation manner, after determining the first model and the second model from the target models, before importing the components of the first model into the second coordinate system where the second model is located based on the positions of the components of the first model in the first coordinate system, the method further includes:
[0016] If the origin of the first coordinate system is different from the position of the origin of the second coordinate system, move the origin of the first coordinate system to the position where the origin of the second coordinate system is located;
[0017] If the direction of any coordinate axis of the first coordinate system is different from the direction of the same coordinate axis in the second coordinate system, adjust the direction of the any coordinate axis to the direction of the same coordinate axis in the second coordinate system.
[0018] In the process of reconstructing the constraints, the alignment of the coordinate systems in which the first model and the second model are located can be achieved by determining that the origin positions are the same and the coordinate axis directions are the same. After the coordinate systems are aligned, the coordinates corresponding to the same components in the two coordinate systems are the same. Therefore, in the process of importing the components in the first model into the second model, it can be completed more accurately and conveniently.
[0019] In a possible implementation manner, importing the components of the first model into the second coordinate system in which the second model is located based on the positions of the components of the first model in the first coordinate system includes:
[0020] Determine at least one target component from the multiple components included in the first model that are not included in the multiple components included in the second model;
[0021] Determine the target position of the target component in the second coordinate system based on the coordinates of the at least one target component in the first coordinate system and the shape of the at least one target component;
[0022] Import the target component to the target position.
[0023] After the first coordinate system and the second coordinate system are aligned, the coordinates corresponding to the same components in the two coordinate systems are the same. Therefore, the coordinates of these components in the second coordinate system can be determined based on the coordinates of the components in the first model in the first coordinate system, so as to import the components in the first model into the second model, greatly reducing the time for component import and increasing the convenience of constraint reconstruction.
[0024] In a possible implementation manner, before determining at least one target coordinate point in the second coordinate system that has the same coordinates as at least one constraint coordinate point included in the first model, the method further includes:
[0025] Obtain at least one constraint included in the first model and perform the following operations on the target constraint; the target constraint is any one of the at least one constraint:
[0026] If it is determined that the constraint type of the target constraint is a point constraint, extract the coordinate point corresponding to the target constraint in the first coordinate system;
[0027] If it is determined that the constraint type of the target constraint is a surface constraint, extract multiple coordinate points corresponding to the target constraint in the first coordinate system; the multiple coordinate points corresponding to the target constraint are used to represent the constraint surface corresponding to the target constraint;
[0028] Save the coordinate point corresponding to each constraint to the constraint point set; each point in the constraint point set is a constraint coordinate point.
[0029] Constraints can be divided into point constraints and surface constraints. Corresponding coordinate points are extracted for different types of constraint regions, and the coordinate points corresponding to point constraints and the coordinate points corresponding to surface constraints are both saved to the constraint point set. Each point in the constraint point set serves as a constraint coordinate point, enabling each constraint in the first model to be covered by coordinate points and making the reconstructed constraints more accurate.
[0030] In a possible implementation, after establishing corresponding constraints in the second model based on the at least one target coordinate point and the constraint type corresponding to each target coordinate point, the method further includes:
[0031] If the difference between the first quantity and the second quantity is different from the third quantity, or the difference between the fourth quantity and the fifth quantity is different from the sixth quantity, prompt the user that the constraint establishment fails, and in response to the user's reconstruction instruction, return to execute the step of establishing corresponding constraints in the second model based on the at least one target coordinate point and the constraint type corresponding to each target coordinate point;
[0032] Wherein, the first quantity is the number of point constraints in the second model; the second quantity is the number of point constraints in the first model; the third quantity is the number of point constraints in the second model before importing the components of the first model into the second model, the fourth quantity is the number of surface constraints in the second model; the fifth quantity is the number of surface constraints in the first model; the sixth quantity is the number of surface constraints in the second model before importing the components of the first model into the second model.
[0033] Verify whether there is a constraint reconstruction failure or mis-reconstruction during the constraint reconstruction process according to the number of constraints included in the second model after constraint reconstruction, the number of constraints included in the first model, and the number of constraints included in the second model before constraint reconstruction. If it is determined that there is a problem during the constraint reconstruction process, the step of reconstructing the constraints can be executed again, improving the fault tolerance rate of the constraint reconstruction process.
[0034] In a possible implementation, after regenerating corresponding constraints based on the target coordinate points and the constraint type corresponding to each constraint coordinate point in the first model, the method further includes:
[0035] Record the component identifiers corresponding to the components included in the second model in the target file;
[0036] When generating a model based on other physical objects except the target physical object, perform a comparison and extract the components included in the other physical object;
[0037] If at least one target component identifier corresponding to the components included in the other physical object is included in the target file, extract at least one target component corresponding to the at least one target component identifier from the second model, and use the at least one target component as a sub-model of the model corresponding to the other physical object;
[0038] If there are constraints between the at least one target component, add the constraints to the sub-model.
[0039] By generating the target file in the above manner, it is possible to reuse each component and each constraint in the already generated second model. During the process of generating other models, the components and constraints included in the second model can be used as sub-models to regenerate the model again, reducing the workload of model generation and improving the efficiency of model generation.
[0040] In a second aspect, an embodiment of the present application provides a constraint reconstruction device, including:
[0041] A model component import unit, configured to import the components of the first model into the second coordinate system where the second model is located based on the positions of the components of the first model in the first coordinate system; the first model and the second model are models generated based on the components of different parts of the target physical object and the constraints between adjacent components;
[0042] A constraint coordinate determination unit, configured to determine at least one target coordinate point in the second coordinate system that has the same coordinates as at least one constraint coordinate point in the first coordinate system; the constraint coordinate point is used to represent the position of the constraint in the first model in the first coordinate system; the target coordinate point is used to represent the position of the constraint in the first model in the second coordinate system;
[0043] A constraint type determination unit, configured to determine the constraint type corresponding to each target coordinate point in the second coordinate system based on the constraint type corresponding to each constraint coordinate point in the first coordinate system; the constraint type corresponding to each target coordinate point is the same as the constraint type corresponding to the constraint coordinate point with the same coordinates;
[0044] A constraint reconstruction unit, configured to establish corresponding constraints in the second model based on the at least one target coordinate point and the constraint type corresponding to each target coordinate point.
[0045] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0046] A memory, configured to store program instructions;
[0047] A processor, configured to call the program instructions stored in the memory and execute the constraint reconstruction steps included in the method described in the first aspect according to the obtained program instructions.
[0048] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the constraint reconstruction method described in the first aspect is implemented.
[0049] An embodiment of the present application provides a constraint reconstruction method, apparatus, computing device, and storage medium. After importing the components of the first model into the second model, at least one target coordinate point in the second coordinate system where the second model is located can be determined based on the coordinates of at least one constraint coordinate point in the first coordinate system where the first model is located, and the constraint type corresponding to each target coordinate point can be determined based on the constraint type corresponding to each constraint coordinate point. Corresponding constraints can be established in the second model through the coordinates of the target coordinate points and the constraint types of the corresponding constraints. Although the constraints included in the first model, i.e., the imported model, will disappear during the process of merging the first model and the second model, through the above method, the constraints included in the imported model can be reconstructed in the target model, eliminating the need for relevant personnel to manually add the constraints between each component, thereby improving the processing efficiency of server modeling and simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0051] Figure 1 A schematic diagram of an application scenario of a constraint reconstruction method provided by an embodiment of the present application;
[0052] Figure 2 A flowchart of a constraint reconstruction method provided by an embodiment of the present application;
[0053] Figure 3 A specific flowchart of a constraint reconstruction method provided by an embodiment of the present application;
[0054] Figure 4 A structural block diagram of a constraint reconstruction apparatus provided by an embodiment of the present application;
[0055] Figure 5 A structural block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0056] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Among them, the described embodiments are some but not all of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts belong to the scope of protection of this application.
[0057] In the description of the embodiments of this application, unless otherwise specified, " / " means "or". For example, A / B may represent A or B; "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone.
[0058] Specifically, in the description of this application, it should be understood that the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. It is only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, so it should not be construed as a limitation of this application. In addition, the "connection" and "coupling" mentioned in this application, unless otherwise specified, both include direct and indirect connection (coupling).
[0059] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood 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 the described features. In the description of this application, "a plurality" means two or more, unless otherwise specifically defined.
[0060] The following further elaborates on this application in detail with reference to the accompanying drawings and specific embodiments.
[0061] In one possible embodiment, Figure 1 The following figure shows a schematic diagram of the application scenario of a constraint reconstruction method provided by the embodiments of this application. Refer to Figure 1 as shown in Figure 1It includes two computing devices, namely computing device 100 and computing device 200. Among them, a user can use computing device 100 to create a first model, and another user can use computing device 200 to create a second model. Moreover, the first model created by computing device 100 can be imported into the second model created by computing device 200. Alternatively, only one computing device can be used, such as using computing device 200 to create the first model and the second model, and importing the first model into the second model. By using computing device 200 to execute the constraint reconstruction method provided in the embodiments of the present application, it can be realized that the constraints included in the imported model are imported into the imported model together, without relevant personnel manually adding the constraints between each component, improving the processing efficiency of server modeling and simulation.
[0062] Figure 1 The application scenario is only an example of an application scenario for implementing the embodiments of the present application, and the embodiments of the present application are not limited to the above Figure 1 described application scenario. The following combines the above-described application scenario and refers to the accompanying drawings to describe the constraint reconstruction method provided by the exemplary embodiments of the present application. It should be noted that the above application scenario is only shown for the convenience of understanding the spirit and principle of the present application, and the embodiments of the present application are not restricted in this regard.
[0063] Figure 2 The flowchart of a constraint reconstruction method provided by the embodiments of the present application is shown. As Figure 2 shown, the method may include the following steps:
[0064] Step S201, based on the positions of the components of the first model in the first coordinate system, import the components of the first model into the second coordinate system where the second model is located.
[0065] In a possible embodiment, before executing step S201, multiple components in the target physical object can be obtained first. By screening out the target models that contain any component in the target physical object from multiple models and presenting the target models to the user, the user can select the first model and the second model from the presented multiple target models, so as to import the components and constraints included in the first model into the second model.
[0066] In another possible embodiment, the TargetModel function can also be used to obtain the second model, and the CopyModel function can be used to obtain the first model. The CopyModel function can determine the first model based on the model identifier input by the user. After the user inputs the model identifier, the first model corresponding to the model identifier input by the user can be determined from the storage space where the model is saved. If the model identifier input by the user cannot be found in the storage space, a prompt message can be popped up to prompt the user to re-enter the model identifier to determine the first model. Herein, the model identifier can be the name of the model or the save path of the model.
[0067] In one possible embodiment, after obtaining the first model and the second model, the first coordinate system in which the first model is located can be aligned with the second coordinate system in which the second model is located in the following manner: If the origin positions of the first coordinate system and the second coordinate system are different, the origin of the first coordinate system can be moved to the position where the origin of the second coordinate system is located; If the direction of any coordinate axis in the first coordinate system is different from the direction of the same coordinate axis in the second coordinate system, the direction of any coordinate axis can be adjusted to the direction of the same coordinate axis in the second coordinate system. For example, if the origin position of the first coordinate system is (0, 1, 2) and the origin position of the second coordinate system is (0, 0, 0), the origin of the first coordinate system can be moved to (0, 0, 0) to align the two coordinate systems; Additionally, if the x-axis of the first coordinate system is different from the x-axis of the second coordinate system in direction, the direction of the x-axis of the first coordinate system can be adjusted to the direction of the x-axis of the second coordinate system.
[0068] In another possible embodiment, if the first model and the second model contain the same component, the coordinates of the same component can be used to align the first coordinate system and the second coordinate system. For example, the same component A in the first model and the second model is determined. The coordinate of component A in the first coordinate system where the first model is located is determined to be (1, 2, 3), and the coordinate of component A in the second coordinate system where the second model is located is determined to be (1, 2, 3). Since the two coordinates are the same, it can be determined that the coordinate systems in which the first model and the second model are located are already aligned; If the coordinate of component A in the second coordinate system where the second model is located is determined to be (2, 3, 4), the x-axis in the first coordinate system where the first model is located can be moved backward by one unit length, the y-axis can be moved backward by one unit length, and the z-axis can be moved backward by one unit length.
[0069] In another possible embodiment, it may not be determined whether the coordinate systems in which the first model and the second model are located are aligned. Generally, it can be defaulted that the user completes the development of different models in the same coordinate system. If the user modifies the coordinate system, after obtaining the first model and the second model, the coordinate transformation and array parameters can be actively input. The coordinate transformation and array parameters can reflect how the user has changed the coordinate system, so they can be used to align the first coordinate system in which the first model is located and the second coordinate system in which the second model is located.
[0070] In a possible embodiment, after aligning the first coordinate system in which the first model is located and the second coordinate system in which the second model is located, the components of the first model can be imported into the second coordinate system in which the second model is located based on the positions of the components of the first model in the first coordinate system. For example, if the positions of the components of the first model in the first coordinate system are (1, 2, 3), (2, 3, 4), (4, 5, 6), then the components can be directly placed at the same positions in the second coordinate system, which are also (1, 2, 3), (2, 3, 4), (4, 5, 6). To facilitate the placement of the same components and reduce the corresponding workload, the number of consecutive identical components can be determined. For example, if the same components are placed at positions (1, 2, 3) and (2, 3, 4), then the number of identical components can be determined to be 2. During the process of importing this type of component into the second coordinate system, after determining the position (1, 2, 3), the position of the second component, that is, (2, 3, 4), can be continued to be determined. It should be noted that during the process of importing the components in the first model into the second model, duplicate components will not be imported. For example, if both the first model and the second model contain a main board at the position (2, 3, 4), then during the import process, only the main board at the position (2, 3, 4) in the second model needs to be retained, and there is no need to import the main board at the position (2, 3, 4) in the first model.
[0071] Step S202, determine at least one target coordinate point in the second coordinate system that has the same coordinates as at least one constraint coordinate point included in the first model.
[0072] In a possible embodiment, at least one constraint included in the first model may be obtained first. Among them, constraints are generally divided into point constraints and surface constraints. Point constraints may include constraints formed by connecting adjacent components with screws, and surface constraints may include constraints formed by welding adjacent components. During the process of obtaining the constraint regions included in the first model, the constraint type of each obtained constraint may be identified to distinguish whether it is a point constraint or a surface constraint. If a constraint is a point constraint, the coordinate points corresponding to the point constraint may be extracted; if a constraint is a surface constraint, the coordinate points corresponding to the surface constraint may be extracted. Among them, the coordinate points corresponding to the surface constraint are used to represent the constraint surface corresponding to the surface constraint. After confirming the constraint type and the corresponding coordinate points for each constraint, all the obtained coordinate points may be saved to the constraint point set. Each point in the constraint point set is a constraint coordinate point. Among them, the constraint coordinate points may be used to represent the position of the constraints in the first model in the first coordinate system. Also, since the first coordinate system and the second coordinate system have been aligned, the coordinates of the constraint coordinate points in the first coordinate system are also the coordinates in the second coordinate system. For example, if there are constraint coordinate points (1, 2, 3), (2, 3, 4), and (4, 5, 6) in the first coordinate system, then in the second coordinate system, the coordinates of these three constraint coordinate points are also (1, 2, 3), (2, 3, 4), and (4, 5, 6). In the second coordinate system, these three constraint coordinate points may be referred to as target coordinate points. Among them, the target coordinate points are used to represent the position of the constraints in the first model in the second coordinate system.
[0073] Step S203: Based on the constraint type corresponding to each constraint coordinate point in the first coordinate system, determine the constraint type corresponding to each target coordinate point in the second coordinate system.
[0074] In a possible embodiment, each constraint coordinate point in the first model corresponds to a constraint type. For example, (1, 1, 1) corresponds to a point constraint, and (2, 2, 2) and (3, 3, 3) both correspond to the same surface constraint. Then, after importing the components of the first model into the second coordinate system where the second model is located, it can be determined that (1, 1, 1) in the second coordinate system where the second model is located also corresponds to a point constraint, and (2, 2, 2) and (3, 3, 3) also both correspond to the same surface constraint. Therefore, based on the constraint type corresponding to each constraint coordinate point in the first model, the constraint type corresponding to each target coordinate point in the second model can be determined, and the constraint types corresponding to the constraint coordinate points and the target coordinate points with the same coordinates are also the same.
[0075] Step S204: Based on at least one target coordinate point and the constraint type corresponding to each target coordinate point, establish corresponding constraints in the second model.
[0076] In a possible embodiment, since the constraint types corresponding to the constraint coordinate points and the target coordinate points with the same coordinates are the same, corresponding constraints can be established in the second model based on at least one target coordinate point and the constraint type corresponding to each target coordinate point. After the constraints are established, it can be considered that the second model contains the first model.
[0077] To verify whether the constraints are correctly reconstructed, six quantities can be obtained, namely the first quantity of point constraints in the second model, the second quantity of point constraints in the first model, the third quantity of point constraints in the second model before importing the components of the first model into the second model, the fourth quantity of surface constraints in the second model, the fifth quantity of surface constraints in the first model, and the sixth quantity of surface constraints in the second model before importing the components of the first model into the second model. If the difference between the first quantity and the second quantity is different from the third quantity, or the difference between the fourth quantity and the fifth quantity is different from the sixth quantity, it indicates that a failure occurred during the establishment of the constraints, and the user can be prompted that the constraint establishment failed. A confirmation button can be included in the prompt box for prompting the user that the constraint establishment failed. When the user clicks the confirmation button, the reconstruction instruction of the user can be responded to, and step S203 can be returned to execute the step of constraint reconstruction, and then the subsequent verification steps can be continued.
[0078] For example, in the first model, there are 3 point constraint regions and 5 surface constraint regions. Before constraint reconstruction, the second model contains 1 point constraint region and 2 surface constraint regions. If the constraints are correctly reconstructed, the second model after constraint reconstruction should contain 4 point constraint regions and 7 surface constraint regions. If the second model after constraint reconstruction contains 5 point constraint regions and 7 surface constraint regions, it can be determined that the difference between the number of constraints contained in the second model and the number of constraints contained in the first model is different from the number of constraints contained in the second model before constraint reconstruction. Therefore, corresponding constraints need to be regenerated based on the target coordinate points and the constraint type corresponding to each constraint coordinate point in the first model until the difference between the number of constraints contained in the second model and the number of constraints contained in the first model is the same as the number of constraints contained in the second model before constraint reconstruction.
[0079] In a possible embodiment, after the constraint reconstruction of the second model is completed, the component identifiers corresponding to the components included in the second model can be recorded in the target file. When generating a model based on other physical objects, the components included in the other physical objects can be compared. After extracting the components included in the other physical objects, at least one target component corresponding to the components included in the other physical objects in the target file can be obtained, and then the target components and the constraints existing between the target components can be extracted from the second model. The set of components and constraints after extraction can be used as a sub-model for establishing the model of other physical objects, improving the reusability of the merged model of the present application and greatly improving the efficiency in the process of generating similar models.
[0080] The embodiments of the present application provide a constraint reconstruction method, apparatus, computing device, and storage medium. After importing the components of the first model into the second model, at least one target coordinate point in the second coordinate system where the second model is located can be determined based on the coordinates of at least one constraint coordinate point in the first coordinate system where the first model is located, and the constraint type corresponding to each target coordinate point can be determined based on the constraint type corresponding to each constraint coordinate point. Corresponding constraints can be established in the second model through the coordinates of the target coordinate points and the constraint types of the corresponding constraints. Although the constraints included in the first model, that is, the imported model, will disappear during the process of merging the first model and the second model, through the above method, the constraints included in the imported model can be reconstructed in the target model, eliminating the need for relevant personnel to manually add the constraints between each component and improving the processing efficiency of server modeling and simulation.
[0081] In a specific embodiment, Figure 3 The specific flowchart of a constraint reconstruction method provided by the embodiments of the present application is shown. As Figure 3 shown, the method may include the following steps:
[0082] Step S301, screen out the target model containing any component in the target physical object from multiple models and display the target model to the user.
[0083] Step S302, in response to the user's selection operation, determine the first model and the second model from the target model.
[0084] Step S303, move the origin of the first coordinate system to the position where the origin of the second coordinate system is located.
[0085] In a possible embodiment, the first coordinate system is the coordinate system where the first model is located, and the second coordinate system is the coordinate system where the second model is located.
[0086] Step S304, adjust the direction of any coordinate axis of the first coordinate system to the direction of the same coordinate axis in the second coordinate system.
[0087] Step S305: Determine at least one target component from among the multiple components included in the first model, excluding the multiple components included in the second model.
[0088] Step S306: Determine the target position of the target component in the second coordinate system based on the coordinates of the at least one target component in the first coordinate system and the shape of the at least one target component, and import the target component to the target position.
[0089] Step S307: Determine at least one target coordinate point in the second coordinate system that has the same coordinates as at least one constraint coordinate point in the first coordinate system.
[0090] Step S308: Determine the constraint type corresponding to each target coordinate point in the second coordinate system based on the constraint type corresponding to each constraint coordinate point in the first coordinate system.
[0091] Step S309: Establish corresponding constraints in the second model based on the at least one target coordinate point and the constraint type of each constraint corresponding to the target coordinate point.
[0092] Step S310: If the difference between the first quantity and the second quantity is different from the third quantity, or the difference between the fourth quantity and the fifth quantity is different from the sixth quantity, prompt the user that the constraint establishment fails.
[0093] In a possible embodiment, the first quantity is the number of point constraints in the second model; the second quantity is the number of point constraints in the first model; the third quantity is the number of point constraints in the second model before importing the components of the first model into the second model; the fourth quantity is the number of surface constraints in the second model; the fifth quantity is the number of surface constraints in the first model; the sixth quantity is the number of surface constraints in the second model before importing the components of the first model into the second model.
[0094] Step S311: Record the component identifiers corresponding to the components included in the second model in the target file, and perform comparison when generating a model based on other physical objects except the target physical object to extract the components included in the other physical objects.
[0095] Step S312: If the target file contains at least one target component identifier corresponding to the components included in the other physical object, extract at least one target component corresponding to the at least one target component identifier from the second model, and use the at least one target component as a sub-model of the model corresponding to the other physical object. If there are constraints between the at least one target components, add the constraints to the sub-model.
[0096] Based on the same inventive concept, Figure 4 is a structural block diagram of a constraint reconstruction device provided by an embodiment of the present application, as Figure 4As shown in the figure, the constraint reconstruction device 400 may include:
[0097] A model component import unit 401, configured to import the components of the first model into the second coordinate system where the second model is located based on the positions of the components of the first model in the first coordinate system; the first model and the second model are models generated based on the constraints between the components of different parts of the target physical object and adjacent components;
[0098] A constraint coordinate determination unit 402, configured to determine at least one target coordinate point in the second coordinate system whose coordinates are the same as those of at least one constraint coordinate point in the first coordinate system; the constraint coordinate point is used to represent the position of the constraint in the first model in the first coordinate system; the target coordinate point is used to represent the position of the constraint in the first model in the second coordinate system;
[0099] A constraint type determination unit 403, configured to determine the constraint type corresponding to each target coordinate point in the second coordinate system based on the constraint type corresponding to each constraint coordinate point in the first coordinate system; the constraint type corresponding to each target coordinate point is the same as the constraint type corresponding to the constraint coordinate point with the same coordinates;
[0100] A constraint reconstruction unit 404, configured to establish corresponding constraints in the second model based on the at least one target coordinate point and the constraint type corresponding to each target coordinate point.
[0101] In a possible implementation manner, the model component import unit 401 is further configured to screen out a target model containing any component in the target physical object from multiple models, and display the target model to the user;
[0102] In response to the user's selection operation, determine the first model and the second model from the target model.
[0103] In a possible implementation manner, the model component import unit 401 is further configured to, if the origin of the first coordinate system is different from the origin of the second coordinate system, move the origin of the first coordinate system to the position where the origin of the second coordinate system is located;
[0104] If the direction of any coordinate axis of the first coordinate system is different from the direction of the same coordinate axis in the second coordinate system, adjust the direction of the any coordinate axis to the direction of the same coordinate axis in the second coordinate system.
[0105] In a possible implementation manner, the model component import unit 401 is specifically configured to determine at least one target component from the multiple components included in the first model except for the multiple components included in the second model;
[0106] Determine the target position of the target component in the second coordinate system based on the coordinates of the at least one target component in the first coordinate system and the shape of the at least one target component;
[0107] Import the target component to the target position.
[0108] In a possible implementation, the constraint coordinate determination unit 402 is further configured to obtain at least one constraint included in the first model, and perform the following operations on the target constraint; the target constraint is any one of the at least one constraint:
[0109] If it is determined that the constraint type of the target constraint is a point constraint, extract the coordinate point corresponding to the target constraint in the first coordinate system;
[0110] If it is determined that the constraint type of the target constraint is a surface constraint, extract a plurality of coordinate points corresponding to the target constraint in the first coordinate system; the plurality of coordinate points corresponding to the target constraint are used to characterize the constraint surface corresponding to the target constraint;
[0111] Save the coordinate points corresponding to each constraint to a constraint point set; each point in the constraint point set is a constraint coordinate point.
[0112] In a possible implementation, the constraint coordinate determination unit 402 is further configured to, if the difference between the first quantity and the second quantity is different from the third quantity, or the difference between the fourth quantity and the fifth quantity is different from the sixth quantity, prompt the user that the constraint establishment fails, and in response to the user's reconstruction instruction, return to execute the step of establishing the corresponding constraint in the second model based on the at least one target coordinate point and the constraint type corresponding to each target coordinate point;
[0113] Wherein, the first quantity is the number of point constraints in the second model; the second quantity is the number of point constraints in the first model; the third quantity is the number of point constraints in the second model before importing the components of the first model into the second model, the fourth quantity is the number of surface constraints in the second model; the fifth quantity is the number of surface constraints in the first model; the sixth quantity is the number of surface constraints in the second model before importing the components of the first model into the second model.
[0114] In a possible implementation, the constraint coordinate determination unit 402 is further configured to record the component identifier corresponding to the component included in the second model in a target file;
[0115] When generating a model based on other physical objects except the target physical object, perform a comparison, and extract the components included in the other physical object;
[0116] If at least one target component identifier corresponding to the components included in the other physical object is included in the target file, extract at least one target component corresponding to the at least one target component identifier from the second model, and use the at least one target component as a sub-model of the model corresponding to the other physical object;
[0117] If there are constraints between the at least one target component, add the constraints to the sub-model.
[0118] Based on the same inventive concept, an embodiment of the present application provides a computing device, which can implement the functions of the constraint reconstruction method discussed above. Please refer to Figure 5 , the computing device 500 includes a memory 501, a processor 502, and a bus 503.
[0119] The memory 501 is used to store the computer program executed by the processor 502. The memory 501 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system and programs required to run the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0120] The memory 501 may be a volatile memory, such as a random access memory (RAM); the memory 501 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD), or the memory 501 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 501 may be a combination of the above memories.
[0121] The processor 502 may include one or more central processing units (CPUs) or be a digital processing unit, etc. The processor 502 is used to implement the constraint reconstruction method in the above embodiment when calling the computer program stored in the memory 501.
[0122] In the embodiment of the present application, the specific connection medium between the memory 501 and the processor 502 is not limited. In the embodiment of the present application Figure 5 it is connected between the memory 501 and the processor 502 through the bus 503, and the bus 503 is in Figure 5The connection in the figure is represented by a thick line. The connection manners between other components are only for illustrative purposes and are not limited thereto. The bus 503 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 5 it is only represented by a thick line in the figure, but it does not mean that there is only one bus or one type of bus.
[0123] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium. The computer program product includes: computer program code. When the computer program code runs on a computer, it causes the computer to execute any of the constraint reconstruction methods described above. Since the principle of solving problems by the above computer-readable storage medium is similar to that of the constraint reconstruction method, the implementation of the above computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be described again.
[0124] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0125] The present application is described with reference to the flowcharts and / or block diagrams of the method, device (system), and computer program product according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the function specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0126] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the function specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0127] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are executed on the computer or other programmable apparatus to produce a computer-implemented process, thereby the instructions executed on the computer or other programmable apparatus provide steps for realizing the functions specified in one process or a plurality of processes and / or blocks Figure 1 one process or a plurality of processes and / or blocks Figure 1 steps for realizing the functions specified in one block or a plurality of blocks.
[0128] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A constrained reconstruction method, characterized in that: include: Based on the position of the component of the first model in the first coordinate system, importing the component of the first model into the second coordinate system where the second model is located; The first model and the second model are models generated based on components of different parts of the target object and constraints between adjacent components; Determine in the second coordinate system at least one target coordinate point having the same coordinates as at least one constraint coordinate point in the first coordinate system; the constraint coordinate point is used to represent the position of the constraint in the first model in the first coordinate system; The target coordinate point is used to represent the position of the constraint in the first model in the second coordinate system; Based on the constraint type corresponding to each constraint coordinate point in the first coordinate system, determine the constraint type corresponding to each target coordinate point in the second coordinate system; the constraint type corresponding to each target coordinate point is the same as the constraint type corresponding to the constraint coordinate point with the same coordinates; A corresponding constraint is established in the second model based on the at least one target coordinate point and a constraint type corresponding to each target coordinate point.
2. The method according to claim 1, characterized in that Before importing the component of the first model into the second coordinate system where the second model is located based on the position of the component of the first model in the first coordinate system, the method further includes: Filtering out a target model including any component of the target object from a plurality of models, and displaying the target model to a user; In response to a selection operation by a user, the first model and the second model are determined from the target model.
3. The method according to claim 2, characterized in that After determining the first model and the second model from the target model, and before importing the component of the first model into the second coordinate system where the second model is located based on the position of the component of the first model in the first coordinate system, the method further includes: If the origin of the first coordinate system and the origin of the second coordinate system are at different positions, move the origin of the first coordinate system to the position where the origin of the second coordinate system is located; If the direction of any coordinate axis of the first coordinate system is different from the direction of the same coordinate axis in the second coordinate system, the direction of the any coordinate axis is adjusted to the direction of the same coordinate axis in the second coordinate system.
4. The method according to claim 1, characterized in that: The step of importing the component of the first model into the second coordinate system where the second model is located based on the position of the component of the first model in the first coordinate system includes: determining at least one target component other than the plurality of components included in the second model from the plurality of components included in the first model; determining a target position of the target component in the second coordinate system based on the coordinates of the at least one target component in the first coordinate system and the shape of the at least one target component; The target component is introduced to the target position.
5. The method according to claim 1, characterized in that Before determining in the second coordinate system at least one target coordinate point having the same coordinates as at least one constraint coordinate point included in the first model, the method further comprises: Obtain at least one constraint included in the first model, and perform the following operations on a target constraint; the target constraint is any constraint in the at least one constraint: If it is determined that the constraint type of the target constraint is a point constraint, extracting a coordinate point corresponding to the target constraint in the first coordinate system; If it is determined that the constraint type of the target constraint is a surface constraint, extracting a plurality of coordinate points corresponding to the target constraint in the first coordinate system; the plurality of coordinate points corresponding to the target constraint are used to characterize a constraint surface corresponding to the target constraint; The coordinate points corresponding to each constraint are saved in a constraint point set; each point in the constraint point set is a constraint coordinate point.
6. The method according to claim 5, characterized in that After establishing corresponding constraints in the second model based on the at least one target coordinate point and the constraint type corresponding to each target coordinate point, the method further includes: If the difference between the first number and the second number is different from the third number, or the difference between the fourth number and the fifth number is different from the sixth number, prompting the user that the constraint establishment fails, responding to the user's reconstruction instruction, returning to the step of establishing the corresponding constraint in the second model based on the at least one target coordinate point and the constraint type corresponding to each target coordinate point; Among them, the first number is the number of point constraints in the second model; the second number is the number of point constraints in the first model; the third number is the number of point constraints in the second model before the components of the first model are imported into the second model, the fourth number is the number of face constraints in the second model; the fifth number is the number of face constraints in the first model; the sixth number is the number of face constraints in the second model before the components of the first model are imported into the second model.
7. The method according to claim 6, characterized in that After regenerating the corresponding constraint based on the target coordinate point and the constraint type corresponding to each constraint coordinate point in the first model, the method further includes: Recording component identifiers corresponding to the components included in the second model in a target file; When generating a model based on other physical objects other than the target physical object, comparison is performed to extract components included in the other physical objects; If the target file contains at least one target component identifier corresponding to the component contained in the other physical object, extract at least one target component corresponding to the at least one target component identifier from the second model, and use the at least one target component as a sub-model of the model corresponding to the other physical object; If a constraint exists between the at least one target component, the constraint is added to the sub-model.
8. A constraint reconstruction device, characterized in that: include: A model component importing unit, used for importing the component of the first model into the second coordinate system where the second model is located based on the position of the component of the first model in the first coordinate system; The first model and the second model are models generated based on components of different parts of the target object and constraints between adjacent components; a constraint coordinate determination unit, configured to determine, in the second coordinate system, at least one target coordinate point having the same coordinates as at least one constraint coordinate point in the first coordinate system; the constraint coordinate point being used to characterize a position of a constraint in the first model in the first coordinate system; The target coordinate point is used to represent the position of the constraint in the first model in the second coordinate system; a constraint type determination unit, configured to determine the constraint type corresponding to each target coordinate point in the second coordinate system based on the constraint type corresponding to each constraint coordinate point in the first coordinate system; the constraint type corresponding to each target coordinate point is the same as the constraint type corresponding to the constraint coordinate point with the same coordinates; A constraint reconstruction unit is used to establish a corresponding constraint in the second model based on the at least one target coordinate point and the constraint type of each target coordinate point corresponding to the constraint.
9. A computing device, characterized in that include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-7 according to the obtained program instructions.
10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.