A method and device for quickly converting 3D model scene data and CAD drawings based on DXF file technology

Through the three-dimensional model and two-dimensional drawing conversion method based on DXF file technology, using JSON format and DXF code combination, combined with CAD analysis system and relational database, the problem of three-dimensional model and two-dimensional drawing conversion is solved, and a fast and standardized drawing solution is realized.

CN115758494BActive Publication Date: 2025-08-19KUNMING KSEC LOGISTIC INFORMATION IND
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211483219.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-24
Publication Date
2025-08-19
Estimated Expiration
2042-11-24

AI Technical Summary

Technical Problem

In the prior art, the conversion between three-dimensional models and two-dimensional drawings is difficult to achieve rapid and standardized, resulting in poor communication effects and low drawing efficiency, especially the uneven drawing quality of different engineers.

Method used

Using the method based on DXF file technology, the data conversion is achieved through the three-dimensional to two-dimensional and two-dimensional to three-dimensional processes, using JSON format and DXF codes, combining the CAD analysis system and relational database management of the three-dimensional model and two-dimensional tiles, the standard modular processing of the model is realized.

Benefits of technology

It realizes rapid and standardized conversion between three-dimensional models and two-dimensional drawings, improves drawing efficiency and communication effects, reduces drawing errors, and ensures the standardization of drawings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115758494B_ABST
    Figure CN115758494B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for rapidly converting three-dimensional model scene data and CAD drawings based on DXF file technology, belonging to the field of drawing, including: 3D to 2D conversion: transmitting the three-dimensional scene data in JSON format to a CAD parsing system for processing; traversing the device data in the three-dimensional scene data, finding the data of the corresponding CAD standard blocks, and processing the CAD blocks according to the device data; writing the CAD blocks generated after all device processing into the DXF file in the form of DXF group codes to form a two-dimensional drawing of the scene; 2D to 3D conversion: using the DXF file of the two-dimensional drawing of the scene as input information, reading the DXF file content through a file IO interface, parsing the group code information; generating scene data in JSON format based on the parsing; finding the three-dimensional model information of the corresponding device based on the device information in the JSON format scene data; and rendering the corresponding three-dimensional model scene. The present invention realizes the rapid conversion of three-dimensional scenes and two-dimensional drawings, as well as the standardization of drawing, thereby improving drawing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of drawing, and in particular to a method and device for quickly converting three-dimensional model scene data and CAD drawings based on DXF file technology. Background Art

[0002] At present, when communicating with customers about 3D construction plans, the plans are mainly explained to customers through verbal communication and CAD drawings. However, the CAD drawings are not intuitive, especially for non-professionals. They cannot quickly and intuitively understand the overall plan and cannot fully reflect the effect of the specific implementation plan of 3D construction, resulting in poor communication effect. When signing a contract with the customer, the plan needs to be implemented on a 2D CAD drawing. It is time-consuming for engineers to draw CAD drawings based on the 3D scene from scratch. In addition, different drawing engineers have different experiences and may draw different drawings, resulting in uneven drawing quality.

[0003] Therefore, it is necessary to design a device that can quickly generate three-dimensional scenes based on CAD drawings, so as to explain the specific implementation plan to customers conveniently and intuitively. At the same time, it can also independently build three-dimensional scenes and implement the plans on two-dimensional CAD drawings, so as to achieve a plan and device that can quickly convert three-dimensional scenes and two-dimensional drawings. Summary of the Invention

[0004] The purpose of the present invention is to provide a method and device for quickly converting three-dimensional model scene data into CAD drawings based on DXF file technology to solve the problem of difficult conversion between three-dimensional models and two-dimensional drawings, and to achieve standard and fast conversion between three-dimensional models and two-dimensional drawings.

[0005] The technical solutions of the present invention are as follows:

[0006] The present invention discloses a method for quickly converting three-dimensional model scene data and CAD drawings based on DXF file technology, comprising:

[0007] 3D to 2D conversion: 3D scene data is transmitted to the CAD parsing system in JSON format for processing; the device data in the 3D scene data is traversed to find the corresponding CAD standard block data, and the CAD blocks are processed according to the device data; the CAD blocks generated after all device processing are written into the DXF file according to the DXF group code method to form a 2D drawing of the scene;

