DXF (.dxf)

BackgroundBackground

    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 and ExportImport and 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.

ElementsElements

  • 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.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

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

In[1]:=
Click for copyable input
Out[1]=

Summary properties of the solid model:

In[2]:=
Click for copyable input
Out[2]=

Export a 3D model to a DXF file:

In[1]:=
Click for copyable input
Out[1]=

Print the raw textual contents of the file:

In[2]:=
Click for copyable input
Introduced in 2000
(4.1)
| Updated in 2016
(10.4)