Three-dimensional model conversion method and device, electronic equipment and storage medium
By obtaining the target format file of the geometric model and changing the parameter of the system simulation standard model, the problem of inconsistent description methods of geometric model and system simulation model is solved, and interoperability and consistent modeling between models are achieved.
Patent Information
- Application Number
- CN202411785606.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, geometric models and system simulation models lack a unified description method, resulting in splitting phenomena during the modeling process, poor information transmission, and poor interoperability between models.
By obtaining the target format file of the geometric model, changing the parameter of the system simulation standard model, creating a target three-dimensional model that has both the attribute information of the geometric model and can also be simulated in the system simulation.
It breaks the split phenomenon in the modeling process, realizes consistent modeling of geometric models and system simulation models, and improves interoperability between models.
Smart Images

Figure CN119722942A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a three-dimensional model conversion method, device, electronic equipment and storage medium. Background Art
[0002] Geometric models and system simulation models are two core elements in modern engineering design and analysis. In complex engineering projects, geometric models are used to describe the shape and structure of physical entities, while system simulation models are used to analyze the dynamic behavior of the system and its interaction with the outside world.
[0003] However, in the process of building these models, different software tools and modeling methods are often needed. The diversity of such tools and methods makes the geometric model and the system simulation model lack a unified description method. The geometric model focuses on the topological structure of the space, while the system simulation model focuses on the state evolution of dynamic behavior. This essential difference leads to the separation of the two in terms of concept and implementation, which leads to the separation phenomenon in the modeling process, resulting in poor information transmission and poor interoperability between models. Summary of the invention
[0004] The present invention provides a three-dimensional model conversion method, device, electronic device and storage medium, which are used to change the parameters of a system simulation standard model through a target format file of a geometric model, so as to obtain a target three-dimensional model that has both attribute information of the geometric model and can perform system simulation, thereby breaking the separation phenomenon in the modeling process, realizing consistent modeling of the geometric model and the system simulation model, and improving the interoperability between models.
[0005] In a first aspect, an embodiment of the present invention provides a three-dimensional model conversion method, the method comprising:
[0006] Acquire a target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform; wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information, and geometric shape information of the three-dimensional model to be converted;
[0007] In response to a model creation triggering operation in a second model editing platform, creating an initial rigid body sub-model and an initial basic shape sub-model;
[0008] Based on the target format file, the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model are modified to obtain a target three-dimensional model suitable for a second model editing platform.
[0009] In a second aspect, an embodiment of the present invention further provides a three-dimensional model conversion device, the device comprising:
[0010] A model file acquisition module, used to acquire a target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform; wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information and geometric shape information of the three-dimensional model to be converted;
[0011] A sub-model construction module, for creating an initial rigid body sub-model and an initial basic shape sub-model in response to a model creation trigger operation in a second model editing platform;
[0012] The target model determination module is used to modify the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model based on the target format file to obtain a target three-dimensional model suitable for the second model editing platform.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] The storage device is used to store one or more programs. When the one or more programs are executed by one or more processors, the one or more processors implement the three-dimensional model conversion method as any one of the embodiments of the present invention.
[0016] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a three-dimensional model conversion method as described in any one of the embodiments of the present invention.
[0017] The technical solution of the embodiment of the present invention obtains the target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform, wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information and geometric shape information of the three-dimensional model to be converted, and then, in response to the model creation trigger operation in the second model editing platform, creates an initial rigid body sub-model and an initial basic shape sub-model, thereby, based on the target format file, the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model are changed and processed to obtain a target three-dimensional model suitable for the second model editing platform. The technical solution of this embodiment changes the parameters of the system simulation standard model through the target format file of the geometric model to obtain a target three-dimensional model that has both the attribute information of the geometric model and can be used for system simulation, breaking the separation phenomenon in the modeling process, realizing the consistent modeling of the geometric model and the system simulation model, and improving the interoperability between models. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required to describe the embodiments. Obviously, the drawings introduced are only drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A schematic diagram of a flow chart of a three-dimensional model conversion method provided by an embodiment of the present invention;
[0020] Figure 2 A schematic diagram of a three-dimensional model to be converted edited in a first model editing platform according to an embodiment of the present invention;
[0021] Figure 3 A schematic diagram of an initial rigid body sub-model and an initial basic shape sub-model involved in an embodiment of the present invention;
[0022] Figure 4 A schematic diagram of a specific implementation process of a three-dimensional model conversion method according to an embodiment of the present invention;
[0023] Figure 5 A schematic diagram of a target three-dimensional model involved in an embodiment of the present invention;
[0024] Figure 6 A schematic flow chart of another three-dimensional model conversion method provided by an embodiment of the present invention;
[0025] Figure 7 A schematic diagram of the structure of a three-dimensional model conversion device provided by an embodiment of the present invention;
[0026] Figure 8 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0028] Embodiment 1
[0029] Figure 1A flow chart of a three-dimensional model conversion method provided in an embodiment of the present invention. This embodiment is applicable to situations where a geometric model needs to be converted into a system simulation model. The method can be executed by a three-dimensional model conversion device, which can be implemented in the form of software and / or hardware. The hardware can be an electronic device, such as a mobile terminal, a PC or a server.
[0030] like Figure 1 As shown, the three-dimensional model conversion method includes:
[0031] S110: Obtain a target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform.
[0032] The first model editing platform refers to a software platform that can perform 3D model editing and visualization in a first manner. The second model editing platform refers to a software platform that can perform 3D model editing and visualization in a second manner. In addition, the second model editing platform can also perform system simulation on the 3D model to simulate the state evolution of the dynamic behavior of the 3D model. The 3D model to be converted is a 3D geometric model to be converted. The 3D model to be converted can be an overall structural model composed of multiple component models, or a certain component model.
[0033] In this embodiment, the target format file refers to a file of a specified format corresponding to the three-dimensional model to be converted. The target format is a file format that can be read by both the first model editing platform and the second model editing platform. Exemplarily, most three-dimensional model platforms support reading data files in STEP format. Based on this, the target format file can be a STEP format file corresponding to the three-dimensional model to be converted. Among them, the STEP format is a neutral format that can contain all information such as the product's geometry, properties, materials, and processes.
[0034] More specifically, the target format file includes the model data to be converted corresponding to the three-dimensional model to be converted. The model data to be converted includes the center of mass position coordinates, mass information, inertia tensor information and geometric shape information. Among them, the center of mass position coordinates refer to the X coordinate value, Y coordinate value and Z coordinate value of the center of mass of the three-dimensional model to be converted in the world coordinate system. The mass information refers to the weight value of the three-dimensional model to be converted. The inertia tensor information describes the inertia when the rigid body rotates around a fixed point, which can be introduced by the momentum when the rigid body rotates around a fixed point. The geometric shape information refers to the data describing the shape and structure of the three-dimensional model to be converted, mainly including the information of vertices, edges and faces. This information defines the shape and structure of the model and is the basis for building a three-dimensional model. Optionally, the three-dimensional model to be converted can be characterized by boundary representation (B-rep representation) data. In the B-rep representation, an entity is represented as a set of connected surface elements, which define the boundary of the entity. Each surface can be further decomposed into loops, edges and vertices. Together, these elements form the geometry and topology of the entity.
[0035] Next, how to determine the target format file corresponding to the three-dimensional model to be converted is described in detail. Optionally, the specific implementation steps of determining the target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform may include:
[0036] S1. In response to a triggering operation on at least one three-dimensional model to be selected in a first model editing platform, a three-dimensional model to be converted is determined from the at least one three-dimensional model to be selected, and boundary representation data including geometric shape information of the three-dimensional model to be converted is obtained.
[0037] In this embodiment, one or more to-be-selected 3D models can be edited in advance in the first model editing platform, and when the user circles and clicks one or more to-be-selected 3D models in the first model editing platform, the triggered to-be-selected 3D models are the to-be-converted 3D models. At this time, the boundary representation data including the geometric shape information of the to-be-converted 3D models can be obtained.
[0038] S2. In response to a trigger operation on a target measurement tool in the first model editing platform, based on a mass characteristic extraction algorithm integrated in the target measurement tool, determine the center of mass position coordinates, mass information, and inertia tensor information corresponding to the three-dimensional model to be converted.
[0039] The target measurement tool is a mass characteristic measurement tool integrated in the first model editing platform. The mass characteristic refers to the center of mass position coordinates, mass information and inertia tensor information of a certain three-dimensional model.
[0040] In this embodiment, a mass characteristic extraction algorithm is pre-configured in the target measurement tool. When a certain three-dimensional model to be converted is selected and the user triggers the target measurement tool, configuration attribute information corresponding to the three-dimensional model to be converted can be obtained. For example, the configuration attribute information includes but is not limited to material attributes, three-dimensional coordinate system, basic geometric entities, entity attributes and other information. The target measurement tool processes and analyzes these configuration attribute information through the mass characteristic extraction algorithm to obtain the center of mass position coordinates, mass information, and inertia tensor information corresponding to the three-dimensional model to be converted.
[0041] S3. Exporting the center of mass position coordinates, mass information, inertia tensor information and boundary representation data in a target format to obtain a target format file corresponding to the three-dimensional model to be converted.
[0042] Based on the above embodiment, after obtaining the center of mass position coordinates, mass information, inertia tensor information and boundary representation data, these data contents can be exported in a target format, so that a target format file corresponding to the three-dimensional model to be converted can be obtained, and the target format file can be stored in a preset storage location.
[0043] In this embodiment, the three-dimensional model conversion method provided in this embodiment can be integrated into a second model editing platform, and a model conversion control for starting to enable the three-dimensional model conversion method can be pre-configured. When the user needs to perform model conversion on any one of the selected three-dimensional models, the selected three-dimensional model is the three-dimensional model to be converted. When the three-dimensional model to be converted is selected and the model conversion control is clicked, a pre-exported target format file corresponding to the three-dimensional model to be converted can be obtained from a preset storage location.
[0044] For example, the schematic diagram of the three-dimensional model to be converted edited in the first model editing platform is shown in Figure 2 In the first model editing platform, a rectangular model is formed by taking (0,0,0) as the origin, extending 4m in the x direction, 3m in the y direction, and 2m in the z direction. The rectangular model is the 3D model to be converted. The center of mass position coordinates of the 3D model to be converted are (2,1.5,1), the mass information is 240kg, and the inertia tensor information is {260,400,500,0,0,0}kg·m 2 , the geometric shape information is a STEP format file represented by B-rep representation. Finally, a STEP format file including the center of mass position coordinates, mass information, inertia tensor information and geometric shape information can be exported.
[0045] S120 . In response to a model creation triggering operation in the second model editing platform, an initial rigid body sub-model and an initial basic shape sub-model are created.
[0046] The rigid body submodel is a standard rigid body component in the system simulation language system. For example, the rigid body component is a mechanical multi-body component in the Modelica standard library component: Mechanics.MultiBody.Parts.Body. The initial rigid body submodel refers to a standard rigid body component whose attribute information in the model is the default value.
[0047] The basic shape submodel is a standard basic shape component in the system simulation language system. For example, the standard basic shape component is the mechanical multi-body visualization component in the Modelica standard library component: Mechanics.MultiBody.Visualizers.FixedShape. The initial basic shape submodel refers to the standard basic shape component whose attribute information in the model is the default value.
[0048] In this embodiment, the user can click on the first model creation control for creating a standard rigid body component in the second model editing platform, and an initial rigid body sub-model can be created at this time; based on the same method, the user can also click on the second model creation control for creating a standard basic shape component in the second model editing platform, and an initial basic shape sub-model can be created at this time. For example, the schematic diagram of the initial rigid body sub-model and the initial basic shape sub-model is shown in FIG. Figure 3 Among them, the initial rigid body sub-model is mainly responsible for encapsulating the mass characteristics of the 3D model. The standard parameters of the initial rigid body sub-model include relative center of mass, mass, inertia tensor, etc. The initial basic shape sub-model is mainly responsible for encapsulating the geometric shape information of the 3D model. The standard parameters of the initial basic shape sub-model include center of mass offset difference, 3D model shape display data, etc.
[0049] S130, modifying the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model based on the target format file to obtain a target three-dimensional model suitable for the second model editing platform.
[0050] The target three-dimensional model is a three-dimensional system simulation model that is finally generated and can be edited, operated, displayed, and analyzed in state space simulation on the second model editing platform.
[0051] Specifically, the mass default parameters in the initial rigid body sub-model can be modified through the mass information in the target format file, and the inertia tensor default parameters in the initial rigid body sub-model can be modified through the inertia tensor information in the target format file, and the target rigid body sub-model can be obtained after the modification is completed; at the same time, the center of mass default parameters in the initial basic shape sub-model can be modified through the center of mass position coordinates in the target format file, and the geometric shape default parameters in the initial basic shape sub-model can be modified through the geometric shape information in the target format file, and the target basic shape sub-model can be obtained after the modification is completed; further, the target rigid body sub-model and the target basic shape sub-model are bound to obtain a target three-dimensional model suitable for the second model editing platform.
[0052] For example, the specific implementation process diagram of the 3D model conversion method provided in this embodiment is shown in Figure 4 .like Figure 4 As shown, the 3D CAD model (i.e. the 3D model to be converted) can be edited in the FreeCAD platform (i.e. the first model editing platform), and the 3D CAD model is a geometric model. The target measurement tool in the FreeCAD platform can be used to calculate the center of mass information, mass information, and inertia tensor information corresponding to the 3D model to be converted according to its material properties, 3D coordinate system, basic geometric entities, entity properties and other information, and the corresponding B-rep model (i.e. geometric shape information) can be obtained, and the center of mass information, mass information, inertia tensor information and B-rep model can be exported in STEP data format to obtain a target format file and store the target format file in a preset storage location. When it is necessary to convert the three-dimensional model to be converted, the pre-configured model conversion control can be triggered in the second model editing platform. At this time, the pre-exported target format file corresponding to the three-dimensional model to be converted can be obtained from the preset storage location. Further, the FixedShape standard component (i.e., the initial basic shape sub-model) and the Body standard component (i.e., the initial rigid body sub-model) can be constructed in the second model editing platform. Subsequently, the FixedShape standard component and the Body standard component are modified according to the center of mass position coordinates, mass information, inertia tensor information, and geometric shape information in the target format file. For example, the example table of relevant parameters after the initial rigid body sub-model is changed is shown in Table 1; the example table of relevant parameters after the initial basic shape sub-model is changed is shown in Table 2.
[0053] Table 1 Example of relevant parameters after rigid body sub-model changes
[0054] Parameter name describe Parameter value examples m quality 240kg Inertia tensor Inertia tensor {260,400,500,0,0,0} r_CM Relative centroid {0,0,0}
[0055] Table 2 Example of relevant parameters after the basic shape sub-model is changed
[0056]
[0057]
[0058] After completing the parameter change process, the changed target FixedShape component and target Body component can be obtained, and the two are bound to obtain a Modelica model (i.e., a target three-dimensional model) suitable for the second model editing platform. The target three-dimensional model is a system simulation model. Figure 5 ,like Figure 5 As shown in , the target FixedShape component and the target Body component can be bound by connecting lines to obtain the target 3D model. Figure 5 As shown, a port exposure component can be added to the target three-dimensional model, so that the control source component and the target three-dimensional model can be connected to form an overall model that can perform state space simulation through the port exposure component. Therefore, the control source component can input control parameters for the target three-dimensional model to perform state space numerical simulation control on the target three-dimensional model.
[0059] The technical solution of the embodiment of the present invention obtains the target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform, wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information and geometric shape information of the three-dimensional model to be converted, and then, in response to the model creation trigger operation in the second model editing platform, creates an initial rigid body sub-model and an initial basic shape sub-model, thereby, based on the target format file, the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model are changed and processed to obtain a target three-dimensional model suitable for the second model editing platform. The technical solution of this embodiment changes the parameters of the system simulation standard model through the target format file of the geometric model to obtain a target three-dimensional model that has both the attribute information of the geometric model and can be used for system simulation, breaking the separation phenomenon in the modeling process, realizing the consistent modeling of the geometric model and the system simulation model, and improving the interoperability between models.
[0060] Embodiment 2
[0061] Figure 6 This is a schematic diagram of a 3D model conversion method provided by an embodiment of the present invention. Based on the above embodiment, S130 is further refined. The specific implementation method can refer to the technical solution of this embodiment. The technical terms that are the same or corresponding to the above embodiment are not repeated here.
[0062] like Figure 6 As shown, the method specifically comprises the following steps:
[0063] S210, obtaining a target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform, wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information, and geometric shape information of the three-dimensional model to be converted.
[0064] S220: In response to a model creation triggering operation in the second model editing platform, an initial rigid body sub-model and an initial basic shape sub-model are created.
[0065] S230. Based on the mass information and inertia tensor information in the target format file, the first attribute parameter of the initial rigid body sub-model is changed to obtain a target rigid body sub-model.
[0066] The first attribute parameter is a default attribute parameter corresponding to the initial rigid body sub-model. Specifically, the first attribute parameter includes a mass attribute parameter and an inertia tensor attribute parameter.
[0067] Optionally, based on the mass information and inertia tensor information in the target format file, the first attribute parameter of the initial rigid body sub-model is changed to obtain the target rigid body sub-model. The specific implementation steps may include:
[0068] S2301. Obtain a rigid body property script corresponding to the initial rigid body sub-model.
[0069] The rigid body attribute script refers to the script information including all attribute parameters of the initial rigid body sub-model.
[0070] In this embodiment, when an initial rigid body sub-model is constructed in the second model editing platform, a rigid body property script corresponding to the initial rigid body sub-model can be created at the same time, so it is easy to obtain the rigid body property script.
[0071] S2302. Based on the mass information, the first field content corresponding to the mass attribute parameter in the rigid body attribute script is changed, and based on the inertia tensor information, the second field content corresponding to the inertia tensor attribute parameter in the rigid body attribute script is changed to obtain a target rigid body attribute script.
[0072] Based on the above embodiment, the rigid body attribute script includes: a first field content corresponding to the mass attribute parameters and a second field content corresponding to the inertia tensor attribute parameters. Based on this, the first field content can be modified to the mass information of the three-dimensional model to be converted; the second field content can be modified to the inertia tensor information of the three-dimensional model to be converted. The rigid body attribute script after modification is the target rigid body attribute script.
[0073] S2303. Determine the target rigid body sub-model based on the target rigid body attribute script.
[0074] In this embodiment, based on obtaining the target rigid body attribute script, the attribute parameters in the initial rigid body sub-model have been modified. At this time, the target rigid body attribute script corresponds to the target rigid body sub-model.
[0075] S240: Based on the centroid position coordinates and geometric shape information in the target format file, the second attribute parameter of the initial basic shape sub-model is modified to obtain a target basic shape sub-model.
[0076] The second attribute parameter is a default attribute parameter of the basic shape sub-model. Specifically, the first attribute parameter includes the second attribute parameter including the centroid attribute parameter and the geometric shape attribute parameter.
[0077] Optionally, based on the centroid position coordinates and geometric shape information in the target format file, the second attribute parameter of the initial basic shape sub-model is changed to obtain the target basic shape sub-model in the following specific implementation steps:
[0078] S2401. Obtain a basic shape attribute script corresponding to an initial basic shape sub-model.
[0079] The basic shape attribute script refers to the script information including all attribute parameters corresponding to the initial basic shape sub-model.
[0080] In this embodiment, when an initial basic shape sub-model is constructed in the second model editing platform, a basic shape attribute script corresponding to the initial basic shape sub-model can be created at the same time, so the basic shape attribute script can be easily obtained.
[0081] S2402. Change the third field content corresponding to the centroid attribute parameter in the basic shape attribute script based on the centroid position coordinates, and change the fourth field content corresponding to the geometric shape attribute parameter in the basic shape attribute script based on the geometric shape information to obtain a target basic shape attribute script.
[0082] Based on the above embodiment, the basic shape attribute script includes: the third field content corresponding to the centroid attribute parameter and the fourth field content corresponding to the geometric shape attribute parameter. Based on this, the third field content can be modified according to the centroid position coordinates, and the third field content can be modified according to the geometric shape information. The modified basic shape attribute script is the target basic shape attribute script.
[0083] Optionally, the specific implementation method of changing the third field content corresponding to the center of mass attribute parameter in the basic shape attribute script based on the center of mass position coordinates may include: determining the center of mass offset coordinates based on the center of mass position coordinates; and modifying the third field content corresponding to the center of mass attribute parameter in the basic shape attribute script to the center of mass offset coordinates.
[0084] The centroid offset coordinates refer to the offset coordinate table of the centroid position coordinates relative to the coordinate origin.
[0085] In this embodiment, the center of mass position coordinates can be expressed as (a, b, c), and the center of mass offset coordinates can be expressed as (-a, -b, -c). Further, the third field content corresponding to the center of mass attribute parameters in the basic shape attribute script can be modified to (-a, -b, -c), and the step of changing the third field content corresponding to the center of mass attribute parameters in the basic shape attribute script is now completed.
[0086] Optionally, a specific implementation method for changing the content of the fourth field corresponding to the geometric shape attribute parameters in the basic shape attribute script based on the geometric shape information may include: determining the target storage path and file name corresponding to the target format file; modifying the content of the fourth field corresponding to the geometric shape attribute parameters in the basic shape attribute script to the target storage path and / or file name, so as to read the geometric shape information in the target format file based on the target storage path and / or file name when displaying the target three-dimensional model based on the target basic shape sub-model.
[0087] The target storage path refers to the specific location of the target format file on the computer storage device, including the disk partition, folder and file name. The file name refers to the name used in the computer system to identify the information stored on the external medium. The file name usually consists of two parts: the file name and the file extension, which are separated by a dot (.).
[0088] In this embodiment, the storage location of the target format file on the computer device is determined, based on which, it is easy to determine the target storage path and file name of the target format file. On the basis of obtaining the target storage path and file name, the fourth field content corresponding to the geometric shape attribute parameter in the basic shape attribute script can be modified to the target storage path and / or file name. For example, if the storage paths of the basic shape attribute script and the target format file are the same, then the fourth field content can be modified to the file name; if the storage paths of the basic shape attribute script and the target format file are different, then the fourth field content can be modified to the target storage path and file name. Thus, when displaying the target three-dimensional model based on the target basic shape sub-model, the geometric shape information in the target format file can be read according to the information content of the target storage path and / or file name for simulation and visual display.
[0089] S2403. Determine the target basic shape sub-model based on the target basic shape attribute script.
[0090] In this embodiment, based on obtaining the target rigid body attribute script, the attribute parameters in the initial rigid body sub-model have been modified. At this time, the target rigid body attribute script corresponds to the target rigid body sub-model.
[0091] S250: Obtain a target three-dimensional model suitable for a second model editing platform based on the target rigid body sub-model and the target basic shape sub-model.
[0092] In this embodiment, based on the target rigid body sub-model and the target basic shape sub-model, the two can be further bound to obtain an overall model including the target rigid body sub-model and the target basic shape sub-model. The overall model is the target three-dimensional model suitable for the second model editing platform.
[0093] The technical solution of the embodiment of the present invention is to obtain the target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform, wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information and geometric shape information of the three-dimensional model to be converted, and then, in response to the model creation trigger operation in the second model editing platform, create an initial rigid body sub-model and an initial basic shape sub-model, thereby, based on the mass information and inertia tensor information in the target format file, change the first attribute parameter of the initial rigid body sub-model to obtain the target rigid body sub-model; based on the center of mass position coordinates and geometric shape information in the target format file, change the second attribute parameter of the initial basic shape sub-model to obtain the target basic shape sub-model; based on the target rigid body sub-model and the target basic shape sub-model, obtain the target three-dimensional model suitable for the second model editing platform. The technical solution of this embodiment changes the parameters of the system simulation standard model through the target format file of the geometric model, and obtains the target three-dimensional model that has both the attribute information of the geometric model and can be used for system simulation, breaking the separation phenomenon in the modeling process, realizing the consistent modeling of the geometric model and the system simulation model, and improving the interoperability between models.
[0094] Embodiment 3
[0095] Figure 7 This is a schematic diagram of the structure of a three-dimensional model conversion device provided by an embodiment of the present invention. The device includes: a model file acquisition module 310, a sub-model construction module 320 and a target model determination module 330.
[0096] The model file acquisition module 310 is used to acquire a target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform; wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information and geometric shape information of the three-dimensional model to be converted;
[0097] A sub-model construction module 320, for creating an initial rigid body sub-model and an initial basic shape sub-model in response to a model creation triggering operation in the second model editing platform;
[0098] The target model determination module 330 is used to modify the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model based on the target format file to obtain a target three-dimensional model suitable for the second model editing platform.
[0099] Based on the above device, optionally, the three-dimensional model conversion device further includes a model file determination module; the model file determination module includes:
[0100] a model determination unit, configured to, in response to a triggering operation on at least one to-be-selected three-dimensional model in the first model editing platform, determine the to-be-converted three-dimensional model from the at least one to-be-selected three-dimensional model, and acquire boundary representation data including geometric shape information of the to-be-converted three-dimensional model;
[0101] A quality characteristic determination unit, configured to determine, in response to a trigger operation on a target measurement tool in the first model editing platform, the center of mass position coordinates, mass information, and inertia tensor information corresponding to the three-dimensional model to be converted based on a quality characteristic extraction algorithm integrated in the target measurement tool;
[0102] The model file determination unit is used to export the center of mass position coordinates, the mass information, the inertia tensor information and the boundary representation data in a target format to obtain a target format file corresponding to the three-dimensional model to be converted.
[0103] Based on the above device, optionally, the target model determination module 330 includes:
[0104] A rigid body sub-model determination unit, configured to modify a first attribute parameter of the initial rigid body sub-model based on the mass information and the inertia tensor information in the target format file to obtain a target rigid body sub-model;
[0105] A basic shape sub-model determining unit, configured to modify a second attribute parameter of the initial basic shape sub-model based on the centroid position coordinates and the geometric shape information in the target format file to obtain a target basic shape sub-model;
[0106] The rigid body sub-model determining unit is used to obtain a target three-dimensional model suitable for a second model editing platform based on the target rigid body sub-model and the target basic shape sub-model.
[0107] Based on the above device, optionally, the first attribute parameter includes a mass attribute parameter and an inertia tensor attribute parameter, and the rigid body sub-model determination unit includes:
[0108] A rigid body script acquisition subunit, used to acquire a rigid body attribute script corresponding to the initial rigid body sub-model;
[0109] A rigid body script modification subunit, used to modify the first field content corresponding to the mass attribute parameter in the rigid body attribute script based on the mass information, and modify the second field content corresponding to the inertia tensor attribute parameter in the rigid body attribute script based on the inertia tensor information, to obtain a target rigid body attribute script;
[0110] The rigid body sub-model determining sub-unit is used to determine the target rigid body sub-model based on the target rigid body attribute script.
[0111] Based on the above device, optionally, the second attribute parameter includes a centroid attribute parameter and a geometric shape attribute parameter, and the basic shape sub-model determination unit includes:
[0112] A basic shape script acquisition subunit, used to acquire a basic shape attribute script corresponding to the initial basic shape sub-model;
[0113] A basic shape script modification subunit is used to modify the third field content corresponding to the centroid attribute parameter in the basic shape attribute script based on the centroid position coordinates, and to modify the fourth field content corresponding to the geometric shape attribute parameter in the basic shape attribute script based on the geometric shape information, so as to obtain a target basic shape attribute script;
[0114] The basic shape sub-model determining sub-unit is used to determine the target basic shape sub-model based on the target basic shape attribute script.
[0115] Based on the above device, optionally, the basic shape script modification subunit is specifically used to determine the center of mass offset coordinates based on the center of mass position coordinates; and modify the third field content corresponding to the center of mass attribute parameters in the basic shape attribute script to the center of mass offset coordinates.
[0116] Based on the above-mentioned device, optionally, the basic shape script change sub-unit is further used to determine the target storage path and file name corresponding to the target format file; modify the fourth field content corresponding to the geometric shape attribute parameter in the basic shape attribute script to the target storage path and / or the file name, so as to read the geometric shape information in the target format file based on the target storage path and / or the file name when displaying the target three-dimensional model based on the target basic shape sub-model.
[0117] The technical solution of the embodiment of the present invention obtains the target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform, wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information and geometric shape information of the three-dimensional model to be converted, and then, in response to the model creation trigger operation in the second model editing platform, creates an initial rigid body sub-model and an initial basic shape sub-model, thereby, based on the target format file, the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model are changed and processed to obtain a target three-dimensional model suitable for the second model editing platform. The technical solution of this embodiment changes the parameters of the system simulation standard model through the target format file of the geometric model to obtain a target three-dimensional model that has both the attribute information of the geometric model and can be used for system simulation, breaking the separation phenomenon in the modeling process, realizing the consistent modeling of the geometric model and the system simulation model, and improving the interoperability between models.
[0118] The three-dimensional model conversion device provided in the embodiment of the present invention can execute the three-dimensional model conversion method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0119] It is worth noting that the various units and modules included in the above system are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.
[0120] Embodiment 4
[0121] Figure 8 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 8 The electronic device 40 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0122] like Figure 8 As shown, the electronic device 40 is in the form of a general computing device. The components of the electronic device 40 may include but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 connecting different system components (including the system memory 402 and the processing unit 401).
[0123] Bus 403 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0124] The electronic device 40 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 40, including volatile and non-volatile media, removable and non-removable media.
[0125] System memory 402 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 404 and / or cache memory 405. Electronic device 40 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 406 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 403 via one or more data medium interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.
[0126] A program / utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 407 generally perform the functions and / or methods of the embodiments described herein.
[0127] The electronic device 40 may also communicate with one or more external devices 409 (e.g., keyboards, pointing devices, displays 810, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 40, and / or may communicate with any device that enables the electronic device 40 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 411. Furthermore, the electronic device 40 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 412. As shown, the network adapter 412 communicates with other modules of the electronic device 40 via the bus 403. It should be understood that although Figure 8 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 40, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0128] The processing unit 401 executes various functional applications and page processing by running the programs stored in the system memory 402, for example, implementing the three-dimensional model conversion method provided in the embodiment of the present invention.
[0129] Embodiment 5
[0130] The embodiment of the present invention further provides a storage medium containing computer executable instructions, which are used to perform a three-dimensional model conversion method when executed by a computer processor, including:
[0131] Acquire a target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform; wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information, and geometric shape information of the three-dimensional model to be converted;
[0132] In response to a model creation triggering operation in the second model editing platform, creating an initial rigid body sub-model and an initial basic shape sub-model;
[0133] Based on the target format file, the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model are modified to obtain a target three-dimensional model suitable for a second model editing platform.
[0134] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0135] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0136] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0137] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0138] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A three-dimensional model conversion method, characterized in that: The invention is characterized by comprising: Acquire a target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform; wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information, and geometric shape information of the three-dimensional model to be converted; In response to a model creation triggering operation in the second model editing platform, creating an initial rigid body sub-model and an initial basic shape sub-model; Based on the target format file, the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model are modified to obtain a target three-dimensional model suitable for a second model editing platform.
2. The method according to claim 1, characterized in that The method further includes: determining a target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform, including: In response to a triggering operation on at least one to-be-selected three-dimensional model in the first model editing platform, determining the to-be-converted three-dimensional model from the at least one to-be-selected three-dimensional model, and acquiring boundary representation data including geometric shape information of the to-be-converted three-dimensional model; In response to a triggering operation on a target measurement tool in the first model editing platform, based on a mass characteristic extraction algorithm integrated in the target measurement tool, determining the center of mass position coordinates, mass information, and inertia tensor information corresponding to the three-dimensional model to be converted; The center of mass position coordinates, the mass information, the inertia tensor information and the boundary representation data are exported in a target format to obtain a target format file corresponding to the three-dimensional model to be converted.
3. The method according to claim 1, characterized in that The modifying of the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model based on the target format file to obtain a target three-dimensional model suitable for the second model editing platform includes: Based on the mass information and the inertia tensor information in the target format file, a first attribute parameter of the initial rigid body sub-model is modified to obtain a target rigid body sub-model; Based on the centroid position coordinates and the geometric shape information in the target format file, modify the second attribute parameter of the initial basic shape sub-model to obtain a target basic shape sub-model; Based on the target rigid body sub-model and the target basic shape sub-model, a target three-dimensional model suitable for a second model editing platform is obtained.
4. The method according to claim 3, characterized in that The first attribute parameter includes a mass attribute parameter and an inertia tensor attribute parameter, and the first attribute parameter of the initial rigid body sub-model is changed based on the mass information and the inertia tensor information in the target format file to obtain a target rigid body sub-model, including: Obtaining a rigid body property script corresponding to the initial rigid body sub-model; Based on the mass information, the first field content corresponding to the mass attribute parameter in the rigid body attribute script is changed, and based on the inertia tensor information, the second field content corresponding to the inertia tensor attribute parameter in the rigid body attribute script is changed to obtain a target rigid body attribute script; Based on the target rigid body property script, a target rigid body sub-model is determined.
5. The method according to claim 3, characterized in that: The second attribute parameters include centroid attribute parameters and geometric shape attribute parameters, and the second attribute parameters of the initial basic shape sub-model are modified based on the centroid position coordinates and the geometric shape information in the target format file to obtain the target basic shape sub-model, including: Obtaining a basic shape attribute script corresponding to the initial basic shape sub-model; The third field content corresponding to the centroid attribute parameter in the basic shape attribute script is modified based on the centroid position coordinates, and the fourth field content corresponding to the geometric shape attribute parameter in the basic shape attribute script is modified based on the geometric shape information to obtain a target basic shape attribute script; Based on the target basic shape attribute script, a target basic shape sub-model is determined.
6. The method according to claim 5, characterized in that The changing the third field content corresponding to the centroid attribute parameter in the basic shape attribute script based on the centroid position coordinates includes: Determine the center of mass offset coordinates based on the center of mass position coordinates; The third field content corresponding to the centroid attribute parameter in the basic shape attribute script is modified to the centroid offset coordinates.
7. The method according to claim 5, characterized in that The changing of the fourth field content corresponding to the geometric shape attribute parameter in the basic shape attribute script based on the geometric shape information includes: Determine the target storage path and file name corresponding to the target format file; The fourth field content corresponding to the geometric shape attribute parameters in the basic shape attribute script is modified to the target storage path and / or the file name, so that when the target three-dimensional model is displayed based on the target basic shape sub-model, the geometric shape information in the target format file is read based on the target storage path and / or the file name.
8. A three-dimensional model conversion device, characterized in that: The device includes: A model file acquisition module, used to acquire a target format file corresponding to the three-dimensional model to be converted edited in the first model editing platform; wherein the target format file includes the center of mass position coordinates, mass information, inertia tensor information and geometric shape information of the three-dimensional model to be converted; A sub-model construction module, for creating an initial rigid body sub-model and an initial basic shape sub-model in response to a model creation trigger operation in a second model editing platform; The target model determination module is used to modify the attribute parameters of the initial rigid body sub-model and the initial basic shape sub-model based on the target format file to obtain a target three-dimensional model suitable for the second model editing platform.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the three-dimensional model conversion method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the three-dimensional model conversion method according to any one of claims 1 to 7 when executed.