CN117744198A - Model file processing method, device, equipment and storage medium - Google Patents

Model file processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN117744198A
CN117744198A CN202311459999.1A CN202311459999A CN117744198A CN 117744198 A CN117744198 A CN 117744198A CN 202311459999 A CN202311459999 A CN 202311459999A CN 117744198 A CN117744198 A CN 117744198A
Authority
CN
China
Prior art keywords
information
model
file
model file
data structure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311459999.1A
Other languages
Chinese (zh)
Inventor
魏启赟
杨小荻
何宛余
李沛文
刘旭东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Xkool Technology Co Ltd
Original Assignee
Shenzhen Xkool Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Xkool Technology Co Ltd filed Critical Shenzhen Xkool Technology Co Ltd
Priority to CN202311459999.1A priority Critical patent/CN117744198A/en
Publication of CN117744198A publication Critical patent/CN117744198A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The application relates to a method, a device, equipment and a storage medium for processing a model file. The method comprises the following steps: reading a model file to be processed and an expansion file associated with the model file, converting the model file and the expansion file into a data structure comprising a graphic element, an object and a model, wherein the model is at least matched with one object, the object is at least matched with one graphic element, the object and the model respectively have corresponding semantic information, graphic information and expansion information, responding to an instruction input by a user, executing operation related to the instruction on the semantic information, the graphic information and/or the expansion information in the data structure, or converting the data structure into a target model file corresponding to the instruction according to the instruction. The method integrates graphic data and semantic information in the model file by a lightweight, expandable and universal data structure, and is more suitable for an actual development mode.

Description

Model file processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing a model file.
Background
With the progress of computer technology and the development of industrial software, industrial drawing software and modeling software are widely used in various industries, and a file storing vector graphic data is generated therefrom. The file formats and graphic data structures corresponding to different software are often different, for example, building industry modeling software is taken as an example, CAD, rhino, revit is more software, which corresponds to dwg, 3dm and rvt respectively, and the three software are also different on the built-in graphic data structure, and most typically, different classifications and levels are set for graphic elements, which also makes the mutual conversion of graphic data between different software difficult.
In practical applications, in addition to the graphics data, the semantic information is also very important (i.e. the actual meaning corresponding to each graphic), and the software typically uses layers, groups, etc. to combine the graphics data with the semantic information. Wherein a Layer (Layer) is used to integrate various graphic data of the same Layer name, for example, in a dxf format model file, a Layer named "wall" can be used as a base file to seed all the graphic data related to "wall information". Groups (groups) are used to combine graphic data having a correlation so that they exist in an integrated form. For example, in a 3dm format model file, a group representing a "window" may consist of several window-related component models.
However, after obtaining the semantic information such as the graphic data and the layer group in the model file, it is difficult to further establish complete, detailed, coupled and matched semantic information for each graphic data, so there are many disadvantages in analyzing and subsequent operations of the file in practical development and application, specifically as follows:
1. when analyzing the model files (dwg, 3dm, rvt), a large amount of semantic data is lost, for example, data such as the map, texture and the like of the face pattern is lost, so that analysis cannot be performed;
2. the graphic data structures of the building industry modeling software are extremely complex and difficult to convert, and a data structure frame capable of accommodating different model graphic data and matching semantic information is lacked;
3. in building industry modeling software, the Revit software realizes the integration of space scale complex graphics and complex semantic information, and forms a BIM data structure framework by basic data and extension data. However, the BIM framework is too huge, and a lightweight data structure framework which can adapt to the actual development mode is needed in the actual application and development.
4. The model file has poor expansibility, the existing graphic data and matched semantic information are difficult to be reserved when the model file is displayed at a webpage end, and the steps of multiple data analysis and format conversion are often needed in an actual development mode;
Therefore, how to integrate graphic data and semantic information in model files and complement missing semantic information in a light, expandable and general data structure and processing mode when analyzing and processing model files produced by different industrial software has become a technical problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the foregoing, the present application provides a method, an apparatus, a device, and a storage medium for processing a model file, which aim to solve the above technical problems.
In a first aspect, the present application provides a method for processing a model file, where the method includes:
reading a model file to be processed and an expansion file associated with the model file;
converting the model file and the expansion file into a data structure comprising graphic elements, objects and models, wherein the models are at least matched with one object, the objects are at least matched with one graphic element, and the graphic elements, the objects and the models respectively have corresponding semantic information, graphic information and expansion information;
and responding to an instruction input by a user, executing an operation related to the instruction on semantic information, graphic information and/or expansion information in the data structure, or converting the data structure into a target model file corresponding to the instruction according to the instruction.
In a second aspect, the present application provides a processing apparatus for a model file, where the processing apparatus for a model file includes:
and a reading module: the method is used for reading a model file to be processed and an expansion file associated with the model file;
and a conversion module: the method comprises the steps of converting the model file and the expansion file into a data structure comprising graphic elements, objects and models, wherein the models are at least matched with one object, the objects are at least matched with one graphic element, and the graphic elements, the objects and the models respectively have corresponding semantic information, graphic information and expansion information;
and a response module: and the method is used for responding to the instruction input by the user, executing the operation related to the instruction on the semantic information, the graphic information and/or the expansion information in the data structure, or converting the data structure into the target model file corresponding to the instruction according to the instruction.
In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
And the processor is used for realizing the steps of the processing method of the model file according to any embodiment of the first aspect when executing the program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, implements the steps of the method for processing model files according to any of the embodiments of the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
and converting the model file and the expansion file into a data structure comprising the graphic element, the object and the model, wherein the model is at least matched with one object, the object is at least matched with one graphic element, and the graphic element, the object and the model respectively have corresponding semantic information, graphic information and expansion information. The graphic data and the semantic information in the model file to be processed are integrated to obtain a data structure with strong coupling of the graphic data and the semantic information, and the semantic information missing in the model file is complemented in the data structure due to the fact that the expansion file contains the semantic information missing in the model file, so that matching and integration of the semantic information and the data structure of the graphic element, the object and the model are realized. In addition, the data structure comprising the graphics primitive, the object and the model is lighter than the BIM data structure framework and is more suitable for the actual development mode. In addition, the data structure coupled with the graphic data and the semantic information can be communicated and transmitted in a multi-code environment according to instructions input by a user to obtain target model files in various file formats, and the integration of the graphic data and the semantic information in the model files to be processed can be realized in various application scenes in a light manner, so that the requirements in the actual application process are met.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow chart illustrating a preferred embodiment of a method for processing a model file of the present application;
FIG. 2 is a schematic diagram of the relationship among primitives, objects and models in the data structure of the present application;
FIG. 3 is a schematic diagram of a rectangular primitive and a cavitated cube primitive in an embodiment of the present application;
FIG. 4 is a schematic diagram of a residential project model file in an embodiment of the present application;
FIG. 5 is a schematic diagram of the present application for converting the residential project model files of FIG. 4 into a data structure;
FIG. 6 is a schematic diagram of the model of the residential project model file of FIG. 4 after being converted into a data structure in accordance with the present application;
FIG. 7 is a schematic illustration of an object contained in the model of FIG. 6 of the present application;
FIG. 8 is a schematic illustration of primitives contained within the model of FIG. 6 of the present application;
FIG. 9 is a schematic diagram of primitives included in the object of FIG. 7 of the present application;
FIG. 10 is a schematic illustration of an article included in the article of FIG. 7 of the present application;
FIG. 11 is a schematic illustration of an article included in the article of FIG. 10 of the present application;
FIG. 12 is a schematic illustration of a shadow object generated by the model of FIG. 6 of the present application;
FIG. 13 is a schematic diagram of a model file in dxf format for urban market place information in an embodiment of the application;
FIG. 14 is a schematic view of the object model file output after the model file of FIG. 13 is converted into a data structure;
FIG. 15 is a schematic block diagram of a processing device according to a preferred embodiment of the present application;
FIG. 16 is a schematic diagram of a preferred embodiment of the electronic device of the present application;
the realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The application provides a processing method of a model file. Referring to fig. 1, a method flow diagram of an embodiment of a processing method of the model file of the present application is shown. The method may be performed by an electronic device, which may be implemented in software and/or hardware. The processing method of the model file comprises the following steps:
step S10: reading a model file to be processed and an expansion file associated with the model file;
step S20: converting the model file and the expansion file into a data structure comprising graphic elements, objects and models, wherein the models are at least matched with one object, the objects are at least matched with one graphic element, and the graphic elements, the objects and the models respectively have corresponding semantic information, graphic information and expansion information;
step S30: and responding to an instruction input by a user, executing an operation related to the instruction on semantic information, graphic information and/or expansion information in the data structure, or converting the data structure into a target model file corresponding to the instruction according to the instruction.
In this embodiment, the model file to be processed refers to a model file that needs to be converted into a data structure including primitives, objects and models, and the model file to be processed may be a building industry model file such as a residential project model file, a business district building model file, and an urban planning model file. The model files to be processed can be read from a local database or downloaded and read from a third party database, and the formats of the model files to be processed can be dwg format, 3dm format, rvt format and the like.
The expansion file associated with the model file to be processed contains semantic information of missing model files, for example: mapping, material quality and self-defined semantic data. The extension file may be txt file, xlsx table file, json format file, picture, etc.
After the model file to be processed and the expansion file associated with the model file are read, the model file and the expansion file are converted into a data structure comprising the graphics primitive, the objects and the models, the models in the data structure are at least matched with one object in the data structure, the objects in the data structure are at least matched with the graphics primitive in the data structure, as shown in fig. 2, the relationship diagram of the graphics primitive, the objects and the models in the data structure is shown in the specification, the objects are the upper-level structure of the graphics primitive, the models are the upper-level structure of the objects, the objects and the objects can be mutually nested, the models can be formed by a plurality of objects and the graphics primitive, and the objects can be formed by a plurality of graphics primitive and objects. The primitives, objects and models in the data structure have corresponding semantic information, graphic information and expansion information respectively. Because the expansion file contains the semantic information of the missing model file, the data structure obtained by conversion is a data structure with strong coupling of the graphic data and the semantic information of the model, and the data structure can be compatible with multi-platform intercommunication and transmission and multi-file format conversion, and can meet different scene requirements in actual development.
The primitives in the data structure represent the minimum hierarchy in the parsed model file, and the storage class formed by the sub-divided graphic units and the auxiliary semantic information thereof is not needed. The graphic primitive comprises semantic information of the graphic primitive, graphic information of the graphic primitive and expansion information of the graphic primitive.
The semantic information of the primitive comprises the index number of the primitive, the name of the primitive and predefined semantic information matched with the primitive. Index numbers of primitives refer to index numbers unique to primitives for retrieving and distinguishing between different primitives. The primitive name represents the name of the primitive name. The predefined semantic information matched with the primitive is used for storing various custom semantic information matched with the primitive and is used for special requirements of unnecessary scenes.
The graphic information of the graphic element represents the related data of the minimum graphic unit contained in the graphic element, and the graphic information of the graphic element comprises graphic element data, graphic element types and custom graphic element data. Primitive data represents minimum graphic element data, such as: 1 point, 1 multi-segment line, 1 polygonal area, one cube, one triangular face. The graphic units are corresponding to the matched constructors, and can directly generate graphic entities and mutually convert in different model files. The primitive type represents the data type of the minimum graphic element data, which can be divided into different types of model files (i.e., model files of different modeling software) according to the types: points, labels, multi-segment lines, arcs, curves, polygons, planes, triangular faces, curved faces, cubes, and the like. Custom primitive data represents special minimum graphic element data such as: the plane with holes and the cube with holes are not of standard primitive types, but can be obtained through Boolean operation of primitives of the types, so that a Boolean operation mode (union, intersection and difference) and a plurality of minimum graphic units needing to be operated can be stored in custom primitive data. Fig. 3 is a schematic diagram of a rectangular primitive and a perforated cube primitive in the embodiment of the present application, where, taking the rectangular primitive as an example, primitive data corresponds to an outline polygon of a rectangle, and primitive types are polygons without custom primitive data. Taking a solid graphic element with holes as an example, the graphic element data is a complete solid without holes, the graphic element type is a solid, and the custom graphic element data comprises a Boolean operation mode of a difference set and the solid graphic element needing to be operated.
The expansion information of the graphic element is used for expanding attribute information which is mutually coupled with graphic information of the graphic element, the expansion information of the graphic element comprises graphic layer information, space information, material information and associated information, and the graphic layer information represents a graphic layer name and a graphic layer index corresponding to the graphic element in a model file to be processed. The spatial information represents spatial data related to the graphic element in three-dimensional space, for example: data values such as initial height, actual height, height interval, coordinate axis sequence and normal vector of the primitive. The texture information represents data information (dot-like or linear primitives are free of texture information) related to the texture of the surface layer of the planar/volumetric primitive in the three-dimensional space, for example: parameters such as the color or the material of the picture, the scaling of the picture, the rotation angle of the picture, the transparency, the diffuse reflection and the like corresponding to the picture element. The association information represents hierarchical data of the inter-association between the graphic elements, for example: tree structure, hierarchical relationship, upper level structure, etc. attributes between primitives and other structured data.
The objects in the data structure are of a higher hierarchical type above the primitives, and correspond to groups (i.e. combinations among the primitives) in the building industry modeling software, and it should be noted that the objects may also be formed by a plurality of objects, and the types of the objects may be mutually nested to implement a complex tree structure. The object in the data structure contains corresponding semantic information, graphic information and expansion information.
The semantic information of the object comprises an index number of the object, an object name and predefined semantic information matched with the object. The index number of an object represents an object-unique index number for retrieving and distinguishing between different objects. The item name represents the name of the item name. The predefined semantic information matched with the object is used for storing various custom semantic information matched with the object, and is used for avoiding special requirements of scenes.
The graphic information of the object represents the subset data structure (the graphic element and the object) contained in the object, and the graphic information of the object also stores a graphic element list after all the subset structures contained in the object are disassembled into the graphic elements.
The expansion information of the object is used for summarizing topology information of all the primitives, and is specifically divided into layer information, space information, material information and associated information. The layer information indicates that the object contains all layer names and layer indexes corresponding to all primitives in the model file to be processed (i.e., the model file before conversion). The spatial information represents spatial data related to the object in three dimensions, such as: the initial height, the actual height, the height interval, the coordinate axis sequence, the normal vector and other data values of the object. The material information indicates that the object contains data information related to the surface layer material of all the graphic elements in the three-dimensional space. The association information represents hierarchical data between the object and other data structures, such as: tree structure, hierarchical relationship, upper level structure, lower level structure, etc.
The model in the data structure corresponds to the original model file (i.e. the model file before conversion) and is used for storing all the primitives and object information in the model file. The model in the data structure contains corresponding semantic information, graphic information and expansion information. The semantic information of the model comprises an index number of the model, a model name and predefined semantic information matched with the model. The index number of a model represents a model-unique index number for retrieving and distinguishing between different models. The model name represents the name of the model naming. The predefined semantic information matched with the model is used for storing various custom semantic information matched with the model and is used for avoiding special requirements of scenes. The graphic information of the model represents the subset structures (primitives and objects) contained in the model, and a primitive list obtained by completely disassembling all the subset structures into primitives is stored in the graphic information of the model.
The expansion information of the model is used for summarizing topology information of all the primitives, and is specifically divided into layer information, space information, material information and associated information. The layer information represents all layer names and layer indexes of the model. The spatial information represents spatial data related to the model in three-dimensional space, such as: data values such as initial height, actual height, height interval, coordinate axis sequence and normal vector. The texture information represents data information related to all textures contained in the model. The association information represents global tree information of the model.
Graphic data and semantic information of different types and levels in a model file to be processed can be conveniently converted into the data structure frame through the data structure frames of the graphic elements, the objects and the models, and matching and integration of multi-format and multi-type semantic information and the data structures of the graphic elements, the objects and the models are realized. Meanwhile, the data structure not only comprises the graph in the original model file and the attached attribute thereof, but also can be compatible with multiple requirements in actual development.
The converting the model file and the expansion file into a data structure including a graphic element, an object and a model includes:
analyzing the model file to obtain a graph, a layer and a group of the model file, wherein the group is a combination of graphs with association relations;
and converting the graph, the layer and the group of the model file into the primitive, the object and the model of the data structure.
And analyzing the model file to be processed in dwg format, 3dm format or rvt format to obtain information such as graphics, layers, groups and the like of the model file, converting the information such as the graphics, the layers, the groups and the like into corresponding graphics, objects and models in the data structure, and automatically generating semantic information, graphic information and expansion information corresponding to the graphics, the objects and the models.
Further, the converting the model file and the expansion file into a data structure including primitives, objects and models includes:
reading semantic data of the expansion file;
and creating new primitives, new objects and new models corresponding to the semantic data of the expansion file in the data structure according to the semantic data of the expansion file, or performing association binding on the semantic data of the expansion file and the corresponding primitives, objects and models in the data structure.
The expansion file contains the semantic data of the to-be-processed model file, so that the expansion file can be used as the supplement of the to-be-processed model file, and the semantic data of the expansion file can be read, for example: mapping, material quality and self-defined semantic data. And associating and binding the semantic data with the corresponding primitive, object and model in the data structure, and if no corresponding primitive, object and model are associated, creating a new primitive, new object and new model corresponding to the semantic data in the data structure.
For the data structure, related operations can be performed on the data structure according to operation instructions input by a user in an interactive interface, the instructions can be calculation instructions, editing instructions, modification instructions and the like, and when the instructions are input by the user, the front end responds to the instructions input by the user to execute operations related to the instructions on semantic information, graphic information and/or expansion information in the data structure, or convert the data structure into target model files corresponding to the instructions according to the instructions.
Specifically, the performing the operation related to the instruction on the semantic information, the graphic information and/or the expansion information in the data structure includes:
performing at least one of moving, rotating, copying, scaling, mapping, combining, decomposing, finding, and filtering on the graphical information in the data structure;
integrating the graphic information and the semantic information in the data structure to obtain an integration result, and calculating index information of the integration result, wherein the index information comprises at least one of volume rate, building density and area information. The graphic information and the site sunshine information in the data structure can be integrated, so that the graphic information of the corresponding shadow can be calculated.
Specifically, the converting the data structure into the target model file corresponding to the instruction according to the instruction includes:
and converting the data structure into at least one target model file in dwg format, 3dm format, rvt format and dae format for subsequent deepening operation. In practical application, the data structure can be transmitted to the front end, and the front end can be used for analyzing and reconstructing the data structure, so that the data structure format can be converted into json data stream and transmitted to the front end interface.
The data structure coupled with the semantic information and the graphic data can be communicated and transmitted in a multi-code environment (such as Python, C#, C++, java, javascript), can be exported into a plurality of file formats (json, txt, xlsx, dwg, 3dm, rvt, dae), can realize the integration of the graphic data, the semantic information and the expansion information in the model file to be processed in various application scenes in a light-weight manner, and meets the requirements in the actual application process.
Taking a model file to be processed as a model file of a residential project in a 3dm format as an example, the scheme is further described. As shown in fig. 4, a schematic diagram of a residential project model file in an embodiment of the present application, where the residential project model file includes a project contour and 4 buildings (project residences 1 through 3, and project high-rise residence 4) therein, and 5 existing buildings exist in the base contour at the same time. Fig. 5 is a schematic diagram of the residential project model file of fig. 4 converted into a data structure, and it should be noted that the names marked in fig. 5 are primitive names, not index numbers. FIG. 6 is a schematic diagram of the model of the residential project model file of FIG. 4 after being converted into a data structure in accordance with the present application. The model of the house item is all geometric information and semantic information contained in the entire base, and as shown in fig. 7, is a schematic diagram of an object (building of the house 1 of the house item) contained in the model of the house item. As shown in fig. 8, a schematic diagram of a primitive (existing building volume outlide-Public-1) included in a model of a residential project is shown. As shown in fig. 9, a schematic diagram of the primitives contained in the article of fig. 7, the primitives being the roof of the project home 1, of the pyramid type. As shown in fig. 10, a schematic diagram of an object included in the object of fig. 7, for example: the 4 th floor of the project house 1, the floor object contains all the geometric primitives of the floor and the information thereof, and also contains the rest of the semantic information of the floor. As shown in fig. 11, which is a schematic view of the object included in the object of fig. 10, the balcony 2 of the 4 th floor of the item home 1.
After the residence project model file is converted into the data structure, the indexes such as the volume rate, the building density and the building area of the residence project can be rapidly calculated by directly indexing the area semantic information stored by the graph, and geometric calculation is not required to be repeated because the indexes are the area semantic information stored by the graph, so that the calculation efficiency can be improved. Shadow geometries may also be generated from the transformed data structure, and the user may control the direction of shadows by means of a vector of sunlight or a set of latitude and longitude, date and time data, which are stored as items in the model, as shown in fig. 12, which is a schematic diagram of shadow items generated by the model of fig. 6. After the model is read, json files or model files in the formats of dwg, 3dm, rvt and the like can be conveniently generated for subsequent deepening operation.
The scheme is further described by taking a model file to be processed as an urban model file as an example. As shown in fig. 13, a model file diagram in dxf format of urban market place information uploaded by a user is shown. Because the geometric and semantic information of the city model file is complex, the screening and searching difficulties are high, and great difficulty is usually brought to a designer in the design stage, and after the city model file is converted into the data structure, the primitives in the city space can be rapidly displayed, classified and searched in different layers, so that the workflow of a user is greatly simplified, and the time consumption and the information deviation are reduced. Meanwhile, secondary information is hidden, primary information is highlighted, a clear analysis expression model can be quickly rendered at the front end, a user can align and drag, zoom and the like, subjective perception and accurate statistics of complex city information are facilitated, and as shown in fig. 14, the model file in fig. 13 is converted into a target model file schematic diagram which is output after a data structure.
Referring to fig. 15, a functional block diagram of a processing apparatus 100 according to the present application model is shown.
The processing device 100 for model files described in the present application may be installed in an electronic device. The processing device 100 of the model file may include a reading module 110, a converting module 120, and a responding module 130 according to the implemented functions. The modules described herein, which may also be referred to as units, refer to a series of computer program segments, which can be executed by a processor of an electronic device and perform fixed functions, are stored in a memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the reading module 110: the method is used for reading a model file to be processed and an expansion file associated with the model file;
the conversion module 120: the method comprises the steps of converting the model file and the expansion file into a data structure comprising graphic elements, objects and models, wherein the models are at least matched with one object, the objects are at least matched with one graphic element, and the graphic elements, the objects and the models respectively have corresponding semantic information, graphic information and expansion information;
response module 130: and the method is used for responding to the instruction input by the user, executing the operation related to the instruction on the semantic information, the graphic information and/or the expansion information in the data structure, or converting the data structure into the target model file corresponding to the instruction according to the instruction.
In one embodiment, the converting the model file and the extension file into data structures including primitives, artifacts, and models includes:
analyzing the model file to obtain a graph, a layer and a group of the model file, wherein the group is a combination of graphs with association relations;
and converting the graph, the layer and the group of the model file into the primitive, the object and the model of the data structure.
In one embodiment, the converting the model file and the extension file into data structures including primitives, artifacts, and models includes:
reading semantic data of the expansion file;
and creating new primitives, new objects and new models corresponding to the semantic data of the expansion file in the data structure according to the semantic data of the expansion file, or performing association binding on the semantic data of the expansion file and the corresponding primitives, objects and models in the data structure.
In one embodiment, the performing the operation related to the instruction on the semantic information, the graphics information, and/or the expansion information in the data structure includes:
performing at least one of moving, rotating, copying, scaling, mapping, combining, decomposing, finding, and filtering on the graphical information in the data structure;
Integrating the graphic information and the semantic information in the data structure to obtain an integration result, and calculating index information of the integration result, wherein the index information comprises at least one of volume rate, building density and area information.
In one embodiment, the converting the data structure into the object model file corresponding to the instruction according to the instruction includes:
the data structure is converted to at least one object model file in dwg format, 3dm format, rvt format, and dae format.
In one embodiment, the semantic information of the primitive includes an index number of the primitive, a primitive name, and predefined semantic information matched with the primitive;
the semantic information of the object comprises an index number of the object, an object name and predefined semantic information matched with the object;
the semantic information of the model comprises an index number of the model, a model name and predefined semantic information matched with the model.
In one embodiment, the expansion information of the primitive is used for expanding attribute information which is mutually coupled with the graphic information of the primitive;
the expansion information of the object is used for summarizing topology information of all the primitives contained in the object;
The expansion information of the model is used for summarizing topology information of all the primitives contained in the model.
Referring to fig. 16, a schematic diagram of a preferred embodiment of an electronic device 1 according to the present application is shown.
The electronic device 1 includes, but is not limited to: memory 11, processor 12, display 13, and communication interface 14. The electronic device 1 is connected to a network via a communication interface 14. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, GSM), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, or a call network.
The memory 11 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 11 may be an internal storage unit of the electronic device 1, such as a hard disk or a memory of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are equipped in the electronic device 1. Of course, the memory 11 may also comprise both an internal memory unit of the electronic device 1 and an external memory device. In this embodiment, the memory 11 is typically used to store an operating system and various application software installed in the electronic device 1, such as program codes of the processing program 10 of the model file. Further, the memory 11 may be used to temporarily store various types of data that have been output or are to be output.
Processor 12 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 12 is typically used for controlling the overall operation of the electronic device 1, e.g. performing data interaction or communication related control and processing, etc. In this embodiment, the processor 12 is configured to execute the program code or process data stored in the memory 11, for example, the program code of the process program 10 running the model file, and so on.
The display 13 may be referred to as a display screen or a display unit. The display 13 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an Organic Light-Emitting Diode (OLED) touch device, or the like in some embodiments. The display 13 is used for displaying information processed in the electronic device 1 and for displaying a visual work interface.
The communication interface 14 may alternatively comprise a standard wired interface, a wireless interface, such as a WI-FI interface, which communication interface 14 is typically used for establishing a communication connection between the electronic device 1 and other electronic devices.
Fig. 16 shows only the electronic device 1 with components 11-14 and the handler 10 of the model file, but it is understood that not all shown components are required to be implemented, and that more or fewer components may alternatively be implemented.
Optionally, the electronic device 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an Organic Light-Emitting Diode (OLED) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device 1 and for displaying a visual user interface.
The electronic device 1 may further comprise Radio Frequency (RF) circuits, sensors and audio circuits etc., which are not described here.
In the above embodiment, the processor 12 may implement the following steps when executing the processing program 10 of the model file stored in the memory 11:
reading a model file to be processed and an expansion file associated with the model file;
converting the model file and the expansion file into a data structure comprising graphic elements, objects and models, wherein the models are at least matched with one object, the objects are at least matched with one graphic element, and the graphic elements, the objects and the models respectively have corresponding semantic information, graphic information and expansion information;
And responding to an instruction input by a user, executing an operation related to the instruction on semantic information, graphic information and/or expansion information in the data structure, or converting the data structure into a target model file corresponding to the instruction according to the instruction.
The storage device may be the memory 11 of the electronic device 1, or may be another storage device communicatively connected to the electronic device 1.
For a detailed description of the above steps, refer to the functional block diagram of the embodiment of the processing apparatus 100 for model files shown in fig. 15 and the flowchart of the embodiment of the processing method for model files shown in fig. 1.
Furthermore, the embodiments of the present application also propose a computer-readable storage medium, which may be non-volatile or volatile. The computer readable storage medium may be any one or any combination of several of a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, etc. The computer readable storage medium includes a storage data area and a storage program area, the storage program area stores a processing program 10 of a model file, and the processing program 10 of the model file realizes the following operations when being executed by a processor:
Reading a model file to be processed and an expansion file associated with the model file;
converting the model file and the expansion file into a data structure comprising graphic elements, objects and models, wherein the models are at least matched with one object, the objects are at least matched with one graphic element, and the graphic elements, the objects and the models respectively have corresponding semantic information, graphic information and expansion information;
and responding to an instruction input by a user, executing an operation related to the instruction on semantic information, graphic information and/or expansion information in the data structure, or converting the data structure into a target model file corresponding to the instruction according to the instruction.
The embodiment of the computer readable storage medium of the present application is substantially the same as the embodiment of the method for processing the model file, and will not be described herein.
It should be noted that, the foregoing embodiment numbers are merely for describing the embodiments, and do not represent the advantages and disadvantages of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, including several instructions for causing a terminal device (which may be a mobile phone, a computer, an electronic device, or a network device, etc.) to perform the method described in the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (10)

1. A method for processing a model file, the method comprising:
Reading a model file to be processed and an expansion file associated with the model file;
converting the model file and the expansion file into a data structure comprising graphic elements, objects and models, wherein the models are at least matched with one object, the objects are at least matched with one graphic element, and the graphic elements, the objects and the models respectively have corresponding semantic information, graphic information and expansion information;
and responding to an instruction input by a user, executing an operation related to the instruction on semantic information, graphic information and/or expansion information in the data structure, or converting the data structure into a target model file corresponding to the instruction according to the instruction.
2. The method for processing a model file according to claim 1, wherein the converting the model file and the extension file into a data structure including primitives, objects, and models comprises:
analyzing the model file to obtain a graph, a layer and a group of the model file, wherein the group is a combination of graphs with association relations;
and converting the graph, the layer and the group of the model file into the primitive, the object and the model of the data structure.
3. The method for processing a model file according to claim 1 or 2, wherein the converting the model file and the extension file into a data structure including primitives, objects, and models includes:
reading semantic data of the expansion file;
and creating new primitives, new objects and new models corresponding to the semantic data of the expansion file in the data structure according to the semantic data of the expansion file, or performing association binding on the semantic data of the expansion file and the corresponding primitives, objects and models in the data structure.
4. The method for processing the model file according to claim 1, wherein the performing the operation related to the instruction on the semantic information, the graphic information and/or the expansion information in the data structure includes:
performing at least one of moving, rotating, copying, scaling, mapping, combining, decomposing, finding, and filtering on the graphical information in the data structure;
integrating the graphic information and the semantic information in the data structure to obtain an integration result, and calculating index information of the integration result, wherein the index information comprises at least one of volume rate, building density and area information.
5. The method for processing a model file according to claim 1, wherein the converting the data structure into the target model file corresponding to the instruction according to the instruction includes:
the data structure is converted to at least one object model file in dwg format, 3dm format, rvt format, and dae format.
6. The method for processing a model file according to claim 1, wherein the semantic information of the primitive includes an index number of the primitive, a primitive name, and predefined semantic information matched with the primitive;
the semantic information of the object comprises an index number of the object, an object name and predefined semantic information matched with the object;
the semantic information of the model comprises an index number of the model, a model name and predefined semantic information matched with the model.
7. The method for processing a model file according to claim 1, wherein the expansion information of the primitive is used for expanding attribute information mutually coupled with graphic information of the primitive;
the expansion information of the object is used for summarizing topology information of all the primitives contained in the object;
the expansion information of the model is used for summarizing topology information of all the primitives contained in the model.
8. A processing apparatus for a model file, the apparatus comprising:
and a reading module: the method is used for reading a model file to be processed and an expansion file associated with the model file;
and a conversion module: the method comprises the steps of converting the model file and the expansion file into a data structure comprising graphic elements, objects and models, wherein the models are at least matched with one object, the objects are at least matched with one graphic element, and the graphic elements, the objects and the models respectively have corresponding semantic information, graphic information and expansion information;
and a response module: and the method is used for responding to the instruction input by the user, executing the operation related to the instruction on the semantic information, the graphic information and/or the expansion information in the data structure, or converting the data structure into the target model file corresponding to the instruction according to the instruction.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method for processing a model file according to any one of claims 1 to 7 when executing a program stored on a memory.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of processing a model file according to any one of claims 1 to 7.
CN202311459999.1A 2023-11-03 2023-11-03 Model file processing method, device, equipment and storage medium Pending CN117744198A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311459999.1A CN117744198A (en) 2023-11-03 2023-11-03 Model file processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311459999.1A CN117744198A (en) 2023-11-03 2023-11-03 Model file processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117744198A true CN117744198A (en) 2024-03-22

Family

ID=90257994

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311459999.1A Pending CN117744198A (en) 2023-11-03 2023-11-03 Model file processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117744198A (en)

Similar Documents

Publication Publication Date Title
CN109408044B (en) BIM data and GIS data integration method based on glTF
CN105701103B (en) Three-dimensional application system based on geographic information
CN110704928B (en) Method for converting BIM model into GIS model
EP2892028A2 (en) Updating of 3D CAD models based on augmented-reality
CN112053130A (en) Pumped storage power station integrated management method, platform, system, equipment and medium
KR101741015B1 (en) Integrated analysis system and integrated analysis method for interpretting environmental performanceenergy of apartment
CN112559667B (en) Map editor, map engine, map editing system, map editing method, and storage medium
CN111008422A (en) Building live-action map making method and system
CN106611438B (en) Local area updating and map cutting method and device of three-dimensional simulation map
CN111080791A (en) Building analysis method and system based on lightweight BIM model
KR20210049498A (en) Method of extracting and converting BIM data for Web Browser and VR/AR Application
CN108958611B (en) Information editing method and device
CN114969586A (en) BIM (building information modeling) graphic engine loading method and device based on WEB side
CN115205484B (en) Three-dimensional space display method, device, equipment and medium for historical culture block
CN112685616A (en) Precise power component management method based on space grid and building information model
CN112053440A (en) Method for determining individualized model and communication device
CN115017348A (en) Method and device for realizing grid data graph
CN111177812A (en) Web map construction method and device containing closed space
CN116982087A (en) Method, apparatus and computer program product for constructing and configuring a model of a three-dimensional space scene
CN114676299A (en) 3D visualization display method and system for classical garden knowledge graph
CN112182279B (en) Indoor self-positioning method and equipment based on discrete grid and image matching
Preka et al. 3D building modeling in LoD2 using the CityGML standard
CN117290918A (en) Grasshopper-based building total plane generation method, system, medium and equipment
CN116842121A (en) Multi-level tile combined large-scale digital twin scene construction method
CN117744198A (en) Model file processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination