DXF (.dxf)

Background & Context

    • MIME types: image/vnd.dxf, image/x-dxf
    • AutoCAD DXF format.
    • 3D geometry format.
    • Commonly used for the exchange of CAD data.
    • Plain text ASCII or binary format.
    • DXF is an acronym derived from Drawing Exchange Format.
    • Stores a 3D object as a collection of line and polygon primitives and their properties.
    • Introduced in 1982.

Import & Export

  • Import["file.dxf"] imports a DXF file as a MeshRegion object representing the surface.
  • Import["file.dxf",elem] imports the specified element from a DXF file.
  • The import format can be specified with Import["file","DXF"] or Import["file",{"DXF",elem,}].
  • Export["file.dxf",expr] exports a 3D mesh-based geometric region to a DXF file. The expr can be any region that is ConstantRegionQ or a Graphics or Graphics3D object.
  • The export format can be specified with Export["file",expr,"DXF"] or Export["file",expr,{"DXF", opt1->val1,}].
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the DXF format.

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties and settings
    "Summary"summary of properties
    "CoordinateTransform"transformation function from DXF format
  • Data format representation elements:
  • "LineData"list of line elements in indexed form
    "PointData"list of point elements in indexed form
    "PolygonData"list of polygon elements in indexed form
    "VertexColors"list of vertex colors
    "VertexData"list of vertex coordinates
  • Geometry representation elements:
  • "BoundaryMeshRegion"boundary mesh representation of a solid
    "MeshRegion"mesh representation of a surface
  • Graphics representation elements:
  • "Graphics3D"DXF file represented as a Graphics3D object
    "GraphicsComplex"DXF file as a GraphicsComplex object
    "LineObjects"list of line primitives in absolute coordinates
    "PointObjects"list of point primitives in absolute coordinates
    "PolygonObjects"list of polygon primitives in absolute coordinates
  • Import and Export use the "MeshRegion" element by default for DXF files.


open allclose all

Basic Examples  (2)

Import a 3D model from DXF as a MeshRegion object:

Summary properties of the solid model:

Export a 3D model to a DXF file:

Print the raw textual contents of the file:

Scope  (10)

Import  (6)

Import works on a DXF file:

Any accessible URL:


Import automatically detects DXF files:

Import provides access to elements in the DXF file:

Import works on large files:

Export  (4)

Export works on 3D graphics:

Special regions:

Formula regions:

Mesh regions:

Import Elements  (12)

"BoundaryMeshRegion"  (1)

Give a boundary mesh region:

"CoordinateTransform"  (1)

The coordinate system used by the DXF format is identical to the Wolfram Language:

"Graphics3D"  (1)

Give the Graphics3D object:

"GraphicsComplex"  (1)

Give the GraphicsComplex object:

"LineData"  (1)

Give the line elements in indexed form:

"LineObjects"  (1)

Give the list of Line primitives given in absolute coordinates:

"MeshRegion"  (1)

Give a mesh region:

"PolygonData"  (1)

Give the polygon elements in indexed form:

"PolygonObjects"  (1)

Give the list of Triangle and Polygon primitives given in absolute coordinates:

"Summary"  (1)

Give the summary of properties:

File size:

"VertexColors"  (1)

Give the color of each vertex:

"VertexData"  (1)

Give the vertex coordinates: