dxfel - A tool for adding pseudo-elevation data to DXF files

Program description:

dxfel is a Python script which takes in 2D DXF files generated by the autotrace raster-to-vector file conversion tool, and assigns each two dimensional DXF polyline element (1-n vectors connected by points) an elevation value, based on the color which autotrace assigned to the vector during the conversion process.

dxfel was originally designed for the purpose of taking vectorized images of Mars terrain, as photographed by the Spirit and Opportunity Mars Exploration Rovers, and using the color information within the images to create 3D terrain maps. The effort produced interesting results. Images and a description of the original project (including images of 3D terrain maps generated using dxfel) may be found here.


dxfel is made available under the GNU General Public License.

Latest release information:

dxfel / Version 1.0 March 3rd, 2004.

Using dxfel

dxfel takes four arguments at the command line:
  1. The filename of the input DXF file (as generated by autotrace)
  2. The desired filename of the DXF file to be output
  3. A floating point value representing the increment to be used between different color layers. Higher numbers will result in greater separation between layers along the 3D model's Z-axis.
  4. The type of elevation incrementation algorithm to be used. Right now, this is always just specified as 'simple' (without the quotes).
At the command line, this translates into:

dxfel.py <input_dxf_file> <output_dxf_file> <elevation_increment> simple

For example:

dxfel.py mars2d.dxf mars3d.dxf 5.0 simple

Rupert Scammell, 2004-06-10.