Dem2DXF.exe written by John B Springer

For questions/comments, email me at johnbspringer@comcast.net

Dem2DXF.exe is a utility program that converts DEM terrain files to the AutoCad DXF file format.
In addition to providing file conversion services, Dem2DXF can also perform mesh optimization and
cropping. It supports both ROAM and chunked terrain tessellations.

============================================================================
EXAMPLES

The below examples converts the DEM file Honolulu.dem to a DXF format. The resulting tessellation
will be constructed using 100 percent of the DEM elevation information resulting in the (w)ritting 
of a HUGE dxf file. The y invokes the creation the mesh skirt. A value of no turns off the skirt. 

dem2dxf.exe Honolulu.dem Honolulu.dxf 100 w y

---------------------------------------------------------------------------

The below example converts the DEM file Honolulu.dem to a DXF format but does not actually
create the Honolulu.dxf file. Instead, the s option prints out statistics containing information
about the approximate file size, the number of polygons that will be written, ext.

dem2dxf.exe Honolulu.dem Honolulu.dxf 100 S y

---------------------------------------------------------------------------

The below examples converts the DEM file Honolulu.dem to a DXF format. The resulting tessellation
will be constructed using only 50 percent of the DEM elevation data resulting in a smaller dxf file 
and a somewhat optimized mesh.

dem2dxf.exe Honolulu.dem Honolulu.dxf 50 w y

---------------------------------------------------------------------------
The below example converts the DEM file Honolulu.dem to a DXF format. The resulting tessellation
will be constructed using 100 percent of the DEM elevation data constrained within colomns 290-350 
and row 0 100 of the DEM file. The result is a smaller dxf file containing 100% DEM fidelity
and a non-optimized but smaller mesh.

dem2dxf.exe Honolulu.dem Honolulu.dxf 100 w y 290 350 0 100

---------------------------------------------------------------------------
The below example converts the DEM file Honolulu.dem to a DXF format. The resulting tessellation
will be constructed using 100 percent of the DEM elevation data constrained within colomns 290-350 
and row 0 100 of the DEM file. The result is a smaller dxf file containing 100% DEM fidelity
and a non-optimized mesh. The R (case dependent) informs dem2dxf.exe to arrange the polygons within 
the mesh in the ROAM format. Since ROAM is a runtime optimization method, the resulting tessellation
is composed using 100% of the DEM data set within constrained area.

dem2dxf.exe Honolulu.dem Honolulu.dxf R w y 290 350 0 100

---------------------------------------------------------------------------

The below example converts the DEM file Honolulu.dem to a DXF format. The resulting tessellation
will be constructed using only 15 percent of the original DEM elevation data and the output will be
constrained within the specified UTM cordinates:

dem2dxf.exe Honolulu.dem Honolulu.dxf 15 w y 0.626040000000000D+06 0.622890000000000D+06 0.236400000000000D+07 0.235007476800000D+07

0.626040000000000D+06 Max Latitude  through 0.622890000000000D+06 Min Latitude
0.236400000000000D+07 Max Longitude through 0.235007476800000D+07 Min Longitude
The above UTM cordinates are in scientific notation

Decimal notation is also supported as shown below
dem2dxf.exe Honolulu.dem Honolulu.dxf 15 w y 626040.0 622890.0 2364000.0 2350074.768
626040.0 Max Latitude  through 622890.0 Min Latitude
2364000.0 Max Longitude through 2350074.768 Min Longitude

The result is a smaller dxf file containing 15% DEM fidelity and a highly optimized mesh.