[0008] 2D to 3D conversion: Take the DXF file of the scene's 2D drawing as input information, read the DXF file content through the file IO interface code, and parse the group code information; generate scene data in JSON format based on the parsed information; find the 3D model information of the corresponding device based on the device information in the JSON format scene data; and render the corresponding 3D model scene.

[0009] Preferably, in the conversion from 3D to 2D, the method for processing CAD blocks includes calculating the curve in the curved track, and using three points to calculate the convexity of the curve: assuming that the track equipment information contains the curve starting point p1 (x1, y1), the curve end point p2 (x2, y2), and the curve center p (x, y), b is the intermediate value, and bulge is the curve convexity. According to the definition of convexity in AutoCAD:

[0010] x=(x1+x2-(y2-y1)*b) / 2

[0011] y=(y1+y2+(x2-x1*b) / 2

[0012] b=(1 / bulge-bulge) / 2

[0013] We get: b = (x1 + x2 - 2*x) / (y2 - y1)

[0014] Curve convexity

[0015] Preferably, the method for processing a CAD block includes:

[0016] Processing CAD block coordinates: First, swap the y-axis and z-axis coordinates of the 3D device, then assign the xyz coordinate data of the 3D device to the 2D device CAD block in the form of DXF group codes; after reading the device information, recalculate the center of the drawing based on the length and width of the device;

[0017] Processing CAD block scaling: multiply the length, width, and height of the CAD block by the x, y, and z-axis scaling values in the device information; processing device height: determine whether the current device is above the ground based on the device's z-axis height, and write the device floor height into the additional attributes of the CAD block;

[0018] Processing models that require dynamic generation of multiple layers and columns: Use basic primitives for drawing, and generate the CAD blocks of each model by assembling polygon LwpolyLine primitives;

[0019] Handling equipment on the same floor: Group the equipment on the same floor according to the information of the floor where the equipment is located. Grouping method: Use DXF group code to assign the same group code to the equipment on the same floor.

[0020] As a preferred method, the center of the graphics is recalculated as follows:

[0021] Get the maximum and minimum x-axis coordinates and the maximum and minimum y-axis coordinates of the graph, record them as xMax, xMin, yMax, yMin respectively, set the coordinates of the center of the graph (xCenter, yCenter), set the horizontal length in the x direction as xLength, and the vertical length in the y direction as yLength,

[0022] xLength = xMax - xMin

[0023] yLength = yMax - yMin

[0024] Get the coordinates of the center of the graphics (xCenter, yCenter)

[0025] xCenter=xMin+xLength / 2

[0026] yCenter=yMin+yLength / 2.

[0027] Preferably, after receiving the 3D scene data, the CAD parsing system first performs MD5 encoding on the 3D scene data, and then compares whether the corresponding 3D scene data exists in the database. If so, it directly returns the parsed DXF file for the user to download, otherwise it starts to traverse the device data in the 3D scene.

[0028] Preferably, the three-dimensional scene data includes: all device information of the scene, each device information includes the device ID, size, coordinates, rotation, scaling, and plane number.

[0029] Preferably, when traversing the device data in the three-dimensional scene data, if the device model cannot be correctly matched to the CAD standard block, a preset default block is used for drawing.

[0030] Preferably, in the conversion from 2D to 3D, parsing the group code information includes Block segment group code parsing and Entity segment group code parsing; the Block segment group code parsing: reads the Block segment group code, obtains the value of the device id that has a one-to-one correspondence with the standard model in the database, and customized model properties.

[0031] Preferably, the Entity segment group code parsing: reads the Entity segment group code to obtain coordinates, deformation, and custom attribute information; according to the specific graphics, splits into multiple graphic objects: straight line object Line, polygon object LwpolyLine, circle object Ellipse, each graphic object is responsible for parsing and assembling its own graphic elements.

[0032] The present invention discloses a device for rapidly converting three-dimensional model scene data and CAD drawings based on DXF file technology, comprising: a CAD parsing system, a 3D system and a relational database; the CAD parsing system comprises a three-dimensional model standard library and two-dimensional standard CAD blocks, and performs standard module processing on the CAD blocks; the relational database is used to manage and store the association between the three-dimensional model and the two-dimensional blocks; the 3D system is used to build and render three-dimensional model scenes and parse group code information.

[0033] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0034] 1. The present invention solves the problem of difficulty in converting between three-dimensional model scenes and two-dimensional drawings. It can convert two-dimensional drawings into three-dimensional model scenes, and can also convert three-dimensional model scenes into two-dimensional drawings.

[0035] 2. The present invention realizes the rapid conversion between three-dimensional scenes and two-dimensional drawings. The three-dimensional scene is quickly converted into a two-dimensional drawing after parsing and CAD block processing; the two-dimensional drawing is quickly converted into scene data in JSON format after Block segment group code parsing and Entity segment group code parsing, and a three-dimensional model scene is rendered.

[0036] 3. This invention solves the problem that drawing cannot be standardized due to different drawing skill levels of different engineers. By performing standard modular processing on CAD blocks, each model has its own CAD block, and a relational database is used to manage the correspondence between three-dimensional models and two-dimensional blocks. The generated CAD drawings also avoid errors when converting three-dimensional models to two-dimensional graphics.

[0037] 4. Many models of the present invention are assembled into a set of scene JSON string data, which is transmitted to the web page. The web page renders the three-dimensional scene according to the scene data.

[0038] 5. When drawing CAD drawings, the present invention uses pre-set standard blocks for drawing, which is conducive to the standardization of drawing and reduces drawing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The present invention will now be described by way of example with reference to the accompanying drawings, in which:

[0040] Figure 1 This is a flow chart of converting a three-dimensional scene into a two-dimensional drawing in the present invention.

[0041] Figure 2 This is a flow chart of converting a two-dimensional drawing into a three-dimensional scene in the present invention.

[0042] Figure 3 3D scene diagram in the embodiment.

[0043] Figure 4 It is a two-dimensional CAD drawing schematic diagram in the embodiment.

[0044] Figure 5 Schematic diagram comparing DXF format and JSON format in the embodiment. DETAILED DESCRIPTION

[0045] All features disclosed in this specification, or all steps in the disclosed methods or processes, except mutually exclusive features and / or steps, can be combined in any manner.

[0046] Any feature disclosed in this specification (including any appended claims and abstract), unless otherwise stated, may be replaced by other equivalent or similar features. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.

[0047] The features and performance of the present invention are further described in detail below with reference to the embodiments.

[0048] like Figure 3 and 4 As shown in the figure, they are 3D scenes and 2D CAD drawings. 3D scenes can show the layout, structure and overall environment of the scene in a more three-dimensional and intuitive way. 2D CAD drawings can record the specific parameters of products and solutions, which is convenient for subsequent implementation. 3D scenes are suitable for presentations, as they have a good display effect. 2D CAD drawings are suitable for recording and displaying when delivering solutions or product designs. Figure 5 The following shows a 2D CAD DXF file and a 3D scene JSON file of a product or solution. The recorded information is different and needs to be converted to be displayed in the form of CAD or 3D model scene.

[0049] In order to achieve mutual conversion between three-dimensional scenes and two-dimensional drawings, the present invention discloses a method for quickly converting three-dimensional model scene data and CAD drawings based on DXF file technology, comprising:

[0050] 3D to 2D conversion: 3D scene data is transmitted to the CAD parsing system in JSON format for processing; the device data in the 3D scene data is traversed to find the corresponding CAD standard block data, and the CAD blocks are processed according to the device data; the CAD blocks generated after all device processing are written into the DXF file according to the DXF group code method to form a 2D drawing of the scene;

[0051] The process of converting 2D to 3D is as follows: after building the 3D scene, the scene data is passed to the CAD parsing system in JSON format for processing. The scene data contains all the device information of this scene, and each device has information such as size, coordinates, rotation, and scaling. After the backend obtains the 3D scene data, it traverses the devices in it. First, according to the device ID, it finds the corresponding CAD standard block in the database. Then, according to the information of the 3D device, it parses the coordinates, rotation and other information of the device and writes it into the DXF file. Some special models, such as tracks, will be specially processed. The DXF file after the traversal is completed is the final converted 2D drawing file. The final generated DXF file will be uploaded to the cloud document center for users to download. In particular, if the 3D scene has not changed since the last save, the last generated 2D drawing will be downloaded directly without the need to regenerate it.

[0052] 2D to 3D conversion: Take the DXF file of the scene's 2D drawing as input information, read the DXF file content through the file IO interface code, and parse the group code information; generate scene data in JSON format based on the parsed information; find the 3D model information of the corresponding device based on the device information in the JSON format scene data; and render the corresponding 3D model scene.

[0053] The 2D to 3D conversion process involves translating the contents of a DXF file into a JSON format readable by the 3D system. The DXF file is used as input, and the system's file I / O interface reads the DXF file contents. The device information contained within is then traversed and written to a JSON file. This file is then returned to the 3D system. The 3D system then uses the device information in the JSON to locate the corresponding device's 3D model in the database. After processing the device's coordinates, rotation, and other information, the system renders the corresponding 3D model scene in the 3D simulation design system.

[0054] like Figure 1 As shown in the figure, the specific process of converting 3D scenes to 2D drawings is as follows: build a 3D scene, export a 2D drawing, and determine whether the scene data exists; if the scene data already exists, obtain the DXF file from the cloud and return it to the browser through the file stream for the user to download; if the scene data does not exist, parse the scene JSON data;

[0055] Further determine whether it is a special device; if not, find the 2D block corresponding to the 3D model in the database; if the corresponding 2D block exists, process the coordinates of the block, scale, and rotate it; if the corresponding 2D block does not exist, use the default 2D block provided by the system, process the coordinates of the block, scale, and rotate it;

[0056] If it is determined to be a special device, further determine whether it is a track; if it is a track, the algorithm parses it into DXF and outputs a curve; if it is not a track, further determine whether it is a shelf; if it is a shelf, dynamically generate the shelf according to the shelf information of the device; if it is not a shelf, use the default two-dimensional block provided by the system; after completing the algorithm parsing into a curve that can be output by DXF, dynamically generating the shelf according to the shelf information of the device, and completing the processing of the block coordinates, scaling, and rotation, they are written into blank DXF files respectively; the DXF file is uploaded to cloud storage; and returned to the browser through the file stream for the user to download.

[0057] The CAD parsing system has two standard libraries: a 3D model library, which stores standard 3D models of equipment; and a 2D drawing library, which stores the corresponding 2D standard CAD blocks. The system associates the corresponding 3D models with the 2D blocks, and stores the relationship in a database for easy access during subsequent conversions.

[0058] In one embodiment, a method for converting a 3D scene into a CAD drawing is disclosed, and the specific implementation steps are as follows:

[0059] S1: Associate the standard 3D model with the standard 2D CAD block in the 3D system;

[0060] S2: Build a three-dimensional scene by dragging and dropping models in a 3D system;

[0061] S3: After the construction is completed, the CAD drawing is exported. At this time, the 3D system transmits the 3D scene data in JSON format to the CAD parsing system for processing. The JSON data contains all the devices in the 3D scene. Each device has its ID, coordinates, length, width, height, scale, rotation, plane number, floor location, etc.

[0062] S4: After receiving the scene data, the CAD parsing system first performs MD5 encoding on the JSON data, and then compares whether the corresponding scene data exists in the database. If so, it directly returns the parsed DXF file for the user to download. Otherwise, it starts to traverse the device data in the scene.

[0063] S5: After obtaining the device data, first determine whether it is a special model based on the device type. If it is not a special model, then find the standard CAD block corresponding to the device in the database based on the device ID, and then process the CAD block based on the device information. The specific processing method is as follows:

[0064] S5.1: If the device ID cannot be correctly matched to the standard CAD block, the pre-set default block is used for drawing;

[0065] S5.2: If there is a standard model, first process the coordinates of the CAD block; since the coordinates of the three-dimensional scene are divided into three axes: x, y, and z, and the z-axis in the three-dimensional system is the y-axis on the two-dimensional plane, first swap the y-axis coordinates and the z-axis coordinates of the three-dimensional device, and then assign the xyz coordinate data of the three-dimensional device to the two-dimensional device CAD block in the form of DXF group codes. Sometimes there is an error between the position of the model and the drawing. This is because the center of the model on the drawing is not the geometric center of the three-dimensional model. After reading the device information, the center of the graphic is recalculated according to the length and width of the device to solve the problem of position error. The method of recalculating the center of the graphic is to obtain the maximum and minimum x-axis coordinates and the maximum and minimum y-axis coordinates of the graphic, denoted as xMax, xMin, yMax, and yMin respectively, and set the coordinates of the center of the graphic (xCenter, yCenter), set the horizontal length in the x direction to xLength, and the vertical length in the y direction to yLength,

[0066] xLength = xMax - xMin

[0067] yLength = yMax - yMin

[0068] Get the coordinates of the center of the graphic:

[0069] xCenter=xMin+xLength / 2

[0070] yCenter=yMin+yLength / 2

[0071] Then process the scaling of the model. The device information will store the scaling values on the xyz axis. The CAD block needs to multiply the corresponding length, width and height by the scaling values on the corresponding coordinate axis to complete the scaling of the block.

[0072] S5.3: Determine whether the current device is above the ground based on the device's z-axis height. Because devices of different heights appear on the same plane in a 2D drawing, accurate representation of the height difference is required when converting to a 3D model. This invention writes the current device's floor height into an additional attribute of the CAD block to facilitate conversion to a 3D scene.

[0073] S5.4: If the model needs to be dynamically generated with multiple layers and columns, such as special equipment shelves, the number of layers and columns will change each time. In this case, basic primitives will be used for drawing. The 3D system data will transmit the shelf height, number of columns, and column width. The length and width of each shelf location can be assembled by assembling polygon LwpolyLine primitives to generate the shelf CAD block.

[0074] S5.5: If it is a curved track in special equipment, the calculation of the curve is solved by calculating the convexity of three points. The convexity of the curve needs to be calculated based on the starting point, end point and center point of the curve contained in the track equipment information. Use the group code provided by DXF to draw the corresponding curved track in the DXF file.

[0075] The calculation formula for convexity is: let the starting point p1 (x1, y1), the end point p2 (x2, y2), the center p (x, y), b is the middle value, bulge is the convexity, according to the definition of convexity in AutoCAD:

[0076] x=(x1+x2-(y2-y1)*b) / 2

[0077] y=(y1+y2+(x2-x1*b) / 2

[0078] b=(1 / bulge-bulge) / 2

[0079] get:

[0080] b=(x1+x2-2*x) / (y2-y1)

[0081]

[0082] S5.6: Group the devices on the same floor based on their floor information to facilitate dragging the entire floor on the CAD drawing. Use DXF group codes to assign the same group code to the devices on the same floor.

[0083] S5.7: Finally, all CAD blocks generated after processing by the equipment are written into the DXF file according to the DXF group code to form a complete scene 2D drawing;

[0084] The final generated two-dimensional drawing will be uploaded to the cloud document center via network file streaming for download.

[0085] like Figure 2 As shown in the figure, the process of converting 2D drawings to 3D scenes: the file IO interface reads the DXF file and parses the DXF group code content line by line; determines whether it is a BLOCK; if it is a BLOCK, parses the BLOCK segment content in the DXF file; processes the graphic midpoints and attributes of the BLOCK; and writes the device attributes into an empty JSON file.

[0086] If it is not a BLOCK, further determine whether it is an ENTITY; if not an ENTITY, skip and do not parse; if it is an ENTITY, parse the data in the ENTITY segment; call the corresponding processing method according to the entity type; read the insert content in the ENTITY segment to obtain the coordinates, rotation, scale, etc.; write the device properties to an empty JSON file; and return the JSON data to the 3D Design Center for rendering.

[0087] In one embodiment, a method for converting a CAD drawing into a 3D scene is disclosed, and the specific implementation steps are as follows:

[0088] S10: Read the DXF file through the file IO interface code and parse the group code information; the group code information is generally a group of two lines, the first line identifies the meaning of the group code, and the second line identifies the specific value of the group code. In the code, two lines of data are read each time, and the meaning of the group code is analyzed in the form of key-value pairs. DXF files contain a large amount of data that is not related to the model, such as text format, line type, view height, etc., and the parsing of this data is not considered during the parsing;

[0089] S20: The parsing is divided into the Block segment group code and the Entity segment group code. Block is translated as "block", which is the name of a graphic formed by combining multiple graphics elements. The Block segment starts with the "BLOCKS" keyword and ends with "ENDBLK". It contains information about multiple blocks in the middle, and each block is marked with a separate group code 0. Each block contains the value of the device ID, which has a one-to-one correspondence with the standard model in the database. Through this ID, the 3D simulation scheme design system can find the corresponding 3D model.

[0090] S30: Group code 330 is read from the block's attributes. Its value is the Entity ID, which is used to associate the Entity primitives and represents which specific primitives are used by the block. The block also has some custom model attributes, such as notes. The above operations are repeated to read the corresponding attributes of all blocks and assemble them into JSON data. The data parsing of the block is completed.

[0091] S40: Entities are basic graphics. One or more entities can form a block. Due to the variety of graphics, multiple graphics objects will be split according to the specific graphics. The data of the graphics element is keyed by group code 0 and the value is ENTITIES. When the above key-value pairs are read, the entity is parsed. After parsing, the coordinates, rotation, deformation, custom attributes and other data are written into the JSON data.

[0092] S50: Repeat the above steps to parse all BLOCKs and ENTITIES; finally, a JSON-formatted scene data is formed and returned to the 3D system for 3D display.

[0093] S60: When performing 3D rendering, if the corresponding 3D model cannot be found, the 3D system provides a default 3D model for rendering and reminds the user that the 3D model is missing, to ensure that the page can be rendered normally.

[0094] The present invention solves the problem of different drawing skill levels among different engineers, which leads to the inability to standardize drawings. By standardizing and modularizing CAD blocks, each model has its own CAD block, and a relational database is used to manage the correspondence between three-dimensional models and two-dimensional blocks. The generated CAD drawings also avoid errors caused by the program reading line segments. Many such models are then assembled into a set of scene JSON string data, which is then transmitted to the web page. The web page then renders the three-dimensional scene based on the scene data. When drawing CAD drawings, using pre-set standard blocks for drawing is conducive to drawing standardization and improves drawing efficiency.

[0095] The above-described embodiments merely represent specific implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of protection of the present application. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the technical concept of the present application, and all such variations and improvements fall within the scope of protection of the present application.

Claims

1. A method for rapidly converting 3D model scene data and CAD drawings based on DXF file technology, characterized in that: include: 3D to 2D conversion: 3D scene data is transferred to the CAD parsing system in JSON format for processing; Traverse the device data in the 3D scene data, find the corresponding CAD standard block data, and process the CAD blocks according to the device data; write the CAD blocks generated after all devices are processed into the DXF file according to the DXF group code method to form a 2D drawing of the scene; 2D to 3D conversion: Take the DXF file of the scene's 2D drawing as input information, read the DXF file content through the file IO interface, and parse the group code information; The scene data in JSON format is generated by parsing; based on the device information in the scene data in JSON format, the 3D model information of the corresponding device is found; And render the corresponding three-dimensional model scene; Methods for processing CAD blocks include: Processing CAD block coordinates: First, swap the y-axis and z-axis coordinates of the 3D device, then assign the xyz coordinate data of the 3D device to the 2D device CAD block in the form of DXF group codes; after reading the device information, recalculate the center of the drawing based on the length and width of the device; Processing the scaling of CAD blocks: multiply the length, width and height of the CAD block by the scaling value on the xyz axis in the device information; Process the equipment height; determine whether the current equipment is above the ground by the equipment's z-axis height, and write the equipment floor height into the additional attributes of the CAD block; Processing models that require dynamic generation of multiple layers and columns: Use basic primitives for drawing, and generate the CAD blocks of each model by assembling polygon LwpolyLine primitives; Handling equipment on the same floor: Group the equipment on the same floor according to the information of the floor where the equipment is located. Grouping method: Use DXF group code to assign the same group code to the equipment on the same floor.

2. The method for rapidly converting 3D model scene data and CAD drawings based on DXF file technology according to claim 1, characterized in that: In the 3D to 2D conversion process, the method for processing CAD blocks includes the curve calculation of curved tracks. The curve convexity is calculated using three points: the track equipment information contains the curve starting point p1(x1, y1), the curve end point p2(x2, y2), and the curve center p(x, y). b is the intermediate value, and bulge is the curve convexity. According to the definition of convexity in AutoCAD: get: Curve convexity .

3. The method for rapidly converting 3D model scene data and CAD drawings based on DXF file technology according to claim 1, characterized in that: Method for recalculating the center of the graphics: Get the maximum and minimum x-axis coordinates and the maximum and minimum y-axis coordinates of the graph, respectively recorded as xMax, xMin, yMax, yMin, set the coordinates of the center of the graph (xCenter, yCenter), set the horizontal length in the x direction to xLength, and the vertical length in the y direction to yLength, Get the coordinates of the center of the graphics (xCenter, yCenter) 。 4. The method for rapidly converting 3D model scene data and CAD drawings based on DXF file technology according to claim 1 or 3, characterized in that: After receiving the 3D scene data, the CAD parsing system first performs MD5 encoding on the 3D scene data, and then compares whether the corresponding 3D scene data exists in the database. If so, it directly returns the parsed DXF file for the user to download. Otherwise, it starts to traverse the device data in the 3D scene.

5. The method for rapidly converting 3D model scene data and CAD drawings based on DXF file technology according to claim 1 or 3, characterized in that: The three-dimensional scene data includes: all device information of the scene, each device information includes the device ID, size, coordinates, rotation, scaling, and plane number.

6. The method for rapidly converting 3D model scene data and CAD drawings based on DXF file technology according to claim 1 or 3, characterized in that: When traversing the device data in the 3D scene data, if the device model cannot be correctly matched to the CAD standard block, the pre-set default block is used for drawing.

7. The method for rapidly converting 3D model scene data and CAD drawings based on DXF file technology according to claim 1, characterized in that: In the 2D to 3D conversion, parsing the group code information includes parsing the Block segment group code and parsing the Entity segment group code; parsing the Block segment group code: read the Block segment group code to obtain the value of the device ID that has a one-to-one correspondence with the standard model in the database, as well as the customized model properties.

8. The method for rapidly converting 3D model scene data and CAD drawings based on DXF file technology according to claim 7, characterized in that: Parse the Entity segment group code: split into multiple graphic objects according to the specific graphics, each graphic object is responsible for parsing and assembling its own graphic elements; read the Entity segment group code to obtain coordinates, deformation, and custom attribute information.

9. A device for rapidly converting 3D model scene data and CAD drawings based on DXF file technology, characterized in that: include: CAD parsing system, 3D system and relational database; the CAD parsing system includes a 3D model standard library and 2D standard CAD blocks, and performs standard module processing on the CAD blocks; The relational database is used to manage and store the relationship between the three-dimensional model and the two-dimensional blocks; The 3D system is used to build and render three-dimensional model scenes and parse group code information; wherein the method for processing CAD blocks includes: Processing CAD block coordinates: First, swap the y-axis and z-axis coordinates of the 3D device, then assign the xyz coordinate data of the 3D device to the 2D device CAD block in the form of DXF group codes; after reading the device information, recalculate the center of the drawing based on the length and width of the device; Processing the scaling of CAD blocks: multiply the length, width and height of the CAD block by the scaling value on the xyz axis in the device information; Process the equipment height; determine whether the current equipment is above the ground by the equipment's z-axis height, and write the equipment floor height into the additional attributes of the CAD block; Processing models that require dynamic generation of multiple layers and columns: Use basic primitives for drawing, and generate the CAD blocks of each model by assembling polygon LwpolyLine primitives; Handling equipment on the same floor: Group the equipment on the same floor according to the information of the floor where the equipment is located. Grouping method: Use DXF group code to assign the same group code to the equipment on the same floor.

Citation Information

Patent Citations

  • Method for translating dimensions on two-dimensional engineering drawing to three-dimensional CAD (computer aided design) model

    CN102568038A

  • Indoor positioning system and method based on CAD drawing to generate three-dimensional model

    CN109360262A