home *** CD-ROM | disk | FTP | other *** search
/ 3D Madness! Companion CD / 3DMADNESS.iso / dosdemos / 3dwkshop / dxf23dw.doc < prev    next >
Text File  |  1985-11-19  |  7KB  |  124 lines

  1. Date:  07-Aug-92 10:07 PDT
  2. From:  Presidio [75300,2404]
  3. Subj:  dxf converter docs
  4.  
  5. DXF to 3DW File Conversion Utility
  6. Presidio Software, Inc.
  7. Copyright (c)1992, Paul D. LeFevre
  8.  
  9. Autodesk, 3D Studio, AutoCAD, and DXF are trademarks of Autodesk, Inc.
  10. Microsoft Windows is a trademark of Microsoft, Inc.
  11. Presidio and 3D WorkShop are trademarks of Presidio Software, Inc.
  12.  
  13. Background
  14.  
  15. DXF23DW.EXE is a utility for taking 3D models saved in ASCII DXF
  16. format files and converting them to 3DW type files, so that they
  17. can be loaded and animated in Presidio Software's 3D WorkShop.
  18. This document details the use of this utility, defines the types
  19. of DXF files that will successfully convert, and gives tips for
  20. making the conversion process as painless as possible.
  21.  
  22. Drawing Interchange (DXF) Files
  23.  
  24. DXF is a standard interchange file format developed by Autodesk, Inc.
  25. to allow CAD programs to exchange drawings and to provide a means
  26. for other programs to access the information in a drawing file.  With
  27. the advent of 3D creation programs and the addition of 3D entities to
  28. popular CAD programs, DXF was extended to handle 3D information as
  29. well as 2D drawings.  The DXF standard provides basically two ways to
  30. store 3D information in a DXF file - polyface mesh entities and 3D Face
  31. entities.  This conversion program currently works only with polyface
  32. mesh entities - the type of 3D model information saved in a DXF file
  33. by Autodesk's 3D Studio product and by AutoCAD itself when the PFACE
  34. command is used to generate 3D entities.
  35.    The DXF standard also provides a Binary DXF format, however this
  36. utility works only with ASCII DXF files and does not currently support
  37. the Binary DXF format.
  38.  
  39. Using the Program
  40.  
  41. DXF23DW.EXE is a DOS text-only program, and needs to be run from the
  42. DOS command line or in a DOS window from Microsoft Windows.  The
  43. command line syntax is as follows:
  44.         DXF23DW filename <-v>
  45.         (note: typing DXF23DW with no parameters at the command prompt
  46.         will provide info on using the program on-screen)
  47. filename: the full name and path of the ASCII DXF file you wish to
  48.           convert.  The program does NOT automatically add the DXF
  49.           extension.  Example: DXF23DW corvette.dxf
  50. -v switch: the -v switch is optional - it provides a "verbose" mode,
  51.           causing the program to list the X,Y,Z coordinates of every
  52.           vertex as they are converted, and the 3 vertices that make
  53.           up each triangular face as they are converted.  This can
  54.           be useful to extract a simple ASCII dump from a DXF file
  55.           using command-line redirection.
  56.           Example: DXF23DW corvette.dxf -v > corvette.asc
  57.           will convert corvette.dxf and write the verbose dump to
  58.           a file named corvette.asc
  59.  
  60. Technical Information
  61.  
  62. 3D WorkShop models consist of points in 3D space (vertices) upon which
  63. triangular polygon "faces" are built, giving a surface to the model.  
  64. ALL of the polygon faces in 3D WorkShop (as well as Autodesk's 3D Studio)
  65. are triangles.  The simple reason for this is that a triangle is the only
  66. type of polygon that is guaranteed to be planar (that is, all of the
  67. vertices that define the polygon lie in the same plane).  More complex
  68. polygons are simulated by "hiding" some of the triangular edges that make
  69. up the entire polygon.  For example, a flat face of a cube has four
  70. vertices - this is made up of two triangles, with the diagonal edges of
  71. the triangles hidden to make it appear as one large square face.
  72. The program maintains a simple list of all of the vertices that make up
  73. an object.  Faces are then defined in a clockwise order when looking from
  74. the "front" of the face by the numbers of the vertices that define the
  75. face.  This gives the face a direction - the program can tell when a
  76. face is pointed "away" from the view by using the clockwise order of
  77. the vertices to get a normal vector to the face and comparing it to the
  78. view direction.
  79.    Polymesh entities in a DXF file are described in exactly the same
  80. manner.  The DXF file has a list of X,Y,Z coordinates for each vertex
  81. in a VERTEX entity in the DXF file.  It then defines the faces in
  82. other VERTEX entities by listing the numbers of the vertices that define
  83. the face.  In a DXF file, the "hidden" edges are denoted in a face
  84. definition by making the vertex number negative.
  85.    Note that in a DXF file, the vertices are numbered starting at 1,
  86. while 3D WorkShop numbers vertices starting at 0.  If you create your own
  87. DXF files, be sure the face definitions use a vertex list that starts
  88. with 1 instead of 0 - the conversion program will make the adjustments.
  89.    The conversion program will use the DXF variables $EXTMIN and $EXTMAX
  90. to find the extents of the objects in the DXF file, and achieve proper
  91. scaling for the objects.  These variables are always written out in DXF
  92. files created by Autodesk's 3D Studio, however they are NOT required in
  93. a DXF file - other programs creating DXF files may not include them.
  94. If these variables are not in the DXF file, the conversion program will
  95. examine the vertices listed and define the extents of the models itself
  96. for scaling.
  97.    Color information in DXF files is not well-defined.  The conversion
  98. program makes no attempt to extract color information - all of the faces
  99. are defined as having color 0, which in the default set-up of 3D WorkShop
  100. provides a red plastic color.  Object colors can be modified at any time
  101. in 3D WorkShop after loading by the Transform/Surface command.
  102.    While DXF files are for the most part an excellent exchange medium,
  103. the user should be aware that programs writing DXF files vary greatly.
  104. Because DXF is such a broad standard, some DXF files written by other
  105. programs may not provide what the conversion utility expects in a
  106. "standard" DXF file, and so may not properly convert.  This utility
  107. was specifically designed to work with DXF files produced by Autodesk
  108. products - and there is no guarantee that DXF files from other sources
  109. will work properly.  You can almost always get model information into
  110. a DXF format that the utility will recognize, however, by using the
  111. import facilities in Autodesk's AutoCAD and 3D Studio.  If the models
  112. can be loaded into these programs, then any needed modifications can
  113. be made, and the files saved as DXF files from these programs.  This
  114. will insure that the conversion utility can properly read and convert
  115. the information in the DXF file.
  116.    An excellent source of information on DXF files and standards is
  117. on CompuServe, in the Autodesk forums.  You can find the DXF file format
  118. specifications, other DXF utilities, and DXF files for downloading.
  119. Presidio Software also maintains a forum on CompuServe, where we will be
  120. happy to answer questions and provide assistance in using any Presidio
  121. products.  Type GO PRES at any ! prompt, or go to the Graphics Vendors
  122. forum and browse Message Section/Library 11, the Presidio Software forum.
  123.  
  124.