15-09-2021

This is a brief description of the DXF format or more precisely: the subset of DXF that KLayout understands. Syntactically, DXF is a very simple format. The basic problem when reading DXF however is how to interpret it.Apparently, it is more or less a dump of the object properties of the CAD tool, and many questions regarding theinterpretation of the properties are left open.

The implementation of KLayout is based on a number of test cases and comparison with other viewers. In some cases, the interpretation of features was varying (for example, the interpretation of array instances). In that case, TrueView (see link below) was believed to be the main authority in DXF interpretation.

Open the DXF file you want to convert (go to the 'File' menu and click on 'Open' or press the 'Open' button from the menu bar). Select the 'Save As' option from the 'File' menu (or use Shift+S key combination). From the drop-down format list, select GDS II and choose the desired location for your output (see image). The group code is an integer which implicitly defines the value type and acts as a key for the value. In ASCII DXF, group codes and values are written in a single line each. These are the group codes and values relevant for layout data: 0: string (keyword) 2: string (arbitrary) 6: string. 10.13: double precision coordinate.

Here are some links and references to other free viewers:

Gds To Dxf Converter Free

Basic format

DXF consists of records of a very simple structure:

The group code is an integer which implicitly defines the value type and acts as a key for the value.In ASCII DXF, group codes and values are written in a single line each.These are the group codes and values relevant for layout data:

  • 0: string (keyword)
  • 2: string (arbitrary)
  • 6: string
  • 8: string
  • 10..13: double precision coordinate
  • 20..23: double precision coordinate
  • 30..33: double precision coordinate
  • 39: double precision coordinate
  • 40..45: double precision floating point value
  • 50: double precision angle (in degree)
  • 62: 16 bit integer value
  • 66: 16 bit integer value
  • 70: 16 bit integer value
  • 210: double precision coordinate
  • 220: double precision coordinate
  • 230: double precision coordinate

Pure ASCII DXF allows the lines to contain leading or trailing blanks. KLayout also tries to identify stray blank lines and skip them. Some systems generate such files.

There is also a binary version of the DXF format with this basic structure:

  • Header (22 Bytes): 'AutoCAD Binary DXF<CR><LF><SUB><NULL>
  • 16 bit integers: 2 btyes, LSB firs
  • double: 8 bytes, LSB firs
  • string: zero-terminated

Apparently the binary format is rarely used. It suffers from a pretty basic issue: since the data typeof a value - hence the byte count - is implicitly determined by the group code, exact knowledge of the data typeassociated with each group code is required.

General structure

This is the general structure of a DXF file as KLayout understands it. This is a schematic representation.The '//' comments are not part of the file - they are provided for readability. In addition, group codes and values have been written on one line. In ASCII DXF, group codes and values are on separate lines.The indentation indicates coherent sections. '...' indicates that other group code / value pairs may be present which are read over:

KLayout reads these entities which are described in detail below:

Converter
  • POLYLINE: polygon, paths
  • LWPOLYLINE: polygon, paths
  • SPLINE: a spline line segment
  • TRACE: a four-point polygon
  • ARC: an arc segment
  • ELLIPSE: an elliptic segment
  • INSERT: cell reference
  • LINE: parts of polygon contours, path
  • SOLID: triangle or tetragon
  • HATCH: a filled area (polygon)
  • CIRCLE: a circle
  • DIMENSION: a dimension drawing
  • TEXT: text
  • ATTRIB: text
  • MTEXT: multi-line text

POLYLINE entity

A closed polyline with a width of 0 usually creates a polygon (unless in 'keep lines' mode - see below). A polyline with a width > 0 creates a path.A non-closed polyline with a width of 0 creates a path with width 0 or contributes to the edges thatwill be merged in 'merge lines' mode.

Polylines with constant width are translated into GDS PATH objects. Polylines with non-constantwidth are translated into polygons.

For paths: no round ends are provided. Variable extensions have to be emulated by extending the first and last segment.

LWPOLYLINE entity for polygons

Gds to dxf converter online

LWPOLYLINE entities are alternative representations of POLYLINE entities and are treated alike.

ARC entity

An ARC creates a path with width 0 or contributes to the edges thatwill be merged in 'merge lines' mode.The arc will be interpolated according to the number of points per circle specifiedin the reader options.

ELLIPSE entity

An ELLIPSE creates a path with width 0 or contributes to the edges thatwill be merged in 'merge lines' mode.The arc will be interpolated according to the number of points per circle specifiedin the reader options.

SPLINE entity

A spline creates a path with width 0 or contributes to the edges thatwill be merged in 'merge lines' mode.

TRACE entity

A TRACE entity generates a polygon with four vertices.

SOLID entity

To get a correctly ordered tetragon, points 3 and 4 must be swapped. A triangle is formed by setting position 3 and 4 to the same coordinates.

DIMENSION entity

Gds To Dxf Converter Free

A DIMENSION entity is only implemented as importing the drawing block without a displacementusing the given layer on '0' wildcard layers inside the block.

INSERT entity

The layer specified overrides the '0' layer inside the block. This requires layer specific variants. This override is inherited by child cells as well.

Gds To Dxf Converter

The array vectors specified by number of column spacing and row spacing is rotated by the given angle, but not scaled or mirrored.

LINE entity

Lines are converted into paths with the specified width or contribute to the lines merged in 'merge lines' mode.

CIRCLE entity

Circles are converted to single-point, round-ended paths.

TEXT entity

MTEXT entity

Free

ATTRIB entity

The ATTRIB entity is basically handled like the TEXT entity except that group 74 is used for the vertical alignment.

HATCH entity

A hatch entity creates a polygon. Individual polygon parts are combined with the even-odd union rule: an overlapping contour can cancel an area of another contour even if the orientation of both is the same.

Other topics

Polygon formation and LINE/POLYLINE interpretation

The are several ways to form polygons from DXF input, which are controlled by the LINE/POLYLINE mode setting on thereader options page. The following modes are provided:

  • Automatic
  • Keep lines
  • Create polygons from closed polylines with width = 0
  • Merge lines with width = 0 into polygons
  • Merge lines and auto-close open contours

'Automatic' mode will select the following modes:

  • 'Keep lines' if at least one SOLID or HATCH entity is present
  • 'Create polygons from closed polylines with width = 0' if at least one closed POLYLINE or LWPOLYLINE entity with width = 0 is present
  • 'Merge lines with width = 0 into polygons' otherwise.

The modes have the following effect:

  • SOLID entities always form filled tetragons or triangles.
  • HATCH entities always form complex polygons.
  • Closed POLYLINE or LWPOLYLINE entities with width = 0 form polygons unless 'keep lines' mode is selected. In 'auto-close' mode, non-closed polylines will form a closed polygon by connecting the first and last point.
  • Multiple segments specified by either SPLINE,ARC,ELLIPSE,LINE or POLYLINE/LWPOLYLINE entities with width = 0 are joined and, if they form a loop, create a polygon in the 'merge lines' modes. In 'auto-close' mode, open contours will be closed by connecting the first and last point. Reverse-oriented loops can create holes in outer loops.

Gdsii To Dxf Converter

Extrusion direction

The extrusion direction specified by the group codes 210, 220 and 230 is by default (0,0,1). This is the normal case. Extrusion direction (0,0,-1)is also supported. In this case, the shapes will be mirrored at the Y axis.

Gds To Dxf Converter Online

INSERT entities with layer specification

Gds To Dxf Converter Download

Layer '0' is a 'wildcard' layer and can be overridden on a per-instancebasis by a instance specific layer. If the instance has itself '0' layer assigned, no override takes place (or it does not have any effect).

Gds To Dxf Converter Free

Name JPG DXF
Full nameJPG - Joint Photographic Experts GroupDXF - Drawing Interchange Format
File extension.jpg, .jpeg, .jpe.dxf
MIME typeimage/jpegimage/vnd.dxf
Developed byJoint Photographic Experts GroupAutodesk
Type of formatlossy image formatCAD
DescriptionJPG is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPG typically achieves 10:1 compression with little perceptible loss in image quality.AutoCAD DXF (Drawing Interchange Format, or Drawing Exchange Format) is a CAD data file format developed by Autodesk for enabling data interoperability between AutoCAD and other programs. Versions of AutoCAD from Release 10 and up support both ASCII and binary forms of DXF. Earlier versions support only ASCII.
Technical detailsImage files that employ JPG compression are commonly called 'JPG files', and are stored in variants of the JIF image format. Most image capture devices (such as digital cameras) that output JPG are actually creating files in the Exif format, the format that the camera industry has standardized on for metadata interchange.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. 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.
File conversion JPG conversion DXF conversion
Associated programsApple Safari, Google Chrome, Mozilla Firefox, Internet Explorer, Adobe Photoshop, Paint Shop Pro, the GIMP, ImageMagick, IrfanView, Pixel image editor, Paint.NET, Xara Photo & Graphic Designer.AutoCAD
Wiki https://en.wikipedia.org/wiki/JPEG https://en.wikipedia.org/wiki/AutoCAD_DXF