Saturday, 24 October 2015

IGES and DXF

 https://en.wikipedia.org/wiki/IGES
IGES
An IGES file is composed of 80-character ASCII records, a record length derived from the punched card era. Text strings are represented in "Hollerith" format, the number of characters in the string, followed by the letter "H", followed by the text string, e.g., "4HSLOT" (this is the text string format used in early versions of the Fortranlanguage). Early IGES translators had problems with IBM mainframe computers because the mainframes usedEBCDIC encoding for text, and some EBCDIC-ASCII translators would either substitute the wrong character, or improperly set the parity bit, causing a misread.Here is a very small IGES file from 1987,[5] containing only two POINT (Type 116), two CIRCULAR ARC (Type 100), and two LINE (Type 110) entities. It represents a slot, with the points at the centers of the two half-circles that form the ends of the slot, and the two lines that form the sides. 
                                                                        S      1
1H,,1H;,4HSLOT,37H$1$DUA2:[IGESLIB.BDRAFT.B2I]SLOT.IGS;,                G      1
17HBravo3 BravoDRAFT,31HBravo3->IGES V3.002 (02-Oct-87),32,38,6,38,15,  G      2
4HSLOT,1.,1,4HINCH,8,0.08,13H871006.192927,1.E-06,6.,                   G      3
31HD. A. Harrod, Tel. 313/995-6333,24HAPPLICON - Ann Arbor, MI,4,0;     G      4
     116       1       0       1       0       0       0       0       1D      1
     116       1       5       1       0                               0D      2
     116       2       0       1       0       0       0       0       1D      3
     116       1       5       1       0                               0D      4
     100       3       0       1       0       0       0       0       1D      5
     100       1       2       1       0                               0D      6
     100       4       0       1       0       0       0       0       1D      7
     100       1       2       1       0                               0D      8
     110       5       0       1       0       0       0       0       1D      9
     110       1       3       1       0                               0D     10
     110       6       0       1       0       0       0       0       1D     11
     110       1       3       1       0                               0D     12
116,0.,0.,0.,0,0,0;                                                    1P      1
116,5.,0.,0.,0,0,0;                                                    3P      2
100,0.,0.,0.,0.,1.,0.,-1.,0,0;                                         5P      3
100,0.,5.,0.,5.,-1.,5.,1.,0,0;                                         7P      4
110,0.,-1.,0.,5.,-1.,0.,0,0;                                           9P      5
110,0.,1.,0.,5.,1.,0.,0,0;                                            11P      6
S      1G      4D     12P      6                                        T      1


The file is divided into 5 sections: Start, Global, Directory Entry, Parameter Data, and Terminate indicated by the characters S, G, D, P, or T in column 73. The characteristics and geometric information for an entity is split between two sections; one in a two record, fixed-length format (the Directory Entry, or DE Section), the other in a multiple record, comma delimited format (the Parameter Data, or PD Section), as can be seen in a more human-readable representation of the file.[6]

When displayed, the user should see two yellow points (hard to see on a white background, but most CAD systems use a black background), one located at the origin of model space [0,0,0], two red circular arcs, and twogreen lines.
Slot.gif
 AutoCAD DXF 


(Drawing Interchange Format, or Drawing Exchange Format) is a CAD data file format developed by Autodesk[2] for enabling data interoperability between AutoCAD and other programs.

DXF was originally introduced in December 1982 as part of AutoCAD 1.0, and was intended to provide an exact representation of the data in the AutoCAD native file format, DWG (Drawing), for which Autodesk for many years did not publish specifications. Because of this, correct imports of DXF files have been difficult. Autodesk now publishes the DXF specifications as a PDF[1] on its website.

Versions of AutoCAD from Release 10 (October 1988) and up support both ASCII and binary forms of DXF. Earlier versions support only ASCII.

As AutoCAD has become more powerful, supporting more complex object types, DXF has become less useful. Certain object types, including ACIS solids and regions, are not documented. Other object types, including AutoCAD 2006's dynamic blocks, and all of the objects specific to the vertical market versions of AutoCAD, are partially documented, but not well enough to allow other developers to support them. For these reasons many CAD applications use the DWG format which can be licensed from Autodesk or non-natively from the Open Design Alliance.

DXF coordinates are always without dimensions so that the reader or user needs to know the drawing unit or has to extract it from the textual comments in the sheets.

Contents


File structure

ASCII versions of DXF can be read with any text editor. The basic organization of a DXF file is as follows: 

HEADER section – General information about the drawing. Each parameter has a variable name and an associated value. 

CLASSES section – Holds the information for application-defined classes whose instances appear in the BLOCKS, ENTITIES, and OBJECTS sections of the database. Generally does not provide sufficient information to allow interoperability with other programs. 

TABLES section – This section contains definitions of named items.
 
Application ID (APPID) table

Block Record (BLOCK_RECORD) table

Dimension Style (DIMSTYPE) table

Layer (LAYER) table

Linetype (LTYPE) table

Text style (STYLE) table

User Coordinate System (UCS) table

View (VIEW) table

Viewport configuration (VPORT) table 

BLOCKS section – This section contains Block Definition entities describing the entities comprising each Block in the drawing. 

ENTITIES section – This section contains the drawing entities, including any Block References. 

OBJECTS section – Contains the data that apply to nongraphical objects, used by AutoLISP and ObjectARX applications. 

THUMBNAILIMAGE section – Contains the preview image for the DXF file.
 
END OF FILE

The data format of a DXF is called a "tagged data" format which "means that each data element in the file is preceded by an integer number that is called a group code. A group code's value indicates what type of data element follows. This value also indicates the meaning of a data element for a given object (or record) type. Virtually all user-specified information in a drawing file can be represented in DXF format."


3 comments: