home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
3D Madness! Companion CD
/
3DMADNESS.iso
/
dosdemos
/
3dwkshop
/
dxf23dw.doc
< prev
next >
Wrap
Text File
|
1985-11-19
|
7KB
|
124 lines
Date: 07-Aug-92 10:07 PDT
From: Presidio [75300,2404]
Subj: dxf converter docs
DXF to 3DW File Conversion Utility
Presidio Software, Inc.
Copyright (c)1992, Paul D. LeFevre
Autodesk, 3D Studio, AutoCAD, and DXF are trademarks of Autodesk, Inc.
Microsoft Windows is a trademark of Microsoft, Inc.
Presidio and 3D WorkShop are trademarks of Presidio Software, Inc.
Background
DXF23DW.EXE is a utility for taking 3D models saved in ASCII DXF
format files and converting them to 3DW type files, so that they
can be loaded and animated in Presidio Software's 3D WorkShop.
This document details the use of this utility, defines the types
of DXF files that will successfully convert, and gives tips for
making the conversion process as painless as possible.
Drawing Interchange (DXF) Files
DXF is a standard interchange file format developed by Autodesk, Inc.
to allow CAD programs to exchange drawings and to provide a means
for other programs to access the information in a drawing file. With
the advent of 3D creation programs and the addition of 3D entities to
popular CAD programs, DXF was extended to handle 3D information as
well as 2D drawings. The DXF standard provides basically two ways to
store 3D information in a DXF file - polyface mesh entities and 3D Face
entities. This conversion program currently works only with polyface
mesh entities - the type of 3D model information saved in a DXF file
by Autodesk's 3D Studio product and by AutoCAD itself when the PFACE
command is used to generate 3D entities.
The DXF standard also provides a Binary DXF format, however this
utility works only with ASCII DXF files and does not currently support
the Binary DXF format.
Using the Program
DXF23DW.EXE is a DOS text-only program, and needs to be run from the
DOS command line or in a DOS window from Microsoft Windows. The
command line syntax is as follows:
DXF23DW filename <-v>
(note: typing DXF23DW with no parameters at the command prompt
will provide info on using the program on-screen)
filename: the full name and path of the ASCII DXF file you wish to
convert. The program does NOT automatically add the DXF
extension. Example: DXF23DW corvette.dxf
-v switch: the -v switch is optional - it provides a "verbose" mode,
causing the program to list the X,Y,Z coordinates of every
vertex as they are converted, and the 3 vertices that make
up each triangular face as they are converted. This can
be useful to extract a simple ASCII dump from a DXF file
using command-line redirection.
Example: DXF23DW corvette.dxf -v > corvette.asc
will convert corvette.dxf and write the verbose dump to
a file named corvette.asc
Technical Information
3D WorkShop models consist of points in 3D space (vertices) upon which
triangular polygon "faces" are built, giving a surface to the model.
ALL of the polygon faces in 3D WorkShop (as well as Autodesk's 3D Studio)
are triangles. The simple reason for this is that a triangle is the only
type of polygon that is guaranteed to be planar (that is, all of the
vertices that define the polygon lie in the same plane). More complex
polygons are simulated by "hiding" some of the triangular edges that make
up the entire polygon. For example, a flat face of a cube has four
vertices - this is made up of two triangles, with the diagonal edges of
the triangles hidden to make it appear as one large square face.
The program maintains a simple list of all of the vertices that make up
an object. Faces are then defined in a clockwise order when looking from
the "front" of the face by the numbers of the vertices that define the
face. This gives the face a direction - the program can tell when a
face is pointed "away" from the view by using the clockwise order of
the vertices to get a normal vector to the face and comparing it to the
view direction.
Polymesh entities in a DXF file are described in exactly the same
manner. The DXF file has a list of X,Y,Z coordinates for each vertex
in a VERTEX entity in the DXF file. It then defines the faces in
other VERTEX entities by listing the numbers of the vertices that define
the face. In a DXF file, the "hidden" edges are denoted in a face
definition by making the vertex number negative.
Note that in a DXF file, the vertices are numbered starting at 1,
while 3D WorkShop numbers vertices starting at 0. If you create your own
DXF files, be sure the face definitions use a vertex list that starts
with 1 instead of 0 - the conversion program will make the adjustments.
The conversion program will use the DXF variables $EXTMIN and $EXTMAX
to find the extents of the objects in the DXF file, and achieve proper
scaling for the objects. These variables are always written out in DXF
files created by Autodesk's 3D Studio, however they are NOT required in
a DXF file - other programs creating DXF files may not include them.
If these variables are not in the DXF file, the conversion program will
examine the vertices listed and define the extents of the models itself
for scaling.
Color information in DXF files is not well-defined. The conversion
program makes no attempt to extract color information - all of the faces
are defined as having color 0, which in the default set-up of 3D WorkShop
provides a red plastic color. Object colors can be modified at any time
in 3D WorkShop after loading by the Transform/Surface command.
While DXF files are for the most part an excellent exchange medium,
the user should be aware that programs writing DXF files vary greatly.
Because DXF is such a broad standard, some DXF files written by other
programs may not provide what the conversion utility expects in a
"standard" DXF file, and so may not properly convert. This utility
was specifically designed to work with DXF files produced by Autodesk
products - and there is no guarantee that DXF files from other sources
will work properly. You can almost always get model information into
a DXF format that the utility will recognize, however, by using the
import facilities in Autodesk's AutoCAD and 3D Studio. If the models
can be loaded into these programs, then any needed modifications can
be made, and the files saved as DXF files from these programs. This
will insure that the conversion utility can properly read and convert
the information in the DXF file.
An excellent source of information on DXF files and standards is
on CompuServe, in the Autodesk forums. You can find the DXF file format
specifications, other DXF utilities, and DXF files for downloading.
Presidio Software also maintains a forum on CompuServe, where we will be
happy to answer questions and provide assistance in using any Presidio
products. Type GO PRES at any ! prompt, or go to the Graphics Vendors
forum and browse Message Section/Library 11, the Presidio Software forum.