(***********************************************************************

                    Mathematica-Compatible Notebook

This notebook can be used on any computer system with Mathematica 4.0,
MathReader 4.0, or any compatible application. The data for the notebook 
starts with the line containing stars above.

To get the notebook into a Mathematica-compatible application, do one of 
the following:

* Save the data starting with the line of stars above into a file
  with a name ending in .nb, then open the file inside the application;

* Copy the data starting with the line of stars above to the
  clipboard, then use the Paste menu command inside the application.

Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode.  Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).

NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing the 
word CacheID, otherwise Mathematica-compatible applications may try to 
use invalid cache data.

For more information on notebooks and Mathematica-compatible 
applications, contact Wolfram Research:
  web: http://www.wolfram.com
  email: info@wolfram.com
  phone: +1-217-398-0700 (U.S.)

Notebook reader applications are available free of charge from 
Wolfram Research.
***********************************************************************)

(*CacheID: 232*)


(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[      6628,        235]*)
(*NotebookOutlinePosition[      9821,        339]*)
(*  CellTagsIndexPosition[      9529,        323]*)
(*WindowFrame->Normal*)



Notebook[{
Cell[TextData[{
  "Utilities",
  StyleBox["`", "MB"],
  "DXF",
  StyleBox["`", "MB"]
}], "Subsection",
  CellTags->{"S6.9.1", "1.1"}],

Cell[TextData[{
  "DXF is a graphics interchange format in plain text form created by \
AutoDesk, the makers of AutoCAD. This format can be used for the transfer of \
graphics to AutoCAD and many other programs, including ray tracers and other \
three\[Hyphen]dimensional rendering packages. The package allows the export \
of ",
  StyleBox["Graphics3D", "MR"],
  " objects to a file in the DXF format. "
}], "Text",
  CellTags->{"S6.9.1", "1.2"}],

Cell[BoxData[
    FormBox[
      StyleBox[
        FrameBox[
          StyleBox[GridBox[{
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"WriteDXF[\\\\\\\\\\\\\\\"\
\\\\\\\"\\\", \
\\\"MR\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"filename\\\\\\\"\\\", \\\"TI\\\"]\
\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"\\\\\\\\\\\\\\\",\\\\\\\"\\\", \
\\\"MR\\\"]\\) \\!\\(\\*StyleBox[\\\"\\\\\\\"graphic\\\\\\\"\\\", \\\"TI\\\"]\
\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"]\\\\\\\"\\\", \\\"MR\\\"]\\) \"\>", \
\("write a three\[Hyphen]dimensional graphic to the named file in DXF format"\
\)}
                },
              ColumnAlignments->{Right, Left}],
            GridBoxOptions->{RowLines->False}]],
        "2ColumnBox"], TraditionalForm]], "Text",
  CellTags->{"S6.9.1", "1.3"}],

Cell["Using the DXF format. ", "Caption",
  CellTags->"S6.9.1"],

Cell[TextData[{
  StyleBox["WriteDXF", "MR"],
  " does not allow writing to an ",
  StyleBox["OutputStream", "MR"],
  "; it only writes to an unopened file. Note that the graphic must be a ",
  StyleBox["Graphics3D", "MR"],
  " object. To export a ",
  StyleBox["SurfaceGraphics", "MR"],
  " or other type of object, the object must first be converted to a ",
  StyleBox["Graphics3D", "MR"],
  " object. "
}], "Text",
  CellTags->{"S6.9.1", "1.4"}],

Cell["This loads the package.", "MathCaption",
  CellTags->{"S6.9.1", "1.5"}],

Cell["<<Utilities`DXF`", "Input",
  CellLabel->"In[1]:= ",
  CellTags->"S6.9.1"],

Cell["This defines a three\[Hyphen]dimensional graphic.", "MathCaption",
  CellTags->{"S6.9.1", "1.6"}],

Cell["\<\
gr = Graphics3D[
    {Point[{0, 0, 0}], Point[{0, 1, 0}]}];\
\>", "Input",
  CellLabel->"In[2]:= ",
  CellTags->"S6.9.1"],

Cell[TextData[{
  "This creates a DXF file for ",
  StyleBox["gr", "MR"],
  "."
}], "MathCaption",
  CellTags->{"S6.9.1", "1.7"}],

Cell[CellGroupData[{

Cell["WriteDXF[\"test.dxf\", gr]", "Input",
  CellLabel->"In[3]:= ",
  CellTags->"S6.9.1"],

Cell[BoxData[
    \("test.dxf"\)], "Output",
  CellLabel->"Out[3]= ",
  CellTags->"S6.9.1"]
}, Open  ]],

Cell["Here is what the file looks like.", "MathCaption",
  CellTags->{"S6.9.1", "1.8"}],

Cell[CellGroupData[{

Cell["!!test.dxf", "Input",
  CellLabel->"In[4]:= ",
  CellTags->"S6.9.1"],

Cell["\<\
  0
SECTION
  2
ENTITIES
  0
POINT
  8
0
 10
0
 20
0
 30
0
  0
POINT
  8
0
 10
0
 20
1
 30
0
  0
ENDSEC
  0
EOF\
\>", "Print",
  CellTags->"S6.9.1"]
}, Open  ]],

Cell[BoxData[
    FormBox[
      StyleBox[
        FrameBox[
          StyleBox[GridBox[{
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"PolygonsOnly\\\\\\\"\\\", \
\\\"MR\\\"]\\) \\!\\(\\*StyleBox[\\\"\\\\\\\"->\\\\\\\"\\\", \\\"MR\\\"]\\) \
\\!\\(\\*StyleBox[\\\"\\\\\\\"False\\\\\\\"\\\", \\\"MR\\\"]\\) \"\>", \
"\<\"export all graphics primitives\"\>"},
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"PolygonsOnly\\\\\\\"\\\", \
\\\"MR\\\"]\\) \\!\\(\\*StyleBox[\\\"\\\\\\\"->\\\\\\\"\\\", \\\"MR\\\"]\\) \
\\!\\(\\*StyleBox[\\\"\\\\\\\"True\\\\\\\"\\\", \\\"MR\\\"]\\) \"\>", \
"\<\"export polygons only\"\>"}
                },
              ColumnAlignments->{Right, Left}],
            GridBoxOptions->{RowLines->False}]],
        "2ColumnBox"], TraditionalForm]], "Text",
  CellTags->{"S6.9.1", "1.9"}],

Cell[TextData[{
  "Options for ",
  StyleBox["WriteDXF", "MR"],
  "."
}], "Caption",
  CellTags->"S6.9.1"],

Cell[TextData[{
  "In some cases (",
  StyleBox["e.g.", "TI"],
  ", export to ray\[Hyphen]tracing software), you may wish to output polygons \
only. The ",
  StyleBox["PolygonsOnly", "MR"],
  " option allows you to do this. \n",
  StyleBox["Note:", "TB"],
  " The package currently writes out only certain graphics primitives (",
  StyleBox["Line", "MR"],
  ", ",
  StyleBox["Point", "MR"],
  ", ",
  StyleBox["Polygon", "MR"],
  ", and ",
  StyleBox["Cuboid", "MR"],
  "). Any style information is lost, as are axes, boxes, and so on. This \
results in a DXF file equivalent to one created by the entities only option \
from AutoCAD. Cuboids and polygons with more than four sides are subdivided \
into triangular polygons. (This process creates a temporary file; be sure you \
have enough disk space to accommodate it. This will consume as much disk \
space as a ",
  StyleBox["Mathematica", "TI"],
  " PostScript file for the same objects.) "
}], "Text",
  CellTags->{"S6.9.1", "1.10"}]
},
FrontEndVersion->"4.0 for X",
ScreenRectangle->{{0, 800}, {0, 600}},
WindowSize->{520, 455},
WindowMargins->{{140, Automatic}, {Automatic, 72}},
StyleDefinitions -> "HelpBrowser.nb"
]


(***********************************************************************
Cached data follows.  If you edit this Notebook file directly, not using
Mathematica, you must remove the line containing CacheID at the top of 
the file.  The cache data will then be recreated when you save this file 
from within Mathematica.
***********************************************************************)

(*CellTagsOutline
CellTagsIndex->{
  "S6.9.1"->{
    Cell[1717, 49, 133, 6, 70, "Subsection",
      CellTags->{"S6.9.1", "1.1"}],
    Cell[1853, 57, 447, 9, 70, "Text",
      CellTags->{"S6.9.1", "1.2"}],
    Cell[2303, 68, 760, 17, 70, "Text",
      CellTags->{"S6.9.1", "1.3"}],
    Cell[3066, 87, 63, 1, 70, "Caption",
      CellTags->"S6.9.1"],
    Cell[3132, 90, 448, 12, 70, "Text",
      CellTags->{"S6.9.1", "1.4"}],
    Cell[3583, 104, 77, 1, 70, "MathCaption",
      CellTags->{"S6.9.1", "1.5"}],
    Cell[3663, 107, 80, 2, 70, "Input",
      CellTags->"S6.9.1"],
    Cell[3746, 111, 103, 1, 70, "MathCaption",
      CellTags->{"S6.9.1", "1.6"}],
    Cell[3852, 114, 131, 5, 70, "Input",
      CellTags->"S6.9.1"],
    Cell[3986, 121, 129, 5, 70, "MathCaption",
      CellTags->{"S6.9.1", "1.7"}],
    Cell[4140, 130, 90, 2, 70, "Input",
      CellTags->"S6.9.1"],
    Cell[4233, 134, 91, 3, 70, "Output",
      CellTags->"S6.9.1"],
    Cell[4339, 140, 87, 1, 70, "MathCaption",
      CellTags->{"S6.9.1", "1.8"}],
    Cell[4451, 145, 74, 2, 70, "Input",
      CellTags->"S6.9.1"],
    Cell[4528, 149, 158, 30, 70, "Print",
      CellTags->"S6.9.1"],
    Cell[4701, 182, 822, 17, 70, "Text",
      CellTags->{"S6.9.1", "1.9"}],
    Cell[5526, 201, 106, 5, 70, "Caption",
      CellTags->"S6.9.1"],
    Cell[5635, 208, 989, 25, 70, "Text",
      CellTags->{"S6.9.1", "1.10"}]},
  "1.1"->{
    Cell[1717, 49, 133, 6, 70, "Subsection",
      CellTags->{"S6.9.1", "1.1"}]},
  "1.2"->{
    Cell[1853, 57, 447, 9, 70, "Text",
      CellTags->{"S6.9.1", "1.2"}]},
  "1.3"->{
    Cell[2303, 68, 760, 17, 70, "Text",
      CellTags->{"S6.9.1", "1.3"}]},
  "1.4"->{
    Cell[3132, 90, 448, 12, 70, "Text",
      CellTags->{"S6.9.1", "1.4"}]},
  "1.5"->{
    Cell[3583, 104, 77, 1, 70, "MathCaption",
      CellTags->{"S6.9.1", "1.5"}]},
  "1.6"->{
    Cell[3746, 111, 103, 1, 70, "MathCaption",
      CellTags->{"S6.9.1", "1.6"}]},
  "1.7"->{
    Cell[3986, 121, 129, 5, 70, "MathCaption",
      CellTags->{"S6.9.1", "1.7"}]},
  "1.8"->{
    Cell[4339, 140, 87, 1, 70, "MathCaption",
      CellTags->{"S6.9.1", "1.8"}]},
  "1.9"->{
    Cell[4701, 182, 822, 17, 70, "Text",
      CellTags->{"S6.9.1", "1.9"}]},
  "1.10"->{
    Cell[5635, 208, 989, 25, 70, "Text",
      CellTags->{"S6.9.1", "1.10"}]}
  }
*)

(*CellTagsIndex
CellTagsIndex->{
  {"S6.9.1", 7252, 252},
  {"1.1", 8601, 289},
  {"1.2", 8694, 292},
  {"1.3", 8781, 295},
  {"1.4", 8869, 298},
  {"1.5", 8957, 301},
  {"1.6", 9051, 304},
  {"1.7", 9146, 307},
  {"1.8", 9241, 310},
  {"1.9", 9335, 313},
  {"1.10", 9425, 316}
  }
*)

(*NotebookFileOutline
Notebook[{
Cell[1717, 49, 133, 6, 70, "Subsection",
  CellTags->{"S6.9.1", "1.1"}],
Cell[1853, 57, 447, 9, 70, "Text",
  CellTags->{"S6.9.1", "1.2"}],
Cell[2303, 68, 760, 17, 70, "Text",
  CellTags->{"S6.9.1", "1.3"}],
Cell[3066, 87, 63, 1, 70, "Caption",
  CellTags->"S6.9.1"],
Cell[3132, 90, 448, 12, 70, "Text",
  CellTags->{"S6.9.1", "1.4"}],
Cell[3583, 104, 77, 1, 70, "MathCaption",
  CellTags->{"S6.9.1", "1.5"}],
Cell[3663, 107, 80, 2, 70, "Input",
  CellTags->"S6.9.1"],
Cell[3746, 111, 103, 1, 70, "MathCaption",
  CellTags->{"S6.9.1", "1.6"}],
Cell[3852, 114, 131, 5, 70, "Input",
  CellTags->"S6.9.1"],
Cell[3986, 121, 129, 5, 70, "MathCaption",
  CellTags->{"S6.9.1", "1.7"}],

Cell[CellGroupData[{
Cell[4140, 130, 90, 2, 70, "Input",
  CellTags->"S6.9.1"],
Cell[4233, 134, 91, 3, 70, "Output",
  CellTags->"S6.9.1"]
}, Open  ]],
Cell[4339, 140, 87, 1, 70, "MathCaption",
  CellTags->{"S6.9.1", "1.8"}],

Cell[CellGroupData[{
Cell[4451, 145, 74, 2, 70, "Input",
  CellTags->"S6.9.1"],
Cell[4528, 149, 158, 30, 70, "Print",
  CellTags->"S6.9.1"]
}, Open  ]],
Cell[4701, 182, 822, 17, 70, "Text",
  CellTags->{"S6.9.1", "1.9"}],
Cell[5526, 201, 106, 5, 70, "Caption",
  CellTags->"S6.9.1"],
Cell[5635, 208, 989, 25, 70, "Text",
  CellTags->{"S6.9.1", "1.10"}]
}
]
*)




(***********************************************************************
End of Mathematica Notebook file.
***********************************************************************)

