Three-dimensional structure file conversion method and device, equipment and medium
By acquiring the geometric attribute data from STP files, constructing a data structure based on the GDML specification, and converting it to GDML format, the problem that STP files cannot be directly used for radiation simulation is solved. This achieves efficient, standardized, and complete conversion of geometric attribute data, thereby improving its applicability in radiation simulation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-07
AI Technical Summary
Existing STP format files cannot be directly applied to radiation simulations due to a lack of material property information, rendering radiation simulation software ineffective.
By obtaining the geometric attribute data from the STP file, a data structure is constructed based on the GDML specification, and the data is converted into GDML format. Default values are set to supplement missing information, and the data is finally stored as a GDML file.
It enables efficient and standardized conversion of STP file geometric attribute data into GDML format, ensuring the integrity and validity of the converted data and improving its usability in radiation simulation scenarios.
Smart Images

Figure CN121807778A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data conversion, in particular to a three-dimensional structure file conversion method, device, equipment and medium. BACKGROUND
[0002] STP is a general CAD file format, supports export and reading, can accurately represent geometric body, assembly structure, material properties and other details, and as an open standard, it is convenient for different software and systems to share and exchange geometric data. It is widely used in mechanical engineering, automobile industry, electronic equipment and other industries, and in aerospace design, it can be used to represent the geometric shape and assembly structure of aircraft, satellite and other spacecraft, and provide accurate boundary conditions for engineering analysis and simulation such as stress analysis and heat conduction analysis.
[0003] Although STP format files are widely used in many fields, most of them do not contain material properties, resulting in that most existing radiation simulation software does not support this format, and cannot meet the needs of radiation simulation, spacecraft and satellite anti-radiation evaluation and other scenarios. SUMMARY
[0004] The problem solved by the present application is how to convert an STP format file into a file that can be used for radiation simulation.
[0005] To solve the above problems, the present application provides a three-dimensional structure file conversion method, device, equipment and medium.
[0006] In a first aspect, the present application provides a three-dimensional structure file conversion method, comprising: obtaining geometric property data of an STP file; constructing a data structure for storing the geometric property data based on GDML specification; converting the geometric property data in the data structure into GDML format data and setting default values to obtain conversion data; storing the conversion data as a GDML text to obtain a GDML file.
[0007] Optionally, the conversion of the geometric property data in the data structure into GDML format data comprises: converting point data in the geometric property data into coordinate data in the GDML format data; converting surface and surface data in the geometric property data into triangular facet data in the GDML format data; converting material property data in the geometric property data into material definition data in the GDML format data.
[0008] Optionally, the data structure storing the geometric attribute data is constructed based on the GDML specification, and the data structure comprises: Based on the GDML specification, a structured data organization technique is used to construct classes and structures corresponding to GDML elements, wherein the GDML elements include geometric definitions, material definitions, and volume definitions. According to the constructed classes and structures, the data structure is obtained.
[0009] Optionally, the default values are set, and the setting comprises: The missing information is determined by comparing the geometric attribute data and the GDML elements. The missing information is set as the corresponding default value.
[0010] Optionally, the geometric attribute data of the STP file is obtained, and the obtaining comprises: An open-source geometry library is called by using a programming language to read the STP file and parse the geometric attribute data.
[0011] Optionally, after the conversion data is stored as a GDML text to obtain a GDML file, the method further comprises: The GDML file is verified by using a radiation transport simulation tool.
[0012] Optionally, before the geometric attribute data of the STP file is obtained, the method further comprises: The STP file to be converted is imported, and the integrity and standardization of the STP file are determined.
[0013] In a second aspect, the present application provides a three-dimensional structure file conversion device, comprising: An acquisition module is configured to acquire geometric attribute data of an STP file. A construction module is configured to construct a data structure storing the geometric attribute data based on a GDML specification. A conversion module is configured to convert the geometric attribute data in the data structure into GDML format data, set default values, and obtain conversion data. A file module is configured to store the conversion data as a GDML text to obtain a GDML file.
[0014] In a third aspect, the present application provides an electronic device comprising a memory and a processor. The memory is configured to store a computer program. The processor is configured to implement the three-dimensional structure file conversion method of the first aspect when the computer program is executed.
[0015] In a fourth aspect, the present application provides a computer readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the three-dimensional structure file conversion method according to the first aspect is implemented.
[0016] The three-dimensional structure file conversion method, device, equipment and medium of the present application have the following advantages: First, the geometric attribute data of the STP file is obtained, laying a precise data foundation for subsequent conversion work and ensuring that the conversion process has reliable original data support. Then, the data structure for storing the geometric attribute data is constructed based on the GDML specification, so that the dispersed geometric attribute data can be sequentially carried according to a unified standard, improving the standardization of data storage and the smoothness of subsequent conversion. Subsequently, the geometric attribute data in the data structure is converted into GDML format data, realizing the adaptation of the geometric attribute data to the GDML format. By default value supplement, the necessary information of a certain type of GDML or the information of this type which is not explicitly specified in the STP file is set, avoiding the conversion problem caused by data loss and ensuring the integrity and effectiveness of the converted data. Finally, the converted data is stored as a GDML text to obtain a GDML file, so that the geometric attribute data of the STP file which is originally difficult to be directly applied to related scenes is converted into a standardized GDML file which can be directly used for radiation simulation, effectively improving the usability of the geometric attribute data of the STP file in the GDML adaptation scene. The whole process is closely linked, and efficient and standardized conversion of the geometric attribute data from the original format to the target usable format is gradually realized. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 A flowchart of the three-dimensional structure file conversion method provided by the embodiment of the present application is shown in the figure. Figure 2 A schematic diagram of the STP file provided by the embodiment of the present application is shown in the figure. Figure 3 A schematic diagram of radiation simulation provided by the embodiment of the present application is shown in the figure. Figure 4 A structural schematic diagram of the three-dimensional structure file conversion device provided by the embodiment of the present application is shown in the figure. Figure 5 A structural schematic diagram of the electronic device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0018] In order to make the above objectives, characteristics and advantages of the present application more apparent, concrete embodiments of the present application will be described in detail below with reference to the drawings. Although some embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein, but rather, these embodiments are provided so as to more thoroughly and completely understand the present application. It should be understood that the drawings and embodiments of the present application are merely for illustrative purposes, and are not intended to limit the scope of protection of the present application.
[0019] It should be understood that each of the steps recited in the method embodiments of the present application can be performed in different orders, and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0020] The term "comprising" and variations thereof as used herein are open-ended, that is "including, but not limited to"; the term "based on" is "based, at least in part, on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optional" means "optional in at least some embodiments". Related definitions are given throughout the detailed description. It should be noted that the concepts mentioned in the present application are merely for distinguishing different apparatuses, modules or units, and are not intended to limit the functions of these apparatuses, modules or units.
[0021] It should be noted that the modification of "one" or "more" mentioned in the present application is illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise explicitly stated in the context, it should be understood as "one or more".
[0022] The names of the messages or information exchanged between the plurality of apparatuses in the embodiments of the present application are merely for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0023] GDML (Geometry Description Markup Language) is an XML-based markup language, mainly used for describing geometry, material and detector. Compared with STP format, it can more comprehensively present the geometry, material properties and material radiation interaction parameters involved in radiation simulation, and support detailed parameterization description of materials. It is closely integrated with widely used radiation simulation software environments such as Geant4, and can be directly read and parsed by related software, providing strong adaptability of geometry and material information support for radiation simulation.
[0024] The GDML format is more suitable for accurate description of radiation simulation. After converting the STP format into the GDML format, the geometric and material information can be directly imported into a radiation simulation tool such as Geant4, thereby providing a convenient and consistent environment for simulation parameter setting and analysis, and providing technical support for aerospace vehicle development, engineering analysis and radiation protection design.
[0025] However, in the prior art, there is no technology for converting the STP format into the GDML format.
[0026] In view of the above technical problems, the embodiments of the present application provide a three-dimensional structure file conversion method, device, equipment and medium.
[0027] As shown in Figure 1 The three-dimensional structure file conversion method provided by the embodiments of the present application comprises the following steps. Obtain the geometric attribute data of the STP file.
[0028] Specifically, obtaining the geometric attribute data of the STP file refers to extracting information related to geometric structure from a three-dimensional model file conforming to the STEP (Standard for the Exchange of Product model data) standard, such as entity type, coordinate point, edge, face, voxel and topological relationship thereof. The STP file is as shown in Figure 2 This step identifies and extracts the core attributes for describing three-dimensional geometric shapes by analyzing the ISO 10303-21 format content inside the STP file, thereby providing a basis for the subsequent conversion to the GDML (Geometry Description Markup Language) format.
[0029] Based on the GDML specification, a data structure for storing the geometric attribute data is constructed.
[0030] Specifically, according to the requirements specified by the GDML, a data structure for storing the geometric attribute data is constructed, so that it can accurately map the geometric elements extracted from the STP to the entity types supported by the GDML and the corresponding parameter fields. The data structure needs to ensure that the geometric attribute data is logically consistent with the GDML semantics, thereby providing structured support for format conversion.
[0031] The geometric attribute data in the data structure is converted into GDML format data, and a default value is set to obtain conversion data.
[0032] In particular, the default value is a standard parameter value preset by the application according to the GDML specification and the radiation simulation requirement, which is used to supplement the missing information (such as material-related attributes) of a certain type of GDML required information in the original STP file or the information of the type that is not explicitly specified in the original STP file, that is, it is a standardized supplementary parameter for the missing information of the original file. And the default value can be modified by the user according to the actual scene, and is not a fixed value. The core function is to complete the necessary information of the GDML file to ensure that it can be normally parsed by the radiation simulation software. According to the syntax specification of GDML, the geometric attribute data in the data structure is converted into an intermediate representation conforming to GDML, and reasonable default values are assigned to the parameters of the type that are not explicitly specified in STP but required by GDML, to ensure that the generated GDML content is syntactically complete and can be correctly parsed by simulation tools such as Geant4, thereby bridging the semantic gap between the source format and the target format. The conversion data includes GDML format data and the set default values.
[0033] The conversion data is stored as a GDML text to obtain a GDML file.
[0034] In particular, the conversion data is stored as a GDML text with a ".GDML" suffix to obtain a GDML file, and the conversion is completed.
[0035] In this embodiment, the geometric attribute data of the STP file is first obtained to lay a precise data foundation for subsequent conversion work and ensure that the conversion process has reliable original data support. Then, the data structure for storing the geometric attribute data is constructed based on the GDML specification, so that the dispersed geometric attribute data can be orderly carried according to a unified standard, improving the standardization of data storage and the smoothness of subsequent conversion. Subsequently, the geometric attribute data in the data structure is converted into GDML format data, realizing the adaptation of the geometric attribute data to the GDML format, and the missing information of a certain type of GDML required information in the STP file or the information of the type that is not explicitly specified is supplemented by the default value, avoiding the conversion problem caused by data missing and ensuring the integrity and effectiveness of the conversion data. Finally, the conversion data is stored as a GDML text to obtain a GDML file, so that the geometric attribute data of the STP file, which is originally difficult to be directly applied to related scenes, is converted into a standardized GDML file that can be directly used for radiation simulation, effectively improving the usability of the geometric attribute data of the STP file in the GDML adaptation scene. The whole process is closely linked, and the efficient and standardized conversion of the geometric attribute data from the original format to the target usable format is gradually realized.
[0036] Optionally, the conversion of the geometric attribute data in the data structure into GDML format data includes: The point data in the geometric attribute data is converted into coordinate data in the GDML format data. converting the surface data in the geometric and attribute data into triangular facet data in the GDML format data; converting the material attribute data in the geometric and attribute data into material definition data in the GDML format data.
[0037] Specifically, in converting the geometric and attribute data into the GDML format data, first, for the point data in the STP file, it is converted one by one into the point data in the GDML format data <define>The coordinate data under the label "position" is stored in the "position" element, which explicitly indicates the coordinate name, unit, and x, y, z axis values. For example, the Cartesian point (0., 0., 0.) numbered #12 in the STP file is converted to the "center" coordinate data in GDML. Then, the curved surface and surface data in the geometric attribute data are processed. After analyzing the entity information such as curves and surfaces in the STP file, they are disassembled into a plurality of triangular facets according to the geometric topological relationship, and the "surface" element in the GDML format data is filled in. <solids>The triangular facets are associated with the "tessellated" element under the label, and each triangular facet explicitly indicates the coordinate references and types of the three vertices through the "triangular" label, ensuring that the shapes of the curved surfaces and surfaces are accurately restored in the GDML file. Finally, the material attribute data is processed. Since the STP file usually does not contain complete material information, the material-related attributes (or default material attributes) obtained by parsing are converted into the GDML format data <structure>The material definition data under the label is specified by a "materialref" element, and the material definition data not contained in the STP file is set to a default value, such as a default G4_Al, to realize the association of material properties with geometry. The three conversion steps are progressive, the point data conversion to coordinate data is the basis, providing data support for subsequent triangle patch construction, the curved surface and surface data conversion to triangle patch data is the core, guaranteeing accurate transmission of geometric morphology, and the material attribute data conversion to material definition data is a supplement, meeting the needs of radiation simulation for material information, and the three together ensure the complete and accurate conversion of geometric attribute data to the GDML format. The beneficial effects of the feature are that the geometric core features and necessary attribute information of the STP file can be restored in a targeted manner, so that the converted GDML file not only meets the accuracy requirements of geometric topology, but also has the material definition required by radiation simulation, greatly improving the adaptability of the GDML file to the radiation simulation software, and providing a reliable data basis for subsequent simulation calculation.
[0038] Optionally, the data structure for storing the geometric attribute data is constructed based on the GDML specification, and the method comprises the following steps: Based on the GDML specification, a structured data organization technique is used to construct classes and structures corresponding to GDML elements, wherein the GDML elements include geometric definition, material definition and volume definition; According to the constructed classes and structures, the data structure is obtained.
[0039] Specifically, when constructing the data structure for storing the geometric attribute data based on the GDML specification, first, the syntax rules and data requirements of the core elements such as geometric definition, material definition, and volume definition in the GDML specification are thoroughly combed, and structured data organization techniques such as XML parsing library and tools are used to design classes and structures corresponding to each GDML element. For example, a geometric definition class is constructed to store geometric basic data such as point coordinates and curve parameters; a material definition structure is designed to accommodate attribute information such as material type, density, and radiation interaction parameters; and a volume definition class is created to associate geometric structures with corresponding materials and clarify the mapping relationship between them. Subsequently, these independent classes and structures are combined according to the logical association of the GDML specification, and a complete data structure that can comprehensively accommodate the geometric attribute data of the STP file is formed through class inheritance and structure nesting, ensuring that each component of the data structure corresponds to an element of the GDML file. In the step of association, the classes and structures constructed are the core units of the data structure, the geometric definition class provides a geometric data storage framework for the data structure, the material definition structure supplements the physical attribute storage dimension, and the volume definition class realizes the organic combination of geometry and material. The three cooperate with each other and are logically coherent, together forming a data storage carrier that conforms to the GDML specification and providing a solid structural support for the subsequent conversion and storage of geometric attribute data. The beneficial effects of this feature are that through the design of structured classes and structures, the data structure strictly follows the GDML specification, ensuring the orderliness and logicality of the storage of geometric attribute data, facilitating quick mapping during subsequent data conversion, reducing the difficulty of modifying and maintaining the GDML file, and improving the standardization and operability of the entire conversion method.
[0040] Optionally, the setting of the default value comprises: comparing the geometric attribute data and the GDML elements to determine missing information; setting the missing information as the corresponding default value.
[0041] Specifically, the core defect of the original STP file is "not containing material attributes", and the GDML format as a special format for radiation simulation must contain material definitions (such as material name, density, and radiation interaction parameters) to be recognized by software such as Geant4. Therefore, the missing information refers to the GDML elements that are not in the geometric attribute data but are necessary, such as material definitions. By comparing the geometric attribute data and the GDML elements, the missing information can be determined, and the missing information can be set as the corresponding default value, such as setting the material as the default G4_Al, which can solve the core defect of the original STP file.
[0042] Optionally, the obtaining of the geometric attribute data of the STP file comprises: The open-source geometry library is called by using a programming language to read the STP file and parse the geometry attribute data.
[0043] Specifically, when obtaining the geometry attribute data of the STP file, a C++ programming language is used as a development basis, relevant interface functions of an open-source geometry library OpenCASCADE are called, and reading and parsing of the STP file are implemented by writing adaptive program codes. In a specific implementation, a program loads a target STP file through a file reading module provided by the OpenCASCADE library, uses a geometry entity parsing tool in the library to extract geometry entity information such as points, lines, curves, and surfaces in the file one by one, and records attribute data (such as entity identifiers and association relationships) corresponding to each entity, thereby providing complete original data for subsequent construction of a data structure based on a GDML specification. This step is a front-end core link of the entire conversion process, and through the synergistic effect of a programming language and an open-source geometry library, the completeness and accuracy of subsequent data conversion are directly determined. Only when the geometry attribute data of the STP file is accurately read and parsed, can subsequent data structure construction and format conversion work be effectively carried out. The feature has the beneficial effects that the C++ programming language has high execution efficiency and powerful underlying operation capability, the OpenCASCADE library has mature STP file parsing functions, and the combination of the two can quickly and accurately obtain the geometry attribute data in the STP file, avoids a complex process and potential errors of self-developed parsing tools, significantly improves the efficiency and reliability of data acquisition, and lays a foundation for the practicability of the entire conversion method.
[0044] Optionally, after the conversion data is stored as a GDML text to obtain a GDML file, the method further includes: The GDML file is verified by using a radiation transmission simulation tool.
[0045] Specifically, after the conversion data is stored as a GDML text and a GDML file is obtained, a radiation transport simulation tool verification step is added, and Geant4 is selected as the core verification tool. In specific implementation, the load_gdml.exe program of the G01 example in the Geant4 software is called, the generated GDML file is imported into the program, and the geometric structure integrity, topological relationship correctness, material association rationality and the like in the GDML file are comprehensively verified through the built-in geometric verification algorithm of the program. If geometric errors (such as vertex coordinate conflicts, triangular facet overlaps, volume association abnormalities and the like) are found in the verification process, the corresponding contents in the GDML file are manually modified according to the error prompt information output by the program, the GDML file is reimported into the program for verification after the errors are corrected, and the verification is completed after it is confirmed that there is no geometric error and the GDML file can be successfully read and correctly parsed by the load_gdml.exe program. This step forms a closed loop with the conversion and storage steps described above, and is a key link of GDML file quality control. Through the verification of the professional radiation transport simulation tool, the usability of the GDML file is directly verified, and the subsequent radiation simulation is avoided or the result is distorted due to hidden errors in the file. The beneficial effects of this feature are that, with the professional verification capability of mature radiation transport simulation tools such as Geant4, geometric problems in the GDML file can be accurately identified, it is ensured that the converted GDML file fully meets the use requirements of the radiation simulation software, the user does not need to perform complex file verification operations, the reliability and use efficiency of the GDML file are significantly improved, and the subsequent radiation transport and intersection calculation simulation are smoothly carried out.
[0046] Exemplarily, after it is verified that there is no geometric error, a radiation simulation tool can be used for radiation simulation, for example, the load_gdml.exe program in the G01 example in Geant4 is used to read the generated GDML file, and a gamma ray radiation simulation calculation effect is performed, and the simulation effect is as shown in Figure 3 .
[0047] Optionally, before the geometric attribute data of the STP file is acquired, the method further includes: The STP file that needs to be converted is imported, and the integrity and standardization of the STP file are determined.
[0048] Specifically, before acquiring the geometry attribute data of the STP file, the import and verification steps of the STP file are first performed. In specific implementation, the STP file that needs to be converted in format is loaded into the conversion system through a preset file import interface, and then a file verification program is started to detect the completeness and standardization of the imported STP file. The completeness detection mainly checks whether the file has problems such as content missing, data damage, and incomplete entity information (such as whether the definition of a key geometric entity is missing, and whether the data field is complete); the standardization detection verifies whether the file conforms to the open standard of the STP format (such as whether the ISO-10303-21 specification is followed, and whether the file structure meets the requirements of the general CAD data exchange format). If the detection finds that the file has completeness defects or standardization problems, the system will output corresponding prompt information, and the user can repair the file according to the prompt (such as supplementing the missing content and repairing the damaged data) or reacquire an STP file that meets the requirements, until the imported STP file passes the completeness and standardization verification, and then enters the subsequent geometry attribute data acquisition step. This step is a preparatory link of the entire conversion process, and its result directly affects the execution effect of all subsequent steps. Only by ensuring that the imported STP file is complete and meets the standard, can the problems such as data loss and parsing failure in the subsequent parsing process be avoided, and obstacles for the smooth development of the subsequent steps are cleared. The beneficial effects of this feature are that by verifying the completeness and standardization of the STP file in advance, the conversion process interruption or conversion result error caused by file problems is avoided from the source, invalid operations and repeated work are reduced, the execution efficiency and stability of the entire conversion method are significantly improved, and the quality of the final GDML file is guaranteed.
[0049] As shown in Figure 4 , the three-dimensional structure file conversion device provided by the embodiment of the application comprises: an acquisition module, configured to acquire geometry attribute data of an STP file; a construction module, configured to construct a data structure for storing the geometry attribute data based on a GDML specification; a conversion module, configured to convert the geometry attribute data in the data structure into GDML format data, set a default value, and obtain conversion data; a file module, configured to store the conversion data as a GDML text and obtain a GDML file.
[0050] As shown in Figure 5 , the electronic device 500 provided by the embodiment of the application comprises a memory 510 and a processor 520; the memory 510 is configured to store a computer program; and the processor 520 is configured to implement the three-dimensional structure file conversion method as described above when the computer program is executed.
[0051] Or, an electronic device 500, comprising a memory 510 and a processor 520 coupled to the memory 510; the memory 510 is configured to store a computer program; the processor 520 is configured to execute the following operations when executing the computer program: Obtain the geometric attribute data of the STP file; Based on the GDML specification, a data structure storing the geometric attribute data is constructed; The geometric attribute data in the data structure is converted into GDML format data, and a default value is set to obtain conversion data; The conversion data is stored as GDML text to obtain a GDML file.
[0052] The embodiment of the application provides a computer readable storage medium, and the storage medium stores a computer program.
[0053] Or, a non-volatile computer readable storage medium, the storage medium stores a computer program, when the computer program is executed by a processor, the processor executes the following operations: Obtain the geometric attribute data of the STP file; Based on the GDML specification, a data structure storing the geometric attribute data is constructed; The geometric attribute data in the data structure is converted into GDML format data, and a default value is set to obtain conversion data; The conversion data is stored as GDML text to obtain a GDML file.
[0054] Now, the electronic device 500 which can be a server or a client of the application will be described, which is an example of a hardware device that can be applied to various aspects of the application. The electronic device 500 is intended to represent various forms of digital electronic computer devices such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device 500 can also represent various forms of mobile devices such as personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the applications described and / or claimed in this document.
[0055] The electronic device 500 includes a computing unit that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). Various programs and data required for device operation can also be stored in the RAM. The computing unit, the ROM, and the RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.
[0056] The computer program product provided by the embodiment of the present application comprises a computer program, which, when executed by a processor, implements the method described above.
[0057] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiment methods. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM), a random access memory (RAM), or the like. In this application, the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place or distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present application. In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0058] Although the present application is disclosed as above, the protection scope of the present application is not limited to this. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application, and these changes and modifications will fall within the protection scope of the present application.< / structure> < / solids> < / define>
Claims
1. A method for converting three-dimensional structure files, characterized in that, include: Obtain the geometric attribute data of the STP file; Based on the GDML specification, construct a data structure to store the geometric attribute data; The geometric attribute data in the data structure is converted into GDML format data, and default values are set to obtain the converted data; The converted data is stored as GDML text to obtain a GDML file.
2. The three-dimensional structure file conversion method according to claim 1, characterized in that, The step of converting the geometric attribute data in the data structure into GDML format data includes: Convert the point data in the geometric attribute data into coordinate data in the GDML format data; Convert the surface and curved surface data in the geometric attribute data into triangular facet data in the GDML format data; The material property data in the geometric property data is converted into material definition data in the GDML format data.
3. The three-dimensional structure file conversion method according to claim 1, characterized in that, The data structure for storing the geometric attribute data, based on the GDML specification, includes: Based on the GDML specification, structured data organization technology is used to construct classes and structures corresponding to GDML elements, wherein the GDML elements include geometric definitions, material definitions and volume definitions; The data structure is obtained based on the constructed class and the constructed structure.
4. The three-dimensional structure file conversion method according to claim 3, characterized in that, The setting of default values includes: By comparing the geometric attribute data with the GDML elements, missing information is determined; Set the missing information to the corresponding default value.
5. The three-dimensional structure file conversion method according to claim 1, characterized in that, The process of obtaining the geometric attribute data of the STP file includes: A programming language is used to call an open-source geometry library to read the STP file and parse the geometric attribute data.
6. The three-dimensional structure file conversion method according to claim 1, characterized in that, After storing the converted data as GDML text to obtain a GDML file, the process further includes: The GDML file was examined using a radiative transfer simulation tool.
7. The three-dimensional structure file conversion method according to claim 1, characterized in that, Before obtaining the geometric attribute data of the STP file, the following steps are also included: Import the STP file that needs to be formatted and verify the integrity and standardization of the STP file.
8. A three-dimensional structure file conversion device, characterized in that, include: The acquisition module is used to acquire the geometric attribute data of the STP file; The building module is used to construct a data structure for storing the geometric attribute data based on the GDML specification; The conversion module is used to convert the geometric attribute data in the data structure into GDML format data, and set default values to obtain the converted data; The file module is used to store the converted data as GDML text to obtain a GDML file.
9. An electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to implement the three-dimensional structure file conversion method as described in any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the three-dimensional structure file conversion method as described in any one of claims 1 to 6.