DXF files describe graphical data in the form of a document. You can open a DXF-formatted file by using WordPad.
The DXF file is divided into the following segment numbers
The format of each segment is as follows:
0
Section
2
HEADER
The most important of these are entity segments (entities)
This section contains data for all the graphs, such as line, ARC, CIRCLE, point, and so on. The methods described are:
such as line segments:
0
Line
5
19
330
3 A
100
Acdbentity
8
0
100
Acdbline
10
55.0
20
33.0
30
0.0
11
55.0
21st
7.0
31
0.0
Mainly look at the data below the Acdbline, 10 the following data represents the x-coordinate of the starting point, 20 the data below represents the y-coordinate of the starting point, and 30 the data below represents the z-coordinate of the starting point. 11 The following data represents the x-coordinate of the end point, 21 the following data represents the y-coordinate of the end point, and 31 the data below represents the z-coordinate of the end point. For a straight line, the coordinates of the starting and ending points are determined, and the line is determined.
Another example is the circle:
0
CIRCLE
5
19
330
3D
100
Acdbentity
8
0
100
Acdbcircle
10
40.0
20
20.0
30
0.0
40
12.8062484748657
The main still look at the section below the Acdbcircle, where 10, 20, 30 The following data represents the circle center coordinate, 40 the following data represents the radius of the circle, with the center and radius, then the circle is also determined.
And like an arc.
0
ARC
5
1E
330
3D
100
Acdbentity
8
0
100
Acdbcircle
10
20.0
20
33.0
30
0.0
40
43.60045871318328
100
Acdbarc
50
0.0961209608856947
51
23.02549200852804
Also to see the acdbcircle the following data, 10, 20, 30 The following data represents the center coordinate of the arc, 40 the following data represents the radius length of the arc, 50 represents the angle at which the arc begins, and 51 represents the angle at which the arc ends. So the arc is OK.
The graph of the DXF file of my example is as follows: (with QCad casually painted)