: dxfo = dxfparse (dxfi)
: dxfo = dxfparse (dxfi, outstyle)

Parse a DXF struct (read by dxfread) into a DXF drawing struct or into a mapstruct.

Input arg dxfi can be a DXF cell array produced by dxfread, or a DXF file name (dxfparse will invoke dfread to read it).

Optional numeric input argument outstyle can be used to select a desired output format:

  • 0 (default) Return an output struct optimized for fast drawing with dxfdraw.m
  • 1 Return an output struct containing 2D (Matlab-compatible) mapstructs like those returned by shaperead.m. The output struct contains a "dxfpl" Polyline mapstruct for LINEs and open POLYLINEs and LWPOLYLINE entities; a "dxfpt" Point mapstruct for POINT entities; and a "dxfpg" Polygon mapstucts for closed POLYLINE and LWPOLYLINE entities.
  • 2 If the DXF file is 3D, return a 3D mapstruct as returned by shaperead.m with Z coordinates.

See also: dxfread, dxfdraw.

Package: mapping