home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / PLOT / IRITSM3S.ZIP / DOCS / IRIT.SRC next >
Encoding:
Text File  |  1992-03-10  |  131.0 KB  |  4,102 lines

  1. ;This is the source file to create documentation for the IRIT solid modeler.
  2. ;First character in line specifies the action to take for this line/next block
  3. ;as follows:
  4. ; ';' - a comment that is always ignored.
  5. ; '#' - all lines following this line until next '#' are indented as an array.
  6. ;       Four integers follows specifying indentations, # of elements per
  7. ;       line, whether or not to put an internal vertical seperators, and
  8. ;       if entries are row ordered (1) or col ordered (2).
  9. ; '@' - latex only manual. Latex commands can appear within this line.
  10. ; '!' - plain text and irit docs only manual - keywords/headers.
  11. ; '&' - plain text only manual - headers.
  12. ; '$' - terminator for current block.
  13. ;
  14. ; latex commands can appear in regular text limited to a single line as
  15. ; {\command *}. For plain text the {\command } will be filtered out.
  16. ; Escaped characters via '\' (i.e. \#) will be left escaped (\#) in the
  17. ; latex output but unescaped (#) in the plain output.
  18. ;
  19. ;                       IRIT solid modeler (C) Gershon Elber 1991.
  20. ;
  21.  
  22. @%
  23. @% Irit Solid modeler latex manual.
  24. @%
  25. @% Authors:     Gershon Elber
  26. @%
  27. @% Date:        Tri Nov 29, 1991
  28. @%
  29. @% Copyright (c) 1991 Gershon Elber
  30. @%
  31. @
  32. @\documentstyle[11pt]{article}
  33. @\oddsidemargin  -.195in
  34. @\evensidemargin -.195in
  35. @\textwidth 6.50in
  36. @\topmargin -.5in
  37. @\textheight 9.5in
  38. @
  39. @\begin{document}
  40. @
  41. @\pagestyle{empty}
  42. @   \rule{0in}{3in}
  43. @   \begin{center}
  44. @       {\huge\bf IRIT}\\
  45. @       \vspace{3cm}
  46. @       {\Large A Solid modeling Program}\\
  47. @       \vspace{2cm}
  48. @       {\large Copyright (C) 1989, 1990, 1991 Gershon Elber}\\
  49. @       \vspace{1cm}
  50. @       {\large EMail: gershon@gr.utah.edu }\\
  51. @
  52. @       \vfill
  53. @       {\small This manual is for IRIT version 3.0.}
  54. @   \end{center}
  55. @\newpage
  56. @
  57. @\tableofcontents
  58. @\newpage
  59. @
  60. @\setcounter{page}{1}
  61. @\markright{{\em {\bf Irit Solid modeler}}\hfil G. Elber}
  62. @\pagestyle{myheadings}
  63. @\newpage
  64. @
  65. @
  66. @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  67. @
  68. @\section{Introduction}
  69. !INTRODUCTION
  70.  
  71.    {\em IRIT} is a small solid modeler developed for educational purposes. Although
  72.  small, it is now powerful enough to create quite complex scenes. I wrote
  73.  it mainly so I can learn all the little small and not so small problems
  74.  in developing such a system.
  75.  
  76.    {\em IRIT} started as a polygonal solid modeler and was originally developed
  77.  (and mostly still is) on an IBM PC under MSDOS. Version 2.0 was also ported
  78.  to X11 and version 3.0 to SGI 4D systems. Version 3.0 also includes
  79.  quite a few free form curves and surfaces tools. See the UPDATE.NEW
  80.  file for more detailed update information.
  81. $
  82.  
  83. @\section{Copyrights}
  84. !COPYRIGHTS
  85.  
  86.    BECAUSE {\em IRIT} AND ITS SUPPORTING TOOLS AS DOCUMENTED IN THIS DOCUMENT
  87.  ARE LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY NO WARRANTY, TO THE EXTENT
  88.  PERMITTED BY APPLICABLE STATE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, I
  89.  GERSHON ELBER PROVIDE {\em IRIT} PROGRAM AND ITS SUPPORTING TOOLS "AS IS" WITHOUT
  90.  WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED
  91.  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  92.  PURPOSE.
  93.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THESE PROGRAMS IS WITH
  94.  YOU. SHOULD THE {\em IRIT} PROGRAMS PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
  95.  NECESSARY SERVICING, REPAIR OR CORRECTION.
  96.  
  97.    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL GERSHON ELBER,
  98.  BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES,
  99.  OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  100.  USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR A
  101.  FAILURE OF THE PROGRAMS TO OPERATE WITH PROGRAMS NOT DISTRIBUTED BY GERSHON
  102.  ELBER) THE PROGRAMS, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF
  103.  SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  104.  
  105. @\smallskip
  106.  
  107.    {\em IRIT} is a freeware solid modeler. It is not public domain since I
  108.  hold copyrights on it. However unless you are to sell or attempt to make
  109.  money from any part of this code and/or any model you made with this solid
  110.  modeler, you are free to make anything you want with it.
  111.  
  112.    You are not obligated to me or to anyone else in any way by using {\em IRIT}.
  113.    You are encourage to share any model you made with it, but the models
  114.  you made with it are {\em yours}, and you have no obligation to share them.
  115.    You can use this program and/or any model created with it for any non
  116.  commerical and non profit purposes only. An acknowledgement on the way the
  117.  models were created would be nice but is {\em not} required.
  118. $
  119.  
  120. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  121. @\section{Command Line Options and Set Up}
  122. !SETUP
  123.  
  124.    The {\em IRIT} program reads a file called {\bf IRIT.CFG} each time it is executed.
  125.    This file configures the system. It is a regular text file with comments, so
  126.  you can edit it and properly modify it for your environment.
  127.    This file is being searched for in all directories as specified by the
  128.  PATH environment variable on MSDOS BC++ port or in the IRIT\_PATH environment
  129.  variable under UNIX hosts or MSDOS DJGPP port.
  130.    For example 'setenv IRIT\_PATH /u/gershon/irit/bin/'.
  131.    Note IRIT\_PATH must terminate with '/'. If the variables is not set only
  132.  the current directory is being searched for {\bf IRIT.CFG} under UNIX systems.
  133.    Since there exists a configuration file for MSDOS BC++ called IRIT-DOS.CFG,
  134.  for MSDOS DJGPP called IRIT\_DJG.CFG, and for UNIX called IRIT-UNX.CFG, make
  135.  sure you copy the right one for your system, into {\bf IRIT.CFG}.
  136.  
  137.    In addition, if exists, a file by the name of {\bf IRITINIT.IRT} will be
  138.  automatically executed before any other '.irt' file. This file may contain
  139.  any {\em IRIT} command. It is the proper place to put your ALIASs if you have
  140.  some. This file will be searched much the same way {\bf IRIT.CFG} is. The
  141.  name of this initialization file may be changed by setting the StartFile
  142.  entry in the configuration file.
  143.  
  144.    Under MSDOS the solid modeler can be executed in text mode (see the .cfg
  145.  and the -t flag below) on virtually any MSDOS compatible system. The BC++ port
  146.  uses Borlands BGI interface which makes it possible to use almost any device
  147.  that has a BGI interface from Hercules to a Super VGA. See the configuration
  148.  file for the supported device. The DJGPP port can be used on any system that
  149.  has graphic driver for it in this compiler.
  150.  Under BC++ the coprocessor will be used if detected but floating pointing
  151.  emulation will take place otherwise. Under DJGPP the provided emulator
  152.  (emu387) must be used if no 387 exists. If a mouse or a joystick exists
  153.  they can be use by enabling their respective flags in the configuration
  154.  file. The mouse sensitivity can be controlled via the configuration file
  155.  MouseSensitivity flag. In addition whether a mouse or a joystick exists or
  156.  not, the numeric keypad can be used to move the cursor as well. Shifted keys
  157.  will move the cursors 10 pixels at a time instead of one.
  158.    Since MSDOS does not support windowing system, an interface library called
  159.  intr\_lib is used and which provides the windowing and interfacing
  160.  capabilities expected from a windowing system. Four windows are created
  161.  under BC++, three under DJGPP:
  162. # 19 2 0 1
  163.  View
  164.   The window where geometry is displayed.
  165.  Transformation
  166.   The window holding the transformation interaction.
  167.  
  168.   This window pops up with INTERACT command, by default.
  169.  Input
  170.   The window input is keyed in/sourced from a file.
  171.  Status
  172.   Status window, mainly for core left display (only BC++).
  173. #
  174.    These windows can be placed everywhere in the screen by specifing their
  175.  position and size in the configuration file. Border width and color of
  176.  the window can be specified in the configuration file as well as other
  177.  window attributes such as smooth scrolling and window headers.
  178.    Furthermore, these windows can be moved, resized, poped, or pushed during
  179.  a session via a pop up window triggered by the left mouse button (EXECUTE -
  180.  see INTERACT) or F1 keystroke. Note however that while the mouse cursor is
  181.  on the Input window scroll bar or in the Trans window, EXECUTE has a
  182.  different meaning and the pop up menu will not be displayed. The following
  183.  entries can be found in the pop up menu, and their meaning.
  184. # 12 2 0 1
  185.  Redraw all
  186.   Redraw all windows. No window configuration is modified.
  187.  Move
  188.   Move a window. Window to move is picked by left mouse button.
  189.  Resize
  190.   Resize a window. Window to resize is picked as above.
  191.  Pop
  192.   Pop up a window. Window to pop up is picked as above.
  193.  Push
  194.   Push up a window. Window to push down is picked as above.
  195.  Zoom
  196.   Zoom a window to full screen. Window is picked as above.
  197.  
  198.   Zoom on a zoomed window restore the window original size.
  199.  Reset
  200.   Reset all windows to their default position and size.
  201.  Headers
  202.   Toggle the display of windows header - names.
  203. #
  204.  
  205.   Under UNIX using X11 add the following options to your .Xdefaults. Most
  206.  are self explanatory. The Trans attributes control the transformation
  207.  window, while View control the view window. SubWin attributes control
  208.  the subwindows within the Transformation window.
  209. # 33 2 0 1
  210.  irit*Trans*BackGround:
  211.   NavyBlue
  212.  irit*Trans*BorderColor:
  213.   Red
  214.  irit*Trans*BorderWidth:
  215.   3
  216.  irit*Trans*TextColor:
  217.   Yellow
  218.  irit*Trans*SubWin*BackGround:
  219.   DarkGreen
  220.  irit*Trans*SubWin*BorderColor:
  221.   Magenta
  222.  irit*Trans*Geometry:
  223.   =150x500+500+0
  224.  irit*Trans*CursorColor:
  225.   Green
  226.  irit*View*BackGround:
  227.   NavyBlue
  228.  irit*View*BorderColor:
  229.   Red
  230.  irit*View*BorderWidth:
  231.   3
  232.  irit*View*Geometry:
  233.   =500x500+0+0
  234.  irit*View*CursorColor:
  235.   Red
  236. #
  237.  
  238.    If poly3d is used under SGI gl library, you can set the prefered windows
  239.  location in the poly3d.cfg. No color control is provided at this time.
  240.  
  241.    A session can be logged into a file as set via LogFile in the configuration
  242.  file. See also the LOGFILE command.
  243.  
  244.    When developing new model under MSDOS, it is extremely convenient to switch
  245.  between the solid modeler and an editor of your choice to edit the '.irt' file.
  246.  The solid modeler provides a way to fork to an editor of your choice to edit
  247.  the current '.irt' program you develop. Set EditPrgm (in irit.cfg) to the
  248.  editor of your choice, which should be small for fast access. Specify the
  249.  full path to that editor. Use the edit command in {\em IRIT} to call it. Only one
  250.  argument is given to the editor once forking to it - the '.irt' file name as
  251.  given to the edit command (see EDIT command). You can alias the command to
  252.  make it even faster as it is done in the current iritinit.irt - {\em IRIT}
  253.  initialization file.
  254.    Under UNIX one can use the gnu emacs irit.el {\em IRIT} mode provided in this
  255.  package to run {\em IRIT}.
  256.  
  257.    The following command line options are available:
  258.  
  259. @\begin{verbatim}
  260.    IRIT [-t] [-z] [file.irt]
  261. @\end{verbatim}
  262.  
  263. # 10 2 1 1
  264.  -t
  265.    Puts {\em IRIT} into text mode. No graphics will be displayed and
  266.  
  267.    the INTERACT and VIEW commands will be ignored. Useful when
  268.  
  269.    one needs to execute an irt file to create data on a tty device...
  270.  -z
  271.    Prints usage message and current configuration/version
  272.  
  273.    information.
  274.  file.irt
  275.    A file to directly invoke instead of waiting to input from
  276.  
  277.    stdin.
  278. #
  279. $
  280.  
  281. @\section{First Usage}
  282. !FIRSTUSAGE
  283.  
  284.    Once executed, the program opens four windows under MSDOS BC++ (three
  285.  under MSDOS DJGPP - no status window): view, status, trans and input windows,
  286.  and opens a view window under UNIX.
  287.  
  288.    Commands are entered through the input window, which is in the same window
  289.  as the shell executed {\em IRIT} under UNIX. Objects are viewed in the view
  290.  window, and the status window is used as an auxiliary window (MSDOS only).
  291.  
  292.    Some important commands to begin with are
  293.  
  294.    1. include("file.irt"); - will execute the commands in file.irt. Note
  295.       include can be recursive up to 10 levels. To execute the demo
  296.       (demo.irt) simply type 'include("demo.irt");'. Another way to run
  297.       the demo is by typing DEMO (must be capitalized as this is an alias
  298.       loaded via the iritinit.irt initialization file - see the ALIAS
  299.       command for more).
  300.  
  301.    2. help(""); - will print all available commands and how to get help on
  302.       them. A file by the name irit.hlp will be searched as irit.cfg is
  303.       being searched (see above), to provide the help.
  304.  
  305.    3. exit(); - close everything and exit {\em IRIT}.
  306.  
  307.    Be careful. Most operators are overloaded. This means that you can multiply
  308.  two scalars (numbers) or two vectors or even two matrices with the same
  309.  multiplication symbol ($*$). To get its on line type 'help("$*$");'
  310.  
  311.    The best way to learn this program (like any other program...) is by
  312.  playing with it. Print the manual and study each of the commands available.
  313.    Study the demo programs ($*$.irt) provided as well.
  314.  
  315.    Under MSDOS, input from keyboard has full line editing capability:
  316.  
  317.    1. Up/Down arrow : retrieve old command for 10 last commands.
  318.  
  319.    2. Left/Right arrows : to move left and right along the line.
  320.  
  321.    3. Home/End : to move to beginning/end of line.
  322.  
  323.    4. Delete : to delete the character the cursor is on.
  324.  
  325.    5. Back space : to delete one char backward.
  326.  
  327.    6. Insert : toggles insert/overwrite mode. Note cursor shape is modified.
  328.  
  329.    7. Esc : clear the entire line.
  330.  
  331.    8. CR : to accept line and quit.
  332. $
  333.  
  334. @\section{Data Types}
  335. !DATATYPES
  336.   These are the Data Types recognized the system. They are also used to
  337.  define the calling sequences of the different functions below:
  338. # 18 2 1 1
  339.  {\bf ConstantType}
  340.   Scalar real type that cannot be modified.
  341.  {\bf NumericType}
  342.   Scalar real type.
  343.  {\bf VectorType}
  344.   3D real type vector (points/vectors).
  345.  {\bf CtlPtType}
  346.   Curve or Surface Control Point.
  347.  {\bf MatrixType}
  348.   4 by 4 matrix (homogeneous transformation matrix).
  349.  {\bf PolygonType}
  350.   Object consists of Polygons.
  351.  {\bf PolylineType}
  352.   Object consists of Polylines.
  353.  {\bf CurveType}
  354.   Object consists of Curves.
  355.  {\bf SurfaceType}
  356.   Object consists of Surfaces.
  357.  {\bf GeometriceType}
  358.   One of Polygon/lineType, CurveType, SurfaceType.
  359.  {\bf GeometricTreeType}
  360.   A list of GeometricTypes or GeometricTreeTypes.
  361.  {\bf StringType}
  362.   Sequence of chars within double quotes - "A string".
  363.  
  364.   Current implementation is limited to 80 chars.
  365.  {\bf AnyType}
  366.   Any of the above.
  367.  {\bf ListType}
  368.   List of (any of the above type) objects. Implementation 
  369.  
  370.   is currently limited to 250 (50 MSDOS) objects in a list.
  371. #
  372. $
  373.  
  374. @\section{Commands summary}
  375. !COMMANDS
  376.  
  377.  These are all the commands and operators supported by the {\em IRIT} solid modeler:
  378.  
  379. # 11 6 1 0
  380.  $+$
  381.  $-$
  382.  $*$
  383.  $/$
  384.  \verb+^+
  385.  ABS
  386.  ACOS
  387.  ALIAS
  388.  ARC
  389.  AREA
  390.  ASIN
  391.  ATAN
  392.  ATAN2
  393.  ATTRIB
  394.  BEEP
  395.  BOOLSUM
  396.  BOX
  397.  CBEZIER
  398.  CBSPLINE
  399.  CDIVIDE
  400.  CEDITPT
  401.  CEVAL
  402.  CHDIR
  403.  CIRCLE
  404.  CIRCPOLY
  405.  CLOSED
  406.  CMESH
  407.  COLOR
  408.  COMMENT
  409.  CON2
  410.  CONE
  411.  CONVEX
  412.  COS
  413.  CPOLY
  414.  CRAISE
  415.  CREFINE
  416.  CREGION
  417.  CROSSEC
  418.  CSURFACE
  419.  CTANGENT
  420.  CTLPT
  421.  CYLIN
  422.  DIR
  423.  EDIT
  424.  EXIT
  425.  EXP
  426.  EXTRUDE
  427.  FOR
  428.  FREE
  429.  GBOX
  430.  GPOLYGON
  431.  GPOLYLINE
  432.  HELP
  433.  IF
  434.  INCLUDE
  435.  INTERACT
  436.  LIST
  437.  LN
  438.  LOAD
  439.  LOG
  440.  LOGFILE
  441.  MERGEPOLY
  442.  NORMAL
  443.  NTH
  444.  OFFSET
  445.  PAUSE
  446.  POLY
  447.  ROTX
  448.  ROTY
  449.  ROTZ
  450.  RULEDSRF
  451.  SAVE
  452.  SBEZIER
  453.  SBSPLINE
  454.  SCALE
  455.  SDIVIDE
  456.  SEDITPT
  457.  SEVAL
  458.  SFROMCRVS
  459.  SIN
  460.  SNOC
  461.  SNORMAL
  462.  SPHERE
  463.  SQRT
  464.  SRAISE
  465.  SREFINE
  466.  SREGION
  467.  STANGENT
  468.  SURFREV
  469.  SWEEPSRF
  470.  SYSTEM
  471.  TAN
  472.  TIME
  473.  TORUS
  474.  TRANS
  475.  VARLIST
  476.  VECTOR
  477.  VIEW
  478.  VOLUME
  479. #
  480. $
  481.  
  482. @\section{Functions and Variables}
  483. !FUNCTIONS
  484. @ This sections lists all the functions supported by the {\em IRIT} system
  485. @ according to their classes - the object type they return.
  486. @
  487.  
  488.  These are the functions returning a {\bf NumericType}:
  489. # 11 5 1 0
  490.  ABS
  491.  ACOS
  492.  AREA
  493.  ASIN
  494.  ATAN
  495.  ATAN2
  496.  COS
  497.  CPOLY
  498.  EXP
  499.  LN
  500.  LOG
  501.  SIN
  502.  SQRT
  503.  TAN
  504.  VOLUME
  505. #
  506.  
  507.  These are the functions returning a {\bf GeometricType}:
  508. # 11 6 1 0
  509.  ARC
  510.  BOOLSUM
  511.  BOX
  512.  CBEZIER
  513.  CBSPLINE
  514.  CDIVIDE
  515.  CEDITPT
  516.  CEVAL
  517.  CIRCLE
  518.  CIRCPOLY
  519.  CMESH
  520.  CON2
  521.  CONE
  522.  CONVEX
  523.  CPOLY
  524.  CRAISE
  525.  CREFINE
  526.  CREGION
  527.  CROSSEC
  528.  CSURFACE
  529.  CTANGENT
  530.  CTLPT
  531.  CYLIN
  532.  EXTRUDE
  533.  GBOX
  534.  GPOLYGON
  535.  GPOLYLINE
  536.  MERGEPOLY
  537.  OFFSET
  538.  POLY
  539.  RULEDSRF
  540.  SBEZIER
  541.  SBSPLINE
  542.  SDIVIDE
  543.  SEDITPT
  544.  SEVAL
  545.  SFROMCRVS
  546.  SNORMAL
  547.  SPHERE
  548.  SRAISE
  549.  SREFINE
  550.  SREGION
  551.  STANGENT
  552.  SURFREV
  553.  SWEEPSRF
  554.  TORUS
  555. #
  556.  
  557.  These are the functions to linearly transform an object:
  558. # 11 5 1 0
  559.  ROTX
  560.  ROTY
  561.  ROTZ
  562.  SCALE
  563.  TRANS
  564. #
  565.  
  566.  These are the miscellaneous functions:
  567. # 11 6 1 0
  568.  ALIAS
  569.  ATTRIB
  570.  BEEP
  571.  CHDIR
  572.  CLOSED
  573.  COLOR
  574.  COMMENT
  575.  DIR
  576.  EDIT
  577.  EXIT
  578.  FOR
  579.  FREE
  580.  HELP
  581.  IF
  582.  INCLUDE
  583.  INTERACT
  584.  LIST
  585.  LOAD
  586.  LOGFILE
  587.  NORMAL
  588.  NTH
  589.  PAUSE 
  590.  SAVE
  591.  SNOC
  592.  SYSTEM
  593.  TIME
  594.  VARLIST
  595.  VECTOR
  596.  VIEW
  597. #
  598.  
  599.  These are the variables predefined in the system:
  600. # 11 5 1 0
  601.  AXES
  602.  DRAWCTLPT
  603.  DUMPLVL
  604.  ECHOSRC
  605.  FLAT4PLY
  606.  INTERCRV
  607.  INTERNAL
  608.  MACHINE
  609.  RESOLUTION
  610.  VIEW\_MAT
  611. #
  612.  
  613.  These are the constants predefined in the system:
  614. # 11 6 1 0
  615.  APOLLO
  616.  BLACK
  617.  BLUE
  618.  COL
  619.  CYAN
  620.  E2
  621.  E3
  622.  FALSE
  623.  GREEN
  624.  HP
  625.  KV\_FLOAT
  626.  KV\_OPEN
  627.  MAGENTA
  628.  MSDOS
  629.  OFF
  630.  ON
  631.  P2
  632.  P3
  633.  PI
  634.  RED
  635.  ROW
  636.  SGI
  637.  SUN
  638.  TRUE
  639.  UNIX  
  640.  WHITE
  641.  YELLOW
  642. #
  643. $
  644.  
  645. @\section{Language description}
  646. !LANGUAGE
  647.     The front end of the {\em IRIT} solid modeler is an infix parser that mimics
  648.  some of the C language behavior. The infix operators that are supported
  649.  are plus (+), minus (-), multiply (*), divide (/), and power (\verb+^+) for
  650.  numeric operators and with the same precedence as in C.
  651.  
  652.     However, unlike the C language, these operators are overloaded,
  653. @\footnote{In fact the C language do support overloaded operators to some
  654. @extent: '1 + 2' and '1.0 + 2.0' implies invocation of two different
  655. @actions.}
  656.  or different action is taken based upon the different operands.
  657.    This means that one can write '1 + 2' in which the plus sign is a regular
  658.  numetic addition, or one can write 'PolyObj1 + PolyObj2' in which the plus
  659.  sign is now the Boolean operation of union between two geometric objects.
  660.    The exact way each operator is overloaded is defined below.
  661.  
  662.    In this environment the representation of reals, integers, and even
  663.  Boolean data is identical. Data is automatically promoted as necessary.
  664.  The constants TRUE and FALSE are defined as 1.0 and 0.0 respectively,
  665.  for example.
  666.  
  667.    Each expression is terminated by a semicolon. An expression can be as
  668.  simple as 'a;' which prints the value of variable a, or as complex as:
  669.  
  670. @\begin{verbatim}
  671.     for ( (t = 1.1), 0.1, 1.9,
  672.             (
  673.                ( cb1 = csurface( sb, COL, t ) ):
  674.                color( cb1, green ):
  675.                snoc( cb1, cb_all )
  676.             )
  677.         );
  678. @\end{verbatim}
  679.  
  680.    Once a complete expression is read in and parsed correctly (i.e. no syntax
  681.  errors were found), it is executed. Before each operator or a function
  682.  are executed, parameter type matching tests are being made to make sure
  683.  the operator can be applied to these operand(s), or the function gets the
  684.  correct set of arguments.
  685.  
  686.    The parser is almost totally case insensitive (with one exception - see
  687.  the ALIAS command) so Obj, obj and OBJ will refer to the same object while
  688.  MergePoly, MERGEPOLY, and margePoly will refer to the same function.
  689.  
  690.    Objects (Variables if you prefer) need not be declared. Simply use them
  691.  when you need them. Object names may be any alpha-numeric (and underscore)
  692.  string of at most 10 characters. By assigning to an old object, the old
  693.  object will be automatically deleted and if necessary its type will be
  694.  changing on the fly. For example:
  695.  
  696. @\begin{verbatim}
  697.     V = sin( 45 * pi / 180.0 );
  698.     V = V * vector( 1, 2, 3 );
  699.     V = V * rotx( 90 );
  700.     V = V * V;
  701. @\end{verbatim}
  702.  
  703.  will assign to V a NumericType of sine of 45 degrees, the VectorType
  704.  ( 1, 2, 3 ) scaled by the sine of 45, rotate that vector around the X axis
  705.  by 90 degrees, and finally a NumericType which is its dot product.
  706.  
  707.    The parser will read from stdin unless a file was specified on the command
  708.  line or an INCLUDE command was executed. In both cases, when done reading
  709.  from the file, the parser will again wait for input from stdin. In order
  710.  to execute a file and quit when the file is done, put an EXIT command as
  711.  the last command in the file.
  712. $
  713.  
  714. @\section{Operator overloading}
  715. @
  716. @ This section lists the way the basic operators $+$, $-$, $*$, $/$, and
  717. @ \verb+^+ are overloaded. In other words, what action is taken by each
  718. @ of these operators depending upon its arguments.
  719. @
  720. @\subsection{Overloading $+$}
  721. !+
  722.  The $+$ operator is overloaded above the following domains:
  723.  
  724. @\begin{verbatim}
  725.   NumericType + NumericType -> NumericType
  726.   VectorType  + VectorType  -> VectorType
  727.   MatrixType  + MatrixType  -> MatrixType
  728.   PolygonType + PolygonType -> PolygonType  (Boolean UNION operation)
  729.   CurveType   + CurveType   -> CurveType    (Curve curve chaining)
  730.   CurveType   + CtlPtType   -> CurveType    (Curve control point chaining)
  731.   CtlPtType   + CtlPtType   -> CurveType    (Control points chaining)
  732.   ListType    + ListType    -> ListType     (Append lists operator)
  733. @\end{verbatim}
  734.  
  735.  Note: Boolean UNION of two disjoint objects (no common volume) will result
  736.  with the two objects combined. It is the USER responsibility to make sure that
  737.  the non intersecting object are also disjoint - this system only tests for
  738.  no intersection.
  739. $
  740.  
  741. @\subsection{Overloading $-$}
  742. !-
  743.  The $-$ operator is overloaded above the following domains:
  744.  
  745.  As a Diadic operator:
  746.  
  747. @\begin{verbatim}
  748.   NumericType - NumericType -> NumericType
  749.   VectorType  - VectorType  -> VectorType
  750.   MatrixType  - MatrixType  -> MatrixType
  751.   PolygonType - PolygonType -> PolygonType (Boolean SUBTRACT operation)
  752. @\end{verbatim}
  753.  
  754.  As a Monadic operator:
  755.  
  756. @\begin{verbatim}
  757.   - NumericType -> NumericType
  758.   - VectorType  -> VectorType    (Scaling all vector by -1)
  759.   - MatrixType  -> MatrixType    (Scaling all matrix by -1)
  760.   - PolygonType -> PolygonType   (Boolean NEGATION operation)
  761.   - CurveType   -> CurveType     (Curve parameterization is reversed)
  762.   - SurfaceType -> SurfaceType   (Surface parameterization is reversed)
  763. @\end{verbatim}
  764.  
  765.  Note: Boolean SUBTRACT of two disjoint objects (no common volume) will result
  766.  with an empty object. For both a curve and a surface parameterization reverse
  767.  opeartion (Monadic minus) causes the object normal to be flipped as a side
  768.  effect.
  769. $
  770.  
  771. @\subsection{Overloading $*$}
  772. !*
  773.  The $*$ operator is overloaded above the following domains:
  774.  
  775. @\begin{verbatim}
  776.   NumericType * NumericType   -> NumericType
  777.   VectorType  * NumericType   -> VectorType     (Vector scaling)
  778.   VectorType  * VectorType    -> NumericType    (Inner product)
  779.   MatrixType  * NumericType   -> MatrixType     (Matrix Scaling)
  780.   MatrixType  * VectorType    -> VectorType     (Vector transform)
  781.   MatrixType  * MatrixType    -> MatrixType     (Matrix multiplication)
  782.   MatrixType  * GeometricType -> GeometricType  (Object transform)
  783.   MatrixType  * ListType      -> ListType       (Object hierarchy transform)
  784.   PolygonType * PolygonType   -> PolygonType    (Boolean INTERSECTION operation)
  785. @\end{verbatim}
  786.  
  787.  Note: Boolean INTERSECTION of two disjoint objects (no common volume) will
  788.  result with an empty object. Object hierarchy transform transforms any
  789.  transformable object (GeometricType) found in the list recursively.
  790. $
  791.  
  792. @\subsection{Overloading $/$}
  793. !/
  794.  The $/$ operator is overloaded above the following domains:
  795.  
  796. @\begin{verbatim}
  797.   NumericType / NumericType -> NumericType
  798.   PolygonType / PolygonType -> PolygonType   (Boolean CUT operation)
  799. @\end{verbatim}
  800. $
  801.  
  802.  Note: Boolean CUT of two disjoint objects (no common volume) will result
  803.  with an empty object.
  804. $
  805.  
  806. @\subsection{Overloading \^{\ }}
  807. !^
  808.  The \verb+^+ operator is overloaded above the following domains:
  809.  
  810. @\begin{verbatim}
  811.   NumericType ^ NumericType -> NumericType
  812.   MatrixType  ^ NumericType -> MatrixType   (Matrix to the power)
  813.   PolygonType ^ PolygonType -> PolygonType  (Boolean MERGE operation)
  814. @\end{verbatim}
  815.  
  816.  Note: Boolean MERGE simply merges the two sets of polygons without any
  817.  intersection tests. Matrix powers must be positive integers or -1 in which
  818.  the matrix inverse (if exists) is computed.
  819. $
  820.  
  821. @\subsection{Assignments}
  822. !=
  823.    Assignments are allowed as side effects, any place in any expressions:
  824.  If Expr is an expression, then (var = Expr) is the exact same expression
  825.  with the side effect of setting Var to that value. There is no guarantee
  826.  on the order of evaluation, so using Vars that are set within same
  827.  expression are a bad practice.
  828.  
  829.    Any assignment which is not at top level, MUST be within parenthesis.
  830. $
  831.  
  832. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  833. @\section{Function's Description}
  834. &Function's Description
  835.  
  836. @ The function description below defines their calling sequence in ANSI C
  837. @ notation. Listed are all the functions the system knows about in alphabetic
  838. @ order, according to their classes.
  839. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  840. @\subsection{NumericType returning functions}
  841. &NumericType returning functions
  842.  
  843. @\subsubsection{ABS}
  844. !ABS
  845.  
  846. @\begin{verbatim}
  847.  NumericType ABS( NumericType Operand )
  848. @\end{verbatim}
  849.  
  850.    Returns the absolute value of the given {\bf Operand}.
  851. $
  852.  
  853. @\subsubsection{ACOS}
  854. !ACOS
  855.  
  856. @\begin{verbatim}
  857.  NumericType ACOS( NumericType Operand )
  858. @\end{verbatim}
  859.  
  860.    Returns the arc cosine value (in radians) of the given {\bf Operand}.
  861. $
  862.  
  863. @\subsubsection{AREA}
  864. !AREA
  865.  
  866. @\begin{verbatim}
  867.  NumericType AREA( PolygonType Object )
  868. @\end{verbatim}
  869.  
  870.    Return the area of the given {\bf Object} (in object units). Returned is
  871.  the real area of the polygonal object - not the primitive it might approximate.
  872.  
  873.    That means that the area of a polygonal approximation to a sphere will be
  874.  returned, not the sphere area.
  875. $
  876.  
  877. @\subsubsection{ASIN}
  878. !ASIN
  879.  
  880. @\begin{verbatim}
  881.  NumericType ASIN( NumericType Operand )
  882. @\end{verbatim}
  883.  
  884.    Returns the arc sine value (in radians) of the given {\bf Operand}.
  885. $
  886.  
  887. @\subsubsection{ATAN}
  888. !ATAN
  889.  
  890. @\begin{verbatim}
  891.  NumericType ATAN( NumericType Operand )
  892. @\end{verbatim}
  893.  
  894.    Returns the arc tangent value (in radians) of the given {\bf Operand}.
  895. $
  896.  
  897. @\subsubsection{ATAN2}
  898. !ATAN2
  899.  
  900. @\begin{verbatim}
  901.  NumericType ATAN2( NumericType Operand1, NumericType Operand2 )
  902. @\end{verbatim}
  903.  
  904.    Returns the arc tangent value (in radians) of the given ratio:
  905.  {\bf Operand1} / {\bf Operand2}, over the whole angle circle.
  906. $
  907.  
  908. @\subsubsection{COS}
  909. !COS
  910.  
  911. @\begin{verbatim}
  912.  NumericType COS( NumericType Operand )
  913. @\end{verbatim}
  914.  
  915.    Returns the cosine value of the given {\bf Operand} (in radians).
  916. $
  917.  
  918. @\subsubsection{CPOLY}
  919. !CPOLY
  920.  
  921. @\begin{verbatim}
  922.  NumericType CPOLY( PolygonType Object )
  923. @\end{verbatim}
  924.  
  925.    Returns the number of polygons in the given polygonal {\bf Object}.
  926. $
  927.  
  928. @\subsubsection{EXP}
  929. !EXP
  930.  
  931. @\begin{verbatim}
  932.  NumericType EXP( NumericType Operand )
  933. @\end{verbatim}
  934.  
  935.    Returns the natural exponent value of the given {\bf Operand}.
  936. $
  937.  
  938. @\subsubsection{LN}
  939. !LN
  940.  
  941. @\begin{verbatim}
  942.  NumericType LN( NumericType Operand )
  943. @\end{verbatim}
  944.  
  945.    Returns the natural logarithm value of the given {\bf Operand}.
  946. $
  947.  
  948. @\subsubsection{LOG}
  949. !LOG
  950.  
  951. @\begin{verbatim}
  952.  NumericType LOG( NumericType Operand )
  953. @\end{verbatim}
  954.  
  955.    Returns the base 10 logarithm value of the given {\bf Operand}.
  956. $
  957.  
  958. @\subsubsection{SIN}
  959. !SIN
  960.  
  961. @\begin{verbatim}
  962.  NumericType SIN( NumericType Operand )
  963. @\end{verbatim}
  964.  
  965.    Returns the sine value of the given {\bf Operand} (in radians).
  966. $
  967.  
  968. @\subsubsection{SQRT}
  969. !SQRT
  970.  
  971. @\begin{verbatim}
  972.  NumericType SQRT( NumericType Operand )
  973. @\end{verbatim}
  974.  
  975.    Returns the square root value of the given {\bf Operand}.
  976. $
  977.  
  978. @\subsubsection{TAN}
  979. !TAN
  980.  
  981. @\begin{verbatim}
  982.  NumericType TAN( NumericType Operand )
  983. @\end{verbatim}
  984.  
  985.    Returns the tangent value of the given {\bf Operand} (in radians).
  986. $
  987.  
  988. @\subsubsection{VOLUME}
  989. !VOLUME
  990.  
  991. @\begin{verbatim}
  992.  NumericType VOLUME( PolygonType Object )
  993. @\end{verbatim}
  994.  
  995.    Return the volume of the given {\bf Object} (in object units). Returned is
  996.  the real volume of the polygonal object - not the object it might approximate.
  997.  
  998.    This routine decompose all non convex polygons to convex ones as side
  999.  effect (see CONVEX).
  1000. $
  1001.  
  1002. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1003. @\subsection{GeometricType returning functions}
  1004.  
  1005. &GeometricType returning functions
  1006.  
  1007. @\subsubsection{ARC}
  1008. !ARC
  1009.  
  1010. @\begin{verbatim}
  1011.  CurveType ARC( VectorType StartPos, VectorType Center, VectorType EndPos )
  1012. @\end{verbatim}
  1013.  
  1014.  An arc constructor between two end points {\bf StartPos} and {\bf EndPos}
  1015.  centered at {\bf Center}. Arc will always be less than 180 degrees so the
  1016.  shortest arc path from {\bf StartPos} to {\bf EndPos} is selected. The
  1017.  case where {\bf StartPos}, {\bf Center}, and {\bf EndPos} are colinear is
  1018.  illegal, since it attempts to define a 180 degrees arc. Arc is constructed
  1019.  as a single rational quadratic Bezier curve. Example:
  1020.  
  1021. @\begin{verbatim}
  1022.     Arc1 = ARC( vector( 1.0, 0.0, 0.0 ),
  1023.                 vector( 1.0, 1.0, 0.0 ),
  1024.                 vector( 0.0, 1.0, 0.0 ) );
  1025. @\end{verbatim}
  1026.  
  1027.  constructs a 90 degrees arc tangent to both X and Y axes at coordinate 1.
  1028. $
  1029.  
  1030. @\subsubsection{BOOLSUM}
  1031. !BOOLSUM
  1032.  
  1033. @\begin{verbatim}
  1034.  SurfaceType BOOLSUM( CurveType Crv1, CurveType Crv2,
  1035.                       CurveType Crv3, CurveType Crv4 )
  1036. @\end{verbatim}
  1037.  
  1038.  Construct a surface using the provided four curves as its four boundary
  1039.  curves. Curves do not have to have the same order or type and will be
  1040.  promoted to their least common denominator. The four curves end points
  1041.  should match as follows:
  1042. # 30 2 0 1
  1043.  {\bf Crv1} start point,
  1044.   to {\bf Crv3} start point.
  1045.  {\bf Crv1} end point,
  1046.   to {\bf Crv4} start point.
  1047.  {\bf Crv2} start point,
  1048.   to {\bf Crv3} end point.
  1049.  {\bf Crv2} end point,
  1050.   to {\bf Crv4} end point.
  1051. #
  1052.  where {\bf Crv1} and {\bf Crv2} are the two boundaries in one parameteric
  1053.  direction and {\bf Crv3} and {\bf Crv4} are the two in the other.
  1054.  
  1055.  Example:
  1056.  
  1057. @\begin{verbatim}
  1058.     Cbzr1 = cbezier( list( ctlpt( E3, 0.1, 0.1, 0.1 ),
  1059.                            ctlpt( E3, 0.0, 0.5, 1.0 ),
  1060.                            ctlpt( E3, 0.4, 1.0, 0.4 ) ) );
  1061.     Cbzr2 = cbezier( list( ctlpt( E3, 1.0, 0.2, 0.2 ),
  1062.                            ctlpt( E3, 1.0, 0.5, -1.0 ),
  1063.                            ctlpt( E3, 1.0, 1.0, 0.3 ) ) );
  1064.     Cbsp3 = cbspline( 4,
  1065.                       list( ctlpt( E3, 0.1,  0.1, 0.1 ),
  1066.                             ctlpt( E3, 0.25, 0.0, -1.0 ),
  1067.                             ctlpt( E3, 0.5,  0.0, 2.0 ),
  1068.                             ctlpt( E3, 0.75, 0.0, -1.0 ),
  1069.                             ctlpt( E3, 1.0,  0.2, 0.2 ) ),
  1070.                       list( KV_OPEN ) );
  1071.     Cbsp4 = cbspline( 4,
  1072.                       list( ctlpt( E3, 0.4,  1.0, 0.4 ),
  1073.                             ctlpt( E3, 0.25, 1.0, 1.0 ),
  1074.                             ctlpt( E3, 0.5,  1.0, -2.0 ),
  1075.                             ctlpt( E3, 0.75, 1.0, 1.0 ),
  1076.                             ctlpt( E3, 1.0,  1.0, 0.3 ) ),
  1077.                       list( KV_OPEN ) );
  1078.     Srf = BOOLSUM( Cbzr1, Cbzr2, Cbsp3, Cbsp4 );
  1079. @\end{verbatim}
  1080. $
  1081.  
  1082. @\subsubsection{BOX}
  1083. !BOX
  1084.  
  1085. @\begin{verbatim}
  1086.  PolygonType BOX( VectorType Point,
  1087.                   NumericType Dx, NumericType Dy, NumericType Dz )
  1088. @\end{verbatim}
  1089.  
  1090.    Creates a main planes parallel BOX polygonal object, defined by {\bf Point} as
  1091.  base position, and {\bf Dx, Dy, Dz} as BOX dimensions. Note negative dimensions
  1092.  are allowed. Example:
  1093.  
  1094. @\begin{verbatim}
  1095.     B = BOX( vector( 0, 0, 0 ), 1, 1, 1);
  1096. @\end{verbatim}
  1097.  
  1098.  creates a unit cube from 0 to 1 in all axes.
  1099. $
  1100.  
  1101. @\subsubsection{CBEZIER}
  1102. !CBEZIER
  1103.  
  1104. @\begin{verbatim}
  1105.  CurveType CBEZIER( ListType CtlPtList )
  1106. @\end{verbatim}
  1107.  
  1108.    Creates a Bezier curve out of the provided control point list. {\bf CtlPtList}
  1109.  is a list of control points, all of the same type (E2, E3, P2, or P3).
  1110.  Example:
  1111.  
  1112. @\begin{verbatim}
  1113.     s45 = sin(pi / 4);
  1114.     Arc90 = CBEZIER( list( ctlpt( P2, 1.0, 0.0, 1.0 ),
  1115.                            ctlpt( P2, s45, s45, s45 ),
  1116.                            ctlpt( P2, 1.0, 1.0, 0.0 ) ) );
  1117. @\end{verbatim}
  1118.  
  1119.  constructs an arc of 90 degrees as a rational quadratic Bezier curve.
  1120. $
  1121.  
  1122. @\subsubsection{CBSPLINE}
  1123. !CBSPLINE
  1124.  
  1125. @\begin{verbatim}
  1126.  CurveType CBSPLINE( NumericType Order, ListType CtlPtList,
  1127.                                                         ListType KnotVector )
  1128. @\end{verbatim}
  1129.  
  1130.    Creates a Bspline curve out of the provided control point list and the
  1131.  knot vector, with the specified order. {\bf CtlPtList} is a list of control points,
  1132.  all of the same type (E2, E3, P2, or P3) defining the curve control polygon.
  1133.  The length of the {\bf KnotVector} must be equal to the number of control
  1134.  points in {\bf CtlPtList} plus {\bf Order}.
  1135.  Example:
  1136.  
  1137. @\begin{verbatim}
  1138.     s45 = sin(pi / 4);
  1139.     HalfCirc = CBSPLINE( 3,
  1140.                       list( ctlpt( P3, 1.0,  0.0, 0.0,  1.0 ),
  1141.                             ctlpt( P3, s45, -s45, 0.0,  s45 ),
  1142.                             ctlpt( P3, 1.0, -1.0, 0.0,  0.0 ),
  1143.                             ctlpt( P3, s45, -s45, 0.0, -s45 ),
  1144.                             ctlpt( P3, 1.0,  0.0, 0.0, -1.0 ) ),
  1145.                       list( 0, 0, 0, 1, 1, 2, 2, 2 ) );
  1146. @\end{verbatim}
  1147.  
  1148.  constructs an arc of 180 degrees in the XZ plane as a rational quadratic
  1149.  Bspline curve.
  1150.  
  1151.    The knot vector list may be specified as {\bf list( KV\_OPEN )} or as
  1152.  {\bf list( KV\_FLOAT )} in which a uniform open or floating knot vector
  1153.  with the appropriate length is automatically constructed. 
  1154. $
  1155.  
  1156. @\subsubsection{CDIVIDE}
  1157. !CDIVIDE
  1158.  
  1159. @\begin{verbatim}
  1160.  ListType CDIVIDE( CurveType Curve, NumericType Param )
  1161. @\end{verbatim}
  1162.  
  1163.    Subdivides a curve into two at the specified parameter value. {\bf Curve}
  1164.  can be either a Bspline curve in which {\bf Param} must be within Curve
  1165.  parametric domain or a Bezier curve in which {\bf Param} must be in the
  1166.  0 to 1 range.
  1167.  
  1168.    Returned is a list of the two sub-curves. The individual curves may be
  1169.  extracted from the list using the NTH command. For example:
  1170.  
  1171. @\begin{verbatim}
  1172.  CrvLst = CDIVIDE( Crv, 0.5 );
  1173.  Crv1 = nth( CrvLst, 1 );
  1174.  Crv2 = nth( CrvLst, 2 );
  1175. @\end{verbatim}
  1176.  
  1177.  subdivides the curve {\bf Crv} at the parameter value 0.5.
  1178. $
  1179.  
  1180. @\subsubsection{CEDITPT}
  1181. !CEDITPT
  1182.  
  1183. @\begin{verbatim}
  1184.  CurveType CEDITPT( CurveType Curve, CtlPtType CtlPt, NumericType Index )
  1185. @\end{verbatim}
  1186.  
  1187.    Provides a simple mechanism to manually modify a single control point number
  1188.  {\bf Index} (base count is 0) in {\bf Curve}, by substituting {\bf CtlPt}
  1189.  instead. {\bf CtlPt} must have the same point type as {\bf Curve} points.
  1190.  Original curve {\bf Curve} is not modified. Example:
  1191.  
  1192. @\begin{verbatim}
  1193.     CPt = ctlpt( E3, 1, 2, 3 );
  1194.     NewCrv = CEDITPT( Curve, CPt, 1 );
  1195. @\end{verbatim}
  1196.  
  1197.  constructs a {\bf NewCrv} with the second control point of {\bf Curve} being
  1198.  {\bf CPt}.
  1199. $
  1200.  
  1201. @\subsubsection{CEVAL}
  1202. !CEVAL
  1203.  
  1204. @\begin{verbatim}
  1205.  CtlPtType CEVAL( CurveType Curve, NumericType Param )
  1206. @\end{verbatim}
  1207.  
  1208.    Evaluates the provided {\bf Curve} at the given {\bf Param } value.
  1209.  {\bf Param} should be with the curve domain if {\bf Curve} is a Bspline
  1210.  curve, or between 0 and 1 if {\bf Curve} is a Bezier curve. Returned
  1211.  control point has the same type as the {\bf Curve} control points. Example:
  1212.  
  1213. @\begin{verbatim}
  1214.     CPt = CEVAL( Crv, 0.25 );
  1215. @\end{verbatim}
  1216.  
  1217.  evaluates {\bf Crv} at the parameter value of 0.25.
  1218. $
  1219.  
  1220. @\subsubsection{CIRCLE}
  1221. !CIRCLE
  1222.  
  1223. @\begin{verbatim}
  1224.  CurveType CIRCLE( VectorType Center, NumericType Radius )
  1225. @\end{verbatim}
  1226.  
  1227.    Construct a circle at the specified {\bf Center} with the specified
  1228.  {\bf Radius}. Returned circle is a Bspline curve of four piecewise Bezier
  1229.  90 degree arcs. Circle is always parallel to the XY plane. Use the linear
  1230.  transformation routines to place the circle in the appropriate location.
  1231. $
  1232.  
  1233. @\subsubsection{CIRCPOLY}
  1234. !CIRCPOLY
  1235.  
  1236. @\begin{verbatim}
  1237.  PolygonType CIRCPOLY( VectorType Normal, VectorType Trans, NumericType Radius )
  1238. @\end{verbatim}
  1239.  
  1240.    As in this solid modeler, open objects are allowed (although any two
  1241.  objects intersection should form a closed loop), a plane (open!) object
  1242.  also exists. The function defines a circular polygon with the given
  1243.  {\bf Normal}, and includes the {\bf Trans} point. It is implemented as a FINITE
  1244.  circle with resolution (see RESOLUTION) edges, radius {\bf Radius} and center
  1245.  {\bf Trans} on that plane. It is the user responsibility to make sure that any
  1246.  Boolean operation on it (or any other open object) will create closed loops as
  1247.  intersecting curves and/or open loops terminated on its boundary (no
  1248.  termination in the middle of it is allowed).
  1249.  
  1250.    Alternative to the function are manual construction of the required plane 
  1251.  as a single polygon using POLY, or construction of a flat ruled surface using
  1252.  RULEDSRF.
  1253. $
  1254.  
  1255. @\subsubsection{CMESH}
  1256. !CMESH
  1257.  
  1258. @\begin{verbatim}
  1259.  CurveType CMESH( SurfaceType Srf, ConstantType Direction, NumericType Index )
  1260. @\end{verbatim}
  1261.  
  1262.    Returns a single ROW or COLumn as specified by the {\bf Direction} and
  1263.  {\bf Index} (base count is 0) of the surface {\bf Srf} control mesh.
  1264.  
  1265.    Returned curve will have the same knot vector as {\bf Srf} in the
  1266.  appropriate direction. See also CSURFACE.
  1267.  
  1268.    Note this curve is {\em not} necessarily in the surface {\bf Srf}. Example:
  1269.  
  1270. @\begin{verbatim}
  1271.     Crv = CMESH( Srf, COL, 0 );
  1272. @\end{verbatim}
  1273.  
  1274.  extracts the first column of surface {\bf Srf} as a curve.
  1275. $
  1276.  
  1277. @\subsubsection{CON2}
  1278. !CON2
  1279.  
  1280. @\begin{verbatim}
  1281.  PolygonType CON2( VectorType Center, VectorType Direction,
  1282.                    NumericType Radius1, NumericType Radius2 )
  1283. @\end{verbatim}
  1284.  
  1285.    Create a truncated CONE geometric object, defined by {\bf Center} as CONE main
  1286.  base center, CONE axes {\bf Direction}, and CONE base radii {\bf Radius1/2}.
  1287.  
  1288.    Note {\bf Direction} magnitude also sets the CONE height. {\bf Direction} can be any
  1289.  3D vector.
  1290.  
  1291.    Unlike the regular cone (CONE) constructor which has discontinuities in
  1292.  its apex generated normals, CON2 may be used to form a truncated cone but
  1293.  with continuous normals. 
  1294.    See RESOLUTION for accuracy of CON2 approximation as polygonal model. 
  1295.    Example:
  1296.  
  1297. @\begin{verbatim}
  1298.     Crv = CON2( vector( 0, 0, -1 ), vector( 0, 0, 4 ), 2, 1 );
  1299. @\end{verbatim}
  1300.  
  1301.  constructs a truncated cone based at the XY parallel plane Z = -1, top at
  1302.  plane Z = 3, and with radii of 2 and 1 respectively.
  1303. $
  1304.  
  1305. @\subsubsection{CONE}
  1306. !CONE
  1307.  
  1308. @\begin{verbatim}
  1309.  PolygonType CONE( VectorType Center, VectorType Direction,
  1310.                    NumericType Radius )
  1311. @\end{verbatim}
  1312.  
  1313.    Create a CONE geometric object, defined by {\bf Center} as CONE base center,
  1314.  CONE axes {\bf Direction}, and CONE base radius {\bf Radius}. Note {\bf Direction} magnitude
  1315.  also sets the CONE height. {\bf Direction} can be any 3D vector.
  1316.  
  1317.    See RESOLUTION for accuracy of CONE approximation as polygonal model. 
  1318.    Example:
  1319.  
  1320. @\begin{verbatim}
  1321.     Crv = CONE( vector( 0, 0, 0 ), vector( 1, 1, 1 ), 1 );
  1322. @\end{verbatim}
  1323.  
  1324.  constructs a cone based in the XY parallel plane, centered at the origin
  1325.  with radius 1 and with tilted apex at ( 1, 1, 1 ).
  1326.  
  1327.    See also CON2.
  1328. $
  1329.  
  1330. @\subsubsection{CONVEX}
  1331. !CONVEX
  1332.  
  1333. @\begin{verbatim}
  1334.  PolygonType CONVEX( PolygonType Object )
  1335. @\end{verbatim}
  1336.  
  1337.    Coerce non convex polygons in {\bf Object}, into convex one. New vertices
  1338.  are introduced into the polygonal data during this process. The Boolean
  1339.  operations require the input to have convex polygons only (although it may
  1340.  return non convex polygons...) and automatically coerced non convex input
  1341.  polygons to convex ones, using this same routine.
  1342.  
  1343.    However some external tools (like irit2ray, poly3d-r and poly3d-h) requires
  1344.  convex polygons. This function may be used on the objects to provide that,
  1345.  just before they are being saved into data files. Example:
  1346.  
  1347. @\begin{verbatim}
  1348.     CnvxObj = CONVEX( Obj );
  1349.     save("data", CnvxObj);
  1350. @\end{verbatim}
  1351.  
  1352.  decompose non convex polygons into convex ones so that data file could be
  1353.  used by external tools requiring convex polygons.
  1354. $
  1355.  
  1356. @\subsubsection{CPOLY}
  1357. !CPOLY
  1358.  
  1359. @\begin{verbatim}
  1360.  NumericType CPOLY( PolygonType Polys )
  1361. @\end{verbatim}
  1362.  
  1363.    Returns number of polygons in provided object. Example:
  1364.  
  1365. @\begin{verbatim}
  1366.     DumpLvl = 1
  1367.     NumPolys = CPOLY( Obj );
  1368.     NumPolys;
  1369. @\end{verbatim}
  1370.  
  1371.  prints the number of polygons in object {\bf Obj}.
  1372. $
  1373.  
  1374. @\subsubsection{CRAISE}
  1375. !CRAISE
  1376.  
  1377. @\begin{verbatim}
  1378.  CurveType CRAISE( CurveType Curve, NumericType NewOrder )
  1379. @\end{verbatim}
  1380.  
  1381.    Raise {\bf Curve} to the {\bf NewOrder} Order specified. Currently
  1382.  implemented for Bezier curves of any order and linear Bspline curve only.
  1383.  Example:
  1384.  
  1385. @\begin{verbatim}
  1386.     Crv = ctlpt( E3, 0.0, 0.0, 0.0 ) +
  1387.           ctlpt( E3, 0.0, 0.0, 1.0 ) +
  1388.           ctlpt( E3, 1.0, 0.0, 1.0 );
  1389.     Crv2 = CRAISE( Crv, 4 );
  1390. @\end{verbatim}
  1391.  
  1392.  raises the 90 degrees corner linear Bspline curve {\bf Crv} to be a cubic.
  1393. $
  1394.  
  1395. @\subsubsection{CREFINE}
  1396. !CREFINE
  1397.  
  1398. @\begin{verbatim}
  1399.  CurveType CREFINE( CurveType Curve, NumericType Replace, ListType KnotList )
  1400. @\end{verbatim}
  1401.  
  1402.    Provides the ability to {\bf Replace} a knot vector of {\bf Curve} or refine 
  1403.  it. {\bf KnotList} is a list of knots to refine {\bf Curve} at and all
  1404.  should be within {\bf Curve} parametric domain. If knot vector is to be
  1405.  replaced, the length of {\bf KnotList} should be identical to the length
  1406.  of {\bf Curve} knot vector. If {\bf Curve} is a Bezier curve, it is
  1407.  automatically promoted to be a Bspline curve. Example:
  1408.  
  1409. @\begin{verbatim}
  1410.     Crv2 = CREFINE( Crv, FALSE, list( 0.25, 0.5, 0.75 ) );
  1411. @\end{verbatim}
  1412.  
  1413.  refines {\bf Crv} at the three knots 0.25, 0.5, and 0.75.
  1414. $
  1415.  
  1416. @\subsubsection{CREGION}
  1417. !CREGION
  1418.  
  1419. @\begin{verbatim}
  1420.  CurveType CREGION( CurveType Curve, NumericType MinParam,
  1421.                                                        NumericType MaxParam )
  1422. @\end{verbatim}
  1423.  
  1424.    Extracts a subdomain of {\bf Curve} between {\bf MinParam} and {\bf MaxParam}.
  1425.  Both {\bf MinParam} and {\bf MaxParam} should be within {\bf Curve}
  1426.  parametric domain. Example:
  1427.  
  1428. @\begin{verbatim}
  1429.     SubCrv = CREGION( Crv, 0.3, 0.6 );
  1430. @\end{verbatim}
  1431.  
  1432.  extracts the subdomain of {\bf Crv} from the parameter value 0.3 to the
  1433.  parameter value 0.6.
  1434. $
  1435.  
  1436. @\subsubsection{CROSSEC}
  1437. !CROSSEC
  1438.  
  1439. @\begin{verbatim}
  1440.  PolygonType CROSSEC( PolygonType Object )
  1441. @\end{verbatim}
  1442.  
  1443. ;   Invoke interactive mode to edit/create a polygon in the plane Z = 0. The
  1444. ; polygon must be in the domain [0..1] in X,Y. The first polygon of the given
  1445. ; Object is copied to begin with. If the given {\bf Operand} is NOT a geometric
  1446. ; object, but false (numeric 0.0), a new polygon is created. Returns an (open)
  1447. ; object with this one polygon only and inside side of +Z. Note that if the
  1448. ; given polygon (first polygon of Object) is not on XY plane it is transformed
  1449. ; to it before editing, and transformed back after.
  1450.    Unfortunately, this feature is NOT implemented...
  1451. $
  1452.  
  1453. @\subsubsection{CSURFACE}
  1454. !CSURFACE
  1455.  
  1456. @\begin{verbatim}
  1457.  CurveType CSURFACE( SurfaceType Srf, ConstantType Direction,
  1458.                                                           NumericType Param )
  1459. @\end{verbatim}
  1460.  
  1461.    Extract an iso parametric curve out of {\bf Srf} in the specified
  1462.  {\bf Direction} (ROW or COL) at the specified parameter value {\bf Param}.
  1463.  {\bf Param} must be in {\bf Srf} parameter range in {\bf Direction} direction.
  1464.  The returned curve is {\em in} {\bf Srf}. See also CMESH. Example:
  1465.  
  1466. @\begin{verbatim}
  1467.     Crv = CSURFACE( Srf, COL, 0.15 ); 
  1468. @\end{verbatim}
  1469.  
  1470.  extract an iso parametric curve in the COLumn direction at parameter value
  1471.  0.15 from surface {\bf Srf}.
  1472. $
  1473.  
  1474. @\subsubsection{CTANGENT}
  1475. !CTANGENT
  1476.  
  1477. @\begin{verbatim}
  1478.  VectorType CTANGENT( CurveType Curve, NumericType Param )
  1479. @\end{verbatim}
  1480.  
  1481.    Computes the tangent vector to {\bf Curve} at the parameter value {\bf Param}.
  1482.  Example:
  1483.  
  1484. @\begin{verbatim}
  1485.     Tang = CTANGENT( Crv, 0.5 );
  1486. @\end{verbatim}
  1487.  
  1488.  computes the tangent to {\bf Crv} at the parameter value 0.5.
  1489. $
  1490.  
  1491. @\subsubsection{CTLPT}
  1492. !CTLPT
  1493.  
  1494. @\begin{verbatim}
  1495.  CPt = CTLPT( ConstantType E2, NumericType X, NumericType Y )
  1496.  
  1497.  or
  1498.  
  1499.  CPt = CTLPT( ConstantType E3, NumericType X, NumericType Y, NumericType Z )
  1500.  
  1501.  or
  1502.  
  1503.  CPt = CTLPT( ConstantType P2, NumericType W, NumericType X, NumericType Y )
  1504.  
  1505.  or
  1506.  
  1507.  CPt = CTLPT( ConstantType P3, NumericType W,
  1508.                                NumericType X, NumericType Y, NumericType Z )
  1509. @\end{verbatim}
  1510.  
  1511.    Construct a single control point to be used in curves and surfaces
  1512.  construction. Four types of points may be constructed as follows:
  1513. # 10 2 1 1
  1514.  E2
  1515.   A two dimensional point with X and Y.
  1516.  E3
  1517.   A three dimensional point with X, Y, and Z.
  1518.  P2
  1519.   A two dimensional rational point at X/W, and Y/W.
  1520.  P3
  1521.   A three dimensional rational point at X/W, Y/W, and Z/W.
  1522. #
  1523.  Example:
  1524.  
  1525. @\begin{verbatim}
  1526.     CPt = CTLPT( E3, 0.0, 0.0, 0.0 );
  1527. @\end{verbatim}
  1528.  
  1529.  constructs an {\bf E3} points at the origin.
  1530. $
  1531.  
  1532. @\subsubsection{CYLIN}
  1533. !CYLIN
  1534.  
  1535. @\begin{verbatim}
  1536.  PolylineType CYLIN( VectorType Center, VectorType Direction,
  1537.                      NumericType Radius )
  1538. @\end{verbatim}
  1539.  
  1540.    Create a CYLINder geometric object, defined by {\bf Center} as CYLIN base center,
  1541.  CYLIN axes {\bf Direction}, and CYLIN base radius {\bf Radius}. Note Direction magnitude
  1542.  also sets the CYLIN height. {\bf Direction} can be any 3D vector.
  1543.    See RESOLUTION for accuracy of CYLIN approximation as polygonal model.
  1544.    Example:
  1545.  
  1546. @\begin{verbatim}
  1547.     Crv = CYLIN( vector( 0, 0, 0 ), vector( 1, 0, 0 ), 10 );
  1548. @\end{verbatim}
  1549.  
  1550.  constructs a cylinder along the X axis from the origin to X = 10.
  1551. $
  1552.  
  1553. @\subsubsection{EXTRUDE}
  1554. !EXTRUDE
  1555.  
  1556. @\begin{verbatim}
  1557.  PolygonType EXTRUDE( PolygonType Object, VectorType Dir )
  1558.  
  1559.  or
  1560.  
  1561.  SurfaceType EXTRUDE( CurveType Object, VectorType Dir )
  1562. @\end{verbatim}
  1563.  
  1564.    Creates an extrusion of the given {\bf Object}. If {\bf Object} is a
  1565.  PolygonObject, its first polygon is used as the base for the extrusion in
  1566.  {\bf Dir} direction, and a closed PolygonObject is constrcted. If {\bf Object}
  1567.  is a CurveType, an extrusion surface is constructed instead which is {\em not}
  1568.  a closed object (the two bases of the extrusion are excluded and the curve may
  1569.  be open by itself).
  1570.  
  1571.    No limitation exists on the polygon (can be non-convex), but {\bf Dir}
  1572.  cannot be coplanar with the polygon plane. The curve need not be planar.
  1573.    Example:
  1574.  
  1575. @\begin{verbatim}
  1576.     Cross = cbspline( 3,
  1577.                       list( ctlpt( E2, -0.018, 0.001 ),
  1578.                             ctlpt( E2,  0.018, 0.001 ),
  1579.                             ctlpt( E2,  0.019, 0.002 ),
  1580.                             ctlpt( E2,  0.018, 0.004 ),
  1581.                             ctlpt( E2, -0.018, 0.004 ),
  1582.                             ctlpt( E2, -0.019, 0.001 ) ),
  1583.                       list( KV_OPEN ) );
  1584.     Cross = Cross + -Cross * scale( vector( 1, -1, 1 ) );
  1585.     Napkin = EXTRUDE( Cross * scale( vector( 1.6, 1.6, 1.6 ) ),
  1586.                       vector( 0.02, 0.03, 0.2 ) );
  1587. @\end{verbatim}
  1588.  
  1589.  constructs a closed cross section {\bf Cross} by duplicating a half of
  1590.  it in reverse and merging the two sub-curves. {\bf Cross} is then used as
  1591.  the cross section for the extrusion operation.
  1592. $
  1593.  
  1594. @\subsubsection{GBOX}
  1595. !GBOX
  1596.  
  1597. @\begin{verbatim}
  1598.  PolygonType GBOX( VectorType Point,
  1599.                    VectorType Dx, VectorType Dy, VectorType Dz )
  1600. @\end{verbatim}
  1601.  
  1602.    Create a parallelpiped - Generalized BOX polygonal object, defined by
  1603.  {\bf Point} as base position, and {\bf Dx, Dy, Dz} as 3 3D vectors to define
  1604.  the 6 faces of this generalized BOX. The regular BOX object is special case
  1605.  of GBOX where {\bf Dx} = vector(Dx, 0, 0),   {\bf Dy} = vector(0, Dy, 0),
  1606.  {\bf Dz} = vector(0, 0, Dz).
  1607.  
  1608.    Note {\bf Dx}, {\bf Dy}, {\bf Dz} must be non-coplanar in order to create a feasible object.
  1609.    Example:
  1610.  
  1611. @\begin{verbatim}
  1612.     GB = GBOX(vector(0.0, -0.35, 0.63), vector(0.5, 0.0, 0.5),
  1613.                                         vector(-0.5, 0.0, 0.5),
  1614.                                         vector(0.0, 0.7, 0.0));
  1615. @\end{verbatim}
  1616. $
  1617.  
  1618. @\subsubsection{GPOLYGON}
  1619. !GPOLYGON
  1620.  
  1621. @\begin{verbatim}
  1622.  PolygonType GPOLYGON( GeometryTreeType Object )
  1623. @\end{verbatim}
  1624.  
  1625.    Approximate all Surface(s) in {\bf Object} as polygons using the RESOLUTION
  1626.  and FLAY4PLY variables. The larger RESOLUTION is the more polygons and
  1627.  finer the result approximation will be. Each Bezier patch will have roughly
  1628.  $RESOLUTION^2$ polygons.
  1629.  
  1630.    FLAT4PLY is a Boolean flag controlling the conversion of an (almost) flat
  1631.  patch into four (TRUE) or two (FALSE) polygons. Normals are computed to
  1632.  polygons vertices using surface normal, so Guaroud or Phong rendering can be
  1633.  performed. Returned is a single polygon object, no matter how complex
  1634.  {\bf Object} Hierarchy is. Example:
  1635.  
  1636. @\begin{verbatim}
  1637.     Polys = GPOLYGON( list( Srf1, Srf2, Srf3 ) );
  1638. @\end{verbatim}
  1639.  
  1640.  Converts to polygons the three surfaces {\bf Srf1}, {\bf Srf2}, and {\bf Srf3}.
  1641. $
  1642.  
  1643. @\subsubsection{GPOLYLINE}
  1644. !GPOLYLINE
  1645.  
  1646. @\begin{verbatim}
  1647.  PolylineType GPOLYLINE( GeometryTreeType Object )
  1648. @\end{verbatim}
  1649.  
  1650.    Converts all Surface(s) and Curves(s) in {\bf Object} into polylines using
  1651.  the RESOLUTION variable. The larger RESOLUTION is the finer the result
  1652.  approximation will be. Returned is a single polyline object, no matter
  1653.  how complex {\bf Object} Hierarchy is. Example:
  1654.  
  1655. @\begin{verbatim}
  1656.     Polys = GPOLYLINE( list( Srf1, Srf2, Srf3, list( Crv1, Crv2, Crv3 ) ) );
  1657. @\end{verbatim}
  1658.  
  1659.  converts to polyline the three surfaces {\bf Srf1}, {\bf Srf2}, and {\bf Srf3}
  1660.  and the three curves {\bf Crv1}, {\bf Crv2}, and {\bf Crv3}.
  1661. $
  1662.  
  1663. @\subsubsection{MERGPOLY}
  1664. !MERGEPOLY
  1665.  
  1666. @\begin{verbatim}
  1667.  PolygonType MERGEPOLY( ListType PolyList )
  1668. @\end{verbatim}
  1669.  
  1670.  Merge a set of polygonal objects in {\bf PolyList} list to a single polygonal
  1671.  object. All elements in {\bf ObjectList} must be of PolygonType type. No test
  1672.  is made on the validity of the data. This function performs the same
  1673.  operation as the {\bf \verb+^+} operator would, but may be more convenient
  1674.  to use under some conditions. Example:
  1675.  
  1676. @\begin{verbatim}
  1677.     Vrtx1 = vector( -3, -2, -1 );
  1678.     Vrtx2 = vector( 3, -2, -1 );
  1679.     Vrtx3 = vector( 3, 2, -1 );
  1680.     Vrtx4 = vector( -3, 2, -1 );
  1681.     Poly1 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ) ); 
  1682.     
  1683.     Vrtx1 = vector( -3, 2, 1 );
  1684.     Vrtx2 = vector( 3, 2, 1 );
  1685.     Vrtx3 = vector( 3, -2, 1 );
  1686.     Vrtx4 = vector( -3, -2, 1 );
  1687.     Poly2 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ) );
  1688.     
  1689.     Vrtx1 = vector( -3, -2, 1 );
  1690.     Vrtx2 = vector( 3, -2, 1 );
  1691.     Vrtx3 = vector( 3, -2, -1 );
  1692.     Vrtx4 = vector( -3, -2, -1 );
  1693.     Poly3 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ) );
  1694.    
  1695.     PolyObj = MERGEPOLY( list( Poly1, Poly2, Poly3 ) );
  1696. @\end{verbatim}
  1697. $
  1698.  
  1699. @\subsubsection{OFFSET}
  1700. !OFFSET
  1701.  
  1702. @\begin{verbatim}
  1703.  CurveType OFFSET( CurveType Crv, NumericType OffsetDistance )
  1704.  
  1705.  or
  1706.  
  1707.  SurfaceType OFFSET( SurfaceType Srf, NumericType OffsetDistance )
  1708. @\end{verbatim}
  1709.  
  1710.  Offsets {\bf Crv} or {\bf Srf}, by translating all control points in the
  1711.  curve or surface normal, by the {\bf OffsetDistance} amount. Returned curve
  1712.  or surface only approximates the real offset. One may improve the offset
  1713.  accuracy using refinement. Negative {\bf OffsetDistance} denotes offset in
  1714.  the reversed direction of the normal.
  1715.  
  1716.  Example:
  1717.  
  1718. @\begin{verbatim}
  1719.     OffCrv = OFFSET(Crv, -0.1);
  1720. @\end{verbatim}
  1721.  
  1722.  offsets {\bf Crv} by the amount of $-0.1$ in the reversed normal direction.
  1723. $
  1724.  
  1725. @\subsubsection{POLY}
  1726. !POLY
  1727.  
  1728. @\begin{verbatim}
  1729.  PolygonType POLY( ListType ObjectList )
  1730. @\end{verbatim}
  1731.  
  1732.    Create a single polygon (and therefore open) object, defined by the
  1733.  vertices which respectively defined by the objects in {\bf ObjectList} (see LIST).
  1734.  All elements in {\bf ObjectList} must be of VertorType type. No validity test is
  1735.  made and it is the user responsibility. see CIRCPOLY for conditions applied to
  1736.  open objects. Example:
  1737.  
  1738. @\begin{verbatim}
  1739.     V1  = vector( 0.0, 0.0, 0.0 );
  1740.     V2  = vector( 0.3, 0.0, 0.0 );
  1741.     V3  = vector( 0.3, 0.0, 0.1 );
  1742.     V4  = vector( 0.2, 0.0, 0.1 );
  1743.     V5  = vector( 0.2, 0.0, 0.5 );
  1744.     V6  = vector( 0.3, 0.0, 0.5 );
  1745.     V7  = vector( 0.3, 0.0, 0.6 );
  1746.     V8  = vector( 0.0, 0.0, 0.6 );
  1747.     V9  = vector( 0.0, 0.0, 0.5 );
  1748.     V10 = vector( 0.1, 0.0, 0.5 );
  1749.     V11 = vector( 0.1, 0.0, 0.1 );
  1750.     V12 = vector( 0.0, 0.0, 0.1 );
  1751.     I = poly( list( V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12 ) );
  1752. @\end{verbatim}
  1753.  
  1754.  constructs an object with a single polygon in the shape of the I letter.
  1755. $
  1756.  
  1757. @\subsubsection{RULEDSRF}
  1758. !RULEDSRF
  1759.  
  1760. @\begin{verbatim}
  1761.  SurfaceType RULEDSRF( CurveType Crv1, CurveType Crv2 )
  1762. @\end{verbatim}
  1763.  
  1764.    Constructs a ruled surface between the two curves {\bf Crv1} and {\bf Crv2}.
  1765.    Curves do not have to have the same order or type and will be promoted to
  1766.  their least common denominator.
  1767.  
  1768.  Example:
  1769.  
  1770. @\begin{verbatim}
  1771.     Circ = circle( vector( 0.0, 0.0, 0.0 ), 0.25 );
  1772.     Cyl = RULEDSRF( circ, circ * trans( vector( 0.0, 0.0, 1.0 ) ) );
  1773. @\end{verbatim}
  1774.  
  1775.  Constructs a cylinder of radius 0.25 along the Z axis from 0 to 1.
  1776. $
  1777.  
  1778. @\subsubsection{SBEZIER}
  1779. !SBEZIER
  1780.  
  1781. @\begin{verbatim}
  1782.  SurfaceType SBEZIER( ListType CtlMesh )
  1783. @\end{verbatim}
  1784.  
  1785.    Creates a Bezier surface out of the provided control mesh. {\bf CtlMesh} is a
  1786.  list of control points rows, each is a list of control points. All control
  1787.  points must be of the same type (E2, E3, P2, or P3).
  1788.  
  1789.  Example:
  1790.  
  1791. @\begin{verbatim}
  1792.    Srf = SBEZIER( list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  1793.                                ctlpt( E3, 0.0, 1.0, 0.0 ),
  1794.                                ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  1795.                          list( ctlpt( E3, 1.0, 0.0, 0.0 ),
  1796.                                ctlpt( E3, 1.0, 1.0, 2.0 ),
  1797.                                ctlpt( E3, 1.0, 2.0, 0.0 ) ),
  1798.                          list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  1799.                                ctlpt( E3, 2.0, 1.0, 0.0 ),
  1800.                                ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  1801.                          list( ctlpt( E3, 3.0, 0.0, 0.0 ),
  1802.                                ctlpt( E3, 3.0, 1.0, 2.0 ),
  1803.                                ctlpt( E3, 3.0, 2.0, 0.0 ) ),
  1804.                          list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  1805.                                ctlpt( E3, 4.0, 1.0, 0.0 ),
  1806.                                ctlpt( E3, 4.0, 2.0, 1.0 ) ) ) );
  1807. @\end{verbatim}
  1808. $
  1809.  
  1810. @\subsubsection{SBSPLINE}
  1811. !SBSPLINE
  1812.  
  1813. @\begin{verbatim}
  1814.  SurfaceType SBSPLINE( NumericType UOrder, NumericType VOrder,
  1815.                        ListType CtlMesh, ListType KnotVectors )
  1816. @\end{verbatim}
  1817.  
  1818.    Creates a Bspline surface out of the provided {\bf UOrder} and {\bf VOrder}
  1819.  orders, the control mesh {\bf CtlMesh} and the two knot vectors {\bf KnotVectors}.
  1820.  {\bf CtlMesh} is a list of control points rows, each is a list of control
  1821.  points. All control points must be of the same type (E2, E3, P2, or P3).
  1822.  {\bf KnotVectors} is a list of two knot vectors,
  1823.  each is a list of NumericType knots or a list of a single constant KV\_OPEN or
  1824.  KV\_FLOAT in which a uniform knot vector with open or floating end condition
  1825.  will automatically be constructed. Example:
  1826.  
  1827. @\begin{verbatim}
  1828.     Mesh = list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  1829.                         ctlpt( E3, 0.0, 1.0, 0.0 ),
  1830.                         ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  1831.                   list( ctlpt( E3, 1.0, 0.0, 0.0 ),
  1832.                         ctlpt( E3, 1.0, 1.0, 2.0 ),
  1833.                         ctlpt( E3, 1.0, 2.0, 0.0 ) ),
  1834.                   list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  1835.                         ctlpt( E3, 2.0, 1.0, 0.0 ),
  1836.                         ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  1837.                   list( ctlpt( E3, 3.0, 0.0, 0.0 ),
  1838.                         ctlpt( E3, 3.0, 1.0, 2.0 ),
  1839.                         ctlpt( E3, 3.0, 2.0, 0.0 ) ),
  1840.                   list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  1841.                         ctlpt( E3, 4.0, 1.0, 0.0 ),
  1842.                         ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
  1843.     Srf = SBSPLINE( 3, 3, Mesh, list( list( KV_OPEN ),
  1844.                                       list( 3, 3, 3, 4, 5, 6, 6, 6 ) ) );
  1845. @\end{verbatim}
  1846.  
  1847.  constructs a Bspline surface with its first knot vector being uniform with
  1848.  open end condition.
  1849. $
  1850.  
  1851. @\subsubsection{SDIVIDE}
  1852. !SDIVIDE
  1853.  
  1854. @\begin{verbatim}
  1855.  SurfaceType SDIVIDE( SurfaceType Srf, ConstantType Direction,
  1856.                                                           NumericType Param )
  1857. @\end{verbatim}
  1858.  
  1859.    Subdivides a surface into two at the specified parameter value {\bf Param}
  1860.  in the specified {\bf Direction} (ROW or COL). {\bf Srf} can be either a Bspline
  1861.  curve in which {\bf Param} must be within surface parametric domain or a Bezier
  1862.  curve in which {\bf Param} must be in the 0 to 1 range.
  1863.  
  1864.    Returned is a list of the two sub-surfaces. The individual surfaces may be
  1865.  extracted from the list using the {\bf NTH} command. Example:
  1866.  
  1867. @\begin{verbatim}
  1868.     SrfLst = SDIVIDE( Srf, ROW, 0.5 );
  1869.     Srf1 = nth( SrfLst, 1 );
  1870.     Srf2 = nth( SrfLst, 2 );
  1871. @\end{verbatim}
  1872.  
  1873.  subdivides {\bf Srf} at the parameter value of 0.5 in the ROW direction.
  1874. $
  1875.  
  1876. @\subsubsection{SEDITPT}
  1877. !SEDITPT
  1878.  
  1879. @\begin{verbatim}
  1880.  SurfaceType SEDITPT( SurfaceType Srf, CtlPtType CPt, NumericType UIndex,
  1881.                                                       NumericType VIndex )
  1882. @\end{verbatim}
  1883.  
  1884.    Provides a simple mechanism to manually modify a single control point number
  1885.  {\bf UIndex} and {\bf VIndex} (base count is 0) in {\bf Srf} control mesh
  1886.  by substituting {\bf CtlPt} instead. CtlPt must have the same point type as
  1887.  {\bf Srf} points. Original surface {\bf Srf} is not modified. Example:
  1888.  
  1889. @\begin{verbatim}
  1890.     CPt = ctlpt( E3, 1, 2, 3 );
  1891.     NewSrf = SEDITPT( Srf, CPt, 0, 0 );
  1892. @\end{verbatim}
  1893.  
  1894.  constructs a {NewSrf} with the first control point of {\bf Srf} being
  1895.  {\bf CPt}.
  1896. $
  1897.  
  1898. @\subsubsection{SEVAL}
  1899. !SEVAL
  1900.  
  1901. @\begin{verbatim}
  1902.  CtlPtType SEVAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
  1903. @\end{verbatim}
  1904.  
  1905.    Evaluates the provided surface {\bf Srf} at the given {\bf UParam} and
  1906.  {\bf VParam} values. Both {\bf UParam} and {\bf VParam} should be within
  1907.  the surface parametric domain if {\bf Srf} is a Bspline surface, or between 0
  1908.  and 1 if {\bf Srf} is a Bezier surface.  Returned control point has the same
  1909.  type as {\bf Srf} control points. Example:
  1910.  
  1911. @\begin{verbatim}
  1912.     CPt = SEVAL( Srf, 0.25, 0.22 );
  1913. @\end{verbatim}
  1914.  
  1915.  evaluates {\bf Srf} at the parameter values of (0.25, 0.22).
  1916. $
  1917.  
  1918. @\subsubsection{SFROMCRVS}
  1919. !SFROMCRVS
  1920.  
  1921. @\begin{verbatim}
  1922.  SurfaceType SFROMCRVS( ListType CrvList )
  1923. @\end{verbatim}
  1924.  
  1925.    Construct a surface by substituting the curves in {\bf CrvList} as rows
  1926.  in a surface control mesh. Curves in {\bf CrvList} are made compatible
  1927.  by promoting Bezier curves to Bsplines if necessary and raising degree
  1928.  and refining as required before substituting their control polygons as
  1929.  rows in the mesh.
  1930.  
  1931.    The other direction order is the same as the first direction order or
  1932.  if not enough curves are provided equal to the number of curves in {\bf CrvList}.
  1933.  
  1934.    The surface will interpolate the first and last curves only. Example:
  1935.  
  1936. @\begin{verbatim}
  1937.     Crv1 = cbspline( 3,
  1938.                      list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  1939.                            ctlpt( E3, 1.0, 0.0, 0.0 ),
  1940.                            ctlpt( E3, 1.0, 1.0, 0.0 ) ),
  1941.                      list( KV_OPEN ) );
  1942.     Crv2 = Crv1 * trans( vector( 0.0, 0.0, 1.0 ) );
  1943.     Crv3 = Crv2 * scale( vector( 0.0, 0.0, 2.0 ) )
  1944.                 * trans( vector( 0.1, 0.1, 0.1 ) );
  1945.     Srf = SFROMCRVS( list( Crv1, Crv2, Crv3 ) );
  1946. @\end{verbatim}
  1947. $
  1948.  
  1949. @\subsubsection{SNORMAL}
  1950. !SNORMAL
  1951.  
  1952. @\begin{verbatim}
  1953.  VectorType SNORMAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
  1954. @\end{verbatim}
  1955.  
  1956.    Computes the normal vector to {\bf Srf} at the parameter values {\bf UParam}
  1957.  and {\bf VParam}. Example:
  1958.  
  1959. @\begin{verbatim}
  1960.     Tang = SNORMAL( Crv, 0.5, 0.5 );
  1961. @\end{verbatim}
  1962.  
  1963.  computes the normal to {\bf Srf} at the parameter values (0.5, 0.5).
  1964. $
  1965.  
  1966. @\subsubsection{SPHERE}
  1967. !SPHERE
  1968.  
  1969. @\begin{verbatim}
  1970.  PolygonType SPHERE( VectorType Center, NumericType Radius )
  1971. @\end{verbatim}
  1972.  
  1973.    Creates a SPHERE geometric object, defined by {\bf Center} as SPHERE center,
  1974.  and with radius {\bf Radius}.
  1975.    See RESOLUTION for accuracy of SPHERE approximation as polygonal model. 
  1976. $
  1977.  
  1978. @\subsubsection{SRAISE}
  1979. !SRAISE
  1980.  
  1981. @\begin{verbatim}
  1982.  SurfaceType SRAISE( SurfaceType Srf, ConstantType Direction,
  1983.                                                       NumericType NewOrder )
  1984. @\end{verbatim}
  1985.  
  1986.    Raise {\bf Srf} to the specified {\bf NewOrder} Order in the specified
  1987.  direction {\bf Direction}. Currently implemented for Bezier surfaces of
  1988.  any order and linear Bspline surfaces only. Example:
  1989.  
  1990. @\begin{verbatim}
  1991.     Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.0 ),
  1992.                                    ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
  1993.                     cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
  1994.                                    ctlpt( E3,  0.5,  0.5, 0.0 ) ) ) );
  1995.     Srf = SRAISE( SRAISE( Srf, ROW, 3 ), COL, 3 );
  1996. @\end{verbatim}
  1997.  
  1998.  construct a bilinear flat ruled surface and raise its both directions to be
  1999.  quadratic.
  2000. $
  2001.  
  2002. @\subsubsection{SREFINE}
  2003. !SREFINE
  2004.  
  2005. @\begin{verbatim}
  2006.  SurfaceType SREFINE( SurfaceType Srf, ConstantType Direction,
  2007.                       NumericType Replace, ListType KnotList )
  2008. @\end{verbatim}
  2009.  
  2010.    Provides the ability to {\bf Replace} a knot vector of {\bf Srf} or refine 
  2011.  it in the specified direction {\bf Direction} (ROW or COL).
  2012.    {\bf KnotList} is a list of knots to refine {\bf Srf} at. All knots should be
  2013.  within {\bf Srf} parametric domain in {\bf Direction} direction. If knot vector
  2014.  is to be replaced, the length of {\bf KnotList} should be identical to the length
  2015.  of {\bf Srf} knot vector in direction {\bf Direction}. If {\bf Srf} is a
  2016.  Bezier surface, it is automatically promoted to be a Bspline surface.
  2017.  Example:
  2018.  
  2019. @\begin{verbatim}
  2020.     Srf = SREFINE( SREFINE( Srf,
  2021.                             ROW, FALSE, list( 0.333, 0.667 ) ),
  2022.                    COL, FALSE, list( 0.333, 0.667 ) );
  2023. @\end{verbatim}
  2024.  
  2025.  refines {\bf Srf} in both directions by adding two more knots at 0.333 and
  2026.  0.667
  2027. $
  2028.  
  2029. @\subsubsection{SREGION}
  2030. !SREGION
  2031.  
  2032. @\begin{verbatim}
  2033.  SurfaceType SREGION( SurfaceType Srf, ConstantType Direction,
  2034.                                                         NumericType NewOrder )
  2035. @\end{verbatim}
  2036.  
  2037.    Extracts a subdomain of {\bf Srf} between {\bf MinParam} and {\bf MaxParam}
  2038.  in the specified {\bf Direction}. Both {\bf MinParam} and {\bf MaxParam}
  2039.  should be within {\bf Srf} parametric domain in {\bf Direction}.
  2040.  Example:
  2041.  
  2042. @\begin{verbatim}
  2043.     SubSrf = SREGION( Srf, COL, 0.3, 0.6 );
  2044. @\end{verbatim}
  2045.  
  2046.  extracts the subdomain of {\bf Srf} from the parameter value 0.3 to the
  2047.  parameter value 0.6 along the COLumn direction. the ROW direction is
  2048.  extracted as a whole.
  2049. $
  2050.  
  2051. @\subsubsection{STANGENT}
  2052. !STANGENT
  2053.  
  2054. @\begin{verbatim}
  2055.  VectorType STANGENT( SurfaceType Srf, ConstantType Direction,
  2056.                       NumericType UParam, NumericType VParam )
  2057. @\end{verbatim}
  2058.  
  2059.    Computes the tangent vector to {\bf Srf} at the parameter values {\bf UParam}
  2060.  and {\bf VParam} in the direction {\bf Direction}. Example:
  2061.  
  2062. @\begin{verbatim}
  2063.     Tang = STANGENT( Srf, ROW, 0.5, 0.6 );
  2064. @\end{verbatim}
  2065.  
  2066.  computes the tangent to {\bf Srf} in the ROW direction at the parameter
  2067.  values (0.5, 0.6).
  2068. $
  2069.  
  2070. @\subsubsection{SURFREV}
  2071. !SURFREV
  2072.  
  2073. @\begin{verbatim}
  2074.  PolygonType SURFREV( PolygonType Object )
  2075.  
  2076.  or
  2077.  
  2078.  SurfaceType SURFREV( CurveType Object )
  2079. @\end{verbatim}
  2080.  
  2081.    Create a surface of revolution by rotating the first polygon/curve of the
  2082.  given {\bf Object}, around the Z axes. No limitation exists on the polygon
  2083.  (can be non-convex), aside from the requirement for it to be non coplanar
  2084.  with a plane of the form Z = Const. No limitation exists for the curve. Use
  2085.  the linear transformation function to position a surface of revolution in a
  2086.  different orientation. Example:
  2087.  
  2088. @\begin{verbatim}
  2089.     VTailAntn = SURFREV( ctlpt( E3, 0.001, 0.0, 1.0 ) +
  2090.                          ctlpt( E3, 0.01,  0.0, 1.0 ) +
  2091.                          ctlpt( E3, 0.01,  0.0, 0.8 ) +
  2092.                          ctlpt( E3, 0.03,  0.0, 0.7 ) +
  2093.                          ctlpt( E3, 0.03,  0.0, 0.3 ) +
  2094.                          ctlpt( E3, 0.001, 0.0, 0.0 ) );
  2095. @\end{verbatim}
  2096.  
  2097.  constructs a piecewise linear Bspline curve in the XZ plane and use it to
  2098.  construct a surface of revolution by rotating it around the Z axis.
  2099. $
  2100.  
  2101. @\subsubsection{SWEEPSRF}
  2102. !SWEEPSRF
  2103.  
  2104. @\begin{verbatim}
  2105.  SurfaceType SWEEPSRF( CurveType CrossSection, CurveType Axis,
  2106.                                                          NumericType Scale )
  2107.  
  2108.  or
  2109.  
  2110.  SurfaceType SWEEPSRF( CurveType CrossSection, CurveType Axis,
  2111.                                                          CurveType ScaleCrv )
  2112. @\end{verbatim}
  2113.  
  2114.    Construct a generalized cylinder surface. This function sweeps a specified
  2115.  cross section {\bf CrossSection} along the provided {\bf Axis}.
  2116.  The cross section may be constantly scaled (first form above), or scaled
  2117.  along the Axis parametric domain (second form).
  2118.  
  2119.    No refinement is performed on any of the curves so scaling and axis
  2120.  following result is only approximated. Refinement at the proper location
  2121.  should improve the output accuracy. {\bf ScaleCrv} parametric domain do not
  2122.  have to match the {\bf Axis} parametric domain and their domains are made
  2123.  compatible by this function.
  2124.  Example:
  2125.  
  2126. @\begin{verbatim}
  2127.     Cross = arc( vector( 0.2, 0.0, 0.0 ),
  2128.                  vector( 0.2, 0.2, 0.0 ),
  2129.                  vector( 0.0, 0.2, 0.0 ) ) +
  2130.             arc( vector( 0.0, 0.4, 0.0 ),
  2131.                  vector( 0.1, 0.4, 0.0 ),
  2132.                  vector( 0.1, 0.5, 0.0 ) ) +
  2133.             arc( vector( 0.8, 0.5, 0.0 ),
  2134.                  vector( 0.8, 0.3, 0.0 ),
  2135.                  vector( 1.0, 0.3, 0.0 ) ) +
  2136.             arc( vector( 1.0, 0.1, 0.0 ),
  2137.                  vector( 0.9, 0.1, 0.0 ),
  2138.                  vector( 0.9, 0.0, 0.0 ) ) +
  2139.             ctlpt( E2, 0.2, 0.0 );
  2140.     Axis = arc( vector( -1.0, 0.0, 0.0 ),
  2141.                 vector(  0.0, 0.0, 0.1 ),
  2142.                 vector(  1.0, 0.0, 0.0 ) );
  2143.     Axis = crefine( Arc1, FALSE, list( 0.25, 0.5, 0.75 ) );
  2144.     ScaleCrv = cbezier( list( ctlpt( E2, 0.0, 0.01 ),
  2145.                               ctlpt( E2, 1.0, 0.5 ),
  2146.                               ctlpt( E2, 2.0, 0.01 ) ) );
  2147.     Srf = SWEEPSRF( Cross, Axis, ScaleCrv );
  2148. @\end{verbatim}
  2149.  
  2150.  constructs a rounded rectangle cross section and sweep it along an arc while
  2151.  scaling it so its end points shrink. Note the axis curve {\bf Axis} is
  2152.  manually refined to better approximate the scaling required.
  2153. $
  2154.  
  2155. @\subsubsection{TORUS}
  2156. !TORUS
  2157.  
  2158. @\begin{verbatim}
  2159.  PolygonType TORUS( VectorType Center, VectorType Normal,
  2160.                     NumericType MRadius, NumericType mRadius )
  2161. @\end{verbatim}
  2162.  
  2163.    Create a TORUS polygonal object, defined by {\bf Center} as TORUS center,
  2164.  {\bf Normal} as main TORUS plane normal, {\bf MRadius} as major radius, and
  2165.  {\bf mRadius} as minor.
  2166.  
  2167.    See RESOLUTION for accuracy of TORUS approximation as polygonal model. 
  2168.    Example:
  2169.  
  2170. @\begin{verbatim}
  2171.     T = TORUS( vector( 0.0, 0.0, 0.0), vector( 0.0, 0.0, 1.0), 0.5, 0.2 );
  2172. @\end{verbatim}
  2173.  
  2174.  constructs a torus with major plane as the XY plane, major radius of 0.5,
  2175.  and minor radius of 0.2.
  2176. $
  2177.  
  2178. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2179.  
  2180. @\subsection{Object transformation functions}
  2181. &Object transformation functions
  2182.  
  2183.  All the routines in this section constructs a 4 by 4 homogeneouos matrix
  2184.  representing the required transform. These matrices may be concatenated to
  2185.  achieve a more complex transforms using the matrix multiplication operator
  2186.  $*$. For example the expression
  2187. @\begin{verbatim}
  2188.     m = trans( vector( -1, 0, 0 ) ) * rotx( 45 ) * trans( vector( 1, 0, 0 ) );
  2189. @\end{verbatim}
  2190.  
  2191.  constructs a transform to rotate an object around the X = 1 line, 45 degrees.
  2192.  A matrix representing the inverse transform can be computed as:
  2193. @\begin{verbatim}
  2194.     InvM = m ^ -1
  2195. @\end{verbatim}
  2196.  See also overloading the - operator.
  2197.  
  2198. @\subsubsection{ROTX}
  2199. !ROTX
  2200.  
  2201. @\begin{verbatim}
  2202.  MatrixType ROTX( NumericType Angle )
  2203. @\end{verbatim}
  2204.  
  2205.    Creates a rotation transformation matrix (around X) with {\bf Angle} degrees.
  2206. $
  2207.  
  2208. @\subsubsection{ROTY}
  2209. !ROTY
  2210.  
  2211. @\begin{verbatim}
  2212.  MatrixType ROTY( NumericType Angle )
  2213. @\end{verbatim}
  2214.  
  2215.    Creates a rotation transformation matrix (around Y) with {\bf Angle} degrees.
  2216. $
  2217.  
  2218. @\subsubsection{ROTZ}
  2219. !ROTZ
  2220.  
  2221. @\begin{verbatim}
  2222.  MatrixType ROTZ( NumericType Angle )
  2223. @\end{verbatim}
  2224.  
  2225.    Creates a rotation transformation matrix (around Z) with {\bf Angle} degrees.
  2226. $
  2227.  
  2228. @\subsubsection{SCALE}
  2229. !SCALE
  2230.  
  2231. @\begin{verbatim}
  2232.  MatrixType SCALE( VectorType ScaleFactors )
  2233. @\end{verbatim}
  2234.  
  2235.    Creates a scaling transformation matrix of {\bf ScaleFactors} scaling factors.
  2236. $
  2237.  
  2238. @\subsubsection{TRANS}
  2239. !TRANS
  2240.  
  2241. @\begin{verbatim}
  2242.  MatrixType TRANS( VectorType TransFactors )
  2243. @\end{verbatim}
  2244.  
  2245.    Creates a translation transformation matrix of {\bf TransFactors} translating
  2246.  amounts.
  2247. $
  2248.  
  2249. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2250. @\subsection{General purpose functions}
  2251. &General purpose functions  
  2252.  
  2253. @\subsubsection{ALIAS}
  2254. !ALIAS
  2255.  
  2256. @\begin{verbatim}
  2257.  ALIAS( StringType Name, StringType Value )
  2258. @\end{verbatim}
  2259.  
  2260.    Defines a text substitution: each occurrence of {\bf Name} will be replaced by
  2261.  the given {\bf Value}. Unlike the rest of the system, this is CASE SENSITIVE.
  2262.  It is a good practice, therefore, to defines the aliases names to be upper
  2263.  case, and rest of program including alias values in lower case. For example:
  2264.  
  2265. @\begin{verbatim}
  2266.     ALIAS("ED", "edit(\"file.irt\");");
  2267. @\end{verbatim}
  2268.  
  2269.  defines the alias "ED" to be 'edit("file.irt");'. Note the way the double
  2270.  quotes are being escaped.
  2271.  
  2272.    Using "ed" instead of "ED" above will cause infinite loop since "ed"
  2273.  will be expanded for ever... The aliases will be expanded until line is
  2274.  too long or 100 expansions occurred in line.
  2275.  
  2276.    If {\bf Name} is empty string, a list of all defined aliases is printed.
  2277.  
  2278.    If {\bf Name} is not empty, but {\bf Value} is, that alias is deleted. This is
  2279.  the only case you need to specify the alias {\bf Name} in LOWER case (otherwise it
  2280.  will be expanded...) - the alias {\bf Name} comparison is case insensitive.
  2281. $
  2282.  
  2283. @\subsubsection{ATTRIB}
  2284. !ATTRIB
  2285.  
  2286. @\begin{verbatim}
  2287.  ATTRIB( GeometricType Object, StringType Name, StringType Value )
  2288. @\end{verbatim}
  2289.  
  2290.    Provides a mechanism to add a string attribute to a geometric {\bf Object},
  2291.  with name {\bf Name} and value {\bf Value}.
  2292.  
  2293.    These attributes may be used to pass information to other programs about
  2294.  this object and are saved with the objects in data files. For example
  2295.  
  2296. @\begin{verbatim}
  2297.     ATTRIB(Glass, "rgb", "255,0,0");
  2298. @\end{verbatim}
  2299.  
  2300.  sets the rendered color of the {\bf Glass} object. This specific attribute
  2301.  provides a finer control on color setting than provided by the color
  2302.  command, for external programs.
  2303. $
  2304.  
  2305. @\subsubsection{BEEP}
  2306. !BEEP
  2307.  
  2308. @\begin{verbatim}
  2309.  BEEP( NumericType Frequency, NumericType Time )
  2310. @\end{verbatim}
  2311.  
  2312.    Generates a tone with the given {\bf Frequency} (in Hz), for the given period
  2313.  of {\bf Time} (in milliseconds). This command is system dependent and may work
  2314.  differently or not work at all on some systems.
  2315. $
  2316.  
  2317. @\subsubsection{CHDIR}
  2318. !CHDIR
  2319.  
  2320. @\begin{verbatim}
  2321.  CHDIR( StringType NewPath )
  2322. @\end{verbatim}
  2323.  
  2324.    Change current working directory to NewPath (if exists).
  2325.    The entry directory is recovered on exit from program.
  2326. $
  2327.  
  2328. @\subsubsection{CLOSED}
  2329. !CLOSED
  2330.  
  2331. @\begin{verbatim}
  2332.  CLOSED( NumericType Set )
  2333. @\end{verbatim}
  2334.  
  2335.    If {\bf Set} is non zero (see TRUE/FALSE and ON/OFF) then every polygonal
  2336.  object drawn is assumed to be closed. If a polygonal model is closed every
  2337.  edge is basically drawn twice - once for each adjacent polygon. If the object
  2338.  is assumed closed, every such edge will be drawn once only. By default
  2339.  this option is TRUE.
  2340. $
  2341.  
  2342. @\subsubsection{COLOR}
  2343. !COLOR
  2344.  
  2345. @\begin{verbatim}
  2346.  COLOR( GeometricType Object, NumericType Color )
  2347. @\end{verbatim}
  2348.  
  2349.    Set the color of the object to one of the specified below. Note that an
  2350.  object has a default color (see IRIT.CFG file) according to his origin -
  2351.  loaded with LOAD command, PRIMITIV, or BOOLEAN operation result.
  2352.    The system internally supports colors (although you may have B\&W system)
  2353.  and the colors recognized are:
  2354.  {\bf BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, and WHITE}.
  2355.  
  2356.    See attrib command for more fine control on colors. 
  2357. $
  2358.  
  2359. @\subsubsection{COMMENT}
  2360. !COMMENT
  2361.  
  2362. @\begin{verbatim}
  2363.  COMMENT
  2364. @\end{verbatim}
  2365.  
  2366.  Two types of comments are allowed:
  2367.  
  2368.  1. One lines comment: starts anywhere is a line at the '\#' char up to the
  2369.     end of the line.
  2370.  
  2371.  2. Block comment: starts by the COMMENT keyword follows by a unique
  2372.     character (anything but white space), up to the second occurrence of that
  2373.     character. This is a fast way to comment out large blocks. For example:
  2374.  
  2375. @\begin{verbatim}
  2376.     COMMENT $
  2377.       This is a comment
  2378.     $
  2379. @\end{verbatim}
  2380. $
  2381.  
  2382. @\subsubsection{DIR}
  2383. !DIR
  2384.  
  2385. @\begin{verbatim}
  2386.  DIR( StringType MatchPattern )
  2387. @\end{verbatim}
  2388.  
  2389.    Print the files match the MatchPattern in the current working directory.
  2390.    MatchPattern may have wild characters as in regular dos DIR - '*', '?'.
  2391.  
  2392.    This command is only supported under the MSDOS implementation. Example:
  2393.  
  2394. @\begin{verbatim}
  2395.     DIR( "*.irt" );
  2396. @\end{verbatim}
  2397.  
  2398.  lists all the '.irt' files in the current directory.
  2399. $
  2400.  
  2401. @\subsubsection{EDIT}
  2402. !EDIT
  2403.  
  2404. @\begin{verbatim}
  2405.  EDIT( StringType FileName )
  2406. @\end{verbatim}
  2407.  
  2408.    Invoke the editor (defined in the IRIT.CFG configuration file) as a child
  2409.  process if the solid modeler. Only one parameter is passed to the editor
  2410.  which is the FileName to edit. As the solid modeler is still resident, the
  2411.  child process (the editor) will get only the remained memory - as seen by
  2412.  the core left.
  2413.  
  2414.    This command is only supported under the MSDOS implementation.
  2415. $
  2416.  
  2417. @\subsubsection{EXIT}
  2418. !EXIT
  2419.  
  2420. @\begin{verbatim}
  2421.  EXIT();
  2422. @\end{verbatim}
  2423.  
  2424.    Exits from the solid modeler. NO warning is given!
  2425. $
  2426.  
  2427. @\subsubsection{FOR}
  2428. !FOR
  2429.  
  2430. @\begin{verbatim}
  2431.  FOR( NumericType Start, NumericType Increment, NumericType End, AnyType Body )
  2432. @\end{verbatim}
  2433.  
  2434.    Execute the {\bf Body} (see below), while the FOR loop conditions hold.
  2435.    {\bf Start, Increment, End} are evaluated first and the loop will be executed
  2436.  while {\bf $<=$ End} if {\bf Increment $>$ 0} or while {\bf $>=$ End} if {\bf Increment $<$ 0}.
  2437.    If {\bf Start} is of the form "(Variable = Expression)" then that variable is
  2438.  updated on each iteration, and can be used within the body.
  2439.    The body may consist of any number of regular commands, separated by
  2440.  COLONs, including nesting FOR loops to arbitrary level.
  2441.    No new variables should be introduced in loops - Use only old
  2442.  variables and/or the iteration variable defined in {\bf Start} (that makes it
  2443.  a feature now...). Example:
  2444.  
  2445. @\begin{verbatim}
  2446.     FOR ( (b = 100), 100, 300,
  2447.         FOR ( (a = 100), 100, 2000,
  2448.                 (
  2449.                   beep(a, b)
  2450.                 )
  2451.             )
  2452.         );
  2453. @\end{verbatim}
  2454.  
  2455.  exercises the BEEP function in different durations and different frequencies.
  2456.  This will best work under MSDOS systems.
  2457. $
  2458.  
  2459. @\subsubsection{FREE}
  2460. !FREE
  2461.  
  2462. @\begin{verbatim}
  2463.  FREE( GeometricType Object )
  2464. @\end{verbatim}
  2465.  
  2466.    Because of the usually huge size of geometric objects, this procedure
  2467.  may be used to free them. Note however that reassigning a value (even
  2468.  of different type) will automatically release old allocated space as well.
  2469. $
  2470.  
  2471. @\subsubsection{HELP}
  2472. !HELP
  2473.  
  2474. @\begin{verbatim}
  2475.  HELP( StringType Subject )
  2476. @\end{verbatim}
  2477.  
  2478.    Provides help on the specified Subject. Example:
  2479.  
  2480. @\begin{verbatim}
  2481.     HELP("");
  2482. @\end{verbatim}
  2483.  
  2484.  will list all {\em IRIT} commands.
  2485. $
  2486.  
  2487. @\subsubsection{IF}
  2488. !IF
  2489.  
  2490. @\begin{verbatim}
  2491.  IF( NumericType Left, StringType Cond, NumericType Right, AnyType Body )
  2492. @\end{verbatim}
  2493.  
  2494.    Executes {\bf Body} (group of regular commands, separated by COLONs - see FOR)
  2495.  if the condition holds: {\bf Left} and {\bf Right} are evaluated and tested against
  2496.  the specified condition {\bf Cond} which may be: "$=$", "$>$", "$<$", "$<>$", "$>=$", "$<=$".
  2497.    Example:
  2498.  
  2499. @\begin{verbatim}
  2500.     resolution = 10;
  2501.     IF ( machine, "=", msdos, ( resolution = 5 ) );
  2502. @\end{verbatim}
  2503.  
  2504.  sets the resolution to be 10 unless running on an MSDOS system in which the
  2505.  resolution variable will be set to 5.
  2506. $
  2507.  
  2508. @\subsubsection{INCLUDE}
  2509. !INCLUDE
  2510.  
  2511. @\begin{verbatim}
  2512.  INCLUDE( StringType FileName )
  2513. @\end{verbatim}
  2514.  
  2515.    Executes the script file {\bf FileName}. Nesting of include file is allowed up
  2516.  to 10 levels deep. If error occurs, all open files in all nested files
  2517.  are closed and data is expected at the top level (standard input).
  2518.  
  2519.    A script file can contain any command the solid modeler supports. Example:
  2520.  
  2521. @\begin{verbatim}
  2522.     INCLUDE( "general.irt" );
  2523. @\end{verbatim}
  2524.  
  2525.  includes the file "general.irt".
  2526. $
  2527.  
  2528. @\subsubsection{INTERACT}
  2529. !INTERACT
  2530.  
  2531. @\begin{verbatim}
  2532.  INTERACT( GeometryTreeType Object, NumericType UpdateViewMat )
  2533. @\end{verbatim}
  2534.  
  2535.    Invoke interactive mode to manipulate (transform) the given (geometric)
  2536.  {\bf Object}. {\bf Object} may be any GeometricType or a list of other
  2537.  GeometryTypes nested to an arbitrary level. {\bf Object} is displayed as
  2538.  a wire frame. ON SGI 4D systems a rendered display is also available.
  2539.  
  2540.    If {\bf UpdateViewMat} is non zero (see TRUE/FALSE and ON/OFF) then the
  2541.  global viewing matrix VIEW\_MAT is updated to the last view from INTERACT.
  2542.  
  2543.    INTERACT open an interactive menu to rotate/translate/scale an object(s).
  2544.  Each transformation has zero influence in middle of its box, and maximum
  2545.  (and opposite) on the box left and right ends.
  2546.  
  2547.    Screen transformation transforms according to the screen - X is horizontal,
  2548.  Y vertical, Z into screen. Object transformation transform in object own
  2549.  coordinate system - you probably want to display AXES object with it (see
  2550.  AXES).
  2551.  
  2552.    Left mouse button (return) is used to EXECUTE transformation. Right mouse
  2553.  button (space bar) is used to ABORT long display in the middle.
  2554.  
  2555.    On MSDOS, use the numeric keyboard pad (with/without shift) to move if no
  2556.  mouse available.
  2557.  
  2558.    If {\bf Object} is a GeometricType, that object is being displayed. If
  2559.  however it is an ListType the list is recursively traversed and all
  2560.  geometric objects within the list are displayed. Non geometric object in
  2561.  the list are ignored.
  2562.  
  2563. @\begin{verbatim}
  2564.  INTERACT( list( Axes, Obj ), FALSE );
  2565. @\end{verbatim}
  2566.  
  2567.  displays and interact with the object {\bf Obj} and the predefined object
  2568.  {\bf Axes}. VIEW\_MAT will not be updated once INTERACT is done.
  2569. $
  2570.  
  2571. @\subsubsection{LIST}
  2572. !LIST
  2573.  
  2574. @\begin{verbatim}
  2575.  ListType LIST( AnyType Elem1, AnyType Elem2, ... )
  2576. @\end{verbatim}
  2577.  
  2578.    Constructs an object as a list of several other objects. Only a reference
  2579.  is made to the Elements, so modifying Elem1 after being included in list,
  2580.  will affect Elem1 in that list, next time list is used!
  2581.  
  2582.    Each inclusion of an object in a list increases its internal {\bf used}
  2583.  reference. The object is freed iff in {\bf used} reference is zero.
  2584.    As a result, attempt to delete a variable (using FREE) which is referenced
  2585.  in a list will remove the variable, but the object itself will be freed only
  2586.  when that list will be freed.
  2587. $
  2588.  
  2589. @\subsubsection{LOAD}
  2590. !LOAD
  2591.  
  2592. @\begin{verbatim}
  2593.  AnyType LOAD( StringType FileName )
  2594. @\end{verbatim}
  2595.  
  2596.    Load the object from the given {\bf FileName}. The object may be any object
  2597.  defined in the system, including lists, in which the structure is
  2598.  loaded recursively and reconstructed as well (internal objects are
  2599.  inserted into the global system object list if have names defined).
  2600.    If no file type is provided, ".dat" is assumed.
  2601. $
  2602.  
  2603. @\subsubsection{LOGFILE}
  2604. !LOGFILE
  2605.  
  2606. @\begin{verbatim}
  2607.  LOGFILE( NumericType Set )
  2608. @\end{verbatim}
  2609.  
  2610.    If {\bf Set} is non zero (see TRUE/FALSE and ON/OFF) then everything printed in
  2611.  the input window, will go to the log file specified in IRIT.CFG configuration
  2612.  file. This file will be created the first time logfile is turned ON.
  2613. $
  2614.  
  2615. @\subsubsection{NORMAL}
  2616. !NORMAL
  2617.  
  2618. @\begin{verbatim}
  2619.  NORMAL( NumericType Set, NumericType Size, NumericType Color )
  2620. @\end{verbatim}
  2621.  
  2622.    If {\bf Set} is non zero (see TRUE/FALSE and ON/OFF) then the normals to the
  2623.  objects are also displayed. Normals should always point INTO the object.
  2624.  
  2625.    {\bf Size} sets the length of the normals, and {\bf Color} their color.
  2626.  See COLOR command for legal colors.
  2627. $
  2628.  
  2629. @\subsubsection{NTH}
  2630. !NTH
  2631.  
  2632. @\begin{verbatim}
  2633.  AnyType NTH( ListType ListObject, NumericType Index )
  2634. @\end{verbatim}
  2635.  
  2636.  Returns the {\bf Index} (base count 1) element of the list {\bf ListObject}.
  2637.  Example:
  2638.  
  2639. @\begin{verbatim}
  2640.     Lst = list( a, list( b, c ), d );
  2641.     Lst2 = NTH( Lst, 2 );
  2642. @\end{verbatim}
  2643.  
  2644.  and now {\bf Lst2} is equal to 'list( b, c )'.
  2645. $
  2646.  
  2647. @\subsubsection{PAUSE}
  2648. !PAUSE
  2649.  
  2650. @\begin{verbatim}
  2651.  PAUSE( NumericType Flush )
  2652. @\end{verbatim}
  2653.  
  2654.    Waits for a keystroke. Nice to have if temporary stopping in middle of
  2655.  included file (see INCLUDE) is needed. If {\bf Flush} is TRUE then the input
  2656.  is first flushed to guarantee we will wait.
  2657.  
  2658.    The implementation of this function is machine dependent and is geared
  2659.  mainly for MSDOS.
  2660. $
  2661.  
  2662. @\subsubsection{SAVE}
  2663. !SAVE
  2664.  
  2665. @\begin{verbatim}
  2666.  SAVE( StringType FileName, AnyType Object )
  2667. @\end{verbatim}
  2668.  
  2669.    Saves the provided {\bf Object} into specified file {\bf FileName}. No extension type
  2670.  is needed (ignored if specified), and ".dat" is always used. {\bf Object} can
  2671.  be any object type including list, in which structure is saved recursively. 
  2672.  See also LOAD.
  2673. $
  2674.  
  2675. @\subsubsection{SNOC}
  2676. !SNOC
  2677.  
  2678. @\begin{verbatim}
  2679.  SNOC( AnyType Object, ListType ListObject )
  2680. @\end{verbatim}
  2681.  
  2682.    Similar to the lisp cons operator but puts the new {\bf Object} in the {\em end}
  2683.  of the list {\bf ListObject} instead of the beginning, in place. Example:
  2684.  
  2685. @\begin{verbatim}
  2686.     Lst = list( axes );
  2687.     SNOC( Srf, Lst );
  2688. @\end{verbatim}
  2689.  
  2690.  and now {\bf Lst} is equal to the list 'list( axes, Srf )'.
  2691. $
  2692.  
  2693. @\subsubsection{SYSTEM}
  2694. !SYSTEM
  2695.  
  2696. @\begin{verbatim}
  2697.  SYSTEM()
  2698. @\end{verbatim}
  2699.  
  2700.    Invoke the current command processor (usually COMMAND.COM) as defined by
  2701.  the COMSPEC environment variable. As the solid modeler is still resident,
  2702.  the child process (the command processor) will get only the remained memory
  2703.  - as seen by the core left.
  2704.  
  2705.    This command is only supported under the MSDOS implementation.
  2706. $
  2707.  
  2708. @\subsubsection{TIME}
  2709. !TIME
  2710.  
  2711. @\begin{verbatim}
  2712.  TIME( NumericType Reset )
  2713. @\end{verbatim}
  2714.  
  2715.    Returns the real time (in seconds) from the last time TIME was called with
  2716.  {\bf Reset} TRUE. Note this is real time and not cpu time so running in a multi
  2717.  tasked system will return values, which not necessarily reflects this program
  2718.  execution time. As mentioned above if {\bf Reset} is non zero the time count is
  2719.  reset. The time is automatically reset to beginning of execution of this
  2720.  program, when the program is first invoked.
  2721.  
  2722.    Since this is real type, it may be unusable for multitasked systems.
  2723.  Example:
  2724.  
  2725. @\begin{verbatim}
  2726.     Time1 = TIME( TRUE );
  2727.       .
  2728.       .
  2729.       .
  2730.     Time1 = TIME( FALSE );
  2731.     DumpLvl = 1;
  2732.     Time1;
  2733. @\end{verbatim}
  2734.  
  2735.  prints the time in seconds between the above two time function calls.
  2736. $
  2737.  
  2738. @\subsubsection{VARLIST}
  2739. !VARLIST
  2740.  
  2741. @\begin{verbatim}
  2742.  VARLIST()
  2743. @\end{verbatim}
  2744.  
  2745.    List all the currently defined objects in the system.
  2746. $
  2747.  
  2748. @\subsubsection{VECTOR}
  2749. !VECTOR
  2750.  
  2751. @\begin{verbatim}
  2752.  VectorType VECTOR( NumericType Operand1, NumericType Operand2,
  2753.                                                        NumericType Operand3 )
  2754. @\end{verbatim}
  2755.  
  2756.    Creates a vector type object, out of 3 NumericType scalars.
  2757. $
  2758.  
  2759. @\subsubsection{VIEW}
  2760. !VIEW
  2761.  
  2762. @\begin{verbatim}
  2763.  VIEW( GeometricTreeType Object, NumericType ClearWindow )
  2764. @\end{verbatim}
  2765.  
  2766.    Display the (geometric) object(s) as given in {\bf Object}. See INTERACT
  2767.  for more on {\bf Object}.
  2768.  
  2769.    If {\bf ClearWindow} is non zero (see TRUE/FALSE and ON/OFF) the window is
  2770.  first cleared (before drawing the objects).
  2771.  
  2772.    The global viewing matrix VIEW\_MAT is used as the transformation matrix.
  2773.    Example:
  2774.  
  2775. @\begin{verbatim}
  2776.     VIEW( Axes, FALSE );
  2777. @\end{verbatim}
  2778.  
  2779.  displays the predefined object {\bf Axes} in the viewing window on top of
  2780.  what was drawn there.
  2781. $
  2782.  
  2783. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2784. @\subsection{System variables}
  2785. &System variables
  2786.  
  2787.  System variables are predefined objects in the system. Any time {\em IRIT} is
  2788.  executed, these variable will exist and be set to values which are sometimes
  2789.  machine dependent. These are {\em regular} objects in any other sense
  2790.  including the ability to delete or overwrite them. One can modify, delete
  2791.  or introduce other objects by the use of the IRITINIT.IRT file.
  2792.  
  2793. @\subsubsection{AXES}
  2794. !AXES
  2795.    Predefined polyline object (PolylineType) that holds XYZ axes system. May be
  2796.  viewed.
  2797. $
  2798.  
  2799. @\subsubsection{DRAWCTLPT}
  2800. !DRAWCTLPT
  2801.    Predefined Boolean variable (NumericType) controlling whether curves control
  2802.  polygons and surfaces control meshes will be drawn (TRUE) or not (FALSE). 
  2803. $
  2804.  
  2805. @\subsubsection{DUMPLVL}
  2806. !DUMPLVL
  2807.    Content of objects assigned to variables may be displayed by executing the
  2808.  command 'objname;' where objname is the name of the object. This variable
  2809.  (NumericType) control the way the data is dumped as follows:
  2810.  
  2811. # 20 2 1 1
  2812.  DumpLvl $>=$ 0
  2813.   Only object names/types are printed.
  2814.  DumpLvl $>=$ 1
  2815.   Non geometric object values are dumped.
  2816.  DumpLvl $>=$ 2
  2817.   Curves and Surfaces are dumped.
  2818.  DumpLvl $>=$ 3
  2819.   Polygons/lines are dumped.
  2820.  DumpLvl $>=$ 4
  2821.   List objects are traversed recursively.
  2822. #
  2823. $
  2824.  
  2825. @\subsubsection{ECHOSRC}
  2826. !ECHOSRC
  2827.    Predefined Boolean variable (NumericType) controlling echoing of
  2828.  interpreted commands to screen (TRUE) or not (FALSE).
  2829. $
  2830.  
  2831. @\subsubsection{FLAT4PLY}
  2832. !FLAT4PLY
  2833.    Predefined Boolean object (NumericType) controlling the way almost flat
  2834.  surface patches are converted to polygons: four polygons (TRUE) or only
  2835.  two polygons (FALSE).
  2836. $
  2837.  
  2838. @\subsubsection{INTERCRV}
  2839. !INTERCRV
  2840.    Predefined numeric object (NumericType) that if TRUE the Boolean geometry
  2841.  operators return the intersection curves instead of the result model.
  2842.  
  2843.    Its default value is FALSE.
  2844. $
  2845.  
  2846. @\subsubsection{INTERNAL}
  2847. !INTERNAL
  2848.    Predefined Boolean object (NumericType) that if not zero enables displaying
  2849.  internal polygon edges (edges created by the convex polygon splitting for
  2850.  example). One usually does not want to see these edges, and its default
  2851.  value is FALSE.
  2852. $
  2853.  
  2854. @\subsubsection{MACHINE}
  2855. !MACHINE
  2856.    Predefined numeric object (NumericType) holding machine type as one of the
  2857.  following constants: MSDOS, SGI, HP, SUN, APOLLO, UNIX.
  2858. $
  2859.  
  2860. @\subsubsection{RESOLUTION}
  2861. !RESOLUTION
  2862.    Predefined numeric object (NumericType) that sets the accuracy of the
  2863.  primitive geometric objects generated. Holds the number of divisions a
  2864.  circle is divided into (with minimum value of 4). If, for example, is set
  2865.  to 6, then a CONE generated, will effectively be 6 sided pyramid.
  2866.  
  2867.    Also controls the fineness freeform curves and surfaces are approximated
  2868.  as piecewise linear polylines (for display purposes for example), and the
  2869.  fineness freeform surfaces are approximated as polygons.
  2870. $
  2871.  
  2872. @\subsubsection{VIEW\_MAT}
  2873. !VIEW_MAT
  2874.    Predefined matrix object (MatrixType) to hold the viewing matrix used/set
  2875.  by VIEW and/or INTERACT.
  2876. $
  2877.  
  2878. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2879. @\subsection{System constants}
  2880. &System constants
  2881.  
  2882.  The following constants are used by the various functions of the system to
  2883.  signal certain conditions. Internally, they are represented numerically
  2884.  although, in general, their exact value is unimportant and may be changed
  2885.  in future versions. In the rare situation you would like to know their
  2886.  values, here is a sequence that will allow you to do so:
  2887.  
  2888. @\begin{verbatim}
  2889.     DumpLvl = 1;
  2890.     A = BLUE;
  2891.     A;
  2892. @\end{verbatim}
  2893.  
  2894.  in other words, assign the constant to a variable and display its content.
  2895.  
  2896. @\subsubsection{APOLLO}
  2897. !APOLLO
  2898.  A constant designates an APOLLO system in the MACHINE variable.
  2899. $
  2900.  
  2901. @\subsubsection{BLACK}
  2902. !BLACK
  2903.  A constant defining a BLACK color.
  2904. $
  2905.  
  2906. @\subsubsection{BLUE}
  2907. !BLUE
  2908.  A constant defining a BLUE color.
  2909. $
  2910.  
  2911. @\subsubsection{COL}
  2912. !COL
  2913.  A constant defining the COLumn direction of a surface mesh.
  2914. $
  2915.  
  2916. @\subsubsection{CYAN}
  2917. !CYAN
  2918.  A constant defining a CYAN color.
  2919. $
  2920.  
  2921. @\subsubsection{E2}
  2922. !E2
  2923.  A constant defining an E2 (X and Y coordinates) control point type.
  2924. $
  2925.  
  2926. @\subsubsection{E3}
  2927. !E3
  2928.  A constant defining an E3 (X, Y, and Z coordinates) control point type.
  2929. $
  2930.  
  2931. @\subsubsection{FALSE}
  2932. !FALSE
  2933.  A zero constant. May be used as Boolean operand.
  2934. $
  2935.  
  2936. @\subsubsection{GREEN}
  2937. !GREEN
  2938.  A constant defining a GREEN color.
  2939. $
  2940.  
  2941. @\subsubsection{HP}
  2942. !HP
  2943.  A constant designates an HP system in the MACHINE variable.
  2944. $
  2945.  
  2946. @\subsubsection{KV\_FLOAT}
  2947. !KV_FLOAT
  2948.  A constant defining a floating end condition uniform knot vector.
  2949. $
  2950.  
  2951. @\subsubsection{KV\_OPEN}
  2952. !KV_OPEN
  2953.  A constant defining an open end condition uniform knot vector.
  2954. $
  2955.  
  2956. @\subsubsection{MAGENTA}
  2957. !MAGENTA
  2958.  A constant defining a MAGENTA color.
  2959. $
  2960.  
  2961. @\subsubsection{MSDOS}
  2962. !MSDOS
  2963.  A constant designates an MSDOS system in the MACHINE variable.
  2964. $
  2965.  
  2966. @\subsubsection{OFF}
  2967. !OFF
  2968.  Synonym of FALSE.
  2969. $
  2970.  
  2971. @\subsubsection{ON}
  2972. !ON
  2973.  Synonym for TRUE.
  2974. $
  2975.  
  2976. @\subsubsection{P2}
  2977. !P2
  2978.  A constant defining an P2 (X, Y, and W coordinates) rational control point
  2979.  type.
  2980. $
  2981.  
  2982. @\subsubsection{P3}
  2983. !P3
  2984.  A constant defining an P3 (X, Y, Z, and W coordinates) rational control
  2985.  point type.
  2986. $
  2987.  
  2988. @\subsubsection{PI}
  2989. !PI
  2990.  The constant of 3.141592...
  2991. $
  2992.  
  2993. @\subsubsection{RED}
  2994. !RED
  2995.  A constant defining a RED color.
  2996. $
  2997.  
  2998. @\subsubsection{ROW}
  2999. !ROW
  3000.   A constant defining the ROW direction of a surface mesh.
  3001. $
  3002.  
  3003. @\subsubsection{SGI}
  3004. !SGI
  3005.  A constant designates a SGI system in the MACHINE variable.
  3006. $
  3007.  
  3008. @\subsubsection{SUN}
  3009. !SUN
  3010.  A constant designates a SUN system in the MACHINE variable.
  3011. $
  3012.  
  3013. @\subsubsection{TRUE}
  3014. !TRUE
  3015.  A non zero constant. May be used as Boolean operand.
  3016. $
  3017.  
  3018. @\subsubsection{UNIX}
  3019. !UNIX
  3020.  A constant designates a generic UNIX system in the MACHINE variable.
  3021. $
  3022.  
  3023. @\subsubsection{WHITE}
  3024. !WHITE
  3025.  A constant defining a WHITE color.
  3026. $
  3027.  
  3028. @\subsubsection{YELLOW}
  3029. !YELLOW
  3030.  A constant defining a YELLOW color.
  3031. $
  3032.  
  3033. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3034.  
  3035. @\section{poly3d - A Data Display Program}
  3036. !poly3d - A Data Display Program
  3037.  
  3038. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3039.  
  3040. @\subsection{Introduction}
  3041. &Introduction
  3042.  
  3043.  poly3d is a display program for data files created by the {\em IRIT} solid
  3044.  modeler. Data can be displayed on almost any IBMPC graphic device that has
  3045.  Borland's BGI support, for the MSDOS BC++ port, or using any device driver
  3046.  that is supported by DJGPP, in the MSDOS DJGPP port.
  3047.    Under UNIX systems both MIT's X11 and SGI's GL are supported.
  3048.  
  3049.    On SGI's, solid smooth shading is available via normal computation
  3050.  support. Displayed images may be saved as postscript files as well as GIF
  3051.  images (if poly3d was built with GIF support).
  3052.  
  3053. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3054. @\subsection{Command Line Options}
  3055. &Command line options
  3056.  
  3057. @\begin{verbatim}
  3058.  poly3d [-c] [-m] [-i] [-e #Edges] [-n] [-N] [-M] [-I n] [-P] [-S n]
  3059.                                                 [-f FineNess] [-4] [-z] DFiles
  3060. @\end{verbatim}
  3061.  
  3062. @\begin{itemize}
  3063. @\item
  3064.   {\bf -c}: Closed object - if an object is closed (such as objects created by
  3065.        {\em IRIT} solid medeller) each edge is actually displayed twice - once
  3066.        for each adjacent polygon. This flag will ensure every edge will be
  3067.        displayed only once.
  3068. @\item
  3069.   {\bf -m}: More - provide some more information on the data file(s) parsed.
  3070. @\item
  3071.   {\bf -i}: Internal edges (created by {\em IRIT}) - default is not to display them, and
  3072.        this option will force displaying them as well.
  3073. @\item
  3074.   {\bf -e n}: \# Edges to use from each given polygon (default all). Very handy to
  3075.        do '-e 2 -4-' or '-e 1 -4' on polygons created from a freeform surface.
  3076. @\item
  3077.   {\bf -n}: Draw vertex normals if data file has them.
  3078. @\item
  3079.   {\bf -N}: Draw polygon normals if data file has them (PLANE definition).
  3080. @\item
  3081.   {\bf -M}: Draw the surfaces control mesh/curves control polygons as well.
  3082. @\item
  3083.   {\bf -I n}: Specify number of isolines per surface.
  3084. @\item
  3085.   {\bf -P}: Generate polygonal approximation for surfaces instead of isolines.
  3086. @\item
  3087.   {\bf -S n}: Specify the log based 2 of number of samples per curve.
  3088. @\item
  3089.   {\bf -f FineNess}: Controls the fineness of the surface to polygon subdivision.
  3090.        This number is log based 2 of roughly the number of subdivisions of
  3091.        the surface in each axes (see cagd\_lib for more).
  3092. @\item
  3093.   {\bf -4}: Force four polygons per flat bilinear in surface to polygon
  3094.        conversion. Otherwise two polygons only.
  3095. @\item
  3096.   {\bf -z}: Print version number and current defaults.
  3097. @\end{itemize}
  3098.  
  3099.    Some of the options may be turned on in poly3d.cfg. They can be then turned
  3100.  off in the command line as -?-.
  3101.  
  3102. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3103. @\subsection{Configuration}
  3104. &Configuration
  3105.  
  3106.    The program can be configured using a configuration file named poly3d.cfg.
  3107.    The appropriate configuration file should be copied into poly3d.cfg:
  3108.    Under MSDOS BC++ its poly3dms.cfg, under MSDOS DJGPP its poly3ddj.cfg, and
  3109.  under UNIX its poly3dun.cfg.
  3110.    This is a plain ascii file you can edit directly and set the parameters
  3111.  according to the comments there. Executing 'poly3d -z' will show the
  3112.  current configuration as read from the configuration file.
  3113.  
  3114.    MSDOS version only:
  3115.  
  3116.    The configuration file in MSDOS BC++ system can be in any directory which
  3117.  is in your path - the same place as the executable is probably a good choice.
  3118.    The program supports SuperVGA, VGA/EGA, CGA \& HERCULES graphics card, and
  3119.  uses the Turbo C autodetect feature. If this fails you can always coerce it
  3120.  to a specific card - see the poly3d.cfg file. For a SuperVGA you will need to
  3121.  provide your own BGI driver.
  3122.    The program will use 80x87 if it detects one - again uses the Turbo C 80x87
  3123.  autodetect, or will run (much!) slower without it...
  3124.    The MSDOS DJGPP port can be used with any graphics driver that DJGPP
  3125.  support. If not 80x87 is present, the emulator, emu387, must be used. 
  3126.    In both the BC++ and DJGPP ports, a mouse or a joystick may be used
  3127.  if properly selected in poly3d.cfg configuration file.
  3128.    A windowing library, called intr\_lib is used (for both BC++ and DJGPP)
  3129.  for the interaction and windows which can be resized/moved/poped/pushed etc.
  3130.  via a default setting as selected by the configuration file and modified via
  3131.  a pop up menu during a session. see Irit solid modeler for more on intr\_lib
  3132.  and the interface.
  3133.  
  3134.    UNIX version only:
  3135.  
  3136.    The configuration file is being searched in the IRIT\_PATH environment
  3137.  variable under UNIX hosts. For example 'setenv IRIT\_PATH /u/gershon/irit/bin/'.
  3138.    Note IRIT\_PATH must terminate with '/'. If the variables is not set only
  3139.  the current directory is being searched.
  3140.    Add the following options to your {\em .Xdefaults} if you use X11. Most options
  3141.  set are self explanatory. The Trans attributes control the transformation
  3142.  window, while View control the view window. SubWin control the subwindows
  3143.  within the Transformation window:
  3144. # 33 2 0 1
  3145.  poly3d*Trans*BackGround:
  3146.   NavyBlue
  3147.  poly3d*Trans*BorderColor:
  3148.   Red
  3149.  poly3d*Trans*BorderWidth:
  3150.   3
  3151.  poly3d*Trans*TextColor:
  3152.   Yellow
  3153.  poly3d*Trans*SubWin*BackGround:
  3154.   DarkGreen
  3155.  poly3d*Trans*SubWin*BorderColor:
  3156.   Magenta
  3157.  poly3d*Trans*Geometry:
  3158.   =150x500+500+0
  3159.  poly3d*Trans*CursorColor:
  3160.   Green
  3161.  poly3d*View*BackGround:
  3162.   NavyBlue
  3163.  poly3d*View*BorderColor:
  3164.   Red
  3165.  poly3d*View*BorderWidth:
  3166.   3
  3167.  poly3d*View*Geometry:
  3168.   =500x500+0+0
  3169.  poly3d*View*CursorColor:
  3170.   Red
  3171. #
  3172.    Note the above options are the same as for the irit solid modeler
  3173.  itself.
  3174.  
  3175.    If poly3d is used under SGI gl library, you can set the prefered windows
  3176.  location in poly3d.cfg. No color control is provided at this time.
  3177.  
  3178. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3179. @\subsection{Usage}
  3180. &Usage
  3181.  
  3182.    The program is controlled via a transformation menu. The object can be
  3183.  rotated, translated, or scaled in screen or object based corrdinate system
  3184.  and with orthographic or perspective projected.
  3185.  
  3186.   Two operations are fundamental to the operation of poly3d:
  3187.  
  3188. # 10 2 0 1
  3189.  EXECUTE
  3190.   $<$Return$>$ key on the keyboard, or left  mouse button if exists.
  3191.  ABORT
  3192.   $<$Space$>$  key on the keyboard, or right mouse button if exists.
  3193. #
  3194.  
  3195.    The cursor may be moved via a mouse (if exists) or using the numeric
  3196.  keypad/arrows (shifted for faster movement).
  3197.    The ABORT may be useful in large data sets when another
  3198.  transformation should be applied with no need to wait to the current one to
  3199.  complete.
  3200.  
  3201.    The menus work in two modes in all implementations. If you click the
  3202.  EXECUTE button once on a transformation subwindow, that transformation
  3203.  will be applied. Most transformation subwindows have vertical bars in
  3204.  the middle. If the cursor is on the vertical bar the {\em amout} of
  3205.  transformation applied is {\em zero}. If the cursor is on the leftmost side
  3206.  of the subwindow, the {\em amount} will be maximized and if the cursor is on
  3207.  the rightmost side, the transformation {\em amount} will be maximized to the
  3208.  other direction (inverse transform).
  3209.    In addition, if one clicks the mouse (with the affect as above) but hold
  3210.  the EXECUTE button while dragging, continuous transformation will be applied.
  3211.  Altough implemented in all systems, you would probably like to try this on
  3212.  very simplistic models on slow machines.
  3213.  
  3214.    Keyboard control support is for MSDOS systems only.
  3215.  
  3216. @\subsection{Output Files}
  3217. &Output Files
  3218.  
  3219.    poly3d can save viewing matrices (to be used by poly3d-h, poly3d-r, or
  3220.  irit2ray for example), postscript files of the current view and GIF images
  3221.  of the screen if poly3d was built with GIF support.
  3222.  
  3223.    The postscript file can be directly sent to a laser printer. The viewing
  3224.  matrix should be appended {\em after} the data when any program is to use
  3225.  it. The last viewing matrix in the data will be the one used. For example
  3226.  
  3227. @\begin{verbatim}
  3228.  irit2ray -l -f 20 b58.dat generic0.mat
  3229. @\end{verbatim}
  3230.  
  3231.  where generic0.mat is the matrix saved bu poly3d.
  3232.  
  3233.    All files will be named genericX.EXT where EXT can be one of '.mat', '.ps'
  3234.  and '.gif' respectively. X is single digit so up to 10 distinguished files
  3235.  of each type can be saved each time.
  3236. $
  3237.  
  3238. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3239.  
  3240. @\section{poly3d-h - Hidden Line Removing Program}
  3241. !poly3d-h - Hidden Line Removing Program
  3242.  
  3243. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3244.  
  3245.  
  3246. @\subsection{Introduction}
  3247. &Introduction
  3248.  
  3249.     poly3d-h is a program to remove hidden line of a given polygonal model.
  3250.  Freeform objects are preprocessed into polygons with controlled fineness.
  3251.  
  3252.     The program performes 4 passes over the input:
  3253.  
  3254.  1. Preprocesses and maps all polgons in scene, and sorts them.
  3255.  
  3256.  2. Generates edges out of the polygonal model and sorts them (preprocesing
  3257.     for the scan line algorithm) into buckets.
  3258.  
  3259.  3. Intersects edges, and splits edges with non homogeneous visibility (the
  3260.     scan line algorithm)
  3261.  
  3262.  4. Applies a visibility test of each edge.
  3263.  
  3264.         This programs can handle CONVEX polygons only. From {\em IRIT} one can
  3265.  ensure a model is consisting of convex polygons only by the CONVEX command:
  3266. @\begin{verbatim}
  3267.   CnvxObj = convex( Obj );
  3268. @\end{verbatim}
  3269.  just before saving it into a file. Surfaces are always decomposed into
  3270.  triangles only.
  3271.  
  3272.     poly3d-h output is of the form of polylines. It is a regular {\em IRIT} data
  3273.  file that can be viewed using poly3d, for example.
  3274.  
  3275. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3276. @\subsection{Command Line Options}
  3277. &Command line options
  3278.  
  3279. @\begin{verbatim}
  3280.  poly3d-h [-b] [-m] [-i] [-e #Edges] [-f FineNess] [-4] [-z] DFiles [> OutFile]
  3281. @\end{verbatim}
  3282.  
  3283. @\begin{itemize}
  3284. @\item
  3285.   {\bf -b}: BackFacing - if object is closed (such as most models created by {\em IRIT})
  3286.        back facing polygons will be deleted, and therefore speed up the
  3287.        process by at list factor of two.
  3288. @\item
  3289.   {\bf -m}: More - provide some more information on the data file(s) parsed.
  3290. @\item
  3291.   {\bf -i}: Internal edges (created by {\em IRIT}) - default is not to display them, and
  3292.        this option will force displaying them as well.
  3293. @\item
  3294.   {\bf -e n}: \# Edges to use from each given polygon (default all). Very handy
  3295.        as '-e 1 -4' for freeform data.
  3296. @\item
  3297.   {\bf -f FineNess}: Controls the fineness of the surface to polygon subdivision.
  3298.        This number is log based 2 of roughly the number of subdivisions of
  3299.        the surface in each axes (see cagd\_lib for more).
  3300. @\item
  3301.   {\bf -4}: Force four polygons per flat bilinear in surface to polygon
  3302.        conversion. Otherwise two polygons only.
  3303. @\item
  3304.   {\bf -z}: Print version number and current defaults.
  3305. @\end{itemize}
  3306.  
  3307.    Some of the options may be turned on in poly3d-h.cfg. They can be then
  3308.  turned off in the command line as -?-.
  3309.  
  3310. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3311. @\subsection{Configuration}
  3312. &Configuration
  3313.  
  3314.    The program can be configured using a configuration file named poly3d-h.cfg.
  3315.    This is a plain ascii file you can edit directly and set the parameters
  3316.  according to the comments there. executing 'poly3d-h -z' will show the
  3317.  current configuration as read from the configuration file.
  3318.  
  3319.    UNIX and MSDOS DJGPP versions only:
  3320.  
  3321.    The configuration file is being searched in the IRIT\_PATH environment
  3322.  variable. For example 'setenv IRIT\_PATH /u/gershon/irit/bin/'.
  3323.    Note IRIT\_PATH must terminate with '/'. If the variables is not set only
  3324.  the current directory is being searched.
  3325.  
  3326.    MSDOS BC++ version only:
  3327.  
  3328.    The configuration file in MSDOS system can be in any directory which is in
  3329.  your path - the same place as the executable is probably a good choice.
  3330.    The program will use 80x87 if it detects one - uses the Turbo C 80x87
  3331.  autodetect, or will run (much!) slower without it...
  3332.  
  3333. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3334. @\subsection{Usage}
  3335. &Usage
  3336.  
  3337.    As this program is not interactive, usage is quite simple, and only
  3338.  control available is using the command lines options.
  3339. $
  3340.  
  3341. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3342.  
  3343. @\section{poly3d-r - A Simple Data Rendering Program}
  3344. !poly3d-r - A Simple Data Rendering Program
  3345.  
  3346. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3347.  
  3348. @\subsection{Introduction}
  3349. &Introduction
  3350.  
  3351.  poly3d-r is a simple rendering program for data files created by the {\em IRIT}
  3352.  solid modeler. poly3d-r generates GIF images with 8 bits per pixel. As a result
  3353.  rendered images are of medium quality. Although reasonably fast, one should
  3354.  use one of several raytracing public domain programs available (such as
  3355.  RAYSHADE which irit2ray can generate data to) for high quality images.
  3356.  
  3357.    poly3d-r uses cosine shading approximation, and flat/Gouraud interpolation.
  3358.  The program performes 4 passes over the input:
  3359.  
  3360.  1. Process the input (parsing.)
  3361.  
  3362.  2. Prepare the polygons by sorting them by their Y after mapping then into
  3363.     screen space.
  3364.  
  3365.  3. Evaluate colors for vertices (using polygon normals if flat shading, or
  3366.     by vertex normals for Gouraud shading).
  3367.  
  3368.  4. Scan the data by scan line basis and dump out image.
  3369.  
  3370.         This programs can handle CONVEX polygons only. From {\em IRIT} one can
  3371.  ensure a model is consisting of convex polygons only by the CONVEX command:
  3372. @\begin{verbatim}
  3373.   CnvxObj = convex( Obj );
  3374. @\end{verbatim}
  3375.  just before saving it into a file. Surfaces are always decomposed into
  3376.  triangles only.
  3377.  
  3378. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3379. @\subsection{Command Line Options}
  3380. &Command line options
  3381.  
  3382. @\begin{verbatim}
  3383.  poly3d-r [-a Ambient] [-c N] [-l X Y Z] [-2] [-m] [-s Xsize Ysize]
  3384.        [-S SubSample] [-g] [-b] [-M Mask] [-f FineNess] [-z] DFiles > Image.gif
  3385. @\end{verbatim}
  3386.  
  3387. @\begin{itemize}
  3388. @\item
  3389.   {\bf -a Ambient}: Sets the ambient intensity (must be in [0.0..1.0] range).
  3390. @\item
  3391.   {\bf -c N}: number of bits per pixel N (must be in [1..8] range).
  3392. @\item
  3393.   {\bf -l X Y Z}: specify the light source normal direction. This vector does not
  3394.      to be unit vector. Only one light source is supported.
  3395. @\item
  3396.   {\bf -2} : Force emulation of 2 light sources at opposite directions as selected
  3397.      via [-l]. This may be useful for models that has no plane specified (i.e.
  3398.      model has no PLANE attribute for its polygons), as the program guess the
  3399.      equation from the points themselves, and which can be to the opposite
  3400.      direction.
  3401. @\item
  3402.   {\bf -m}: More - provide some more information on the data file(s) parsed.
  3403. @\item
  3404.   {\bf -s Xsize Ysize}: specify image dimensions. As the models created by {\em IRIT}
  3405.      are mapped to a unit domain (X in [-1..1], Y in [-1..1]) by the
  3406.      viewing matrix, objects must be scaled up. The scaling up factor is
  3407.      MIN(Xsize, Ysize), which guarantee nothing of the original image will be
  3408.      clipped.
  3409. @\item
  3410.   {\bf -b}: Purge back facing polygons. If the scene contains closed objects (such
  3411.      as the ones usually created by {\em IRIT}), the back facing polygons can be
  3412.      deleted. This would not change the image, but will speed up the process
  3413.      at about %15. Using this option for non complete boundary object and/or
  3414.      objects with polygons with no PLANE specified would almost definitely
  3415.      create wrong image.
  3416. @\item
  3417.   {\bf -g}: Use Gouraud shading interpolation (flat shading is used by default).
  3418.      This is somewhat slower, but gives nicer results.
  3419. @\item
  3420.   {\bf -S SubSample}: sub sample, and uses box filter to low pass filter the
  3421.      image, using SubSample as grid side of SubSample by SubSample.
  3422.      This obviously make things slower, but guess what - it looks much better.
  3423. @\item
  3424.   {\bf -M Mask}: Create a new GIF file named Mask that is a binary image set to 1
  3425.      at any pixel covered by one of the objects or 0 otherwise. As a color of
  3426.      an object can become equal to the background at some point, there is no
  3427.      way to find whether pixel is background or an object in the background
  3428.      color. The Mask can be used instead. This Mask can be used when combining
  3429.      images (such as gifcomp utility in the gif\_lib).
  3430.      This image is a binary alpha channel.
  3431. @\item
  3432.   {\bf -f FineNess}: Controls the fineness of the surface to polygon subdivision.
  3433.      This number is log based 2 of roughly the number of subdivisions of
  3434.      the surface in each axes (see cagd\_lib for more).
  3435. @\item
  3436.   {\bf -z}: Print version number and current defaults.
  3437. @\end{itemize}
  3438.  
  3439.    The image is dumped to stdout as a GIF image which can be redirected to a
  3440.  file or to be piped to any program that reads GIF images from stdin.
  3441.  
  3442.    Some of the options may be turned on in poly3d-r.cfg. They can be then
  3443.  turned off in the command line as -?-.
  3444.  
  3445. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3446. @\subsection{Configuration}
  3447. &Configuration
  3448.  
  3449.    The program can be configured using a configuration file named poly3d-r.cfg.
  3450.    This is a plain ascii file you can edit directly and set the parameters
  3451.  according to the comments there. executing 'poly3d-r -z' will show the
  3452.  current configuration as read from the configuration file.
  3453.  
  3454.    UNIX and MSDOS DJGPP versions only:
  3455.  
  3456.    The configuration file is being searched in the IRIT\_PATH environment
  3457.  variable. For example 'setenv IRIT\_PATH /u/gershon/irit/bin/'.
  3458.    Note IRIT\_PATH must terminate with '/'. If the variables is not set only
  3459.  the current directory is being searched.
  3460.  
  3461.    MSDOS BC++ version only:
  3462.  
  3463.    The configuration file in MSDOS system can be in any directory which is in
  3464.  your path - the same place as the executable is probably a good choice.
  3465.    The program will use 80x87 if it detects one - uses the Turbo C 80x87
  3466.  autodetect, or will run (much!) slower without it...
  3467.  
  3468. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3469. @\subsection{Usage}
  3470. &Usage
  3471.  
  3472.    As this program is not interactive, usage is quite simple, and only
  3473.  control available is using the command lines options.
  3474.  
  3475.    Some Remarks:
  3476.  
  3477.   1. If the input file is degenerate (2 vertices are identical etc.) they
  3478.      will be ignored is the next passes. Use [-m] if you want to know about
  3479.      them.
  3480.  
  3481.   2. The color of the object can be extract via the COLOR attribute as set
  3482.      via the {\em IRIT} COLOR command. In addition to this fixed set of colors, one
  3483.      can specify the color in RGB space using the ATTRIB command. For example:
  3484.  
  3485. @\begin{verbatim}
  3486.      attrib( Srf17, "rgb", "255,155,55" );
  3487. @\end{verbatim}
  3488.  
  3489.      Each of R G B must be integer is the range [0..255].
  3490. $
  3491.  
  3492. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3493. @\section{Irit2Ray - IRIT To RAYSHADE filter}
  3494. !IRIT2RAY - IRIT To RAYSHADE filter
  3495.  
  3496. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3497. @\subsection{Command Line Options}
  3498. &Command line options
  3499.  
  3500. @\begin{verbatim}
  3501.   irit2ray [-l] [-4] [-G GridSize] [-f FineNess] [-o OutName] [-g] [-z] DFiles
  3502. @\end{verbatim}
  3503.  
  3504. @\begin{itemize}
  3505. @\item
  3506.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  3507.        as a single polygon along their linear direction.
  3508.          Although most of the time, linear direction can be exactly represented
  3509.        using a single polygon, even a bilinear surface can have a free form
  3510.        shape (saddle like) that is not representable using a single polygon.
  3511.          Not using this option will better emulate the surface shape but
  3512.        will create unnecessary polygons in cases where one is enough.
  3513. @\item
  3514.   {\bf -4}: Four - Generate four polygons per flat patch. Default is 2.
  3515. @\item
  3516.   {\bf -G GridSize}: Usually objects are grouped as {\em lists} of polygons.
  3517.        This flags will coerce the usage of RAYSHADE {\em grid} constructure,
  3518.        with {\em GridSize} being used as the grid size along the object bounding
  3519.        box largest dimension.
  3520. @\item
  3521.   {\bf -f FineNess}: An integer value controling the fineness of surface to
  3522.        polygons process. Roughly speaking it will set to the number of polygons
  3523.        along one Bezier patch direction. A Bezier patch will have order of
  3524.        $FineNess^2$ polygons then. The Order of the surface also affect the
  3525.        amount of polygons; The higher the order is, more polygons are created.
  3526.          A B-spline surface is first converted into piecewise Bezier to make
  3527.        sure C1 discontinuities will show up in the polygonal approximation.
  3528. @\item
  3529.   {\bf -o OutName}: Name of output files. By default the name of the first data
  3530.        file from {\em DFiles} list is used.  See below on the output files.
  3531. @\item
  3532.   {\bf -g}: Generates the geometry file only. See below.
  3533. @\item
  3534.   {\bf -z}: Print version number and current defaults.
  3535. @\end{itemize}
  3536.  
  3537. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3538. @\subsection{Usage}
  3539. &Usage
  3540.  
  3541.     Irit2Ray converts freeform surfaces into polygons in format that can
  3542.  be used by RAYSHADE. Two files are created, one with '.geom' extension and
  3543.  one with '.ray'. Since the number of polygons can be extremely large,
  3544.  the geometry is isolated in the '.geom' and is included (via '\#include') in
  3545.  the main '.ray' file. The later holds the surface properties for all the
  3546.  geometry as well as viewing and RAYSHADE specific commands. This allows
  3547.  changing shading or viewing properties while editing small ('.ray') files.
  3548.  
  3549.     If '-g' is specified, only the '.geom' file is created, preserving the
  3550.  current '.ray' file.
  3551.  
  3552.     In practice it may be useful to create a low resolution approximation
  3553.  of the model, change viewing/shading parameters in the '.ray' file until
  3554.  a good view and/or surface quality is found and then run Irit2Ray once more
  3555.  to create a high resolution approximation of the geometry using '-g'.
  3556.  
  3557.     Here is a simple example:
  3558.  
  3559. @\begin{verbatim}
  3560.  irit2ray -l -f 5 b58.dat
  3561. @\end{verbatim}
  3562.  
  3563.  creates b58.ray and b58.geom with low resolution (FineNess of 5).
  3564.    At such low resolution it can very well may happen that triangles will have
  3565.  normals "over the edge" since a single polygon may approximate a highly
  3566.  curves surface. That will cause rayshade to issue an
  3567.  "Inconsistant triangle normals" warning. This problem will not exist if
  3568.  high fineness is used.
  3569.    One can ray trace this scene using a command similar to:
  3570.  
  3571. @\begin{verbatim}
  3572.  rayshade -p -W 256 256 b58.ray > b58.rle
  3573. @\end{verbatim}
  3574.  
  3575.  Once done with parameter setting for rayshade, a fine approximation of the
  3576.  model can be created with:
  3577.  
  3578. @\begin{verbatim}
  3579.  irit2ray -l -g -f 25 b58.dat
  3580. @\end{verbatim}
  3581.  
  3582.  which will only recreate b58.geom (becuase of the -g option).
  3583.  
  3584.  Each time a data file is saved in {\em IRIT}, it can be saved with the viewing
  3585.  matrix of the last INTERACT by saving the VIEW\_MAT object as well. I.e.:
  3586.  
  3587. @\begin{verbatim}
  3588.  save( "b58", list( view_mat, b58 ) );
  3589. @\end{verbatim}
  3590.  
  3591.  However one can overwrite the viewing matrix by appending a new matrix in the
  3592.  end of the command line, created by poly3d:
  3593.  
  3594. @\begin{verbatim}
  3595.  poly3d b58.dat
  3596.  irit2ray -l -f 5 b58.dat generic0.mat
  3597. @\end{verbatim}
  3598.  
  3599.  where generic0.mat is the viewing matrix created by poly3d.
  3600.  
  3601. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3602. @\subsection{Advanced Usage}
  3603. &Advanced Usage
  3604.  
  3605.    One can specify surface qualities for individual surfaces of a model.
  3606.  Several such attributes are supported by Irit2Ray and can be set within {\em IRIT}.
  3607.  See also the ATTRIB {\em IRIT} command.
  3608.  
  3609.    If a certain surface should be finer than the rest of the scene, one can
  3610.  set a "resolution" attribute which specifies the {\em relative} FineNess resolution
  3611.  of this specific surface. For example:
  3612.  
  3613. @\begin{verbatim}
  3614.  attrib( srf1, "resolution", 2 );
  3615. @\end{verbatim}
  3616.  
  3617.  will force srf1 to have twice the default resolution, as set via the '-f'
  3618.  flag.
  3619.  
  3620.    Almost flat patches are converted to polygons. The rectangle can be
  3621.  converted into two polygons (by subdividing along one of its diagonals) or
  3622.  into four by introducing a new point at the patch center. This behaviour is
  3623.  controlled by the '-4' flag, but can be overwritten for individual surfaces
  3624.  bu setting "twoperflat" or "fourperflat".
  3625.  
  3626.    RAYSHADE specific properties are controlled via the following attributes:
  3627.  "specpow", "reflect", "transp", "body", "index", and "texture". Refer to
  3628.  RAYSHADE manual for their meaning. For example:
  3629.  
  3630. @\begin{verbatim}
  3631.  attrib( srf1, "transp", "0.3" );
  3632.  attrib( srf1, "texture", "wood" );
  3633. @\end{verbatim}
  3634.  
  3635.    Surface color is controlled in two levels. If the object has an RGB
  3636.  attribute it is used. Otherwise a color as set via {\em IRIT} COLOR command
  3637.  is being used if set. The later allowes you to specify only the 3 additive,
  3638.  3 substractive and white and black and so is very limited for rendering
  3639.  purposes. Example:
  3640.  
  3641. @\begin{verbatim}
  3642.  attrib( tankBody, "rgb", "244,164,96" );
  3643. @\end{verbatim}
  3644.  
  3645.    Current implementation allows white spaces in neither the attribute
  3646.  name nor in the attribute value.
  3647. $
  3648.  
  3649. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3650. @\section{Irit2Nff - IRIT To NFF filter}
  3651. !IRIT2NFF - IRIT To NFF filter
  3652.  
  3653. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3654. @\subsection{Command Line Options}
  3655. &Command line options
  3656.  
  3657. @\begin{verbatim}
  3658.   irit2nff [-l] [-4] [-c] [-f FineNess] [-o OutName] [-g] [-z] DFiles
  3659. @\end{verbatim}
  3660.  
  3661. @\begin{itemize}
  3662. @\item
  3663.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  3664.        as a single polygon along their linear direction.
  3665.          Although most of the time, linear direction can be exactly represented
  3666.        using a single polygon, even a bilinear surface can have a free form
  3667.        shape (saddle like) that is not representable using a single polygon.
  3668.          Not using this option will better emulate the surface shape but
  3669.        will create unnecessary polygons in cases where one is enough.
  3670. @\item
  3671.   {\bf -4}: Four - Generate four polygons per flat patch. Default is 2.
  3672. @\item
  3673.   {\bf -c}: Output files should be filtered by cpp. By doing so, the usually
  3674.        huge geometry file is seperated from the main nff file that contains
  3675.        the surface properties and view parameters. By default all data,
  3676.        including the geometry, is saved into a single file with type extension
  3677.        '.nff'. Use of '-c' will pull out all the geometry into a file with
  3678.        the same name but '.geom' extension and which will be included using
  3679.        '\#include' command. The '.nff' file should, in that case, be
  3680.        preprocessed using cpp before piped into the nff renderer.
  3681. @\item
  3682.   {\bf -f FineNess}: An integer value controling the fineness of surface to
  3683.        polygons process. Roughly speaking it will set to the number of polygons
  3684.        along one Bezier patch direction. A Bezier patch will have order of
  3685.        $FineNess^2$ polygons then. The Order of the surface also affect the
  3686.        amount of polygons; The higher the order is, more polygons are created.
  3687.          A B-spline surface is first converted into piecewise Bezier to make
  3688.        sure C1 discontinuities will show up in the polygonal approximation.
  3689. @\item
  3690.   {\bf -o OutName}: Name of output files. By default the name of the first data
  3691.        file from {\em DFiles} list is used.  See below on the output files.
  3692. @\item
  3693.   {\bf -g}: Generates the geometry file only. See below.
  3694. @\item
  3695.   {\bf -z}: Print version number and current defaults.
  3696. @\end{itemize}
  3697.  
  3698. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3699. @\subsection{Usage}
  3700. &Usage
  3701.  
  3702.     Irit2Nff converts freeform surfaces into polygons in format that can
  3703.  be used by NFF renderer. Usually one file is created with '.nff' type
  3704.  extension. Since the number of polygons can be extremely large, a '-c'
  3705.  option is provided and which separate the geometry from the surface
  3706.  properties and view specification but requires preprocessing by cpp.
  3707.  The geometry is isolated in a file with extension '.geom' and included
  3708.  (via '\#include') in the main '.nff' file. The later holds the surface
  3709.  properties for all the geometry as well as the viewing specification.
  3710.  This allows changing shading or viewing properties while editing small
  3711.  ('.nff') files.
  3712.  
  3713.     If '-g' is specified, only the '.geom' file is created, preserving the
  3714.  current '.nff' file. The '-g' flag can be specified only with '-c'.
  3715.  
  3716.     In practice it may be useful to create a low resolution approximation
  3717.  of the model, change viewing/shading parameters in the '.nff' file until
  3718.  a good view and/or surface quality is found and then run Irit2Nff once more
  3719.  to create a high resolution approximation of the geometry using '-g'.
  3720.  
  3721.     Here is a simple example:
  3722.  
  3723. @\begin{verbatim}
  3724.  irit2nff -c -l -f 5 b58.dat
  3725. @\end{verbatim}
  3726.  
  3727.  creates b58.nff and b58.geom with low resolution (FineNess of 5).
  3728.  
  3729.  Once done with parameter setting, a fine approximation of the model can
  3730.  be created with:
  3731.  
  3732. @\begin{verbatim}
  3733.  irit2nff -c -l -g -f 25 b58.dat
  3734. @\end{verbatim}
  3735.  
  3736.  which will only recreate b58.geom (becuase of the -g option).
  3737.  
  3738.  Each time a data file is saved in {\em IRIT}, it can be saved with the viewing
  3739.  matrix of the last INTERACT by saving the VIEW\_MAT object as well. I.e.:
  3740.  
  3741. @\begin{verbatim}
  3742.  save( "b58", list( view_mat, b58 ) );
  3743. @\end{verbatim}
  3744.  
  3745.  However one can overwrite the viewing matrix by appending a new matrix in the
  3746.  end of the command line, created by poly3d:
  3747.  
  3748. @\begin{verbatim}
  3749.  poly3d b58.dat
  3750.  irit2nff -l -f 5 b58.dat generic0.mat
  3751. @\end{verbatim}
  3752.  
  3753.  where generic0.mat is the viewing matrix created by poly3d.
  3754.  
  3755. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3756. @\subsection{Advanced Usage}
  3757. &Advanced Usage
  3758.  
  3759.    One can specify surface qualities for individual surfaces of a model.
  3760.  Several such attributes are supported by Irit2Nff and can be set within {\em IRIT}.
  3761.  See also the ATTRIB {\em IRIT} command.
  3762.  
  3763.    If a certain surface should be finer than the rest of the scene, one can
  3764.  set a "resolution" attribute which specifies the {\em relative} FineNess resolution
  3765.  of this specific surface. For example:
  3766.  
  3767. @\begin{verbatim}
  3768.  attrib( srf1, "resolution", 2 );
  3769. @\end{verbatim}
  3770.  
  3771.  will force srf1 to have twice the default resolution, as set via the '-f'
  3772.  flag.
  3773.  
  3774.    Almost flat patches are converted to polygons. The rectangle can be
  3775.  converted into two polygons (by subdividing along one of its diagonals) or
  3776.  into four by introducing a new point at the patch center. This behaviour is
  3777.  controlled by the '-4' flag, but can be overwritten for individual surfaces
  3778.  bu setting "twoperflat" or "fourperflat".
  3779.  
  3780.    NFF specific properties are controlled via the following attributes:
  3781.  "kd", "ks", "shine", "trans", "index". Refer to NFF manual for detail.
  3782.  For example:
  3783.  
  3784. @\begin{verbatim}
  3785.  attrib( srf1, "kd", "0.3" );
  3786.  attrib( srf1, "shine", "30" );
  3787. @\end{verbatim}
  3788.  
  3789.    Surface color is controlled in two levels. If the object has an RGB
  3790.  attribute it is used. Otherwise a color as set via {\em IRIT} COLOR
  3791.  command is being used if set. The later allowes you to specify only the
  3792.  3 additive, 3 substractive and white and black and so is very limited for
  3793.  rendering purposes. Example:
  3794.  
  3795. @\begin{verbatim}
  3796.  attrib( tankBody, "rgb", "244,164,96" );
  3797. @\end{verbatim}
  3798.  
  3799.    Current implementation allows white spaces in neither the attribute
  3800.  name nor in the attribute value.
  3801. $
  3802.  
  3803. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3804. @\section{Dat2Irit - Data To IRIT file filter}
  3805. !DAT2IRIT - Data To IRIT file filter
  3806.  
  3807. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3808. @\subsection{Command Line Options}
  3809. &Command line options
  3810.  
  3811. @\begin{verbatim}
  3812.    dat2irit [-z] DFiles
  3813. @\end{verbatim}
  3814.  
  3815. @\begin{itemize}
  3816. @\item
  3817.   {\bf -z}: Print version number and current defaults.
  3818. @\end{itemize}
  3819.  
  3820. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3821. @\subsection{Usage}
  3822. &Usage
  3823.  
  3824.     It may be sometimes desired to convert .dat data files into a form that
  3825.  can be fed in back to {\em IRIT} - a '.irt' file. This filter will do exactly that.
  3826.  Example:
  3827.  
  3828. @\begin{verbatim}
  3829.    dat2irit b58.dat > b58-new.irt
  3830. @\end{verbatim}
  3831. $
  3832.  
  3833. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3834. @\section{Data File Format}
  3835. !DATAFILE Format
  3836.  
  3837.    This section describes the data file format used to exchange data between
  3838.  {\em IRIT} and its accompanied tools.
  3839.  
  3840. @\begin{verbatim}
  3841.  [OBJECT {ATTRS} OBJNAME
  3842.      [NUMBER n]
  3843.  
  3844.    | [VECTOR x y z]
  3845.  
  3846.    | [CTLPT POINT_TYPE {w} x y {z}]
  3847.  
  3848.    | [STRING "a string"]
  3849.  
  3850.    | [MATRIX m00 ... m03
  3851.              m10 ... m13
  3852.              m20 ... m23
  3853.              m30 ... m33]
  3854.  
  3855.      ;A polyline should be drawn from first point to last. Nothing is drawn
  3856.      ;from last to first (in close polyline last pt is equal to first).
  3857.    | [POLYLINE {ATTRS} #PTS                   ;#PTS = number of points.
  3858.          [{ATTRS} x y z]
  3859.          [{ATTRS} x y z]
  3860.             .
  3861.             .
  3862.             .
  3863.          [{ATTRS} x y z]
  3864.      ]
  3865.  
  3866.      ;Defines a closed region boundary. Last point is NOT equal to first
  3867.      ;and a line from last point to first should be drawn when the polygon
  3868.      ;boundary is drawn.
  3869.    | [POLYGON {ATTRS} #PTS
  3870.          [{ATTRS} x y z]
  3871.          [{ATTRS} x y z]
  3872.             .
  3873.             .
  3874.             .
  3875.          [{ATTRS} x y z]
  3876.      ]
  3877.  
  3878.      ;Defines a cloud of points. This entry is not supported by IRIT.
  3879.    | [POINTLIST {ATTRS} #PTS
  3880.          [{ATTRS} x y z]
  3881.          [{ATTRS} x y z]
  3882.             .
  3883.             .
  3884.             .
  3885.          [{ATTRS} x y z]
  3886.      ]
  3887.  
  3888.      ;Defines a bezier curve with #PTS control points. If the curve is
  3889.      ;rational, the rational component is introduced first.
  3890.    | [CURVE BEZIER {ATTRS} #PTS POINT_TYPE
  3891.          [{ATTRS} {w} x y z ...]
  3892.          [{ATTRS} {w} x y z ...]
  3893.             .
  3894.             .
  3895.             .
  3896.          [{ATTRS} {w} x y z ...]
  3897.      ]
  3898.  
  3899.      ;Defines a bezier surface with #UPTS * #VPTS control points. If the
  3900.      ;surface is rational, the rational component is introduced first.
  3901.      ;Points are printed raw after raw (#UPTS per raw), #VPTS raws.
  3902.    | [SURFACE BEZIER {ATTRS} #UPTS #VPTS POINT_TYPE
  3903.          [{ATTRS} {w} x y z ...]
  3904.          [{ATTRS} {w} x y z ...]
  3905.             .
  3906.             .
  3907.             .
  3908.          [{ATTRS} {w} x y z ...]
  3909.      ]
  3910.  
  3911.      ;Defines a BSPLINE curve of order ORDER with #PTS control points. If the
  3912.      ;curve is rational, the rational component is introduced first.
  3913.      ;Note length of knot vector is equal to #PTS + ORDER.
  3914.    | [CURVE BSPLINE {ATTRS} #PTS ORDER POINT_TYPE
  3915.          [KV {ATTRS} kv0 kv1 kv2 ...]                    ;Knot vector
  3916.          [{ATTRS} {w} x y z ...]
  3917.          [{ATTRS} {w} x y z ...]
  3918.             .
  3919.             .
  3920.             .
  3921.          [{ATTRS} {w} x y z ...]
  3922.      ]
  3923.  
  3924.      ;Defines a BSPLINE surface with #UPTS * #VPTS control points, of order
  3925.      ;UORDER by VORDER. If the surface is rational, the rational component
  3926.      ;is introduced first.
  3927.      ;Points are printed raw after raw (#UPTS per raw), #VPTS raws.
  3928.    | [SURFACE BSPLINE {ATTRS} #UPTS #VPTS UORDER VORDER POINT_TYPE
  3929.          [KV {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
  3930.          [KV {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
  3931.          [{ATTRS} {w} x y z ...]
  3932.          [{ATTRS} {w} x y z ...]
  3933.             .
  3934.             .
  3935.             .
  3936.          [{ATTRS} {w} x y z ...]
  3937.      ]
  3938.  ]
  3939.  
  3940.  POINT_TYPE -> E2 | E3 | P2 | P3
  3941.  
  3942.  ATTRS -> [ATTRNAME ATTRVALUE]
  3943.           | [ATTRNAME ATTRVALUE] ATTRS
  3944.  
  3945. @\end{verbatim}
  3946.  
  3947.  Some notes:
  3948.  
  3949.  1. This new definition for the text file is design to minimize the
  3950.     reading time and space. All information can be read without backward
  3951.     or forward referencing (as used to be in the old format).
  3952.  
  3953.  2. An OBJECT can hold any number of geometry entities such as POLYGONs or
  3954.     CURVEs. It is not recommended at this time to have more than one curve
  3955.     or one surface in an object since this feature is not fully implemented
  3956.     for free form objects.
  3957.  
  3958.  3. An OBJECT must not hold different geometry or other entities.
  3959.     I.e. CURVEs, SURFACEs, and POLYGONs must all be in different OBJECTs.
  3960.  
  3961.  4. Attributes should be ignored if not needed. The attribute list may have
  3962.     any length and is always terminated by a token that is NOT '\verb+[+'. This
  3963.     simplified and disambiguous the parsing.
  3964.  
  3965.  5. Comments may appear between '\verb+[+OBJECT ...\verb+]+' blocks, or immediatelly after
  3966.     OBJECT OBJNAME, and only there.
  3967.  
  3968.     A comment body can be anything not containing the '\verb+[+' or the '\verb+]+' tokens
  3969.     (signals start/end of block). Some of the comments in the above definition
  3970.     are {\em illegal} and appear there only of the sake of clarity.
  3971.  
  3972.  6. It is prefered that geometric attributes such as NORNALs will be saved in
  3973.     the geometry strurcture level (POLYGON, CURVE or vertices) while graphical
  3974.     and others such as COLORs will be saved in the OBJECT level.
  3975.  
  3976.  7. Objects may be contained in other objects to any level.
  3977.  
  3978.  Here is an example that exercises most of the data format:
  3979.  
  3980. @\begin{verbatim}
  3981.  This is a legal comment in a data file.
  3982.  [OBJECT DEMO
  3983.      [OBJECT REAL_NUM
  3984.          And this is also a legal comment.     
  3985.          [NUMBER 4]
  3986.      ]
  3987.  
  3988.      [OBJECT A_VECTOR
  3989.          [VECTOR 1 2 3]
  3990.      ]
  3991.  
  3992.      [OBJECT CTL_POINT
  3993.          [CTLPT E3 1 2 3]
  3994.      ]
  3995.  
  3996.      [OBJECT STR_OBJ
  3997.          [STRING "string"]
  3998.      ]
  3999.  
  4000.      [OBJECT UNIT_MAT
  4001.          [MATRIX
  4002.             1 0 0 0
  4003.             0 1 0 0
  4004.             0 0 1 0
  4005.             0 0 0 1
  4006.          ]
  4007.      ]
  4008.  
  4009.      [OBJECT [COLOR 4] POLY1OBJ
  4010.          [POLYGON [PLANE 1 0 0 0.5] 4
  4011.              [-0.5 0.5 0.5]
  4012.              [-0.5 -0.5 0.5]
  4013.              [-0.5 -0.5 -0.5]
  4014.              [-0.5 0.5 -0.5]
  4015.          ]
  4016.          [POLYGON [PLANE 0 -1 0 0.5] 4
  4017.              [0.5 0.5 0.5]
  4018.              [-0.5 0.5 0.5]
  4019.              [-0.5 0.5 -0.5]
  4020.              [0.5 0.5 -0.5]
  4021.          ]
  4022.      ]
  4023.  
  4024.      [OBJECT [COLOR 63] ACURVE
  4025.          [CURVE BSPLINE 16 4 E2
  4026.              [KV 0 0 0 0 1 1 1 2 3 4 5 6 7 8 9 10 11 11 11 11]
  4027.              [0.874 0]
  4028.              [0.899333 0.0253333]
  4029.              [0.924667 0.0506667]
  4030.              [0.95 0.076]
  4031.              [0.95 0.76]
  4032.              [0.304 1.52]
  4033.              [0.304 1.9]
  4034.              [0.494 2.09]
  4035.              [0.722 2.242]
  4036.              [0.722 2.318]
  4037.              [0.38 2.508]
  4038.              [0.418 2.698]
  4039.              [0.57 2.812]
  4040.              [0.57 3.42]
  4041.              [0.19 3.572]
  4042.              [0 3.572]
  4043.          ]
  4044.      ]
  4045.  
  4046.      [OBJECT [COLOR 2] SOMESRF
  4047.          [SURFACE BEZIER 3 3 E3
  4048.              [0 0 0]
  4049.              [0.05 0.2 0.1]
  4050.              [0.1 0.05 0.2]
  4051.  
  4052.              [0.1 -0.2 0]
  4053.              [0.15 0.05 0.1]
  4054.              [0.2 -0.1 0.2]
  4055.  
  4056.              [0.2 0 0]
  4057.              [0.25 0.2 0.1]
  4058.              [0.3 0.05 0.2]
  4059.          ]
  4060.      ]
  4061.  ]
  4062. @\end{verbatim}
  4063. $
  4064.  
  4065. @\section{Bugs and Limitations}
  4066. !BUGS and LIMITATIONS
  4067.  
  4068.    Like any program of more than one line it is far from been perfect.
  4069.  Some limitations as well as simplifications are layed out below.
  4070.  
  4071.  1. No intersection of co-planar polygons is allowed. Such case results are
  4072.     undefined. Most of the time, one can move one of the operands
  4073.     in the Boolean operation by an EPSILON. Such EPSILON should be in the
  4074.     order of 10-3 if the system uses float and and 10-6 if doubles are used.
  4075.     (the UNIX and MSDOS DJGPP version uses doubles, MSDOS BC++ uses floats).
  4076.  
  4077.  2. If the intersection curve of two objects falls exactly on polygon
  4078.     boundaries, for all polygons, the system will scream that the two object
  4079.     do not intersect at all. Again, try to move one by EPSILON into the other.
  4080.     I probably should fix this one - that suppose to be relatively easy.
  4081.  
  4082.  3. Avoid degeneracies - intersection that results with a point or a line will
  4083.     probably cause wrong propagation of the inner and outer part of one object
  4084.     relative to the other. Always extend your object beyond the other object.
  4085.  
  4086.  4. If two objects have no intersection in their boundary, {\em IRIT} assumes they
  4087.     are disjoint: a union simply combines them, and the other Boolean
  4088.     operators return NULL object. One should find FAST way (3D Jordan
  4089.     theorem) to find the relation between the two (A in B, B in A, A
  4090.     disjoint B) and according to that make a decision.
  4091.  
  4092.  5. Sweep of a circular curve along circular curve does {\em not} create an
  4093.     exact piece of a torus. This is probably due to the fact that both curves
  4094.     are rationals.
  4095.  
  4096.  6. No degree raising for Bspline surfaces of order larger than two.
  4097. $
  4098.  
  4099. @\end{document}
  4100.  
  4101.