home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / 3d / irit / docs / irit.src < prev    next >
Encoding:
Text File  |  1995-03-15  |  281.1 KB  |  8,993 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 follow specifying indentations, # of elements per
  7. ;       line, whether or not to put an internal vertical separator, and
  8. ;       if entries are row ordered (1) or column ordered (2).
  9. ; '@' - latex only manual. Latex commands can appear within this line.
  10. ; '^' - text/hlp only manual. Opposite of '@'.
  11. ; '!' - plain text and irit docs only manual - keywords/headers.
  12. ; '&' - plain text only manual - headers.
  13. ; '$' - terminator for current block.
  14. ; '*' - prints line in all modes but without any latex filtering on the line.
  15. ; '%' - copied verbatim to all output types.
  16. ;
  17. ; latex commands can appear in regular text limited to a single line as
  18. ; {\command *}. For plain text the {\command } will be filtered out.
  19. ; Escaped characters via '\' (i.e. \#) will be left escaped (\#) in the
  20. ; latex output but unescaped (#) in the plain output.
  21. ;
  22. ;                       IRIT solid modeler (C) Gershon Elber 1991.
  23. ;
  24.  
  25. @%
  26. @% Irit Solid modeler latex manual.
  27. @%
  28. @% Authors:     Gershon Elber
  29. @%
  30. @% Date:        Thu April 15, 1993
  31. @%
  32. @% Copyright (c) 1991/92/93 Gershon Elber
  33. @%
  34. @
  35. @\documentstyle[11pt]{article}
  36. @\oddsidemargin  -.2in
  37. @\evensidemargin -.2in
  38. @\textwidth 6.75in
  39. @\topmargin 0.0in
  40. @\textheight 9.5in
  41. @
  42. @\newcommand{\eqnref}[1]{(\ref{#1})}
  43. @\newcommand{\inner}[2]{\left<{#1}, {#2} \right>}
  44. @
  45. @\begin{document}
  46. @
  47. @\pagestyle{empty}
  48. @   \rule{0in}{3in}
  49. @   \begin{center}
  50. @       {\huge\bf _IRIT_VERSION_ User's Manual}\\
  51. @       \vspace{3cm}
  52. @       {\Large A Solid modeling Program}\\
  53. @       \vspace{2cm}
  54. @       {\large Copyright (C) 1989, 1990-1995 Gershon Elber}\\
  55. @       \vspace{1cm}
  56. @       {\large EMail: gershon@cs.technion.ac.il }\\
  57. @       \vspace{2cm}
  58. @       {\large Join {\em IRIT} mailing list: gershon@cs.technion.ac.il }\\
  59. @       {\large Mailing list: irit-mail@cs.technion.ac.il }\\
  60. @       {\large Bug reports: irit-bugs@cs.technion.ac.il }\\
  61. @
  62. @       \vfill
  63. @       {\small This manual is for IRIT _IRIT_VERSION_.}
  64. @   \end{center}
  65. @\newpage
  66. @
  67. @\tableofcontents
  68. @\newpage
  69. @
  70. @\setcounter{page}{1}
  71. @\markright{{\em {\bf Irit Solid modeler}}\hfil G. Elber}
  72. @\pagestyle{myheadings}
  73. @\newpage
  74. @
  75. @
  76. !
  77. ! IRIT _IRIT_VERSION_ User's Manual 
  78.  
  79. ! A Solid modeling Program 
  80.  
  81. ^ Copyright (C) 1989, 1990-1995 Gershon Elber
  82.  
  83. ^ EMail: gershon@cs.technion.ac.il
  84.  
  85. ^ Join IRIT mailing list: gershon@cs.technion.ac.il
  86. ^ Mailing list: irit-mail@cs.technion.ac.il
  87. ^ Bug reports: irit-bugs@cs.technion.ac.il
  88.  
  89.  
  90. @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  91. @
  92. @\section{Introduction}
  93. !INTRODUCTION
  94.  
  95.    {\em IRIT} is a solid modeler developed for educational purposes. Although
  96.  small, it is now powerful enough to create quite complex scenes.
  97.  
  98.    {\em IRIT} started as a polygonal solid modeler and was originally developed
  99.  on an IBM PC under MSDOS. Version 2.0 was also ported to X11 and version 3.0
  100.  to SGI 4D systems. Version 3.0 also includes quite a few free form curves
  101.  and surfaces tools. See the UPDATE.NEW file for more detailed update
  102.  information. In Version 4.0, the display devices were enhanced, freeform
  103.  curves and surfaces have further support, functions can be defined, and
  104.  numerous improvement and optimizations are added.
  105. $
  106.  
  107. @\section{Copyrights}
  108. !COPYRIGHTS
  109.  
  110.    BECAUSE {\em IRIT} AND ITS SUPPORTING TOOLS AS DOCUMENTED IN THIS DOCUMENT
  111.  ARE LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY NO WARRANTY, TO THE EXTENT
  112.  PERMITTED BY APPLICABLE STATE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, I
  113.  GERSHON ELBER PROVIDE THE {\em IRIT} PROGRAM AND ITS SUPPORTING TOOLS "AS IS"
  114.  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
  115.  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  116.  PARTICULAR PURPOSE.
  117.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THESE PROGRAMS IS WITH
  118.  YOU. SHOULD THE {\em IRIT} PROGRAMS PROVE DEFECTIVE, YOU ASSUME THE COST OF
  119.  ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  120.  
  121.    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL GERSHON ELBER,
  122.  BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES,
  123.  OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  124.  USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR A
  125.  FAILURE OF THE PROGRAMS TO OPERATE WITH PROGRAMS NOT DISTRIBUTED BY GERSHON
  126.  ELBER) THE PROGRAMS, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF
  127.  SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  128.  
  129. @\smallskip
  130.  
  131.    {\em IRIT} is a freeware solid modeler. It is not public domain since I
  132.  hold copyrights on it. However, unless you are to sell or attempt to make
  133.  money from any part of this code and/or any model you made with this solid
  134.  modeler, you are free to make anything you want with it.
  135.  
  136.    {\em IRIT} can be compiled and executed on numerous Unix systems as well
  137.  as OS2, Windows NT and AmigaDOS. However, beware the MSDOS support is fading
  138.  away.
  139.  
  140.    You are not obligated to me or to anyone else in any way by using {\em IRIT}.
  141.    You are encouraged to share any model you made with it, but the models
  142.  you made with it are {\em yours}, and you have no obligation to share them.
  143.    You can use this program and/or any model created with it for non
  144.  commercial and non profit purposes only. An acknowledgement on the way the
  145.  models were created would be nice but is {\em not} required.
  146. $
  147.  
  148. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  149. @\section{Command Line Options and Set Up of {\em IRIT}}
  150. !SETUP
  151.  
  152.    The {\em IRIT} program reads a file called {\bf irit.cfg} each time it is executed.
  153.    This file configures the system. It is a regular text file with comments, so
  154.  you can edit it and properly modify it for your environment.
  155.    This file is being searched for in the directory specified by the
  156.  IRIT\_PATH environment variable.
  157.    For example 'setenv IRIT\_PATH /u/gershon/irit/bin/'.
  158.    Note IRIT\_PATH must terminate with '/'. If the variable is not set only
  159.  the current directory is being searched for {\bf irit.cfg}.
  160.  
  161.    In addition, if it exists, a file by the name of {\bf iritinit.irt} will be
  162.  automatically executed before any other '.irt' file. This file may contain
  163.  any {\em IRIT} command. It is the proper place to put your predefined
  164.  functions and procedures if you have some.
  165.    This file will be searched much the same way {\bf IRIT.CFG} is. The
  166.  name of this initialization file may be changed by setting the StartFile
  167.  entry in the configuration file.
  168.    This file is far more important starting at version 4.0, because of the new
  169.  function and procedure definition that has been added, and which is used
  170.  to emulate BEEP, VIEW, and INTERACT for example.
  171.  
  172.    The solid modeler can be executed in text mode (see the .cfg and the -t
  173.  flag below) on virtually any system with a C compiler.
  174.  
  175.   Under all systems the following environment variables must be set
  176.  and updated:
  177. # 14 2 0 1
  178.  path
  179.   Add to path the directory where {\em IRIT}'s binaries are.
  180.  IRIT\_PATH
  181.   Directory with config., help and {\em IRIT}'s binary files.
  182.  IRIT\_DISPLAY
  183.   The graphics driver program/options. Must be in path.
  184.  IRIT\_BIN\_IPC
  185.   If set, uses binary Inter Process Communication.
  186. #
  187.  
  188.  For example,
  189.  
  190. @\begin{verbatim}
  191.    set path = ($path /u/gershon/irit/bin)
  192.    setenv IRIT_PATH  /u/gershon/irit/bin/
  193.    setenv IRIT_DISPLAY "xgldrvs -s-"
  194.    setenv IRIT_BIN_IPC 1
  195. @\end{verbatim}
  196.  
  197.  to set /u/gershon/irit/bin as the binary directory and to use the sgi's
  198.  gl driver. If IRIT\_DISPLAY is not set, the server (i.e., the {\em IRIT}
  199.  program) will prompt and wait for you to run a client (i.e., a display
  200.  driver). if IRIT\_PATH is not set, none of the configuration files, nor
  201.  the help file will be found.
  202.  
  203.  If IRIT\_BIN\_IPC is not set, text based IPC is used, which is far
  204.  slower. No real reason not to use IRIT\_BIN\_IPC, unless it does not
  205.  work for you.
  206.  
  207.   In addition, the following optional environment variables may be set.
  208. # 17 2 0 1
  209.  IRIT\_MALLOC
  210.   If set, apply dynamic memory consistency testing.
  211.  
  212.   Programs will execute much slower in this mode.
  213.  IRIT\_NO\_SIGNALS
  214.   If set, no signals are caught by IRIT.
  215.  IRIT\_SERVER\_HOST
  216.   Internet Name of IRIT server (used by graphics driver).
  217.  IRIT\_SERVER\_PORT
  218.   Used internally to the TCP socket number. Should not
  219.  
  220.   be set by users.
  221. #
  222.  
  223.  For example,
  224.  
  225. @\begin{verbatim}
  226.    setenv IRIT_MALLOC 1
  227.    setenv IRIT_NO_SIGNALS 1
  228.    setenv IRIT_SERVER_HOST irit.cs.technion.ac.il
  229. @\end{verbatim}
  230.  
  231.  IRIT\_MALLOC is useful for programmers, or when reporting a memory
  232.  fatal error occurrence. IRIT\_NO\_SIGNALS is also useful for debugging
  233.  when contorl-C is used within a debugger. The IRIT\_SERVER\_HOST/PORT
  234.  controls the server/client ({\em IRIT}/Display device) communication.
  235.  
  236.  IRIT\_SERVER\_HOST and IRIT\_SERVER\_PORT are used in the unix and
  237.  Window NT ports of {\em IRIT}.
  238.  
  239.    See the section on the graphics drivers for more details.
  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.    The following command line options are available:
  245.  
  246. @\begin{verbatim}
  247.    IRIT [-t] [-z] [file.irt]
  248. @\end{verbatim}
  249.  
  250. # 10 2 1 1
  251.  -t
  252.    Puts {\em IRIT} into text mode. No graphics will be displayed and
  253.  
  254.    the display commands will be ignored. Useful when one needs to
  255.  
  256.    execute an irt file to create data on a tty device...
  257.  -z
  258.    Prints usage message and current configuration/version
  259.  
  260.    information.
  261.  file.irt
  262.    A file to invoke directly instead of waiting to input from
  263.  
  264.    stdin.
  265. #
  266.  
  267. @\subsection{IBM PC OS2 Specific Set Up}
  268.  
  269.  Under OS2 the IRIT\_DISPLAY environment variable must be set (if set) to
  270.  os2drvs.exe without any option (-s- will be passed automatically).
  271.  os2drvs.exe must be in a directory that is in the PATH environment
  272.  variable. IRIT\_BIN\_IPC can be used to signal binary IPC which is faster.
  273.  Here is a complete example:
  274.  
  275. @\begin{verbatim}
  276. %set IRIT_PATH=c:\irit\bin\
  277.  set IRIT_DISPLAY=os2drvs.exe
  278.  set IRIT_BIN_IPC=1
  279. @\end{verbatim}
  280.  
  281.  assuming the directory specified by IRIT\_PATH holds the executables of
  282.  IRIT and is in PATH.
  283.  
  284.  If IRIT\_BIN\_IPC is not set, text based IPC is used which is far
  285.  slower. No real reason not to use IRIT\_BIN\_IPC unless it does not
  286.  work for you.
  287.  
  288. @\subsection{IBM PC Window NT Specific Set Up}
  289.  
  290.  The NT port uses sockets and is, in this respect, similar to the unix port.
  291.  The envirnoment variables IRIT\_DISPLAY, IRIT\_SERVER\_HOST,
  292.  IRIT\_BIN\_IPC should all be set in a similar way to the Unix specific setup.
  293.  As a direct result, the server (IRIT) and the display device may be running
  294.  on different hosts. For example the server might be running on an NT system
  295.  while the display device will be running on an SGI4D exploiting the graphic's
  296.  hardware capabilities.
  297.  
  298. @\subsection{Unix Specific Set Up}
  299.    Under UNIX using X11 (x11drvs driver) add the following options to
  300.  your .Xdefaults. Most are self explanatory. The Trans attributes control
  301.  the transformation window, while the View attributes control the view window.
  302.  SubWin attributes control the subwindows within the Transformation window.
  303. # 33 2 0 1
  304.  \#if COLOR
  305.   
  306.  irit*Trans*BackGround:
  307.   NavyBlue
  308.  irit*Trans*BorderColor:
  309.   Red
  310.  irit*Trans*BorderWidth:
  311.   3
  312.  irit*Trans*TextColor:
  313.   Yellow
  314.  irit*Trans*SubWin*BackGround:
  315.   DarkGreen
  316.  irit*Trans*SubWin*BorderColor:
  317.   Magenta
  318.  irit*Trans*Geometry:
  319.   =150x500+500+0
  320.  irit*Trans*CursorColor:
  321.   Green
  322.  irit*View*BackGround:
  323.   NavyBlue
  324.  irit*View*BorderColor:
  325.   Red
  326.  irit*View*BorderWidth:
  327.   3
  328.  irit*View*Geometry:
  329.   =500x500+0+0
  330.  irit*View*CursorColor:
  331.   Red
  332.  irit*MaxColors:
  333.   15
  334.  \#else
  335.   
  336.  irit*Trans*Geometry:
  337.   =150x500+500+0
  338.  irit*Trans*BackGround:
  339.   Black
  340.  irit*View*Geometry:
  341.   =500x500+0+0
  342.  irit*View*BackGround:
  343.   Black
  344.  irit*MaxColors:
  345.   1
  346.  \#endif
  347.   
  348. #
  349. $
  350.  
  351. @\section{First Usage}
  352. !FIRSTUSAGE
  353.  
  354.    Commands to {\em IRIT} are entered using a textual interface, usually
  355.  from the same window the program was executed from.
  356.  
  357.    Some important commands to begin with are,
  358.  
  359.    1. include("file.irt"); - will execute the commands in file.irt. Note
  360.       include can be recursive up to 10 levels. To execute the demo
  361.       (demo.irt) simply type 'include("demo.irt");'. Another way to run
  362.       the demo is by typing demo(); which is a predefined procedure defined
  363.       in iritinit.irt.
  364.  
  365.    2. help(""); - will print all available commands and how to get help on
  366.       them. A file called irit.hlp will be searched as irit.cfg is
  367.       being searched (see above), to provide the help.
  368.  
  369.    3. exit(); - close everything and exit {\em IRIT}.
  370.  
  371.    Most operators are overloaded. This means that you can multiply
  372.  two scalars (numbers), or two vectors, or even two matrices, with the same
  373.  multiplication operator ($*$). To get the on-line help on the
  374.  operator '$*$' type 'help("$*$");'
  375.  
  376.    The best way to learn this program (like any other program...) is by
  377.  trying it. Print the manual and study each of the commands available.
  378.    Study the demo programs ($*$.irt) provided as well.
  379.  
  380.    The "best" mode to use irit is via the emacs editor. With this distribution
  381.  an emacs mode for irit files (irt postfix) is provided (irit.el). Make your
  382.  .emacs load this file automatically. Loading file.irt will switch emacs into
  383.  Irit mode that supports the following three keystrokes:
  384. # 18 2 1 1
  385.  Meta-E
  386.   Executes the current line
  387.  Meta-R
  388.   Executes the current Region (Between Cursor and Mark)
  389.  Meta-S
  390.   Executes a single line from input buffer
  391. #
  392.    The first time one of the above keystrokes is hit, emacs will fork an Irit
  393.  process so that Irit's stdin is controlled via the above commands.
  394.    This emacs mode was tested under various unix environments and under OS2
  395.  2.x.
  396. $
  397.  
  398. @\section{Data Types}
  399. !DATATYPES
  400.   These are the Data Types recognized by the solid modeler. They are also
  401.  used to define the calling sequences of the different functions below:
  402. # 18 2 1 1
  403.  {\bf ConstantType}
  404.   Scalar real type that cannot be modified.
  405.  {\bf NumericType}
  406.   Scalar real type.
  407.  {\bf VectorType}
  408.   3D real type vector.
  409.  {\bf PointType}
  410.   3D real type point.
  411.  {\bf CtlPtType}
  412.   Control point of a freeform curve or surface.
  413.  {\bf MatrixType}
  414.   4 by 4 matrix (homogeneous transformation matrix).
  415.  {\bf PolygonType}
  416.   Object consists of polygons.
  417.  {\bf PolylineType}
  418.   Object consists of polylines.
  419.  {\bf CurveType}
  420.   Object consists of curves.
  421.  {\bf SurfaceType}
  422.   Object consists of surfaces.
  423.  {\bf TrimSrfType}
  424.   Object consists of trimmed surfaces.
  425.  {\bf TrivarType}
  426.   Object consists of trivariate function.
  427.  {\bf GeometricType}
  428.   One of Polygon/lineType, CurveType, SurfaceType,
  429.  
  430.   TrimSrfType, TrivarType.
  431.  {\bf GeometricTreeType}
  432.   A list of GeometricTypes or GeometricTreeTypes.
  433.  {\bf StringType}
  434.   Sequence of chars within double quotes - "A string".
  435.  
  436.   Current implementation is limited to 80 chars.
  437.  {\bf AnyType}
  438.   Any of the above.
  439.  {\bf ListType}
  440.   List of (any of the above type) objects. List 
  441.  
  442.   size is dynamically increased, as needed.
  443. #
  444.   Although points and vectors are not the same, {\em IRIT} does not
  445.  destinguish between them, most of the time. This might change in the future.
  446. $
  447.  
  448. @\section{Commands summary}
  449. !COMMANDS
  450.  
  451.  These are all the commands and operators supported by the {\em IRIT} solid
  452.  modeler:
  453.  
  454. # 11 6 1 0
  455.  $+$
  456.  $-$
  457.  $*$
  458.  $/$
  459.  \verb+^+
  460.  $=$
  461.  $==$
  462.  $!=$
  463.  $<$
  464.  $>$
  465.  $<=$
  466.  $>=$
  467.  ABS
  468.  ACOS
  469.  ADAPISO
  470.  ARC
  471.  AREA
  472.  ASIN
  473.  ATAN
  474.  ATAN2
  475.  ATTRIB
  476.  AOFFSET
  477.  BOOLONE
  478.  BOOLSUM
  479.  BOX
  480.  BSP2BZR
  481.  BZR2BSP
  482.  CBEZIER
  483.  CBSPLINE
  484.  CCINTER
  485.  CCRVTR
  486.  CDERIVE
  487.  CDIVIDE
  488.  CEDITPT
  489.  CEVAL
  490.  CEVOLUTE
  491.  CEXTREMES
  492.  CHDIR
  493.  CINFLECT
  494.  CINTERP
  495.  CIRCLE
  496.  CIRCPOLY
  497.  CLNTCLOSE
  498.  CLNTEXEC
  499.  CLNTREAD
  500.  CLNTWRITE
  501.  CMESH
  502.  CMORPH
  503.  CMULTIRES
  504.  COERCE
  505.  COLOR
  506.  COMMENT
  507.  CON2
  508.  CONE
  509.  CONVEX
  510.  COORD
  511.  COS
  512.  COMPOSE
  513.  CPOLY
  514.  CRAISE
  515.  CREFINE
  516.  CREGION
  517.  CREPARAM
  518.  CROSSEC
  519.  CRVLNDST
  520.  CRVPTDST
  521.  CSURFACE
  522.  CTANGENT
  523.  CTLPT
  524.  CTRIMSRF
  525.  CYLIN
  526.  CZEROS
  527.  ERROR
  528.  EXIT
  529.  EXP
  530.  EXTRUDE
  531.  FFCOMPAT
  532.  FFEXTREME
  533.  FOR
  534.  FREE
  535.  FUNCTION
  536.  GBOX
  537.  GETLINE
  538.  GPOLYGON
  539.  GPOLYLINE
  540.  HELP
  541.  HOMOMAT
  542.  IF
  543.  INCLUDE
  544.  INTERACT
  545.  IRITSTATE
  546.  LIST
  547.  LN
  548.  LOAD
  549.  LOFFSET
  550.  LOG
  551.  LOGFILE
  552.  MERGEPOLY
  553.  MESHSIZE
  554.  MOMENT
  555.  MSLEEP
  556.  NIL
  557.  NTH
  558.  OFFSET
  559.  PAUSE
  560.  PCIRCLE
  561.  PDOMAIN
  562.  POLY
  563.  PRINTF
  564.  PRISA
  565.  PROCEDURE
  566.  RANDOM
  567.  RMATTR
  568.  ROTX
  569.  ROTY
  570.  ROTZ
  571.  RULEDSRF
  572.  SAVE
  573.  SBEZIER
  574.  SBSPLINE
  575.  SCALE
  576.  SCRVTR
  577.  SDERIVE
  578.  SDIVIDE
  579.  SEDITPT
  580.  SEVAL
  581.  SFROMCRVS
  582.  SIN
  583.  SINTERP
  584.  SIZEOF
  585.  SMERGE
  586.  SMORPH
  587.  SNOC
  588.  SNORMAL
  589.  SNRMLSRF
  590.  SPHERE
  591.  SQRT
  592.  SRAISE
  593.  SREFINE
  594.  SREGION
  595.  SREPARAM
  596.  STANGENT
  597.  STRIMSRF
  598.  STRIVAR
  599.  SURFPREV
  600.  SURFREV
  601.  SWEEPSRF
  602.  SWPSCLSRF
  603.  SYMBCPROD
  604.  SYMBDIFF
  605.  SYMBDPROD
  606.  SYMBPROD
  607.  SYMBSUM
  608.  SYSTEM
  609.  TAN
  610.  TBEZIER
  611.  TBSPLINE
  612.  TDERIVE
  613.  TEVAL
  614.  TIME
  615.  TINTERP
  616.  THISOBJ
  617.  TORUS
  618.  TRANS
  619.  TREFINE
  620.  TREGION
  621.  TRIMSRF
  622.  TSUBDIV
  623.  VARLIST
  624.  VECTOR
  625.  VIEW
  626.  VIEWOBJ
  627.  VOLUME
  628. #
  629. $
  630.  
  631. @\section{Functions and Variables}
  632. !FUNCTIONS
  633. @ This section lists all the functions supported by the {\em IRIT} system
  634. @ according to their classes - mostly, the object type they return.
  635. @
  636.  
  637.  Functions that return a {\bf NumericType}:
  638. # 11 5 1 0
  639.  ABS
  640.  ACOS
  641.  AREA
  642.  ASIN
  643.  ATAN
  644.  ATAN2
  645.  COS
  646.  CLNTEXEC
  647.  CPOLY
  648.  EXP
  649.  LN
  650.  LOG
  651.  MESHSIZE
  652.  RANDOM
  653.  SIN
  654.  SIZEOF
  655.  SQRT
  656.  TAN
  657.  THISOBJ
  658.  VOLUME
  659. #
  660.  
  661.  Functions that return a {\bf GeometricType}:
  662. # 11 6 1 0
  663.  ADAPISO
  664.  ARC
  665.  AOFFSET
  666.  BOOLONE
  667.  BOOLSUM
  668.  BOX
  669.  BSP2BZR
  670.  BZR2BSP
  671.  CBEZIER
  672.  CBSPLINE
  673.  CCINTER
  674.  CCRVTR
  675.  CDERIVE
  676.  CDIVIDE
  677.  CEDITPT
  678.  CEVAL
  679.  CEVOLUTE
  680.  CEXTREMES
  681.  CINFLECT
  682.  CINTERP
  683.  CIRCLE
  684.  CIRCPOLY
  685.  CLNTREAD
  686.  CMESH
  687.  CMORPH
  688.  CMULTIRES
  689.  COERCE
  690.  COMPOSE
  691.  CON2
  692.  CONE
  693.  CONVEX
  694.  COORD
  695.  CPOLY
  696.  CRAISE
  697.  CREFINE
  698.  CREGION
  699.  CREPARAM
  700.  CROSSEC
  701.  CRVLNDST
  702.  CRVPTDST
  703.  CSURFACE
  704.  CTANGENT
  705.  CTRIMSRF
  706.  CTLPT
  707.  CYLIN
  708.  CZEROS
  709.  EXTRUDE
  710.  FFCOMPAT
  711.  FFEXTREME
  712.  GBOX
  713.  GETLINE
  714.  GPOLYGON
  715.  GPOLYLINE
  716.  LOFFSET
  717.  MERGEPOLY
  718.  MOMENT
  719.  NIL
  720.  OFFSET
  721.  PCIRCLE
  722.  PDOMAIN
  723.  POLY
  724.  PRISA
  725.  PROCEDURE
  726.  RULEDSRF
  727.  SBEZIER
  728.  SBSPLINE
  729.  SCRVTR
  730.  SDERIVE
  731.  SDIVIDE
  732.  SEDITPT
  733.  SEVAL
  734.  SFROMCRVS
  735.  SINTERP
  736.  SMERGE
  737.  SMORPH
  738.  SNORMAL
  739.  SNRMLSRF
  740.  SPHERE
  741.  SRAISE
  742.  SREFINE
  743.  SREGION
  744.  SREPARAM
  745.  STANGENT
  746.  STRIMSRF
  747.  STRIVAR
  748.  SURFPREV
  749.  SURFREV
  750.  SWEEPSRF
  751.  SWPSCLSRF
  752.  SYMBCPROD
  753.  SYMBDIFF
  754.  SYMBDPROD
  755.  SYMBPROD
  756.  SYMBSUM
  757.  TBEZIER
  758.  TBSPLINE
  759.  TDERIVE
  760.  TEVAL
  761.  TINTERP
  762.  TORUS
  763.  TREFINE
  764.  TREGION
  765.  TRIMSRF
  766.  TSUBDIV
  767. #
  768.  
  769.  Functions that create linear transformation matrices:
  770. # 11 6 1 0
  771.  HOMOMAT
  772.  ROTX
  773.  ROTY
  774.  ROTZ
  775.  SCALE
  776.  TRANS
  777. #
  778.  
  779.  Miscellaneous functions:
  780. # 11 6 1 0
  781.  ATTRIB
  782.  CHDIR
  783.  CLNTCLOSE
  784.  CLNTWRITE
  785.  COLOR
  786.  COMMENT
  787.  ERROR
  788.  EXIT
  789.  FOR
  790.  FREE
  791.  FUNCTION
  792.  HELP
  793.  IF
  794.  INCLUDE
  795.  INTERACT
  796.  IRITSTATE
  797.  LIST
  798.  LOAD
  799.  LOGFILE
  800.  MSLEEP
  801.  NTH
  802.  PAUSE
  803.  PRINTF
  804.  PROCEDURE
  805.  RMATTR
  806.  SAVE
  807.  SNOC
  808.  SYSTEM
  809.  TIME
  810.  VARLIST
  811.  VECTOR
  812.  VIEW
  813.  VIEWOBJ
  814. #
  815.  
  816.  Variables that are predefined in the system:
  817. # 18 4 1 0
  818.  AXES
  819.  DRAWCTLPT
  820.  FLAT4PLY
  821.  MACHINE
  822.  POLY\_APPROX\_OPT
  823.  POLY\_APPROX\_UV
  824.  POLY\_APPROX\_TOL
  825.  PRSP\_MAT
  826.  RESOLUTION
  827.  VIEW\_MAT
  828. #
  829.  
  830.  Constants that are predefined in the system:
  831. # 13 5 1 0
  832.  AMIGA
  833.  APOLLO
  834.  BLACK
  835.  BLUE
  836.  COL
  837.  CTLPT\_TYPE
  838.  CURVE\_TYPE
  839.  CYAN
  840.  DEPTH
  841.  E1
  842.  E2
  843.  E3
  844.  E4
  845.  E5
  846.  FALSE
  847.  GREEN
  848.  HP
  849.  IBMOS2
  850.  IBMNT
  851.  KV\_FLOAT
  852.  KV\_OPEN
  853.  LIST\_TYPE
  854.  MAGENTA
  855.  MATRIX\_TYPE
  856.  MSDOS
  857.  NUMERIC\_TYPE
  858.  OFF
  859.  ON
  860.  P1 
  861.  P2
  862.  P3
  863.  P4
  864.  P5
  865.  PARAM\_CENTRIP
  866.  PARAM\_CHORD
  867.  PARAM\_UNIFORM
  868.  PI
  869.  PLANE\_TYPE
  870.  POINT\_TYPE
  871.  POLY\_TYPE
  872.  RED
  873.  ROW
  874.  SGI
  875.  STRING\_TYPE
  876.  SURFACE\_TYPE
  877.  SUN
  878.  TRIMSRF\_TYPE
  879.  TRIVAR\_TYPE
  880.  TRUE
  881.  UNDEF\_TYPE
  882.  UNIX
  883.  VECTOR\_TYPE
  884.  WHITE
  885.  YELLOW
  886. #
  887. $
  888.  
  889. @\section{Language description}
  890. !LANGUAGE
  891.     The front end of the {\em IRIT} solid modeler is an infix parser that
  892.  mimics some of the C language behavior. The infix operators that are supported
  893.  are plus (+), minus (-), multiply (*), divide (/), and power (\verb+^+), for
  894.  numeric operators, with the same precedence as in C.
  895.  
  896.     However, unlike the C language, these operators are overloaded,
  897. @\footnote{In fact the C language does support overloaded operators to some
  898. @extent: '1 + 2' and '1.0 + 2.0' implies invocation of two different
  899. @actions.}
  900.  or different action is taken, based upon the different operands.
  901.    This means that one can write '1 + 2', in which the plus sign denotes a
  902.  numeric addition, or one can write 'PolyObj1 + PolyObj2', in which case the
  903.  plus sign denotes the Boolean operation of a union between two geometric
  904.  objects.
  905.    The exact way each operator is overloaded is defined below.
  906.  
  907.    In this environment, reals, integers, and even Booleans, are all represented
  908.  as real types. Data are automatically promoted as necessary.
  909.    For example, the constants TRUE and FALSE are defined as 1.0 and 0.0
  910.  respectively.
  911.  
  912.    Each expression is terminated by a semicolon. An expression can be as
  913.  simple as 'a;' which prints the value of variable a, or as complex as:
  914.  
  915. @\begin{verbatim}
  916.     for ( t = 1.1, 0.1, 1.9,
  917.             cb1 = csurface( sb, COL, t ):
  918.             color( cb1, green ):
  919.             snoc( cb1, cb_all )
  920.         );
  921. @\end{verbatim}
  922.  
  923.    While an expression is terminated with a semicolon, a colon is used to
  924.  terminate mini-expressions within an expression.
  925.  
  926.    Once a complete expression is read in (i.e., a semicolon is detected)
  927.  and parsed correctly (i.e. no syntax errors are found), it is executed.
  928.    Before each operator or a function is executed, parameter type matching
  929.  tests are made to make sure the operator can be applied to these
  930.  operand(s), or that the function gets the correct set of arguments.
  931.  
  932.    The parser is totally case insensitive, so Obj, obj, and OBJ will refer
  933.  to the same object, while MergePoly, MERGEPOLY, and mergePoly will refer
  934.  to the same function.
  935.  
  936.    Objects (Variables if you prefer) need not be declared. Simply use them
  937.  when you need them. Object names may be any alpha-numeric (and underscore)
  938.  string of at most 30 characters. By assigning to an old object, the old
  939.  object will be automatically deleted and if necessary its type will be
  940.  modified on the fly.
  941.  
  942.  Example:
  943.  
  944. @\begin{verbatim}
  945.     V = sin( 45 * pi / 180.0 );
  946.     V = V * vector( 1, 2, 3 );
  947.     V = V * rotx( 90 );
  948.     V = V * V;
  949. @\end{verbatim}
  950.  
  951.  will assign to V a NumericType equal to the sine of 45 degrees, the VectorType
  952.  ( 1, 2, 3 ) scaled by the sine of 45, rotate that vector around the X axis
  953.  by 90 degrees, and finally a NumericType which is the dot (inner) product of
  954.  V with itself.
  955.  
  956.    The parser will read from stdin, unless a file is specified on the command
  957.  line or an INCLUDE command is executed. In both cases, when the end of file
  958.  is encountered, the parser will again wait for input from stdin. In order
  959.  to execute a file and quit in the end of the file, put an EXIT command as
  960.  the last command in the file.
  961. $
  962.  
  963. @\section{Operator overloading}
  964. @
  965. @ The basic operators $+$, $-$, $*$, $/$, and \verb+^+ are overloaded.
  966. @ This section describes what action is taken by each of these operators
  967. @ depending on its arguments.
  968. @
  969. @\subsection{Overloading $+$}
  970. !+
  971.  The $+$ operator is overloaded above the following domains:
  972.  
  973. @\begin{verbatim}
  974.   NumericType + NumericType -> NumericType
  975.   VectorType  + VectorType  -> VectorType   (Vector addition)
  976.   MatrixType  + MatrixType  -> MatrixType   (Matrix addition)
  977.   PolygonType + PolygonType -> PolygonType  (Boolean UNION operation)
  978.   CurveType   + CurveType   -> CurveType    (Curve curve profiling)
  979.   CurveType   + CtlPtType   -> CurveType    (Curve control point profiling)
  980.   CtlPtType   + CtlPtType   -> CurveType    (Control points profiling)
  981.   ListType    + ListType    -> ListType     (Append lists operator)
  982.   StringType  + StringType  -> StringType   (String concat)
  983.   StringType  + RealType    -> StringType   (String concat, real as int string)
  984. @\end{verbatim}
  985.  
  986.  Note: Boolean UNION of two disjoint objects (no common volume) will result
  987.  with the two objects combined. It is the USER responsibility to make sure that
  988.  the non intersecting objects are also disjoint - this system only tests for
  989.  no intersection.
  990. $
  991.  
  992. @\subsection{Overloading $-$}
  993. !-
  994.  The $-$ operator is overloaded above the following domains:
  995.  
  996.  As a binary operator:
  997.  
  998. @\begin{verbatim}
  999.   NumericType - NumericType -> NumericType
  1000.   VectorType  - VectorType  -> VectorType   (Vectoric difference)
  1001.   MatrixType  - MatrixType  -> MatrixType   (Matrix difference) 
  1002.   PolygonType - PolygonType -> PolygonType  (Boolean SUBTRACT operation)
  1003. @\end{verbatim}
  1004.  
  1005.  As a unary operator:
  1006.  
  1007. @\begin{verbatim}
  1008.   - NumericType -> NumericType
  1009.   - VectorType  -> VectorType    (Scale vector by -1)
  1010.   - MatrixType  -> MatrixType    (Scale matrix by -1)
  1011.   - PolygonType -> PolygonType   (Boolean NEGATION operation)
  1012.   - CurveType   -> CurveType     (Curve parameterization is reversed)
  1013.   - SurfaceType -> SurfaceType   (Surface parameterization is reversed)
  1014. @\end{verbatim}
  1015.  
  1016.  Note: Boolean SUBTRACT of two disjoint objects (no common volume) will result
  1017.  with an empty object. For both a curve and a surface parameterization, reverse
  1018.  operation (binary minus) causes the object normal to be flipped as a side
  1019.  effect.
  1020. $
  1021.  
  1022. @\subsection{Overloading $*$}
  1023. !*
  1024.  The $*$ operator is overloaded above the following domains:
  1025.  
  1026. @\begin{verbatim}
  1027.   NumericType * NumericType   -> NumericType
  1028.   VectorType  * NumericType   -> VectorType    (Vector scaling)
  1029.   VectorType  * VectorType    -> NumericType   (Inner product)
  1030.   MatrixType  * NumericType   -> MatrixType    (Matrix Scaling)
  1031.   MatrixType  * PointType     -> PointType     (Point transformation)
  1032.   MatrixType  * CtlPtType     -> CtlPtType     (Ctl Point transformation)
  1033.   MatrixType  * VectorType    -> VectorType    (Vector transformation)
  1034.   MatrixType  * MatrixType    -> MatrixType    (Matrix multiplication)
  1035.   MatrixType  * GeometricType -> GeometricType (Object transformation)
  1036.   MatrixType  * ListType      -> ListType      (Object hierarchy transform.)
  1037.   PolygonType * PolygonType   -> PolygonType   (Boolean INTERSECTION operation)
  1038. @\end{verbatim}
  1039.  
  1040.  Note: Boolean INTERSECTION of two disjoint objects (no common volume) will
  1041.  result with an empty object. Object hierarchy transform transforms any
  1042.  transformable object (GeometricType) found in the list recursively.
  1043. $
  1044.  
  1045. @\subsection{Overloading $/$}
  1046. !/
  1047.  The $/$ operator is overloaded above the following domains:
  1048.  
  1049. @\begin{verbatim}
  1050.   NumericType / NumericType -> NumericType
  1051.   PolygonType / PolygonType -> PolygonType   (Boolean CUT operation)
  1052. @\end{verbatim}
  1053. $
  1054.  
  1055.  Note: Boolean CUT of two disjoint objects (no common volume) will result
  1056.  with an empty object.
  1057. $
  1058.  
  1059. @\subsection{Overloading \^{\ }}
  1060. !^
  1061.  The \verb+^+ operator is overloaded above the following domains:
  1062.  
  1063. @\begin{verbatim}
  1064.   NumericType ^ NumericType -> NumericType
  1065.   VectorType  ^ VectorType  -> VectorType  (Cross product)
  1066.   MatrixType  ^ NumericType -> MatrixType  (Matrix to the (int) power)
  1067.   PolygonType ^ PolygonType -> PolygonType (Boolean MERGE operation)
  1068.   StringType  ^ StringType  -> StringType  (String concat)
  1069.   StringType  ^ RealType    -> StringType  (String concat, real as real string)
  1070. @\end{verbatim}
  1071.  
  1072.  Note: Boolean MERGE simply merges the two sets of polygons without any
  1073.  intersection tests. Matrix powers must be positive integers or -1, in which
  1074.  case the matrix inverse (if it exists) is computed.
  1075. $
  1076.  
  1077. @\subsection{Assignments}
  1078. !=
  1079.    Assignments are allowed as side effects, in any place in an expression.
  1080.  If "Expr" is an expression, then "var = Expr" is the exact same expression
  1081.  with the side effect of setting Var to that value. There is no guarantee
  1082.  on the order of evaluation, so using Vars that are set within the same
  1083.  expression is a bad practice. Use parentheses to force the order of
  1084.  evaluation, i.e., "( var = Expr )".
  1085. $
  1086.  
  1087. @\subsection{Comparison operators $==$, $!=$, $<$, $>$, $<=$, $>=$}
  1088. &Comparison operators ==, !=, <, >, <=, >=
  1089.  The conditional comparison operators can be applied to the following
  1090.  domains (o for a comparison operator):
  1091.  
  1092. @\begin{verbatim}
  1093.   NumericType o NumericType -> NumericType
  1094.   StringType  o StringType  -> NumericType
  1095.   PointType   o PointType   -> NumericType
  1096.   VectorType  o VectorType  -> NumericType
  1097.   PlaneType   o PlaneType   -> NumericType
  1098. @\end{verbatim}
  1099.  
  1100.  The returned NumericType is non-zero if the condition holds, or zero if
  1101.  not.
  1102.    For PointTypes, VectorTypes, and PlaneTypes, only $==$ and $!=$ comparisons
  1103.  are valid. This is either the same or different.
  1104.    For NumericTypes and StringTypes (uses strcmp) all comparisons are valid.
  1105. $
  1106.  
  1107. @\subsection{Logical operators $\&\&$, $\|\|$, !}
  1108. &Logical operators &&, ||, !
  1109.  Complex logical expressions can be defined using the logical {\em and} ($\&\&$),
  1110.  logical {\em or} ($\|\|$) and logical {\em not} (!). These operators can be applied
  1111.  to NumericTypes that are considered Boolean results. That is, true for a
  1112.  non-zero value, and false otherwise.
  1113.    The returned NumericType is true if both operands are true for the {\em and}
  1114.  operator, at least one is true for the {\em or} operator, and the operand is
  1115.  false for the {\em not} operator. In all other cases, a false is returned.
  1116.    To make sure Logical expressions are readable, the {\em and} and {\em or}
  1117.  operators are defined to have the {\em same} priority. Use parentheses to
  1118.  disambiguate a logical expression and to make it more readable.
  1119. $
  1120.  
  1121. @\subsection{Geometric Boolean Operations}
  1122. &Geometric Boolean Operations
  1123.    The {\em IRIT} solid modeling system supports Boolean operations between
  1124.  polyhedra objects. Freeform objects will be automaticaly converted to
  1125.  a polygonal representation when used in Boolean operations.
  1126.    The $+$, $*$, and $-$ are overloaded to denote Boolean union, intersection
  1127.  and subtraction when operating on geometric entities. $-$ can also be
  1128.  used as an unary operator to reverse the object orientation inside out.
  1129.  
  1130.    Example:
  1131.  
  1132. @\begin{verbatim}
  1133.     resolution = 20;
  1134.     B = box(vector(-1, -1, -0.25), 2, 1.2, 0.5);
  1135.     C = con2(vector(0, 0, -1.5), vector(0, 0, 3), 0.7, 0.3);
  1136.  
  1137.     D = convex(B - C);
  1138.     E = convex(C - B);
  1139.     F = convex(B + C);
  1140.     G = convex(B * C);
  1141.  
  1142.     tr = rotx( -90 ) * roty( 40 ) * rotx( -30 );
  1143.  
  1144.     All = list( D * tr * trans( vector(  0.6,  0.5, 0.0 ) ),
  1145.                 E * tr * trans( vector(  3.0,  0.0, 0.0 ) ),
  1146.                 F * tr * trans( vector( -2.0,  0.0, 0.0 ) ),
  1147.                 G * tr * trans( vector(  0.7, -1.0, 0.0 ) ) )
  1148.             * scale( vector( 0.25, 0.25, 0.25 ) )
  1149.             * trans( vector( -0.1, -0.3, 0.0 ) );
  1150.     view_mat = rotx( 0 );
  1151.     view( list( view_mat, All ), on );
  1152.     save( "booleans", list( view_mat, All ) );
  1153. @\end{verbatim}
  1154.  
  1155.     A complete example to compute the union, intersection and both
  1156.  differences of a box and a truncated cone.
  1157. @The result of this example can be seen in Figure~\ref{fig-booleans}
  1158. @with its hidden lines removed.
  1159. @\begin{figure}
  1160. @\vspace{3in}
  1161. @\special{psfile=user_man/booleans.ps hscale=100 vscale=100 hoffset=-40 voffset=-130}
  1162. @\caption{Geometric Boolean operatioms between a box and a truncated cone.
  1163. @         Shown are union (left), intersection (bottom center), box minus
  1164. @         the cone (top center), and cone minus the box (right).}
  1165. @\label{fig-booleans}
  1166. @\end{figure}
  1167.  
  1168.     There are several flags to control the Boolean operations. See
  1169.  IRITSTATE command for the "InterCrv", "Coplanar", and "PolySort"
  1170.  states.
  1171. $
  1172.  
  1173. @\subsection{Priority of operators}
  1174. &Priority of operators
  1175.    The following table lists the priority of the different operators.
  1176. # 19 3 0 1
  1177.  Lowest
  1178.  Operator
  1179.  Name of operator
  1180.  priority
  1181.  ,
  1182.  comma
  1183.  
  1184.  :
  1185.  colon
  1186.  
  1187.  $\&\&$, $\|\|$
  1188.  logical and, logical or
  1189.  
  1190.  $=,==,!=,<=,>=,<,>$
  1191.  assignment, equal, not equal, less
  1192.  
  1193.  
  1194.  equal, greater equal, less, greater
  1195.  
  1196.  +, -
  1197.  plus, minus
  1198.  
  1199.  *, /
  1200.  multiply, divide
  1201.  Highest
  1202.  \verb+^+
  1203.  power
  1204.  priority
  1205.  -, !
  1206.  unary minus, logical not
  1207. $
  1208.  
  1209. @\subsection{Grammar}
  1210. &Grammar
  1211.    The grammar of the {\em IRIT} parser follows similar guidelines as
  1212.  the C language for simple expressions. However, complex statements differ.
  1213.    See the IF, FOR, FUNCTION, and PROCEDURE below for the usage of these
  1214.  clauses.
  1215.  
  1216. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1217. @\section{Function Description}
  1218. &Function Description
  1219.  
  1220. @ The description below defines the parameters and returned values of the
  1221. @ predefined functions in the system, using the notation of functions
  1222. @ in ANSI C. Listed are all the functions in the system, in alphabetic
  1223. @ order, according to their classes.
  1224. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1225. @\subsection{NumericType returning functions}
  1226. &NumericType returning functions
  1227.  
  1228. @\subsubsection{ABS}
  1229. !ABS
  1230.  
  1231. @\begin{verbatim}
  1232.  NumericType ABS( NumericType Operand )
  1233. @\end{verbatim}
  1234.  
  1235.    Returns the absolute value of the given {\bf Operand}.
  1236. $
  1237.  
  1238. @\subsubsection{ACOS}
  1239. !ACOS
  1240.  
  1241. @\begin{verbatim}
  1242.  NumericType ACOS( NumericType Operand )
  1243. @\end{verbatim}
  1244.  
  1245.    Returns the arc cosine value (in radians) of the given {\bf Operand}.
  1246. $
  1247.  
  1248. @\subsubsection{AREA}
  1249. !AREA
  1250.  
  1251. @\begin{verbatim}
  1252.  NumericType AREA( PolygonType Object )
  1253. @\end{verbatim}
  1254.  
  1255.    Returns the area of the given {\bf Object} (in object units). Returned is
  1256.  the area of the polygonal object, not the area of the primitive it might
  1257.  approximate.
  1258.  
  1259.    This means that the area of a polygonal approximation of a sphere will be
  1260.  returned, not the exact area of the sphere.
  1261. $
  1262.  
  1263. @\subsubsection{ASIN}
  1264. !ASIN
  1265.  
  1266. @\begin{verbatim}
  1267.  NumericType ASIN( NumericType Operand )
  1268. @\end{verbatim}
  1269.  
  1270.    Returns the arc sine value (in radians) of the given {\bf Operand}.
  1271. $
  1272.  
  1273. @\subsubsection{ATAN}
  1274. !ATAN
  1275.  
  1276. @\begin{verbatim}
  1277.  NumericType ATAN( NumericType Operand )
  1278. @\end{verbatim}
  1279.  
  1280.    Returns the arc tangent value (in radians) of the given {\bf Operand}.
  1281. $
  1282.  
  1283. @\subsubsection{ATAN2}
  1284. !ATAN2
  1285.  
  1286. @\begin{verbatim}
  1287.  NumericType ATAN2( NumericType Operand1, NumericType Operand2 )
  1288. @\end{verbatim}
  1289.  
  1290.    Returns the arc tangent value (in radians) of the given ratio:
  1291.  {\bf Operand1} / {\bf Operand2}, over the whole circle.
  1292. $
  1293.  
  1294. @\subsubsection{COS}
  1295. !COS
  1296.  
  1297. @\begin{verbatim}
  1298.  NumericType COS( NumericType Operand )
  1299. @\end{verbatim}
  1300.  
  1301.    Returns the cosine value of the given {\bf Operand} (in radians).
  1302. $
  1303.  
  1304. @\subsubsection{CLNTEXEC}
  1305. !CLNTEXEC
  1306.  
  1307. @\begin{verbatim}
  1308.  NumericType CLNTEXEC( StringType ClientName )
  1309. @\end{verbatim}
  1310.  
  1311.    Initiate communication channels to a client named {\bf ClientName}.
  1312.  {\bf ClientName} is executed by this function as a sub process and
  1313.  two communication channels are opened between the IRIT server and the
  1314.  new client, for read and write. See also CLNTREAD, CLNTWRITE, and
  1315.  CLNTCLOSE. if {\bf ClientName} is an empty string, the user is provided
  1316.  with the new communication port to be used and the server blocks for the
  1317.  user to manualy executed the client after setting the proper
  1318.  IRIT\_SERVER\_HOST/PORT environment variables.
  1319.  
  1320.  Example:
  1321.  
  1322. @\begin{verbatim}
  1323.    h1 = CLNTEXEC( "" );
  1324.    h2 = CLNTEXEC( "nuldrvs -s-" );
  1325. @\end{verbatim}
  1326.  
  1327.  executes two clients, one is named {\bf nuldrvs} and the other one is
  1328.  prompted for by the user. As a result of the second invokation of
  1329.  CLNTEXEC, the user will be prompted with a message similar to,
  1330.  
  1331. @\begin{verbatim}
  1332.     Irit: Startup your program - I am waiting...
  1333.  
  1334.     setenv IRIT_SERVER_PORT 2182
  1335. @\end{verbatim}
  1336.  
  1337.  and he/she will need to set the proper environment variable and execute
  1338.  their client manually.
  1339. $
  1340.  
  1341. @\subsubsection{CPOLY}
  1342. !CPOLY
  1343.  
  1344. @\begin{verbatim}
  1345.  NumericType CPOLY( PolygonType Object )
  1346. @\end{verbatim}
  1347.  
  1348.    Returns the number of polygons in the given polygonal {\bf Object}.
  1349. $
  1350.  
  1351. @\subsubsection{EXP}
  1352. !EXP
  1353.  
  1354. @\begin{verbatim}
  1355.  NumericType EXP( NumericType Operand )
  1356. @\end{verbatim}
  1357.  
  1358.    Returns the natural exponent value of the given {\bf Operand}.
  1359. $
  1360.  
  1361. @\subsubsection{LN}
  1362. !LN
  1363.  
  1364. @\begin{verbatim}
  1365.  NumericType LN( NumericType Operand )
  1366. @\end{verbatim}
  1367.  
  1368.    Returns the natural logarithm value of the given {\bf Operand}.
  1369. $
  1370.  
  1371. @\subsubsection{LOG}
  1372. !LOG
  1373.  
  1374. @\begin{verbatim}
  1375.  NumericType LOG( NumericType Operand )
  1376. @\end{verbatim}
  1377.  
  1378.    Returns the base 10 logarithm value of the given {\bf Operand}.
  1379. $
  1380.  
  1381. @\subsubsection{MESHSIZE}
  1382. !MESHSIZE
  1383.  
  1384. @\begin{verbatim}
  1385.  NumericType MESHSIZE( SurfaceType Srf, ConstantType Direction )
  1386. @\end{verbatim}
  1387.  
  1388.    Returns the size of {\bf Srf}'s mesh in {\bf Direction}, which
  1389.  is one of COL or ROW.
  1390.  
  1391.  Example:
  1392.  
  1393. @\begin{verbatim}
  1394.    RSize = MESHSIZE( Sphere, ROW );
  1395.    CSize = MESHSIZE( Sphere, COL );
  1396. @\end{verbatim}
  1397. $
  1398.  
  1399. @\subsubsection{RANDOM}
  1400. !RANDOM
  1401.  
  1402. @\begin{verbatim}
  1403.  NumericType RANDOM( NumericType Min, NumericType Max )
  1404. @\end{verbatim}
  1405.  
  1406.    Returns a randomized value between {\bf Min} and {\bf Max}.
  1407. $
  1408.  
  1409. @\subsubsection{SIN}
  1410. !SIN
  1411.  
  1412. @\begin{verbatim}
  1413.  NumericType SIN( NumericType Operand )
  1414. @\end{verbatim}
  1415.  
  1416.    Returns the sine value of the given {\bf Operand} (in radians).
  1417. $
  1418.  
  1419. @\subsubsection{SIZEOF}
  1420. !SIZEOF
  1421.  
  1422. @\begin{verbatim}
  1423.  NumericType SIZEOF( ListType List | PolyType Poly | CurveType Crv )
  1424. @\end{verbatim}
  1425.  
  1426.    Returns the length of a list, if {\bf List}, the number of polygons
  1427.  if {\bf Poly}, or the length of the control polygon if {\bf Crv}.
  1428.    If, however, only one polygon is in {\bf Poly}, it returns the number
  1429.  of vertices in that polygon.
  1430.  
  1431.  Example:
  1432.  
  1433. @\begin{verbatim}
  1434.    len = SIZEOF( list( 1, 2, 3 ) );
  1435.    numPolys = SIZEOF( axes );
  1436.    numCtlpt = SIZEOF( circle( vector( 0, 0, 0 ), 1 ) );
  1437. @\end{verbatim}
  1438.  
  1439.  will assign the value of 3 to the variable {\bf len}, set {\bf numPolys}
  1440.  to the number of polylines in the axes object, and set numCtlPt to 9, the
  1441.  number of control points in a circle.
  1442. $
  1443.  
  1444. @\subsubsection{SQRT}
  1445. !SQRT
  1446.  
  1447. @\begin{verbatim}
  1448.  NumericType SQRT( NumericType Operand )
  1449. @\end{verbatim}
  1450.  
  1451.    Returns the square root value of the given {\bf Operand}.
  1452. $
  1453.  
  1454. @\subsubsection{TAN}
  1455. !TAN
  1456.  
  1457. @\begin{verbatim}
  1458.  NumericType TAN( NumericType Operand )
  1459. @\end{verbatim}
  1460.  
  1461.    Returns the tangent value of the given {\bf Operand} (in radians).
  1462. $
  1463.  
  1464. @\subsubsection{THISOBJ}
  1465. !THISOBJ
  1466.  
  1467. @\begin{verbatim}
  1468.  NumericType THISOBJ( StringType Object )
  1469. @\end{verbatim}
  1470.  
  1471.    Returns the object type of the given name of an {\bf Object}. This can
  1472.  be one of the constants  UNDEF\_TYPE, NUMERIC\_TYPE, STRING\_TYPE,
  1473.  VECTOR\_TYPE, POINT\_TYPE, CTLPT\_TYPE, MATRIX\_TYPE, POLY\_TYPE,
  1474.  CURVE\_TYPE, SURFACE\_TYPE, TRIMSRF\_TYPE, or TRIVAR\_TYPE.
  1475.    This is also a way to ask if an object by a given name do exist (if the
  1476.  returned type is UNDEF\_TYPE or not).
  1477. $
  1478.  
  1479. @\subsubsection{VOLUME}
  1480. !VOLUME
  1481.  
  1482. @\begin{verbatim}
  1483.  NumericType VOLUME( PolygonType Object )
  1484. @\end{verbatim}
  1485.  
  1486.    Returns the volume of the given {\bf Object} (in object units). It returns
  1487.  the volume of the polygonal object, not the volume of the object it might
  1488.  approximate.
  1489.  
  1490.    This routine decomposes all non-convex polygons to convex ones as a side
  1491.  effect (see CONVEX).
  1492. $
  1493.  
  1494. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1495. @\subsection{GeometricType returning functions}
  1496.  
  1497. &GeometricType returning functions
  1498.  
  1499. @\subsubsection{ADAPISO}
  1500. !ADAPISO
  1501.  
  1502. @\begin{verbatim}
  1503.  CurveType ADAPISO( SurfaceType Srf, NumericType Dir, NumericType Eps,
  1504.                     NumericType FullIso, NumericType SinglePath )
  1505. @\end{verbatim}
  1506.  
  1507.  Constructs a {\em coverage} to {\bf Srf} using isocurve in the {\bf Dir} direction,
  1508.  so that for any point p on surface {\bf Srf}, there exists a point on one of
  1509.  the isocurves that is close to p within {\bf Eps}. If {\bf FullIso}, the
  1510.  extracted isocurves span the entire surface domain, otherwise they may
  1511.  span only a subset of the domain. If {\bf SinglePath}, an approximation to
  1512.  a single path (Hamiltonian path) that visits all isocurves is constructed.
  1513.  
  1514. @\begin{verbatim}
  1515.     srf = sbezier( list( list( ctlpt( E3, -0.5, -1.0,  0.0 ),
  1516.                                ctlpt( E3,  0.4,  0.0,  0.1 ),
  1517.                                ctlpt( E3, -0.5,  1.0,  0.0 ) ),
  1518.                          list( ctlpt( E3,  0.0, -0.7,  0.1 ),
  1519.                                ctlpt( E3,  0.0,  0.0,  0.0 ),
  1520.                                ctlpt( E3,  0.0,  0.7, -0.2 ) ),
  1521.                          list( ctlpt( E3,  0.5, -1.0,  0.1 ),
  1522.                                ctlpt( E3, -0.4,  0.0,  0.0 ),
  1523.                                ctlpt( E3,  0.5,  1.0, -0.2 ) ) ) );
  1524.     aiso = ADAPISO( srf, COL, 0.1, FALSE, FALSE );
  1525. @\end{verbatim}
  1526.  
  1527.  Constructs an adaptive isocurve approximation with tolerance of {\bf 0.1} to
  1528.  surface {\bf srf} in direction {\bf COL}. Isocurves are allowed to span a
  1529.  subset of the surface domain. No single path is needed.
  1530.  
  1531.  The {\bf SinglePath} option is currently not supported.
  1532. $
  1533.  
  1534. @\subsubsection{ARC}
  1535. !ARC
  1536.  
  1537. @\begin{verbatim}
  1538.  CurveType ARC( VectorType StartPos, VectorType Center, VectorType EndPos )
  1539. @\end{verbatim}
  1540.  
  1541.  Constructs an arc between the two end points {\bf StartPos} and {\bf EndPos},
  1542.  centered at {\bf Center}. Arc will always be less than 180 degrees, so the
  1543.  shortest circular path from {\bf StartPos} to {\bf EndPos} is selected. The
  1544.  case where {\bf StartPos}, {\bf Center}, and {\bf EndPos} are collinear is
  1545.  illegal, since it attempts to define a 180 degrees arc. Arc is constructed
  1546.  as a single rational quadratic Bezier curve.
  1547.  
  1548.  Example:
  1549.  
  1550. @\begin{verbatim}
  1551.     Arc1 = ARC( vector( 1.0, 0.0, 0.0 ),
  1552.                 vector( 1.0, 1.0, 0.0 ),
  1553.                 vector( 0.0, 1.0, 0.0 ) );
  1554. @\end{verbatim}
  1555.  
  1556.  constructs a 90 degrees arc, tangent to both the X and Y axes at coordinate 1.
  1557. @See Figure~\ref{fig-arc}.
  1558. @\begin{figure}
  1559. @\vspace{2.4in}
  1560. @\special{psfile=user_man/arc1cnst.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
  1561. @\caption{A 90 degree arc constructed using the ARC constructor.}
  1562. @\label{fig-arc}
  1563. @\end{figure}
  1564. $
  1565.  
  1566. @\subsubsection{AOFFSET}
  1567. !AOFFSET
  1568.  
  1569. @\begin{verbatim}
  1570.  CurveType AOFFSET( CurveType Crv, NumericType OffsetDistance,
  1571.                     NumericType Epsilon, NumericType TrimLoops )
  1572.  
  1573.  or
  1574.  
  1575.  SurfaceType AOFFSET( SurfaceType Srf NumericType OffsetDistance,
  1576.                       NumericType Epsilon, NumericType TrimLoops )
  1577. @\end{verbatim}
  1578.  
  1579.  Computes an offset of {\bf OffsetDistance} with globally bounded error
  1580.  (controlled by {\bf Epsilon}). The smaller {\bf Epsilon} is, the better
  1581.  the approximation to the offset. The bounded error is achieved by adaptive
  1582.  refinement of the {\bf Crv}.
  1583.    If {\bf TrimLoops} is TRUE or on, the regions of the object that
  1584.  self-intersect as a result of the offset operation are trimmed away.
  1585.  
  1586.  Example:
  1587.  
  1588. @\begin{verbatim}
  1589.     OffCrv1 = AOFFSET( Crv, -0.4, 0.01, TRUE );
  1590.     OffCrv2 = AOFFSET( Crv, -0.4, 0.01, FALSE );
  1591. @\end{verbatim}
  1592.  
  1593.  computes an adaptive offset to {\bf Crv} with {\bf OffsetDistance} of
  1594.  0.5 and {\bf Epsilon} of 0.03 and trims the self-intersection loops.
  1595.  See also OFFSET and LOFFSET.
  1596. @See Figure~\ref{fig-caoffset}.
  1597. @\begin{figure}
  1598. @\vspace{1.6in}
  1599. @\special{psfile=user_man/caoffset.ps hscale=100 vscale=100 hoffset=-60 voffset=-220}
  1600. @\caption{Adaptive offset approximation (thick) of a Bspline curve (thin).
  1601. @        On the left, the self intersections in the offset computed in the
  1602. @        right are eliminated. Both offsets were computedusing AOFFSET.
  1603. @        (See also Figure~\protect\ref{fig-coffset}.)}
  1604. @\label{fig-caoffset}
  1605. @\end{figure}
  1606. $
  1607.  
  1608. @\subsubsection{BOOLONE}
  1609. !BOOLONE
  1610.  
  1611. @\begin{verbatim}
  1612.  SurfaceType BOOLONE( CurveType Crv )
  1613. @\end{verbatim}
  1614.  
  1615.  Given a closed curve, the curve is subdivided into four segments equally
  1616.  spaced in the parametric space that are fed into BOOLSUM. Useful if
  1617.  a surface should "fill" the area enclosed by a closed curve.
  1618.  
  1619.  Example:
  1620.  
  1621. @\begin{verbatim}
  1622.  Srf = BOOLONE( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  1623. @\end{verbatim}
  1624.  
  1625.  Creates a disk surface containing the area enclosed by the unit circle.
  1626. @See Figure~\ref{fig-boolsum-one}.
  1627. @\begin{figure}
  1628. @\vspace{3.5in}
  1629. @\special{psfile=user_man/boolone.ps hscale=70 vscale=70 hoffset=-80 voffset=-90}
  1630. @\special{psfile=user_man/boolsum.ps hscale=70 vscale=70 hoffset=170 voffset=-70}
  1631. @\caption{A boolean sum of a circle creates a disk (left) using BOOLONE and
  1632. @        a general boolean sum of four curves (right).}
  1633. @\label{fig-boolsum-one}
  1634. @\end{figure}
  1635. $
  1636.  
  1637. @\subsubsection{BOOLSUM}
  1638. !BOOLSUM
  1639.  
  1640. @\begin{verbatim}
  1641.  SurfaceType BOOLSUM( CurveType Crv1, CurveType Crv2,
  1642.                       CurveType Crv3, CurveType Crv4 )
  1643. @\end{verbatim}
  1644.  
  1645.  Construct a surface using the provided four curves as its four boundary
  1646.  curves. Curves do not have to have the same order or type, and will be
  1647.  promoted to their least common denominator. The end points of the four
  1648.  curves should match as follows:
  1649. # 30 2 0 1
  1650.  {\bf Crv1} start point,
  1651.   to {\bf Crv3} start point.
  1652.  {\bf Crv1} end point,
  1653.   to {\bf Crv4} start point.
  1654.  {\bf Crv2} start point,
  1655.   to {\bf Crv3} end point.
  1656.  {\bf Crv2} end point,
  1657.   to {\bf Crv4} end point.
  1658. #
  1659.  where {\bf Crv1} and {\bf Crv2} are the two boundaries in one parametric
  1660.  direction, and {\bf Crv3} and {\bf Crv4} are the two boundaries in the other
  1661.  parametric direction.
  1662.  
  1663.  Example:
  1664.  
  1665. @\begin{verbatim}
  1666.     Cbzr1 = cbezier( list( ctlpt( E3, 0.1, 0.1, 0.1 ),
  1667.                            ctlpt( E3, 0.0, 0.5, 1.0 ),
  1668.                            ctlpt( E3, 0.4, 1.0, 0.4 ) ) );
  1669.     Cbzr2 = cbezier( list( ctlpt( E3, 1.0, 0.2, 0.2 ),
  1670.                            ctlpt( E3, 1.0, 0.5, -1.0 ),
  1671.                            ctlpt( E3, 1.0, 1.0, 0.3 ) ) );
  1672.     Cbsp3 = cbspline( 4,
  1673.                       list( ctlpt( E3, 0.1,  0.1, 0.1 ),
  1674.                             ctlpt( E3, 0.25, 0.0, -1.0 ),
  1675.                             ctlpt( E3, 0.5,  0.0, 2.0 ),
  1676.                             ctlpt( E3, 0.75, 0.0, -1.0 ),
  1677.                             ctlpt( E3, 1.0,  0.2, 0.2 ) ),
  1678.                       list( KV_OPEN ) );
  1679.     Cbsp4 = cbspline( 4,
  1680.                       list( ctlpt( E3, 0.4,  1.0, 0.4 ),
  1681.                             ctlpt( E3, 0.25, 1.0, 1.0 ),
  1682.                             ctlpt( E3, 0.5,  1.0, -2.0 ),
  1683.                             ctlpt( E3, 0.75, 1.0, 1.0 ),
  1684.                             ctlpt( E3, 1.0,  1.0, 0.3 ) ),
  1685.                       list( KV_OPEN ) );
  1686.     Srf = BOOLSUM( Cbzr1, Cbzr2, Cbsp3, Cbsp4 );
  1687. @\end{verbatim}
  1688. $
  1689.  
  1690. @\subsubsection{BOX}
  1691. !BOX
  1692.  
  1693. @\begin{verbatim}
  1694.  PolygonType BOX( VectorType Point,
  1695.                   NumericType Dx, NumericType Dy, NumericType Dz )
  1696. @\end{verbatim}
  1697.  
  1698.    Creates a BOX polygonal object, whose boundary is coplanar with the
  1699.  $XY$, $XZ$, and $YZ$ planes. The BOX is defined by {\bf Point} as
  1700.  base position, and {\bf Dx, Dy, Dz} as BOX dimensions. Negative dimensions
  1701.  are allowed.
  1702.  
  1703.  Example:
  1704.  
  1705. @\begin{verbatim}
  1706.     B = BOX( vector( 0, 0, 0 ), 1, 1, 1);
  1707. @\end{verbatim}
  1708.  
  1709.  creates a unit cube from 0 to 1 in all axes.
  1710. $
  1711.  
  1712. @\subsubsection{BZR2BSP}
  1713. !BZR2BSP
  1714.  
  1715. @\begin{verbatim}
  1716.  CurveType BZR2BSP( CurveType Crv )
  1717.  
  1718.  or
  1719.  
  1720.  SurfaceType BZR2BSP( SurfaceType Srf )
  1721. @\end{verbatim}
  1722.  
  1723.    Creates a Bspline curve or a Bspline surface from the given Bezier curve or
  1724.  Bezier surface. The Bspline curve or surface is assigned open end knot
  1725.  vector(s) with no interior knots, in the parametric domain of zero to one.
  1726.  
  1727.  Example:
  1728.  
  1729. @\begin{verbatim}
  1730.     BspSrf = BZR2BSP( BzrSrf );
  1731. @\end{verbatim}
  1732. $
  1733.  
  1734. @\subsubsection{BSP2BZR}
  1735. !BSP2BZR
  1736.  
  1737. @\begin{verbatim}
  1738.  CurveType | ListType BSP2BZR( CurveType Crv )
  1739.  
  1740.  or
  1741.  
  1742.  SurfaceType | ListType BSP2BZR( SurfaceType Srf )
  1743. @\end{verbatim}
  1744.  
  1745.    Creates Bezier curve(s) or surface(s) from a given Bspline curve or a
  1746.  Bspline surface. The Bspline input is subdivided at all internal knots to
  1747.  create Bezier curves or surfaces. Therefore, if the input Bspline does have
  1748.  internal knots, a list of Bezier curves or surfaces is returned. Otherwise,
  1749.  a single Bezier curve or surface is returned.
  1750.  
  1751.  Example:
  1752.  
  1753. @\begin{verbatim}
  1754.     BzrCirc = BSP2BZR( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  1755. @\end{verbatim}
  1756.  
  1757.  would subdivide the unit circle into four 90 degrees Bezier arcs returned
  1758.  in a list.
  1759. $
  1760.  
  1761. @\subsubsection{CBEZIER}
  1762. !CBEZIER
  1763.  
  1764. @\begin{verbatim}
  1765.  CurveType CBEZIER( ListType CtlPtList )
  1766. @\end{verbatim}
  1767.  
  1768.    Creates a Bezier curve out of the provided control point list. {\bf CtlPtList}
  1769.  is a list of control points, all of which must be of type (E1-E5, P1-P5),
  1770.  or regular PointType defining the curve's control polygon. Curve's point type
  1771.  will be of a space which is the union of the spaces of all points.
  1772. @The created curve is the polynomial (or rational),
  1773. @\begin{equation}
  1774. @     C(t) = \sum_{i=0}^k P_i B_i(t),
  1775. @\end{equation}
  1776. @where $P_i$ are the control points {\bf CtlPtList}, and k is the degree of
  1777. @the curve, which is one less than the number of points.
  1778.  
  1779.  Example:
  1780.  
  1781. @\begin{verbatim}
  1782.     s45 = sin(pi / 4);
  1783.     Arc90 = CBEZIER( list( ctlpt( P2, 1.0, 0.0, 1.0 ),
  1784.                            ctlpt( P2, s45, s45, s45 ),
  1785.                            ctlpt( P1, 1.0, 1.0 ) ) );
  1786. @\end{verbatim}
  1787.  
  1788.  constructs an arc of 90 degrees as a rational quadratic Bezier curve.
  1789. $
  1790.  
  1791. @\subsubsection{CBSPLINE}
  1792. !CBSPLINE
  1793.  
  1794. @\begin{verbatim}
  1795.  CurveType CBSPLINE( NumericType Order, ListType CtlPtList,
  1796.                                                         ListType KnotVector )
  1797. @\end{verbatim}
  1798.  
  1799.    Creates a Bspline curve out of the provided control point list, the
  1800.  knot vector, and the specified order. {\bf CtlPtList} is a list of control
  1801.  points, all of which must be of type (E1-E5, P1-P5), or regular PointType
  1802.  defining the curve's control polygon. Curve's point type will be of a space
  1803.  which is the union of the spaces of all points.
  1804.    The length of the {\bf KnotVector} must be equal to the number of control
  1805.  points in {\bf CtlPtList} plus the {\bf Order}. If, however, the length of
  1806.  the knot vector is equal to {\bf \#CtlPtList + Order + Order - 1} the curve
  1807.  is assumed {\em periodic.}
  1808.    The knot vector list may be specified as either {\bf list( KV\_OPEN )} or
  1809.  {\bf list( KV\_FLOAT )} or {\bf list( KV\_PERIODIC )} in which a uniform
  1810.  open, uniform floating or uniform periodic knot vector with the appropriate
  1811.  length is automatically constructed. 
  1812. @
  1813. @The created curve is the piecewise polynomial (or rational),
  1814. @\begin{equation}
  1815. @     C(t) = \sum_{i=0}^k P_i B_{i,\tau}(t),
  1816. @\end{equation}
  1817. @where $P_i$ are the control points {\bf CtlPtList} and k is the degree of
  1818. @the curve, which is one less than the {\bf Order} or number of points.
  1819. @$\tau$ is the knot vector of the curve.
  1820.  
  1821.  Example:
  1822.  
  1823. @\begin{verbatim}
  1824.     s45 = sin(pi / 4);
  1825.     HalfCirc = CBSPLINE( 3,
  1826.                          list( ctlpt( P3,  1.0,  1.0,  0.0, 0.0 ),
  1827.                                ctlpt( P3,  s45,  s45,  s45, 0.0 ),
  1828.                                ctlpt( P3,  1.0,  0.0,  1.0, 0.0 ),
  1829.                                ctlpt( P3,  s45, -s45,  s45, 0.0 ),
  1830.                                ctlpt( P3,  1.0, -1.0,  0.0, 0.0 ) ),
  1831.                          list( 0, 0, 0, 1, 1, 2, 2, 2 ) );
  1832. @\end{verbatim}
  1833.  
  1834.  constructs an arc of 180 degrees in the XZ plane as a rational quadratic
  1835.  Bspline curve.
  1836.  
  1837.  Example:
  1838.  
  1839. @\begin{verbatim}
  1840.     c = CBSPLINE( 4,
  1841.                   list( ctlpt( E2,  0.5,  0.5 ),
  1842.                         ctlpt( E2, -0.5,  0.5 ),
  1843.                         ctlpt( E2, -0.5, -0.5 ),
  1844.                         ctlpt( E2,  0.5, -0.5 ) ),
  1845.                   list( KV_PERIODIC ) );
  1846.     color( c, red );
  1847.     viewobj( c );
  1848.     
  1849.     c1 = cregion( c, 3, 4 );
  1850.     color( c1, green );
  1851.     c2 = cregion( c, 4, 5 );
  1852.     color( c2, yellow );
  1853.     c3 = cregion( c, 5, 6 );
  1854.     color( c3, cyan );
  1855.     c4 = cregion( c, 6, 7 );
  1856.     color( c3, magenta );
  1857.     viewobj( list( c1, c2, c3, c4 ) );
  1858. @\end{verbatim}
  1859.  
  1860.  creates a periodic curve and extracts its four polynomial domains as four
  1861.  {\em open} end Bspline curves.
  1862. @See Figure~\ref{fig-cperiodic}.
  1863. @\begin{figure}
  1864. @\vspace{2.5in}
  1865. @\special{psfile=user_man/cperiod.ps hscale=100 vscale=100 hoffset=-40 voffset=-230}
  1866. @\caption{A cubic periodic curve created using KV\_PERIODIC end conditions.}
  1867. @\label{fig-cperiodic}
  1868. @\end{figure}
  1869. $
  1870.  
  1871. @\subsubsection{CCINTER}
  1872. !CCINTER
  1873.  
  1874. @\begin{verbatim}
  1875.  ListType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
  1876.                                                        NumericType SelfInter )
  1877.  
  1878.  or
  1879.  
  1880.  SurfaceType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
  1881.                                                        NumericType SelfInter )
  1882. @\end{verbatim}
  1883.  
  1884.    Computes the intersection point(s) of {\bf Crv1} and {\bf Crv2} in the
  1885.  $XY$ plane. Since this computation involves numeric operations, {\bf Epsilon}
  1886.  controls the accuracy of the parametric values of the result.
  1887.    It returns a list of PointTypes, each containing the parameter of {\bf Crv1}
  1888.  in the X coordinate, and the parameter of {\bf Crv2} in the Y coordinate.
  1889.    If, however, {\bf Epsilon} is negative, a scalar field surface representing
  1890.  the square of the distance function is returned instead.
  1891.    If {\bf SelfInter} is TRUE, {\bf Crv1} and {\bf Crv2} can be the same
  1892.  curve, and self-intersection points are searched instead.
  1893.  
  1894.  Example:
  1895.  
  1896. @\begin{verbatim}
  1897.  crv1 = cbspline( 3,
  1898.                   list( ctlpt( E2, 0, 0 ),
  1899.                         ctlpt( E2, 0, 0.5 ),
  1900.                         ctlpt( E2, 0.5, 0.7 ),
  1901.                         ctlpt( E2, 1, 1 ) ),
  1902.                   list( KV_OPEN ) );
  1903.  crv2 = cbspline( 3,
  1904.                   list( ctlpt( E2, 1, 0 ),
  1905.                         ctlpt( E2, 0.7, 0.25 ),
  1906.                         ctlpt( E2, 0.3, 0.5 ),
  1907.                         ctlpt( E2, 0, 1 ) ),
  1908.                   list( KV_OPEN ) );
  1909.  inter_pts = CCINTER( crv1, crv2, 0.0001, FALSE );
  1910. @\end{verbatim}
  1911.  
  1912.  Computes the parameter values of the intersection point of {\bf crv1} and
  1913.  {\bf crv2} to a tolerance of 0.0001.
  1914. @See Figure~\ref{fig-cci}.
  1915. @\begin{figure}
  1916. @\vspace{2.5in}
  1917. @\special{psfile=user_man/cci.ps hscale=100 vscale=100 hoffset=-60 voffset=-200}
  1918. @\caption{A intersection point of two freeform curve computed using CCINTER.}
  1919. @\label{fig-cci}
  1920. @\end{figure}
  1921. $
  1922.  
  1923. @\subsubsection{CCRVTR}
  1924. !CCRVTR
  1925.  
  1926. @\begin{verbatim}
  1927.  NumericType CCRVTR( CurveType Crv, NumericType Epsilon )
  1928.  
  1929.  or
  1930.  
  1931.  CurveType CCRVTR( CurveType Crv, NumericType Epsilon )
  1932. @\end{verbatim}
  1933.  
  1934.    Computes the extreme curvature points on {\bf Crv} in the $XY$ plane.
  1935.  This set includes not only points of maximum (convexity) and mimumum
  1936.  (concavity) curvature, but also points of zero curvature such as
  1937.  inflection points.
  1938.    Since this operation is partially numeric, {\bf Epsilon} is used to set
  1939.  the needed accuracy. It returns the parameter value(s) of the location(s)
  1940.  with extreme curvature along the {\bf Crv}.
  1941.    If, however, {\bf Epsilon} is negative, the curvature scalar field
  1942.  curve is returned as a two dimensional rational vector field curve, for
  1943.  which the first dimension is equal to the parameter, and the second is the
  1944.  curvature value at that parameter.
  1945.  
  1946. @   This function computes the curvature scalar field for planar curves as,
  1947. @\begin{equation}
  1948. @      \kappa(t) = \frac{x'(t) y''(t) - x''(t) y'(t)}
  1949. @             {\left( (x'(t))^2 + (y'(t))^2\ \right)^{\frac{3}{2}}},
  1950. @\end{equation}
  1951. @ and computes kN for three dimensional curves as the following vector field,
  1952. @\begin{equation}
  1953. @      \kappa(t) N(t) = \kappa(t) B(t) \times T(t) =
  1954. @       \frac{C' \times C''}{\| C' \| ^ 3} \times \frac{C'}{\| C' \|} =
  1955. @       \frac{(C' \times C'') \times C'}{\| C' \| ^ 4}.
  1956. @\end{equation}
  1957. ^   This function computes the curvature scalar field for planar curves as,
  1958. ^
  1959. ^          x' y'' - x'' y' 
  1960. ^   k(t) = ----------------
  1961. ^               2     2  3/2
  1962. ^           ( x'  + y'  )
  1963. ^
  1964. ^ and computes kN for three dimensional curves as the following vector field,
  1965. ^
  1966. ^                                  C' x C''     C'    (C' x C'') x C'
  1967. ^   k(t) N(t) = K(t) B(t) x T(t) = -------- x ----- = ---------------
  1968. ^                                        3    | C' |            4
  1969. ^                                   | C'|                 | C' |
  1970.  
  1971.  The extremum values are extracted from the computed curvature field.
  1972.  This curvature field is a high order curve, even if the input geometry is
  1973.  of low order. This is especially true for rational curves, for which the
  1974.  quotient rule for differentiation is used and almost doubles the degree
  1975.  in every differentiation.
  1976.  
  1977.  See also CZEROS, CEXTREMES, and SCRVTR.
  1978.  
  1979.  Example:
  1980.  
  1981. @\begin{verbatim}
  1982.  crv = cbezier( list( ctlpt( E2, -1.0,  0.5 ),
  1983.                       ctlpt( E2, -0.5, -2.0 ),
  1984.                       ctlpt( E2,  0.0,  1.0 ),
  1985.                       ctlpt( E2,  1.0,  0.0 ) ) ) * rotz( 30 );
  1986.  crvtr = CCRVTR( crv, 0.001 );
  1987.  pt_crvtr = nil();
  1988.  pt = nil();
  1989.  for ( i = 1, 1, sizeof( crvtr ),
  1990.      ( pt = ceval( crv, nth( crvtr, i ) ) ):
  1991.      snoc( pt, pt_crvtr )
  1992.  );
  1993.  interact( list( crv, pt_crvtr ) );
  1994. @\end{verbatim}
  1995.  
  1996.  finds the extreme curvature points in {\bf Crv} and displays them all
  1997.  with the curve.
  1998. @See Figure~\ref{fig-ccrvtr}.
  1999. @\begin{figure}
  2000. @\vspace{2.3in}
  2001. @\special{psfile=user_man/ccrvtr.ps hscale=100 vscale=100 hoffset=-40 voffset=-220}
  2002. @\caption{Extreme curvature locations on a freeform curve computed using CCRVTR.}
  2003. @\label{fig-ccrvtr}
  2004. @\end{figure}
  2005. $
  2006.  
  2007. @\subsubsection{CDERIVE}
  2008. !CDERIVE
  2009.  
  2010. @\begin{verbatim}
  2011.  CurveType CDERIVE( CurveType Curve )
  2012. @\end{verbatim}
  2013.  
  2014.    Returns a vector field curve representing the differentiated curve,
  2015.  also known as the Hodograph curve.
  2016.  
  2017.  Example:
  2018.  
  2019. @\begin{verbatim}
  2020.  Circ = circle( vector( 0.0, 0.0, 0.0 ), 1.0 );
  2021.  Hodograph = CDERIVE( Circ );
  2022. @\end{verbatim}
  2023. @See Figure~\ref{fig-cderive}.
  2024. @\begin{figure}
  2025. @\vspace{3.5in}
  2026. @\special{psfile=user_man/cderive.ps hscale=100 vscale=100 hoffset=-40 voffset=-210}
  2027. @\caption{The hodograph (thick) of a bspline circle (thin) constructed as four
  2028. @        90 degrees rational bezier arcs, computed using CDERIVE.}
  2029. @\label{fig-cderive}
  2030. @\end{figure}
  2031. $
  2032.  
  2033. @\subsubsection{CDIVIDE}
  2034. !CDIVIDE
  2035.  
  2036. @\begin{verbatim}
  2037.  ListType CDIVIDE( CurveType Curve, NumericType Param )
  2038. @\end{verbatim}
  2039.  
  2040.    Subdivides a curve into two sub-curves at the specified parameter value.
  2041.  {\bf Curve} can be either a Bspline curve in which {\bf Param} must be
  2042.  within the Curve's parametric domain, or a Bezier curve in which {\bf Param}
  2043.  must be in the range of zero to one.
  2044.  
  2045.    It returns a list of the two sub-curves. The individual curves may be
  2046.  extracted from the list using the NTH command.
  2047.  
  2048.  Example:
  2049.  
  2050. @\begin{verbatim}
  2051.  CrvLst = CDIVIDE( Crv, 1.3 );
  2052.  Crv1 = nth( CrvLst, 1 );
  2053.  Crv2 = nth( CrvLst, 2 );
  2054. @\end{verbatim}
  2055.  
  2056.  subdivides the curve {\bf Crv} at the parameter value of 0.5.
  2057. @See Figure~\ref{fig-cdivide}.
  2058. @\begin{figure}
  2059. @\vspace{2.7in}
  2060. @\special{psfile=user_man/cdivide.ps hscale=80 vscale=80 hoffset=30 voffset=-140}
  2061. @\caption{A Bspline curve is subdivided into two distinct regions using CDIVIDE.}
  2062. @\label{fig-cdivide}
  2063. @\end{figure}
  2064. $
  2065.  
  2066. @\subsubsection{CEDITPT}
  2067. !CEDITPT
  2068.  
  2069. @\begin{verbatim}
  2070.  CurveType CEDITPT( CurveType Curve, CtlPtType CtlPt, NumericType Index )
  2071. @\end{verbatim}
  2072.  
  2073.    Provides a simple mechanism to manually modify a single control point number
  2074.  {\bf Index} (base count is 0) in {\bf Curve}, by substituting {\bf CtlPt}
  2075.  instead. {\bf CtlPt} must have the same point type as the control points of
  2076.  the  {\bf Curve}. Original curve {\bf Curve} is not modified.
  2077.  
  2078.  Example:
  2079.  
  2080. @\begin{verbatim}
  2081.     CPt = ctlpt( E3, 1, 2, 3 );
  2082.     NewCrv = CEDITPT( Curve, CPt, 1 );
  2083. @\end{verbatim}
  2084.  
  2085.  constructs a {\bf NewCrv} with the second control point of {\bf Curve} being
  2086.  {\bf CPt}.
  2087. $
  2088.  
  2089. @\subsubsection{CEVAL}
  2090. !CEVAL
  2091.  
  2092. @\begin{verbatim}
  2093.  CtlPtType CEVAL( CurveType Curve, NumericType Param )
  2094. @\end{verbatim}
  2095.  
  2096.    Evaluates the provided {\bf Curve} at the given {\bf Param} value.
  2097.  {\bf Param} should be in the curve's parametric domain if {\bf Curve} is
  2098.  a Bspline curve, or between zero and one if {\bf Curve} is a Bezier curve.
  2099.  The returned control point has the same point type as the control points
  2100.  of the {\bf Curve}.
  2101.  
  2102.  Example:
  2103.  
  2104. @\begin{verbatim}
  2105.     CPt = CEVAL( Crv, 0.25 );
  2106. @\end{verbatim}
  2107.  
  2108.  evaluates {\bf Crv} at the parameter value of 0.25.
  2109. $
  2110.  
  2111. @\subsubsection{CEVOLUTE}
  2112. !CEVOLUTE
  2113.  
  2114. @\begin{verbatim}
  2115.  CurveType CEVOLUTE( CurveType Curve )
  2116. @\end{verbatim}
  2117.  
  2118.    Computes the evolute of a curve. The evolute is defined as,
  2119. @\begin{equation}
  2120. @  E(t) = C(t) + \frac{N(t)}{\kappa(t)},
  2121. @\end{equation}
  2122. @ where $N(t)$ is the unit normal of $C(t)$ and $k(t)$ is its curvature.
  2123. @
  2124. @  $E(t)$ is computed symbolically as the symbolic sum of $C(t)$ and
  2125. @ $\frac{N(t)}{\kappa(t)}$ where the latter is,
  2126. @
  2127. @\begin{eqnarray}
  2128. @  \frac{N(t)}{\kappa(t)}
  2129. @ & = & \frac{\kappa(t) N(t)}{k^2(t)} \nonumber \\
  2130. @ & = & \frac{(C'(t) \times C''(t)) \times C'(t)}
  2131. @             {\| C'(t) \|^4}
  2132. @       \frac{\|C'(t)\|^6}
  2133. @            {(C'(t) \times C''(t))^2}  \nonumber \\
  2134. @ & = & \frac{\left( {(C'(t) \times C''(t)) \times C'(t)} \right)
  2135. @                                        \| C'(t) \|^2}
  2136. @             {(C'(t) \times C''(t))^2}
  2137. @\end{eqnarray}
  2138. ^
  2139. ^               N(t)
  2140. ^ E(t) = C(t) + ----
  2141. ^               k(t)
  2142. ^
  2143. ^ where N(t) is the unit normal of C(t) and k(t) is its curvature.
  2144. ^ E(t) is computed symbolically as the symbolic sum of C(t) and
  2145. ^ N(t) / k(t).
  2146.  
  2147.  The result of this symbolic computation is exact (upto machine precision)
  2148.  unlike a similar operation which is only approximated, the OFFSET or the
  2149.  AOFFSET.
  2150.  
  2151.  Example:
  2152.  
  2153. @\begin{verbatim}
  2154.     crv = cbspline( 3,
  2155.                     list( ctlpt( E3, -1.0,  0.1,  0.2 ),
  2156.                           ctlpt( E3, -0.1,  1.0,  0.1 ),
  2157.                           ctlpt( E3,  0.1,  0.1,  1.0 ),
  2158.                           ctlpt( E3,  1.0,  0.1,  0.1 ),
  2159.                           ctlpt( E3,  0.1,  1.0,  0.2 ) ),
  2160.                     list( KV_OPEN ) );
  2161.     cev = CEVOLUTE( Crv );
  2162. @\end{verbatim}
  2163. @See Figure~\ref{fig-cevolute}.
  2164. @\begin{figure}
  2165. @\vspace{2in}
  2166. @\special{psfile=user_man/cevolute.ps hscale=100 vscale=100 hoffset=-20 voffset=-260}
  2167. @\caption{The evolute (thick) of a freeform curve (thin) can be computed using
  2168. @        CEVOLUTE.}
  2169. @\label{fig-cevolute}
  2170. @\end{figure}
  2171. $
  2172.  
  2173. @\subsubsection{CEXTREMES}
  2174. !CEXTREMES
  2175.  
  2176. @\begin{verbatim}
  2177.  ListType CEXTREMES( CurveType Crv, NumericType Epsilon, NumericType Axis )
  2178. @\end{verbatim}
  2179.  
  2180.    Computes the extreme set of the given {\bf Crv} in the given axis (1 for X,
  2181.  2 for Y, 3 for Z). Since this computation is numeric, an {\bf Epsilon} is
  2182.  also required to specify the desired tolerance. It returns a list of
  2183.  all the parameter values (NumericType) in which the curve takes an extreme
  2184.  value.
  2185.  
  2186.  Example:
  2187.  
  2188. @\begin{verbatim}
  2189.     extremes = CEXTREMES( Crv, 0.0001, 1 );
  2190. @\end{verbatim}
  2191.  
  2192.  Computes the extreme set of curve {\bf crv}, in the {\bf X} axis, with
  2193.  error tolerance of {\bf 0.0001}. See also CZERO.
  2194. @See Figure~\ref{fig-cextreme}.
  2195. @\begin{figure}
  2196. @\vspace{2in}
  2197. @\special{psfile=user_man/cextreme.ps hscale=100 vscale=100 hoffset=-40 voffset=-330}
  2198. @\caption{The X local extremums of a freeform curve are isolated using CEXTREMES.}
  2199. @\label{fig-cextreme}
  2200. @\end{figure}
  2201. $
  2202.  
  2203. @\subsubsection{CINFLECT}
  2204. !CINFLECT
  2205.  
  2206. @\begin{verbatim}
  2207.  ListType CINFLECT( CurveType Crv, NumericType Epsilon )
  2208.  
  2209.  or
  2210.  
  2211.  CurveType CINFLECT( CurveType Crv, NumericType Epsilon )
  2212. @\end{verbatim}
  2213.  
  2214.    Computes the inflection points of {\bf Crv} in the $XY$ plane.
  2215.  Since this computation is numeric, an {\bf Epsilon} is also required
  2216.  to specify the desired tolerance. It returns a list of all the
  2217.  parameter values (NumericType) in which the curve has an inflection point.
  2218.    If, however, {\bf Epsilon} is negative, a scalar field curve representing
  2219.  the sign of the curvature of the curve is returned instead.
  2220.  
  2221. @ The sign of curvature scalar field is equal to,
  2222. @\begin{equation}
  2223. @      \sigma(t) = x'(t) y''(t) - x''(t) y'(t).
  2224. @\end{equation}
  2225. ^ The sign of curvature scalar field is equal to
  2226. ^
  2227. ^       s(t) = x' y'' - x'' y' 
  2228. ^
  2229.  Example:
  2230.  
  2231. @\begin{verbatim}
  2232.     inflect = CINFLECT( crv, 0.001 );
  2233.     pt_inflect = nil();
  2234.     pt = nil();
  2235.     for ( i = 1, 1, sizeof( inflect ),
  2236.             pt = ceval( crv, nth( inflect, i ) ):
  2237.             snoc( pt, pt_inflect )
  2238.         );
  2239.     interact( list( axes, crv, pt_inflect ), 0);
  2240. @\end{verbatim}
  2241.  
  2242.  Computes the set of inflection points of curve {\bf crv} with error
  2243.  tolerance of {\bf 0.001}. This set is then scanned in a loop and
  2244.  evaluated to the curve's locations which are then displayed with the {\bf crv}.
  2245.  See also CZEROS, CEXTREMES, and CCRVTR.
  2246. @See Figure~\ref{fig-cinflect}.
  2247. @\begin{figure}
  2248. @\vspace{1.2in}
  2249. @\special{psfile=user_man/cinflect.ps hscale=100 vscale=100 hoffset=-40 voffset=-310}
  2250. @\caption{The Inflection points of a freeform curve can be isolated using CINFLECT.}
  2251. @\label{fig-cinflect}
  2252. @\end{figure}
  2253. $
  2254.  
  2255. @\subsubsection{CINTERP}
  2256. !CINTERP
  2257.  
  2258. @\begin{verbatim}
  2259.  CurveType CINTERP( ListType PtList, NumericType Order, NumericType Size,
  2260.                                                         ConstantType Param)
  2261. @\end{verbatim}
  2262.  
  2263.    Computes a Bspline polynomial curve that interpolates or approximates
  2264.  the list of points in {\bf PtList}. The Bspline curve will have order
  2265.  {\bf Order} and {\bf Size} control points. The knots will be spaced
  2266.  according to {\bf Param} which can be one of PARAM\_UNIFORM,
  2267.  PARAM\_CHORD or PARAM\_CENTRIP. The former prescribes a uniform knot
  2268.  sequence and the latters specify knot spacing according to the chord
  2269.  length and a square root of the chord length.
  2270.    All points in {\bf PtList} must be of type (E1-E5, P1-P5) control point,
  2271.  or regular PointType. If {\bf Size} is equal to the number of points in
  2272.  {\bf PtList} the resulting curve will {\em interpolate} the data set.
  2273.  Otherwise, if {\bf Size} is less than the number of points in {\bf PtList}
  2274.  the point data set will be least square approximated. In no time can {\bf Size}
  2275.  be larger that the number of points in {\bf PtList} or lower than {\bf Order}.
  2276.  {\bf Size} of zero forces interpolation by setting {\bf Size} to the
  2277.  data set size.
  2278.    All interior knots will be distinct preserving maximal continuity.
  2279.  The resulting Bspline curve will have open end conditions.
  2280.  
  2281.  Example:
  2282.  
  2283. @\begin{verbatim}
  2284.     pl = nil();
  2285.     for ( x = 0, 1, 100,
  2286.           snoc(point(cos(x / 5), sin(x / 5), x / 50 - 1), pl)
  2287.     );
  2288.     c = CINTERP( pl, 3, 21, PARAM_UNIFORM );
  2289. @\end{verbatim}
  2290.  
  2291.  Samples a helical curve at 100 points and least square fit a quadratic
  2292.  Bspline curve with 21 point to the data set. The curve will have a uniform
  2293.  knot spacing.
  2294. @See Figure~\ref{fig-cinterp}.
  2295. @\begin{figure}
  2296. @\vspace{2.6in}
  2297. @\special{psfile=user_man/cinterp.ps hscale=100 vscale=100 hoffset=-40 voffset=-150}
  2298. @\caption{A Helix is sampled at 100 locations is least square fit using CINTERP
  2299. @        by a quadratic Bspline curve and 21 control points.}
  2300. @\label{fig-cinterp}
  2301. @\end{figure}
  2302. $
  2303.  
  2304. @\subsubsection{CIRCLE}
  2305. !CIRCLE
  2306.  
  2307. @\begin{verbatim}
  2308.  CurveType CIRCLE( VectorType Center, NumericType Radius )
  2309. @\end{verbatim}
  2310.  
  2311.    Constructs a circle at the specified {\bf Center} with the specified
  2312.  {\bf Radius}. The returned circle is a Bspline curve of four piecewise Bezier
  2313.  90 degree arcs. The construced circle is always parallel to the $XY$ plane.
  2314.  Use the linear transformation routines to place the circle in the appropriate
  2315.  orientation and location.
  2316. $
  2317.  
  2318. @\subsubsection{CIRCPOLY}
  2319. !CIRCPOLY
  2320.  
  2321. @\begin{verbatim}
  2322.  PolygonType CIRCPOLY( VectorType Normal, VectorType Trans, NumericType Radius )
  2323. @\end{verbatim}
  2324.  
  2325.    Defines a circular polygon in a plane perpendicular to {\bf Normal} that
  2326.  contains the {\bf Trans} point. Constructed polygon is centered at
  2327.  {\bf Trans}. RESOLUTION vertices will be defined with {\bf Radius} from
  2328.  distance from {\bf Trans}.
  2329.  
  2330.    Alternative ways to construct a polygon are manual construction of the
  2331.  vertices using POLY, or the construction of a flat ruled surface using
  2332.  RULEDSRF.
  2333. $
  2334.  
  2335. @\subsubsection{CLNTREAD}
  2336. !CLNTREAD
  2337.  
  2338. @\begin{verbatim}
  2339.  AnyType CLNTREAD( NumericType Handler, NumericType Block )
  2340. @\end{verbatim}
  2341.  
  2342.    Reads one object from a communication channel of a client.
  2343.  {\bf Handler} contains the index of the communication channel opened via
  2344.  CLNTEXEC. If no data is available in the communication channel, this
  2345.  function will block for at most {\bf Block} millisecond until data is found
  2346.  or timeout occurs. In the latter, a single StringType object is returned
  2347.  with the content of "no data (timeout)".  See also CLNTWRITE, CLNTCLOSE,
  2348.  and CLNTEXEC.
  2349.  
  2350.  Example:
  2351.  
  2352. @\begin{verbatim}
  2353.    h2 = clntexec( "xmtdrvs -s-" );
  2354.        .
  2355.        .
  2356.  
  2357.    Model = CLNTREAD( h2 );
  2358.        .
  2359.        .
  2360.  
  2361.    clntclose( h2,TRUE );
  2362. @\end{verbatim}
  2363.  
  2364.  reads one object from client through communication channel h2 and save it
  2365.  in variable Model.
  2366. $
  2367.  
  2368. @\subsubsection{CMORPH}
  2369. !CMORPH
  2370.  
  2371. @\begin{verbatim}
  2372.  CurveType CMORPH( CurveType Crv1, CurveType Crv2,
  2373.                    NumericType Method, NumericType Blend )
  2374.  
  2375.  or
  2376.  
  2377.  ListType CMORPH( CurveType Crv1, CurveType Crv2,
  2378.                   NumericType Method, NumericType Blend )
  2379. @\end{verbatim}
  2380.  
  2381.  Creates a new curve which is a {\em metamorph} of the two given curves.
  2382.  The two given curves must be compatible (see FFCOMPAT) before this blend
  2383.  is invoked. Very useful if a sequence that "morphs" one curve to another
  2384.  is to be created. Several methods of metamorphosis are supported according
  2385.  to the value of {\bf Method},
  2386.  
  2387. # 3 2 0 1
  2388.  0
  2389.   Simple convex blend.
  2390.  1
  2391.   Corner/Edge cutting scheme, scaled to same curve length.
  2392.  2 
  2393.   Corner/Edge cutting scheme, scaled to same bounding box.
  2394.  3
  2395.   Same as 1 but with filtering out of tangencies.
  2396.  4
  2397.   Same as 2 but with filtering out of tangencies.
  2398.  5
  2399.   Multiresolution decompsition based metamorphosis. See CMULTRES.
  2400. #
  2401.  
  2402.    In {\bf Method} 1, {\bf Blend} is a number between zero ({\bf Crv1})
  2403.  and one ({\bf Crv2}) defining the similarity to {\bf Crv1} and {\bf Crv2},
  2404.  respectively. A single curve is returned.
  2405.  
  2406.    In {\bf Method}s 2 to 5, {\bf Blend} is a step size for the
  2407.  metamorphosis operation and a whole list describing the entire
  2408.  metamorphosis operation is returned.
  2409.  
  2410.  Examples:
  2411.  
  2412. @\begin{verbatim}
  2413.  crv1 = cbezier( list( ctlpt( E2,  0.3,  0.0 ),
  2414.                        ctlpt( E2,  0.0,  0.5 ),
  2415.                        ctlpt( E2, -0.2,  0.0 ) ) );
  2416.  crv1a = crv1 * trans( vector( -0.4, 0.0, 0.0 ) );
  2417.  crv1b = crv1a * scale( vector( -1.0, 1.0, 1.0 ) );
  2418.  
  2419.  for ( i = 0, 1, 300,
  2420.      c = cmorph( crv1a, crv1b, 0, i / 300.0 ):
  2421.      color( c, yellow ):
  2422.      viewobj( c )
  2423.  );
  2424.  
  2425.  crvs = cmorph( crv1a, crv1b, 2, 0.003 );
  2426.  snoc( crv1b, crvs );
  2427.  for ( i = 1, 1, sizeof( crvs ),
  2428.      c = nth( crvs, i ):
  2429.      color( c, yellow ):
  2430.      viewobj( c )
  2431.  );
  2432. @\end{verbatim}
  2433.  
  2434.  creates two metamorphosis animation sequences, one that is based on
  2435.  a convex blend and one that is based on corner/edge cutting scheme.
  2436.  See alost SMORPH.
  2437. @See Figure~\ref{fig-cmorph}.
  2438. @\begin{figure}
  2439. @\begin{picture}(0,200)
  2440. @    \put(110,  0){\large (a)}
  2441. @    \put(320,  0){\large (b)}
  2442. @\end{picture}
  2443. @\special{psfile=user_man/cmorph.ps hscale=100 vscale=100 hoffset=-50 voffset=-260}
  2444. @\caption{A morphing sequence using convex blend (a) and edge cutting (b).}
  2445. @\label{fig-cmorph}
  2446. @\end{figure}
  2447. $
  2448.  
  2449. @\subsubsection{CMULTIRES}
  2450. !CMULTIRES
  2451.  
  2452. @\begin{verbatim}
  2453.  ListType CMULTIRES( CurveType Crv, NumericType Discont )
  2454. @\end{verbatim}
  2455.  
  2456.    Computes a multiresolution decomposition of curve {\bf Crv} using least
  2457.  squares approximation. The resulting list of curves describes an hierarchy
  2458.  of curves in linear subspaces of the space {\bf Crv} was in that can be
  2459.  sum algebraically to form {\bf Crv}. Each of the curves in the hierarchy
  2460.  is a least squares approximation of {\bf Crv} in the subspace it is defined
  2461.  in. {\bf Discont} is a boolean flat that controls the way tangent
  2462.  discontinuities are computed throughout the decomposition.
  2463.  
  2464.  Example:
  2465.  
  2466. @\begin{verbatim}
  2467.     MRCrv = CMULTIRES( Animal, false );
  2468.  
  2469.     sum = nth( MRCrv, 1 );
  2470.     MRCrvs = list( sum * tx( 3.0 ) );
  2471.     for ( ( i = 2 ), 1, sizeof( MRCrv ),
  2472.         sum = symbsum( sum, nth( MRCrv, i ) ):
  2473.         snoc( sum * tx( ( 3 - i ) * 1.5 ), MRCrvs )
  2474.     );
  2475.  
  2476.     All = MRCrvs * sc ( 0.25 );
  2477.     view( All, on );
  2478. @\end{verbatim}
  2479.  
  2480.  Computes a multiresolution decomposition to curve {\bf CrossSec} as
  2481.  {\bf MRCrv} and display all the decomposition levels by summing them all
  2482.  up. The use of {\bf none} as on object name allows one to display an
  2483.  object in the display device without replacing the previous object in the
  2484.  display device, carrying the same name.
  2485.  
  2486.  creates two metamorphosis animation sequences, one that is based on
  2487.  a convex blend and one that is based on corner/edge cutting scheme.
  2488. @See Figure~\ref{fig-cmultres}.
  2489. @\begin{figure}
  2490. @\vspace{1.2in}
  2491. @\special{psfile=user_man/cmultres.ps hscale=100 vscale=100 hoffset=-50 voffset=-280}
  2492. @\caption{A multiresolution decomposition of a curve of an animal using
  2493. @         list squares. Original curve is shown on the left.}
  2494. @\label{fig-cmultres}
  2495. @\end{figure}
  2496. $
  2497.  
  2498. @\subsubsection{CMESH}
  2499. !CMESH
  2500.  
  2501. @\begin{verbatim}
  2502.  CurveType CMESH( SurfaceType Srf, ConstantType Direction, NumericType Index )
  2503. @\end{verbatim}
  2504.  
  2505.    Returns a single ROW or COLumn as specified by the {\bf Direction} and
  2506.  {\bf Index} (base count is 0) of the control mesh of surface {\bf Srf}.
  2507.  
  2508.    The returned curve will have the same knot vector as {\bf Srf} in the
  2509.  appropriate direction. See also CSURFACE.
  2510.  
  2511.    This curve is {\em not} necessarily in the surface {\bf Srf}.
  2512. @It is equal to,
  2513. @\begin{equation}
  2514. @     C(t) = \sum_{i=0}^m P_{ij} B_i(t),
  2515. @\end{equation}
  2516. @and similar for the other parametric direction.
  2517.  
  2518.  Example:
  2519.  
  2520. @\begin{verbatim}
  2521.     Crv = CMESH( Srf, COL, 0 );
  2522. @\end{verbatim}
  2523.  
  2524.  extracts the first column of surface {\bf Srf} as a curve. See also
  2525.  CSURFACE.
  2526. $
  2527.  
  2528. @\subsubsection{COERCE}
  2529. !COERCE
  2530.  
  2531. @\begin{verbatim}
  2532.  AnyType COERCE( AnyType Object, ConstantType NewType )
  2533. @\end{verbatim}
  2534.  
  2535.    Provides a coercion mechanism between different objects or object types.
  2536.  PointType, VectorType, PlaneType, CtlPtType can be all coerced to each
  2537.  other by using the {\bf NewType} of POINT\_TYPE, VECTOR\_TYPE, PLANE\_TYPE,
  2538.  or one of E1-E5, P1-P5 (CtlPtType). Similarly, CurveType, SurfaceType,
  2539.  TrimSrfType, and TrivarType can all be coerced to hold different
  2540.  CtlPtType of control points, or even different open end conditions from
  2541.  KV\_PERIODIC to KV\_FLOAT to KV\_OPEN.
  2542.    If a scalar (E1 or P1) curve is coerced to E2 or P2 curve or
  2543.  a scalar (E1 or P1) surface is coerced to E3 or P3 surface, the Y (YZ)
  2544.  coordinate(s) is (are) updated to hold the parametric domain of the curve
  2545.  (surface).
  2546.  
  2547.  Example:
  2548.  
  2549. @\begin{verbatim}
  2550.     CrvE2 = COERCE( Crv, E2 );
  2551. @\end{verbatim}
  2552.  
  2553.  coerce {\bf Crv} to a new curve that will have an E2 CtlPtType control
  2554.  points. Coerction of a projective curve (P1-P5) to a Euclidean curve
  2555.  (E1-E5) does not preseve the shape of the curve.
  2556. $
  2557.  
  2558. @\subsubsection{COMPOSE}
  2559. !COMPOSE
  2560.  
  2561. @\begin{verbatim}
  2562.  CurveType COMPOSE( CurveType Crv1, CurveType Crv2 )
  2563.  
  2564.  or
  2565.  
  2566.  CurveType COMPOSE( SurfaceType Srf, CurveType Crv )
  2567. @\end{verbatim}
  2568.  
  2569.    Symbolically compute the composition curve {\bf Crv1(Crv2(t))} or
  2570.  {\bf Srf(Crv(t))}. In {\bf Crv1(Crv2(t)}, {\bf Crv1} can be any curve
  2571.  while {\bf Crv2} must be a one-dimensional curve that is either E1 or
  2572.  P1. In {\bf Srf(Crv(t))}, {\bf Srf} can be any surface, while {\bf Crv}
  2573.  must be a two-dimensional curve, that is either E2 or P2. Both {\bf Crv2}
  2574.  in the curve's composition, and {\bf Crv} is the surface's composition
  2575.  must be contained in the curve or surface parametric domain.
  2576.  
  2577.  Example:
  2578.  
  2579. @\begin{verbatim}
  2580.    srf = sbezier( list( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  2581.                               ctlpt( E3, 0.0, 0.5, 1.0 ),
  2582.                               ctlpt( E3, 0.0, 1.0, 0.0 ) ),
  2583.                         list( ctlpt( E3, 0.5, 0.0, 1.0 ),
  2584.                               ctlpt( E3, 0.5, 0.5, 0.0 ),
  2585.                               ctlpt( E3, 0.5, 1.0, 1.0 ) ),
  2586.                         list( ctlpt( E3, 1.0, 0.0, 1.0 ),
  2587.                               ctlpt( E3, 1.0, 0.5, 0.0 ),
  2588.                               ctlpt( E3, 1.0, 1.0, 1.0 ) ) ) );
  2589.    crv = coerce( circle( vector( 0.0, 0.0, 1.0 ), 0.4 ), p2 ) *
  2590.          trans( vector( 0.5, 0.5, 0.0 ) );
  2591.    comp_crv = COMPOSE( srf, crv );
  2592. @\end{verbatim}
  2593.  
  2594.  compose a circle {\bf Crv} to be on the surface {\bf Srf}.
  2595. @See Figure~\ref{fig-compose}.
  2596. @\begin{figure}
  2597. @\vspace{2.5in}
  2598. @\special{psfile=user_man/compose.ps hscale=100 vscale=100 hoffset=-10 voffset=-210}
  2599. @\caption{A circle in the parametric space of the freefrom surface is composed
  2600. @        to create a closed loop curve on the surface using COMPOSE.}
  2601. @\label{fig-compose}
  2602. @\end{figure}
  2603. $
  2604.  
  2605. @\subsubsection{CON2}
  2606. !CON2
  2607.  
  2608. @\begin{verbatim}
  2609.  PolygonType CON2( VectorType Center, VectorType Direction,
  2610.                    NumericType Radius1, NumericType Radius2 )
  2611. @\end{verbatim}
  2612.  
  2613.    Creates a truncated CONE geometric object, defined by {\bf Center} as the
  2614.  center of the main base of the CONE, {\bf Direction} as both the CONE's axis
  2615.  and the length of CONE, and the two radii {\bf Radius1/2} of the two bases of
  2616.  the CONE.
  2617.  
  2618.    Unlike the regular cone (CONE) constructor which has inherited
  2619.  discontinuities in its generated normals at the apex, CON2 can be used to
  2620.  form a (truncated) cone with continuous normals. 
  2621.    See RESOLUTION for the accuracy of the CON2 approximation as a polygonal
  2622.  model.
  2623.  
  2624.  Example:
  2625.  
  2626. @\begin{verbatim}
  2627.     Cone2 = CON2( vector( 0, 0, -1 ), vector( 0, 0, 4 ), 2, 1 );
  2628. @\end{verbatim}
  2629.  
  2630.  constructs a truncated cone with bases parallel to the $XY$ plane at
  2631.  $Z = -1$ and $Z = 3$, and with radii of 2 and 1 respectively.
  2632. @See Figure~\ref{fig-cones}.
  2633. @\begin{figure}
  2634. @\vspace{2.7in}
  2635. @\special{psfile=user_man/cones.ps hscale=100 vscale=100 hoffset=0 voffset=-220}
  2636. @\caption{A cone (left) can be constructed using the CONE constructor and
  2637. @         a truncated cone (right) using the constructor CONE2.}
  2638. @\label{fig-cones}
  2639. @\end{figure}
  2640. $
  2641.  
  2642. @\subsubsection{CONE}
  2643. !CONE
  2644.  
  2645. @\begin{verbatim}
  2646.  PolygonType CONE( VectorType Center, VectorType Direction,
  2647.                    NumericType Radius )
  2648. @\end{verbatim}
  2649.  
  2650.    Creates a CONE geometric object, defined by {\bf Center} as the center of
  2651.  the base of the CONE, {\bf Direction} as the CONE's axis and height, and
  2652.  {\bf Radius} as the radius of the base of the CONE.
  2653.    See RESOLUTION for accuracy of the CONE approximation as a polygonal model. 
  2654.  
  2655.  Example:
  2656.  
  2657. @\begin{verbatim}
  2658.     Cone1 = CONE( vector( 0, 0, 0 ), vector( 1, 1, 1 ), 1 );
  2659. @\end{verbatim}
  2660.  
  2661.  constructs a cone based in an $XY$ parallel plane, centered at the origin
  2662.  with radius 1 and with tilted apex at ( 1, 1, 1 ).
  2663.  
  2664.    See also CON2.
  2665. @See Figure~\ref{fig-cones}.
  2666. $
  2667.  
  2668. @\subsubsection{CONVEX}
  2669. !CONVEX
  2670.  
  2671. @\begin{verbatim}
  2672.  PolygonType CONVEX( PolygonType Object )
  2673.  
  2674.  or
  2675.  
  2676.  ListType CONVEX( ListType Object )
  2677. @\end{verbatim}
  2678.  
  2679.    Converts non-convex polygons in {\bf Object}, into convex ones. New vertices
  2680.  are introduced into the polygonal data during this process. The Boolean
  2681.  operations require the input to have convex polygons only (although it may
  2682.  return non convex polygons...) and it automatically converts non-convex input
  2683.  polygons to convex ones, using this same routine.
  2684.  
  2685.    However, some external tools (like irit2ray and poly3d-h) require convex
  2686.  polygons. This function must be used on the objects to guarantee that
  2687.  only convex polygons are saved into data files for these external tools.
  2688.  
  2689. @\begin{verbatim}
  2690.     CnvxObj = CONVEX( Obj );
  2691.     save( "data", CnvxObj );
  2692. @\end{verbatim}
  2693.  
  2694.  converts non-convex polygons into convex ones, so that the data file can be
  2695.  used by external tools requiring convex polygons.
  2696. $
  2697.  
  2698. @\subsubsection{COORD}
  2699. !COORD
  2700.  
  2701. @\begin{verbatim}
  2702.  AnyType COORD( AnyType Object, NumericType Index )
  2703. @\end{verbatim}
  2704.  
  2705.    Extracts an element from a given {\bf Object}, at index {\bf Index}. From
  2706.  a PointType, VectorType, PlaneType, CtlPtType and MatrixType, a NumericType
  2707.  is returned with {\bf Index} 0 for the X axis, 1 for the Y axis etc.
  2708.  {\bf Index} 0 denotes the weight of CtlPtType. For a PolygonType that
  2709.  contains more than one polygon, the {\bf Index}th polygon is returned. For
  2710.  a PolygonType that contains a single Polygon, the {\bf Index}th vertex is
  2711.  returned. For a CurveType or a SurfaceType, the {\bf Index}th CtlPtType is
  2712.  returned. For a ListType, COORD behaves like NTH and returns the {\bf Index}th
  2713.  object in the list.
  2714.  
  2715.  Example:
  2716.  
  2717. @\begin{verbatim}
  2718.     a = vector( 1, 2, 3 );
  2719.     vector( COORD( a, 0 ), COORD( a, 1 ), COORD( a, 2 ) );
  2720.  
  2721.     a = ctlpt( P2, 6, 7, 8, 9 );
  2722.     ctlpt( P3, coord( a, 0 ), coord( a, 1 ), coord( a, 2 ), coord( a, 3 ) );
  2723.  
  2724.     a = plane( 10, 11, 12, 13 );
  2725.     plane( COORD( a, 0 ), COORD( a, 1 ), COORD( a, 2 ), COORD( a, 3 ) );
  2726. @\end{verbatim}
  2727.  
  2728.  constructs a vector/ctlpt/plane and reconstructs it by extracting the
  2729.  constructed scalar components of the objects using COORD.
  2730.  
  2731.    See also COERCE.
  2732. $
  2733.  
  2734. @\subsubsection{CRAISE}
  2735. !CRAISE
  2736.  
  2737. @\begin{verbatim}
  2738.  CurveType CRAISE( CurveType Curve, NumericType NewOrder )
  2739. @\end{verbatim}
  2740.  
  2741.    Raise {\bf Curve} to the {\bf NewOrder} Order specified.
  2742.  
  2743.  Example:
  2744.  
  2745. @\begin{verbatim}
  2746.     Crv = cbezier( list( ctlpt( E2, -0.7,  0.3 ),
  2747.                          ctlpt( E2,  0.0,  1.0 ),
  2748.                          ctlpt( E2,  0.7,  0.0 ) ) );
  2749.     Crv2 = CRAISE( Crv, 5 );
  2750. @\end{verbatim}
  2751.  
  2752.  raises the 90 degrees corner Bezier curve {\bf Crv} to be a quartic.
  2753. @See Figure~\ref{fig-craise}.
  2754. @\begin{figure}
  2755. @\vspace{2.5in}
  2756. @\special{psfile=user_man/craise.ps hscale=70 vscale=70 hoffset=30 voffset=-220}
  2757. @\caption{Raises a 90 degrees corner quadratic Bezier curve to a quintic
  2758. @        using CRAISE. The control polygons are also shown.}
  2759. @\label{fig-craise}
  2760. @\end{figure}
  2761. $
  2762.  
  2763. @\subsubsection{CREFINE}
  2764. !CREFINE
  2765.  
  2766. @\begin{verbatim}
  2767.  CurveType CREFINE( CurveType Curve, NumericType Replace, ListType KnotList )
  2768. @\end{verbatim}
  2769.  
  2770.    Provides the ability to {\bf Replace} a knot vector of {\bf Curve}, or refine 
  2771.  it. {\bf KnotList} is a list of knots to refine {\bf Curve} at. All knots
  2772.  should be contained in the parametric domain of the {\bf Curve}. If the knot
  2773.  vector is replaced, the length of {\bf KnotList} should be identical to the
  2774.  length of the original knot vector of the {\bf Curve}. If {\bf Curve} is a
  2775.  Bezier curve, it is automatically promoted to be a Bspline curve.
  2776.  
  2777.  Example:
  2778.  
  2779. @\begin{verbatim}
  2780.     Crv2 = CREFINE( Crv, FALSE, list( 0.25, 0.5, 0.75 ) );
  2781. @\end{verbatim}
  2782.  
  2783.  refines {\bf Crv} and adds three new knots at 0.25, 0.5, and 0.75.
  2784. @See Figure~\ref{fig-crefine}.
  2785. @\begin{figure}
  2786. @\vspace{2.5in}
  2787. @\special{psfile=user_man/crefine.ps hscale=70 vscale=70 hoffset=30 voffset=-230}
  2788. @\caption{Refines a 90 degrees corner quadratic Bezier curve at three interior
  2789. @        knots (result is a Bspline curve) using CREFINE.
  2790. @        The control polygons are also shown.}
  2791. @\label{fig-crefine}
  2792. @\end{figure}
  2793. $
  2794.  
  2795. @\subsubsection{CREGION}
  2796. !CREGION
  2797.  
  2798. @\begin{verbatim}
  2799.  CurveType CREGION( CurveType Curve, NumericType MinParam,
  2800.                                                        NumericType MaxParam )
  2801. @\end{verbatim}
  2802.  
  2803.    Extracts a region from {\bf Curve} between {\bf MinParam} and {\bf MaxParam}.
  2804.  Both {\bf MinParam} and {\bf MaxParam} should be contained in the
  2805.  parametric domain of the {\bf Curve}.
  2806.  
  2807.  Example:
  2808.  
  2809. @\begin{verbatim}
  2810.     SubCrv = CREGION( Crv, 0.3, 0.6 );
  2811. @\end{verbatim}
  2812.  
  2813.  extracts the region from {\bf Crv} from the parameter value 0.3 to the
  2814.  parameter value 0.6.
  2815. @See Figure~\ref{fig-cregion}.
  2816. @\begin{figure}
  2817. @\vspace{2.5in}
  2818. @\special{psfile=user_man/cregion.ps hscale=70 vscale=70 hoffset=30 voffset=-230}
  2819. @\caption{Extracts a sub region from a curve using CREGION.}
  2820. @\label{fig-cregion}
  2821. @\end{figure}
  2822. $
  2823.  
  2824. @\subsubsection{CREPARAM}
  2825. !CREPARAM
  2826.  
  2827. @\begin{verbatim}
  2828.  CurveType CREPARAM( CurveType Curve, NumericType MinParam,
  2829.                                                        NumericType MaxParam )
  2830. @\end{verbatim}
  2831.  
  2832.    Reparametrize {\bf Curve} over a new domain from {\bf MinParam} to {\bf MaxParam}.
  2833.  This operation does not affect the geometry of the curve and only affine
  2834.  transforms its knot vector. A Bezier curve will automatically be promoted
  2835.  into a Bspline curve by this function.
  2836.  
  2837.  Example:
  2838.  
  2839. @\begin{verbatim}
  2840.     arc1 = arc( vector( 0.0, 0.0, 0.0 ),
  2841.                 vector( 0.5, 2.0, 0.0 ),
  2842.                 vector( 1.0, 0.0, 0.0 ) );
  2843.     crv1 = arc( vector( 1.0, 0.0, 0.75 ),
  2844.                 vector( 0.75, 0.0, 0.7 ),
  2845.                 vector( 0.5,  0.0, 0.85 ) ) +
  2846.            arc( vector( 0.5,  0.0, 0.75 ),
  2847.                 vector( 0.75, 0.0, 0.8 ),
  2848.                 vector( 1.0,  0.0, 0.65 ) );
  2849.  
  2850.     arc1 = CREPARAM( arc1, 0, 10 );
  2851.     crv1 = CREPARAM( crv1, 0, 10 );
  2852. @\end{verbatim}
  2853.  
  2854.  Sets the domain of the given two curves to be from zero to ten. The
  2855.  Bezier curve arc1 is promoted to a Bspline curve.
  2856. $
  2857.  
  2858. @\subsubsection{CROSSEC}
  2859. !CROSSEC
  2860.  
  2861. @\begin{verbatim}
  2862.  PolygonType CROSSEC( PolygonType Object )
  2863. @\end{verbatim}
  2864.  
  2865. ;   Invoke interactive mode to edit/create a polygon in the plane Z = 0. The
  2866. ; polygon must be in the domain [0..1] in X,Y. The first polygon of the given
  2867. ; Object is copied to begin with. If the given {\bf Operand} is NOT a geometric
  2868. ; object, but FALSE (numeric 0.0), a new polygon is created. Returns an (open)
  2869. ; object with this one polygon only and inside side of $+Z$. Note that if the
  2870. ; given polygon (first polygon of Object) is not on the $XY$ plane, it is transformed
  2871. ; to it before editing, and transformed back after.
  2872.    This feature is NOT implemented.
  2873. $
  2874.  
  2875. @\subsubsection{CRVLNDST}
  2876. !CRVLNDST
  2877.  
  2878. @\begin{verbatim}
  2879.  NumericType CRVLNDST( CurveType Crv, PointType PtOnLine, VectorType LnDir,
  2880.                                  NumericType IsMinDist, NumericType Epsilon )
  2881.  
  2882.  or
  2883.  
  2884.  ListType CRVLNDST( CurveType Crv, PointType PtOnLine, VectorType LnDir,
  2885.                                 NumericType IsMinDist, NumericType Epsilon )
  2886. @\end{verbatim}
  2887.  
  2888.    Computes the closest (if {\bf IsMinDist} is TRUE, farthest if FALSE) point
  2889.  on {\bf Curve} to the line specified by {\bf PtOnLine} and {\bf LnDir} as a
  2890.  point on the line and a line direction.
  2891.    Since this operation is partially numeric, {\bf Epsilon} is used to set
  2892.  the needed accuracy. It returns the parameter value of the location on
  2893.  {\bf Crv} closest to the line.
  2894.    If, however, {\bf Epsilon} is negative, -{\bf Epsilon} is used instead,
  2895.  and all local extrema in the distance function are returned as a list
  2896.  (both minima and maxima).
  2897.    If the line and the curve intersect, the point of intersection is
  2898.  returned as the minimum.
  2899.  
  2900.  Example:
  2901.  
  2902. @\begin{verbatim}
  2903.     Param = CRVLNDST( Crv, linePt, lineVec, TRUE, 0.001 );
  2904. @\end{verbatim}
  2905.  
  2906.  finds the closest point on {\bf Crv} to the line defined by {\bf linePt}
  2907.  and {\bf lineVec}.
  2908. @See Figure~\ref{fig-crvlndst}.
  2909. @\begin{figure}
  2910. @\vspace{2.2in}
  2911. @\special{psfile=user_man/crvlndst.ps hscale=100 vscale=100 hoffset=-40 voffset=-240}
  2912. @\caption{Computes the locations on the freeform curve with local extreme
  2913. @        distance to the given line, using CRVLNDST.}
  2914. @\label{fig-crvlndst}
  2915. @\end{figure}
  2916. $
  2917.  
  2918. @\subsubsection{CRVPTDST}
  2919. !CRVPTDST
  2920.  
  2921. @\begin{verbatim}
  2922.  NumericType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
  2923.                                                          NumericType Epsilon )
  2924.  
  2925.  or
  2926.  
  2927.  ListType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
  2928.                                                          NumericType Epsilon )
  2929. @\end{verbatim}
  2930.  
  2931.    Computes the closest (if {\bf IsMinDist} is TRUE, farthest if FALSE) point
  2932.  on {\bf Crv} to {\bf Point}.
  2933.    Since this operation is partially numeric, {\bf Epsilon} is used to set
  2934.  the needed accuracy. It returns the parameter value of the location on
  2935.  {\bf Crv} closest to {\bf Point}.
  2936.    If, however, {\bf Epsilon} is negative, -{\bf Epsilon} is used instead,
  2937.  and all local extrema in the distance function are returned as a list
  2938.  (both minima and maxima).
  2939.  
  2940.  Example:
  2941.  
  2942. @\begin{verbatim}
  2943.     Param = CRVPTDST( Crv, Pt, FALSE, 0.0001 ); 
  2944. @\end{verbatim}
  2945.  
  2946.  finds the farthest point on {\bf Crv} from point {\bf Pt}.
  2947. @See Figure~\ref{fig-crvptdst}.
  2948. @\begin{figure}
  2949. @\vspace{2.2in}
  2950. @\special{psfile=user_man/crvptdst.ps hscale=100 vscale=100 hoffset=-40 voffset=-240}
  2951. @\caption{Computes the locations on the freeform curve with local extreme
  2952. @        distance to the given point, using CRVPTDST.}
  2953. @\label{fig-crvptdst}
  2954. @\end{figure}
  2955. $
  2956.  
  2957. @\subsubsection{CSURFACE}
  2958. !CSURFACE
  2959.  
  2960. @\begin{verbatim}
  2961.  CurveType CSURFACE( SurfaceType Srf, ConstantType Direction,
  2962.                                                           NumericType Param )
  2963. @\end{verbatim}
  2964.  
  2965.    Extract an isoparametric curve out of {\bf Srf} in the specified
  2966.  {\bf Direction} (ROW or COL) at the specified parameter value {\bf Param}.
  2967.  {\bf Param} must be contained in the parametric domain of {\bf Srf} in
  2968.  {\bf Direction} direction.
  2969.  The returned curve is {\em in} the surface {\bf Srf}.
  2970. @It is equal to,
  2971. @\begin{equation}
  2972. @     C(t) = S(t, v_0) = \sum_{i=0}^m \sum_{j=0}^n P_{ij} B_i(t) B_j(v_0) =
  2973. @            \sum_{i=0}^m \left( \sum_{j=0}^n P_{ij} B_j(u_0) \right) B_i(t) =
  2974. @            \sum_{i=0}^m Q_i B_i(t),
  2975. @     \label{eqn-crv-from-srf}
  2976. @\end{equation}
  2977. @where $Q_i = \sum_{j=0}^n P_{ij} B_j(u_0)$ are the coefficients of the
  2978. @returned curve, and similar for the other parametric direction $S(u_0, t)$.
  2979. @{\bf param} is $v_0$ is equation~\eqnref{eqn-crv-from-srf}
  2980. @
  2981.  
  2982.  Example:
  2983.  
  2984. @\begin{verbatim}
  2985.     Crv = CSURFACE( Srf, COL, 0.45 ); 
  2986. @\end{verbatim}
  2987.  
  2988.  extracts an isoparametric curve in the COLumn direction at the parameter
  2989.  value of 0.15 from surface {\bf Srf}. See also CMESH, COMPOSE.
  2990. @See Figure~\ref{fig-csurface}.
  2991. @\begin{figure}
  2992. @\vspace{2.5in}
  2993. @\special{psfile=user_man/csurface.ps hscale=100 vscale=100 hoffset=-40 voffset=-180}
  2994. @\caption{Extracts an isoparametric curve from the given surface, using CSURFACE.}
  2995. @\label{fig-csurface}
  2996. @\end{figure}
  2997. $
  2998.  
  2999. @\subsubsection{CTANGENT}
  3000. !CTANGENT
  3001.  
  3002. @\begin{verbatim}
  3003.  VectorType CTANGENT( CurveType Curve, NumericType Param )
  3004. @\end{verbatim}
  3005.  
  3006.    Computes the tangent vector to {\bf Curve} at the parameter value {\bf Param}.
  3007.    The returned vector has a unit length.
  3008.  
  3009.  Example:
  3010.  
  3011. @\begin{verbatim}
  3012.     Tang = CTANGENT( Crv, 0.5 );
  3013. @\end{verbatim}
  3014.  
  3015.  computes the tangent vector to {\bf Crv} at the parameter value of 0.5.
  3016. $
  3017.  
  3018. @\subsubsection{CTLPT}
  3019. !CTLPT
  3020.  
  3021. @\begin{verbatim}
  3022.  CPt = CTLPT( ConstantType PtType, NumericType Coord1, ... )
  3023. @\end{verbatim}
  3024.  
  3025.    Constructs a single control point to be used in the construction of curves
  3026.  and surfaces. Points can have from one to five dimensions, and may be
  3027.  either Euclidean or Projective (rational). Points' type is set via the
  3028.  constants E1 to E5 and P1 to P5. The coordinates of the point are specified
  3029.  in order, weight is first if rational.
  3030.  
  3031.  Examples:
  3032.  
  3033. @\begin{verbatim}
  3034.     CPt1 = CTLPT( E3, 0.0, 0.0, 0.0 );
  3035.     CPt2 = CTLPT( P2, 0.707, 0.707, 0.707 );
  3036. @\end{verbatim}
  3037.  
  3038.  constructs an {\bf E3} point at the origin and a P2 rational point with
  3039.  a weight of 0.707. The Projective Pi points are specified as
  3040.  CTLPT(Pn, W, W X1, ... , W Xn).
  3041. $
  3042.  
  3043. @\subsubsection{CTRIMSRF}
  3044. !CTRIMSRF
  3045.  
  3046. @\begin{verbatim}
  3047.  ListType CTRIMSRF( TrimSrfType TSrf, NumericType Parametric )
  3048. @\end{verbatim}
  3049.  
  3050.    Extract the trimming curves of a trimmed surface {\bf TSrf}.
  3051.  If {\bf Parametric} is not zero, then the trimming curves are extracted
  3052.  as parametric space curves of {\bf TSrf}. Otherwise, the trimming curves
  3053.  are evaluated into Euclidean space as curves on surface {\bf TSrf}.
  3054.  
  3055.  Example:
  3056.  
  3057. @\begin{verbatim}
  3058.     TrimCrvs = CTRIMSRF( TrimSrf, FALSE ); 
  3059. @\end{verbatim}
  3060.  
  3061.  extracts the trimming curves of {\bf TrimSrf} as Euclidean curves on
  3062.  {\bf TrimSrf}.
  3063. @See Figure~\ref{fig-ctrimsrf}.
  3064. @\begin{figure}
  3065. @\vspace{3.4in}
  3066. @\special{psfile=user_man/ctrimsrf.ps hscale=100 vscale=100 hoffset=-35 voffset=-170}
  3067. @\caption{Extracts the trimming curves in Euclidean space (middle) and
  3068. @       parametric space (right) of a trimmed surface (left), using CTRIMSRF.}
  3069. @\label{fig-ctrimsrf}
  3070. @\end{figure}
  3071. $
  3072.  
  3073. @\subsubsection{CYLIN}
  3074. !CYLIN
  3075.  
  3076. @\begin{verbatim}
  3077.  PolylineType CYLIN( VectorType Center, VectorType Direction,
  3078.                      NumericType Radius )
  3079. @\end{verbatim}
  3080.  
  3081.    Creates a CYLINder geometric object, defined by {\bf Center} as center of
  3082.  the base of the CYLINder, {\bf Direction} as the CYLINder's axis and height,
  3083.  and {\bf Radius} as the radius of the base of the CYLINder.
  3084.    See RESOLUTION for the accuracy of the CYLINder approximation as a
  3085.  polygonal model.
  3086.  
  3087.  Example:
  3088.  
  3089. @\begin{verbatim}
  3090.     Cylinder1 = CYLIN( vector( 0, 0, 0 ), vector( 1, 0, 0 ), 10 );
  3091. @\end{verbatim}
  3092.  
  3093.  constructs a cylinder along the $X$ axis from the origin to $X = 10$.
  3094. @See Figure~\ref{fig-cylinder}.
  3095. @\begin{figure}
  3096. @\vspace{1.4in}
  3097. @\special{psfile=user_man/cylinder.ps hscale=100 vscale=100 hoffset=-40 voffset=-180}
  3098. @\caption{A cylinder primitive can be constructor using the CYLIN constructor.}
  3099. @\label{fig-cylinder}
  3100. @\end{figure}
  3101. $
  3102.  
  3103. @\subsubsection{CZEROS}
  3104. !CZEROS
  3105.  
  3106. @\begin{verbatim}
  3107.  ListType CZEROS( CurveType Crv, NumericType Epsilon, NumericType Axis )
  3108. @\end{verbatim}
  3109.  
  3110.    Computes the zero set of the given {\bf Crv} in the given axis (1 for X,
  3111.  2 for Y, 3 for Z). Since this computation is numeric, an {\bf Epsilon} is
  3112.  also required to specify the desired tolerance. It returns a list of
  3113.  all the parameter values (NumericType) the curve is zero.
  3114.  
  3115.  Example:
  3116.  
  3117. @\begin{verbatim}
  3118.     xzeros = CZEROS( cb, 0.001, 1 );
  3119.     pt_xzeros = nil();
  3120.     pt = nil();
  3121.     for ( i = 1, 1, sizeof( xzeros ),
  3122.             pt = ceval( cb, nth( xzeros, i ) ):
  3123.             snoc( pt, pt_xzeros )
  3124.         );
  3125.     interact( list( axes, cb, pt_xzeros ), 0 );
  3126. @\end{verbatim}
  3127.  
  3128.  Computes the {\bf X} zero set of curve {\bf cb} with error tolerance
  3129.  of {\bf 0.001}. This set is then scanned in a loop and evaluated to
  3130.  the curve's locations, which are then displayed.
  3131.  See also CINFLECT.
  3132. @See Figure~\ref{fig-czeros}.
  3133. @\begin{figure}
  3134. @\vspace{3.6in}
  3135. @\special{psfile=user_man/czeros.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
  3136. @\caption{Computes the zero set of a given freeform curve, in the given axis, using
  3137. @        CZEROS.}
  3138. @\label{fig-czeros}
  3139. @\end{figure}
  3140. $
  3141.  
  3142. @\subsubsection{EXTRUDE}
  3143. !EXTRUDE
  3144.  
  3145. @\begin{verbatim}
  3146.  PolygonType EXTRUDE( PolygonType Object, VectorType Dir )
  3147.  
  3148.  or
  3149.  
  3150.  SurfaceType EXTRUDE( CurveType Object, VectorType Dir )
  3151. @\end{verbatim}
  3152.  
  3153.    Creates an extrusion of the given {\bf Object}. If {\bf Object} is a
  3154.  PolygonObject, its first polygon is used as the base for the extrusion in
  3155.  {\bf Dir} direction, and a closed PolygonObject is constructed. If {\bf Object}
  3156.  is a CurveType, an extrusion surface is constructed instead, which is {\em not}
  3157.  a closed object (the two bases of the extrusion are excluded, and the curve
  3158.  may be open by itself).
  3159.  
  3160.    Direction {\bf Dir} cannot be coplanar with the polygon plane. The curve
  3161.  may be nonplanar.
  3162.  
  3163.  Example:
  3164.  
  3165. @\begin{verbatim}
  3166.     Cross = cbspline( 3,
  3167.                       list( ctlpt( E2, -0.018, 0.001 ),
  3168.                             ctlpt( E2,  0.018, 0.001 ),
  3169.                             ctlpt( E2,  0.019, 0.002 ),
  3170.                             ctlpt( E2,  0.018, 0.004 ),
  3171.                             ctlpt( E2, -0.018, 0.004 ),
  3172.                             ctlpt( E2, -0.019, 0.001 ) ),
  3173.                       list( KV_OPEN ) );
  3174.     Cross = Cross + -Cross * scale( vector( 1, -1, 1 ) );
  3175.     Napkin = EXTRUDE( Cross * scale( vector( 1.6, 1.6, 1.6 ) ),
  3176.                       vector( 0.02, 0.03, 0.2 ) );
  3177. @\end{verbatim}
  3178.  
  3179.  constructs a closed cross section {\bf Cross} by duplicating one half of
  3180.  it in reverse and merging the two sub-curves. {\bf Cross} is then used as
  3181.  the cross-section for the extrusion operation.
  3182. @See Figure~\ref{fig-extrude}.
  3183. @\begin{figure}
  3184. @\vspace{1.5in}
  3185. @\special{psfile=user_man/extrude.ps hscale=100 vscale=100 hoffset=-40 voffset=-310}
  3186. @\caption{An extrusion of a freeform curve using EXTRUDE to create a freeform
  3187. @        surface.}
  3188. @\label{fig-extrude}
  3189. @\end{figure}
  3190. $
  3191.  
  3192. @\subsubsection{FFCOMPAT}
  3193. !FFCOMPAT
  3194.  
  3195. @\begin{verbatim}
  3196.  FFCOMPAT( CurveType Crv1, CurveType Crv2 )
  3197.  
  3198.  or
  3199.  
  3200.  FFCOMPAT( SurfaceType Srf1, SurfaceType Srf2 )
  3201. @\end{verbatim}
  3202.  
  3203.  Makes the given two curves or surfaces compatible by making them share the
  3204.  same point type, same curve type, same degree, and the same continuity.
  3205.  Same point type is gained by promoting a lower dimension into a higher one,
  3206.  and non-rational to rational points. Bezier curves are promoted to Bspline
  3207.  curves if necessary, for curve type compatibility. Degree compatibility is
  3208.  achieved by raising the degree of the lower order curve. Continuity is
  3209.  achieve by refining both curves to the space with the same (unioned) knot
  3210.  vector. This function returns nothing and compatibility is made
  3211.  {\em in place}.
  3212.  
  3213.  Example:
  3214.  
  3215. @\begin{verbatim}
  3216.  FFCOMPAT( Srf1, Srf2 );
  3217. @\end{verbatim}
  3218.  
  3219.  See also SMORPH.
  3220. $
  3221.  
  3222. @\subsubsection{FFEXTREME}
  3223. !FFEXTREME
  3224.  
  3225. @\begin{verbatim}
  3226.  CtlPtType FFEXTREME( CurveType Crv, NumericType Minimum )
  3227.  
  3228.  or
  3229.  
  3230.  CtlPtType FFEXTREME( SurfaceType Srf, NumericType Minimum )
  3231. @\end{verbatim}
  3232.  
  3233.  Computes a bound on the extreme values a curves {\bf Crv} or surface
  3234.  {\bf Srf} can assume. Returned control points provides a bound on the
  3235.  minimum (maximum) values that can be assumed if {\bf Minimum} is TRUE
  3236.  (FALSE).
  3237.  
  3238.  Example:
  3239.  
  3240. @\begin{verbatim}
  3241.  Bound = FFEXTREME( Srf, false );
  3242. @\end{verbatim}
  3243.  
  3244.  Computes a bound on the maximal values Srf can assume.
  3245. $
  3246.  
  3247. @\subsubsection{GBOX}
  3248. !GBOX
  3249.  
  3250. @\begin{verbatim}
  3251.  PolygonType GBOX( VectorType Point,
  3252.                    VectorType Dx, VectorType Dy, VectorType Dz )
  3253. @\end{verbatim}
  3254.  
  3255.    Creates a parallelepiped - Generalized BOX polygonal object, defined by
  3256.  {\bf Point} as base position, and {\bf Dx, Dy, Dz} as 3 3D vectors to define
  3257.  the 6 faces of this generalized BOX. The regular BOX object is a special case
  3258.  of GBOX where {\bf Dx} = vector(Dx, 0, 0), {\bf Dy} = vector(0, Dy, 0), and
  3259.  {\bf Dz} = vector(0, 0, Dz).
  3260.  
  3261.    {\bf Dx}, {\bf Dy}, {\bf Dz} must all be independent in order to create an
  3262.  object with positive volume.
  3263.  
  3264.  Example:
  3265.  
  3266. @\begin{verbatim}
  3267.     GB = GBOX(vector(0.0, -0.35, 0.63), vector(0.5, 0.0, 0.5),
  3268.                                         vector(-0.5, 0.0, 0.5),
  3269.                                         vector(0.0, 0.7, 0.0));
  3270. @\end{verbatim}
  3271. @See Figure~\ref{fig-gbox}.
  3272. @\begin{figure}
  3273. @\vspace{2.9in}
  3274. @\special{psfile=user_man/gbox.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
  3275. @\caption{A warped box in a general position can be constructed using the GBOX
  3276. @        constructor.}
  3277. @\label{fig-gbox}
  3278. @\end{figure}
  3279. $
  3280.  
  3281. @\subsubsection{GETLINE}
  3282. !GETLINE
  3283.  
  3284. @\begin{verbatim}
  3285.  AnyType GETLINE( NumericType RequestedType )
  3286. @\end{verbatim}
  3287.  
  3288.    Provides a method to get input from keyboard within functions and
  3289.  or subroutines. {\bf RequestedType} can be one of NUMERIC\_TYPE,
  3290.  POINT\_TYPE, VECTOR\_TYPE, or PLANE\_TYPE in which the entered line
  3291.  will be parsed into one, three, or four numeric values (sperated by
  3292.  either spaces or commas) and the proper object will be created and
  3293.  returned. In any other case, including failure to parse the numeric
  3294.  input, a STRING\_TYPE object will be constructed from the entered line.
  3295.  
  3296.  Example:
  3297.  
  3298. @\begin{verbatim}
  3299.     Pt = GETLINE( point_type );
  3300. @\end{verbatim}
  3301.  
  3302.  to read one point (three numeric values) from stdin.
  3303. $
  3304.  
  3305. @\subsubsection{GPOLYGON}
  3306. !GPOLYGON
  3307.  
  3308. @\begin{verbatim}
  3309.  PolygonType GPOLYGON( GeometryTreeType Object, NumericType Normals )
  3310. @\end{verbatim}
  3311.  
  3312.    Approximates all Surface(s)/Trimmed surface(s)/Trivariate(s) in {\bf Object}
  3313.  with polygons using the RESOLUTION and FLAT4PLY variables. The larger the
  3314.  RESOLUTION is, the finer (more polygons) the resulting approximation will be.
  3315.  
  3316.    FLAT4PLY is a Boolean flag controlling the conversion of an (almost) flat
  3317.  patch into four (TRUE) or two (FALSE) polygons. Normals are computed to
  3318.  polygon vertices using surface normals, so Gouraud or Phong shading can be
  3319.  exploited. It returns a single polygonal object.
  3320.  
  3321.    If {\bf Normals} is set, surface normals will be evaluated at the
  3322.  vertices. Otherwise flat shading and constant normals across polygons are
  3323.  assumed.
  3324.  
  3325.  Example:
  3326.  
  3327. @\begin{verbatim}
  3328.     Polys = GPOLYGON( list( Srf1, Srf2, Srf3 ), off );
  3329. @\end{verbatim}
  3330.  
  3331.  Converts to polygons the three surfaces {\bf Srf1}, {\bf Srf2}, and {\bf Srf3}
  3332.  with no normals.
  3333. $
  3334.  
  3335. @\subsubsection{GPOLYLINE}
  3336. !GPOLYLINE
  3337.  
  3338. @\begin{verbatim}
  3339.  PolylineType GPOLYLINE( GeometryTreeType Object, NumericType Optimal )
  3340. @\end{verbatim}
  3341.  
  3342.    Converts all Curves(s), (Trimmed) Surface(s), and Trivariate(s) {\bf Object}
  3343.  into polylines using the RESOLUTION variable. The larger the RESOLUTION is,
  3344.  the finer the resulting approximation will be. It returns a single polyline
  3345.  object.
  3346.  
  3347.    If {\bf Optimal} is false, the points are sampled at equally spaced
  3348.  interval in the parametric space. If {\bf Optimal} true, a better, more
  3349.  expensive computationally, algorithm is used to derive optimal sampling
  3350.  locations as to minimize the maximal distance between the curve and
  3351.  piecewise linear approximation (L infinity norm).
  3352.  
  3353.  Example:
  3354.  
  3355. @\begin{verbatim}
  3356.     Polys = GPOLYLINE( list( Srf1, Srf2, Srf3, list( Crv1, Crv2, Crv3 ) ),
  3357.                        on );
  3358. @\end{verbatim}
  3359.  
  3360.  converts to polylines the three surfaces {\bf Srf1}, {\bf Srf2}, and {\bf Srf3}
  3361.  and the three curves {\bf Crv1}, {\bf Crv2}, and {\bf Crv3}.
  3362. $
  3363.  
  3364. @\subsubsection{LOFFSET}
  3365. !LOFFSET
  3366.     
  3367. @\begin{verbatim}
  3368.  CurveType LOFFSET( CurveType Crv, NumericType OffsetDistance,
  3369.                     NumericType NumOfSamples, NumericType NumOfDOF,
  3370.                     NumericType Order )
  3371. @\end{verbatim}
  3372.  
  3373.  Approximate an offset of {\bf OffsetDistance} by sampling {\bf NumOfSamples}
  3374.  samples along the offset curve and least square fitting them using a Bspline
  3375.  curve of order {\bf Order} and {\bf NumOfDOF} control points.
  3376.  
  3377.  Example:
  3378.  
  3379. @\begin{verbatim}
  3380.     OffCrv1 = LOFFSET( Crv, -0.4, 100, 10, 4 );
  3381. @\end{verbatim}
  3382.  See also OFFSET and AOFFSET.
  3383. $
  3384.  
  3385. @\subsubsection{MERGPOLY}
  3386. !MERGEPOLY
  3387.  
  3388. @\begin{verbatim}
  3389.  PolygonType MERGEPOLY( ListType PolyList )
  3390. @\end{verbatim}
  3391.  
  3392.  Merges a set of polygonal objects in {\bf PolyList} list to a single polygonal
  3393.  object. All elements in {\bf ObjectList} must be of PolygonType type. This
  3394.  function performs the same operation as the overloaded {\bf \verb+^+} operator
  3395.  would, but might be more convenient to use under some circumstances.
  3396.  
  3397.  Example:
  3398.  
  3399. @\begin{verbatim}
  3400.     Vrtx1 = vector( -3, -2, -1 );
  3401.     Vrtx2 = vector( 3, -2, -1 );
  3402.     Vrtx3 = vector( 3, 2, -1 );
  3403.     Vrtx4 = vector( -3, 2, -1 );
  3404.     Poly1 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false ); 
  3405.     
  3406.     Vrtx1 = vector( -3, 2, 1 );
  3407.     Vrtx2 = vector( 3, 2, 1 );
  3408.     Vrtx3 = vector( 3, -2, 1 );
  3409.     Vrtx4 = vector( -3, -2, 1 );
  3410.     Poly2 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false );
  3411.     
  3412.     Vrtx1 = vector( -3, -2, 1 );
  3413.     Vrtx2 = vector( 3, -2, 1 );
  3414.     Vrtx3 = vector( 3, -2, -1 );
  3415.     Vrtx4 = vector( -3, -2, -1 );
  3416.     Poly3 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false );
  3417.    
  3418.     PolyObj = MERGEPOLY( list( Poly1, Poly2, Poly3 ) );
  3419. @\end{verbatim}
  3420. @See Figure~\ref{fig-mergpoly}.
  3421. @\begin{figure}
  3422. @\vspace{2.6in}
  3423. @\special{psfile=user_man/mergpoly.ps hscale=100 vscale=100 hoffset=-40 voffset=-220}
  3424. @\caption{Individual polygons can be merged into a complete model using MERGEPOLY.}
  3425. @\label{fig-mergpoly}
  3426. @\end{figure}
  3427. $
  3428.  
  3429. @\subsubsection{MOMENT}
  3430. !MOMENT
  3431.     
  3432. @\begin{verbatim}
  3433.  PointType MOMENT( CurveType Crv, 0 );
  3434.  
  3435.  or
  3436.  
  3437.  VectorType MOMENT( CurveType Crv, 1 );
  3438. @\end{verbatim}
  3439.  
  3440.  Approximates the zero and first moment of curve {\bf Crv}.
  3441.  
  3442.  Example:
  3443.  
  3444. @\begin{verbatim}
  3445.     a = circle( vector( 0, 0, 0 ), 1 );
  3446.     a = cregion( a, 0, 1 );
  3447.     p = moment( a, 0 );
  3448.     v = moment( a, 1 );
  3449.     view(list(a, p, v), on);
  3450.  
  3451.     a = cregion( a, 0, 1 ) * rz( 45 );
  3452.     p = moment( a, 0 );
  3453.     v = moment( a, 1 );
  3454.     view(list(a, p, v), on);
  3455. @\end{verbatim}
  3456.  
  3457.  computes and displays the zero and first moment of a quarter of a circle
  3458.  in two orientations.
  3459. $
  3460.  
  3461. @\subsubsection{NIL}
  3462. !NIL
  3463.  
  3464. @\begin{verbatim}
  3465.  ListType NIL()
  3466. @\end{verbatim}
  3467.  
  3468.    Creates an empty list so data can be accumulated in it.
  3469.  See CINFLECT or CZEROS for examples. See also LIST and SNOC.
  3470. $
  3471.  
  3472. @\subsubsection{OFFSET}
  3473. !OFFSET
  3474.  
  3475. @\begin{verbatim}
  3476.  CurveType OFFSET( CurveType Crv, NumericType OffsetDistance,
  3477.                    NumericType Tolerance, NumericType BezInterp )
  3478.  
  3479.  or
  3480.  
  3481.  SurfaceType OFFSET( SurfaceType Srf, NumericType OffsetDistance,
  3482.                      NumericType Tolerance )
  3483. @\end{verbatim}
  3484.  
  3485.  Offsets {\bf Crv} or {\bf Srf}, by translating all the control points in the
  3486.  direction of the normal of the curve or surface by an {\bf OffsetDistance}
  3487.  amount. Each control point has a {\em node} parameter value associated with
  3488.  it, which is used to compute the normal. The returned curve or surface only
  3489.  approximates the real offset. If the resulting approximation does not satisfy
  3490.  the accuracy required by {\bf Tolerance}, {\bf Crv} or {\bf Srf} is subdivided
  3491.  and an offset approximation fit is computed to the two halfs. For curves, one
  3492.  can request a Bezier interpolation scheme in the offset approximation by
  3493.  setting {\bf BezInter}. Negative {\bf OffsetDistance} denotes offset in
  3494.  the reversed direction of the normal.
  3495.  
  3496.  Example:
  3497.  
  3498. @\begin{verbatim}
  3499.     OffCrv = OFFSET( Crv, -0.4, 0.1, off );
  3500. @\end{verbatim}
  3501.  
  3502.  offsets {\bf Crv} by the amount of $-0.4$ in the reversed normal direction,
  3503.  {\bf Tolerance} of 0.1 and no Bezier interpolation.
  3504.  See also AOFFSET and LOFFSET.
  3505. @See Figure~\ref{fig-coffset}.
  3506. @\begin{figure}
  3507. @\vspace{2.5in}
  3508. @\special{psfile=user_man/coffset.ps hscale=100 vscale=100 hoffset=-40 voffset=-190}
  3509. @\caption{Offset approximation (thick) of a Bspline curve (thin) (See also
  3510. @        Figure~\protect\ref{fig-caoffset}.)}
  3511. @\label{fig-coffset}
  3512. @\end{figure}
  3513. $
  3514.  
  3515. @\subsubsection{PCIRCLE}
  3516. !PCIRCLE
  3517.  
  3518. @\begin{verbatim}
  3519.  CurveType PCIRCLE( VectorType Center, NumericType Radius )
  3520. @\end{verbatim}
  3521.  
  3522.  Same as CIRCLE but approximates the circle as a {\em polynomial} curve.
  3523.  See CIRCLE.
  3524. $
  3525.  
  3526. @\subsubsection{PDOMAIN}
  3527. !PDOMAIN
  3528.  
  3529. @\begin{verbatim}
  3530.  ListType PDOMAIN( CurveType Crv )
  3531.  
  3532.  or
  3533.  
  3534.  ListType PDOMAIN( SurfaceType Srf )
  3535.  
  3536.  or
  3537.  
  3538.  ListType PDOMAIN( TrimSrfType TrimSrf )
  3539.  
  3540.  or
  3541.  
  3542.  ListType PDOMAIN( TrivarType TV )
  3543. @\end{verbatim}
  3544.  
  3545.    Returns the parametric domain of the curve (TMin, TMax) or of a (trimmed)
  3546.  surface (UMin, UMax, VMin, VMax) or of a trivariate function
  3547.  (UMin, UMax, VMin, VMax, WMin, WMax) as a list object.
  3548.  
  3549.  Example:
  3550.  
  3551. @\begin{verbatim}
  3552.  circ_domain = PDOMAIN( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  3553. @\end{verbatim}
  3554. $
  3555.  
  3556. @\subsubsection{POLY}
  3557. !POLY
  3558.  
  3559. @\begin{verbatim}
  3560.  PolygonType POLY( ListType VrtxList, NumericType IsPolyline )
  3561. @\end{verbatim}
  3562.  
  3563.    Creates a single polygon/polyline (and therefore open) object, defined by
  3564.  the vertices in {\bf VrtxList} (see LIST). All elements in {\bf VrtxList}
  3565.  must be of VectorType type. If {\bf IsPolyline}, a polyline is created,
  3566.  otherwise a polygon.
  3567.  
  3568.  Example:
  3569.  
  3570. @\begin{verbatim}
  3571.     V1  = vector( 0.0, 0.0, 0.0 );
  3572.     V2  = vector( 0.3, 0.0, 0.0 );
  3573.     V3  = vector( 0.3, 0.0, 0.1 );
  3574.     V4  = vector( 0.2, 0.0, 0.1 );
  3575.     V5  = vector( 0.2, 0.0, 0.5 );
  3576.     V6  = vector( 0.3, 0.0, 0.5 );
  3577.     V7  = vector( 0.3, 0.0, 0.6 );
  3578.     V8  = vector( 0.0, 0.0, 0.6 );
  3579.     V9  = vector( 0.0, 0.0, 0.5 );
  3580.     V10 = vector( 0.1, 0.0, 0.5 );
  3581.     V11 = vector( 0.1, 0.0, 0.1 );
  3582.     V12 = vector( 0.0, 0.0, 0.1 );
  3583.     I = POLY( list( V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12 ),
  3584.               FALSE );
  3585. @\end{verbatim}
  3586.  
  3587.  constructs an object with a single polygon in the shape of the letter I.
  3588. @See Figure~\ref{fig-poly}.
  3589. @\begin{figure}
  3590. @\vspace{1.7in}
  3591. @\special{psfile=user_man/poly.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
  3592. @\caption{Polygons or polylines can be manually constructed using the
  3593. @        POLY constructor.}
  3594. @\label{fig-poly}
  3595. @\end{figure}
  3596. $
  3597.  
  3598. @\subsubsection{PRISA}
  3599. !PRISA
  3600.  
  3601. @\begin{verbatim}
  3602.  ListType PRISA( SurfaceType Srfs, NumericType SamplesPerCurve,
  3603.                  NumericType Epsilon, ConstantType Dir, VectorType Space )
  3604. @\end{verbatim}
  3605.  
  3606.    Computes a layout (prisa) of the given surface(s) {\bf Srfs}, and returns
  3607.  a list of surface objects representing the layout.
  3608.    The surface is approximated to within {\bf Epsilon} in direction {\bf Dir}
  3609.  into a set of ruled surfaces and then developable surfaces that are laid out
  3610.  flat onto the $XY$ plane. If {\bf Epsilon} is negative, the piecewise ruled
  3611.  surface approximation in 3-space is returned. 
  3612.    {\bf SamplesPerCurve} controls the piecewise linear approximation of the
  3613.  boundary of the ruled/developable surfaces. {\bf Space} is a vector whose
  3614.  X component controls the space between the different surfaces' layout, and
  3615.  whose Y component controls the space between different layout pieces.
  3616.  
  3617.  Example:
  3618.  
  3619. @\begin{verbatim}
  3620.  cross = cbspline( 3,
  3621.                    list( ctlpt( E3, 0.7, 0.0, 0. ),
  3622.                          ctlpt( E3, 0.7, 0.0, 0.06 ),
  3623.                          ctlpt( E3, 0.1, 0.0, 0.1 ),
  3624.                          ctlpt( E3, 0.1, 0.0, 0.6 ),
  3625.                          ctlpt( E3, 0.6, 0.0, 0.6 ),
  3626.                          ctlpt( E3, 0.8, 0.0, 0.8 ),
  3627.                          ctlpt( E3, 0.8, 0.0, 1.4 ),
  3628.                          ctlpt( E3, 0.6, 0.0, 1.6 ) ),
  3629.                    list( KV_OPEN ) );
  3630.  wglass = surfrev( cross );
  3631.  wgl_ruled = PRISA( wglass, 6, -0.1, COL, vector( 0, 0.25, 0.0 ) );
  3632.  wgl_prisa = PRISA( wglass, 6, 0.1, COL, vector( 0, 0.25, 0.0 ) );
  3633. @\end{verbatim}
  3634.  
  3635.  Computes a layout of a wine glass in {\bf wgl\_prisa} and a three-dimensional
  3636.  ruled surface approximation of wglass in {\bf wgl\_ruled}.
  3637. @See Figure~\ref{fig-prisa}.
  3638. @\begin{figure}
  3639. @\vspace{2.4in}
  3640. @\special{psfile=user_man/prisa.ps hscale=100 vscale=100 hoffset=-30 voffset=-210}
  3641. @\caption{The layout (prisa in hebrew...) of a freeform surface can be approximated
  3642. @        using the PRISA function.}
  3643. @\label{fig-prisa}
  3644. @\end{figure}
  3645. $
  3646.  
  3647. @\subsubsection{RULEDSRF}
  3648. !RULEDSRF
  3649.  
  3650. @\begin{verbatim}
  3651.  SurfaceType RULEDSRF( CurveType Crv1, CurveType Crv2 )
  3652. @\end{verbatim}
  3653.  
  3654.    Constructs a ruled surface between the two curves {\bf Crv1} and {\bf Crv2}.
  3655.    The curves do not have to have the same order or type, and will be promoted
  3656.  to their least common denominator.
  3657.  
  3658.  Example:
  3659.  
  3660. @\begin{verbatim}
  3661.     Circ = circle( vector( 0.0, 0.0, 0.0 ), 0.25 );
  3662.     Cyl = RULEDSRF( circ, circ * trans( vector( 0.0, 0.0, 1.0 ) ) );
  3663. @\end{verbatim}
  3664.  
  3665.  Constructs a cylinder of radius 0.25 along the Z axis from 0 to 1.
  3666. @See Figure~\ref{fig-ruledsrf}.
  3667. @\begin{figure}
  3668. @\vspace{2in}
  3669. @\special{psfile=user_man/ruledsrf.ps hscale=100 vscale=100 hoffset=-40 voffset=-210}
  3670. @\caption{A cylinder can be cunstructed as a RULEDSRF of two different circles.}
  3671. @\label{fig-ruledsrf}
  3672. @\end{figure}
  3673. $
  3674.  
  3675. @\subsubsection{SBEZIER}
  3676. !SBEZIER
  3677.  
  3678. @\begin{verbatim}
  3679.  SurfaceType SBEZIER( ListType CtlMesh )
  3680. @\end{verbatim}
  3681.  
  3682.    Creates a Bezier surface using the provided control mesh. {\bf CtlMesh} is a
  3683.  list of rows, each of which is a list of control points. All control points
  3684.  must be of type (E1-E5, P1-P5), or regular PointType defining the surface's
  3685.  control polygon. Surface's point type will be of a space which is the union
  3686.  of the spaces of all points.
  3687. @
  3688. @The created surface is the piecewise polynomial (or rational) surface,
  3689. @\begin{equation}
  3690. @     S(u, v) = \sum_{i=0}^m \sum_{j=0}^n P_{ij} B_i(u) B_j(v)
  3691. @\end{equation}
  3692. @where $P_{ij}$ are the control points {\bf CtlMesh}. and $m$ and $n$ are the
  3693. @degrees of the surface, which are one less than the number of points in the
  3694. @appropriate direction.
  3695.  
  3696.  Example:
  3697.  
  3698. @\begin{verbatim}
  3699.    Srf = SBEZIER( list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  3700.                                ctlpt( E3, 0.0, 1.0, 0.0 ),
  3701.                                ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  3702.                          list( ctlpt( E3, 1.0, 0.0, 0.0 ),
  3703.                                ctlpt( E3, 1.0, 1.0, 2.0 ),
  3704.                                ctlpt( E3, 1.0, 2.0, 0.0 ) ),
  3705.                          list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  3706.                                ctlpt( E3, 2.0, 1.0, 0.0 ),
  3707.                                ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  3708.                          list( ctlpt( E3, 3.0, 0.0, 0.0 ),
  3709.                                ctlpt( E3, 3.0, 1.0, 2.0 ),
  3710.                                ctlpt( E3, 3.0, 2.0, 0.0 ) ),
  3711.                          list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  3712.                                ctlpt( E3, 4.0, 1.0, 0.0 ),
  3713.                                ctlpt( E3, 4.0, 2.0, 1.0 ) ) ) );
  3714. @\end{verbatim}
  3715. @See Figure~\ref{fig-surface}.
  3716. @\begin{figure}
  3717. @\vspace{1.5in}
  3718. @\special{psfile=user_man/surface.ps hscale=100 vscale=100 hoffset=-70 voffset=-170}
  3719. @\caption{A bezier surface (left) of degree 3 by 5 and a Bspline surface (right)
  3720. @        of degree 3 by 3 (bi-quadratic). Both share the same control mesh.}
  3721. @\label{fig-surface}
  3722. @\end{figure}
  3723. $
  3724.  
  3725. @\subsubsection{SBSPLINE}
  3726. !SBSPLINE
  3727.  
  3728. @\begin{verbatim}
  3729.  SurfaceType SBSPLINE( NumericType UOrder, NumericType VOrder,
  3730.                        ListType CtlMesh, ListType KnotVectors )
  3731. @\end{verbatim}
  3732.  
  3733.    Creates a Bspline surface from the provided {\bf UOrder} and {\bf VOrder}
  3734.  orders, the control mesh {\bf CtlMesh}, and the two knot vectors {\bf KnotVectors}.
  3735.  {\bf CtlMesh} is a list of rows, each of which is a list of control points.
  3736.  All control points must be of point type (E1-E5, P1-P5), or regular
  3737.  PointType defining the surface's control mesh. Surface's point type will
  3738.  be of a space which is the union of the spaces of all points.
  3739.    {\bf KnotVectors} is a list of two knot vectors. Each knot vector is a
  3740.  list of NumericType knots of length {\bf \#CtlPtList} plus the {\bf Order}.
  3741.  If, however, the length of the knot vector is equal to {\bf \#CtlPtList +
  3742.  Order + Order - 1} the curve is assumed {\em periodic.} 
  3743.    The knot vector may also be a list of a single constant KV\_OPEN or
  3744.  KV\_FLOAT or KV\_PERIODIC, in which a uniform knot vector with the
  3745.  appropriate length and with open, floating or periodic end condition
  3746.  will be constructed automatically.
  3747. @
  3748. @The created surface is the piecewise polynomial (or rational) surface,
  3749. @\begin{equation}
  3750. @     S(u, v) = \sum_{i=0}^m \sum_{j=0}^n P_{ij} B_{i,\chi}(u) B_{j,\xi}(v)
  3751. @\end{equation}
  3752. @where $P_{ij}$ are the control points {\bf CtlMesh}, and $m$ and $n$ are the
  3753. @degrees of the surface, which are one less than {\bf UOrder} and {\bf VOrder}.
  3754. @$\chi$ and $\xi$ are the two knot vectors of the surface.
  3755.  
  3756.  Example:
  3757.  
  3758. @\begin{verbatim}
  3759.     Mesh = list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  3760.                         ctlpt( E3, 0.0, 1.0, 0.0 ),
  3761.                         ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  3762.                   list( ctlpt( E3, 1.0, 0.0, 0.0 ),
  3763.                         ctlpt( E3, 1.0, 1.0, 2.0 ),
  3764.                         ctlpt( E3, 1.0, 2.0, 0.0 ) ),
  3765.                   list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  3766.                         ctlpt( E3, 2.0, 1.0, 0.0 ),
  3767.                         ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  3768.                   list( ctlpt( E3, 3.0, 0.0, 0.0 ),
  3769.                         ctlpt( E3, 3.0, 1.0, 2.0 ),
  3770.                         ctlpt( E3, 3.0, 2.0, 0.0 ) ),
  3771.                   list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  3772.                         ctlpt( E3, 4.0, 1.0, 0.0 ),
  3773.                         ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
  3774.     Srf = SBSPLINE( 3, 3, Mesh, list( list( KV_OPEN ),
  3775.                                       list( 3, 3, 3, 4, 5, 6, 6, 6 ) ) );
  3776. @\end{verbatim}
  3777.  
  3778.  constructs a bi-quadratic Bspline surface with its first knot vector
  3779.  having uniform knot spacing with open end conditions.
  3780. @See Figure~\ref{fig-surface}.
  3781. $
  3782.  
  3783. @\subsubsection{SCRVTR}
  3784. !SCRVTR
  3785.  
  3786. @\begin{verbatim}
  3787.  SurfaceType SCRVTR( SurfaceType Srf, ConstType PtType, ConstType Dir )
  3788. @\end{verbatim}
  3789.  
  3790.    Symbolically computes the extreme curvature bound on {\bf Srf}.
  3791.    If {\bf Dir} is either ROW or COL, then the normal curvature square
  3792.  of {\bf Srf} in {\bf Dir} is computed symbolically and returned.
  3793.    Otherwise, a upper bound on the sum of the squares of the two
  3794.  principal curvatures is symbolically computed and returned.
  3795.    
  3796.    Returned value is a surface that can be evaluated to the curvature
  3797.  bound, given a UV location. The returned surface value is a scalar field
  3798.  of point type P1 (scalar rational).
  3799.    However, if {\bf PtType} is one of E1, P1, E3, P3 the returned surface
  3800.  is coerced to this given type. If the types are one of E3, P3, then the
  3801.  Y and Z axes are set to be equivalent to the U and V parametric domains.
  3802.  
  3803. @   This function computes the square of the normal curvature scalar
  3804. @ field for surfaces as (in the U parametric direction, same for V),
  3805. @\begin{equation}
  3806. @      \kappa_n^u(u, v) = \frac{\inner{n}{\frac{\partial^2 S}{\partial u^2}}}
  3807. @                              {\inner{\frac{\partial S}{\partial u}}
  3808. @                                     {\frac{\partial S}{\partial u}}}
  3809. @\end{equation}
  3810. @ and computes $\xi(u, v) = k_1(u, v)^2 + k_2(u, v)^2$ as the scalar field of
  3811. @\begin{equation}
  3812. @       \xi(u, v) = \frac{(g_{11} l_{22} + l_{11} g_{22} - 2 g_{12}
  3813. @                l_{12}) ^ 2 - 2 \left| G \right| \left| L \right|}
  3814. @               {\left| G \right|^2 \| n \|^2},
  3815. @\end{equation}
  3816. @ where $g_{ij}$ and $l_{ij}$ are the coefficients of the first and second
  3817. @ fundamental forms G and L.
  3818. ^   This function computes the square of the normal curvature scalar
  3819. ^ field for surfaces as (in the U parametric direction, same for V),
  3820. ^                     2  
  3821. ^                    d S
  3822. ^              < n , --- >
  3823. ^                      2
  3824. ^    u               du
  3825. ^   k (u, v) = ------------
  3826. ^    n         
  3827. ^                 dS   ds
  3828. ^               < -- , -- >
  3829. ^                 du   du
  3830. ^
  3831. ^ and computes the sum of the squares of the principal curvatures as,
  3832. ^
  3833. ^  2    2  ( g11 l22 + g22 l11 - 2 g12 l12 )^2 - 2 |G| |L|
  3834. ^ k  + k = -----------------------------------------------
  3835. ^  1    2                   |G|^2 ||n||^2
  3836. ^
  3837.  
  3838.  See also CCRVTR.
  3839.  
  3840.  Example:
  3841.  
  3842. @\begin{verbatim}
  3843.  cross = cbspline( 3,
  3844.                    list( ctlpt( E2,  0.0,  0.0 ),
  3845.                          ctlpt( E2,  0.8,  0.0 ),
  3846.                          ctlpt( E2,  0.8,  0.2 ),
  3847.                          ctlpt( E2,  0.07, 1.4 ),
  3848.                          ctlpt( E2, -0.07, 1.4 ),
  3849.                          ctlpt( E2, -0.8,  0.2 ),
  3850.                          ctlpt( E2, -0.8,  0.0 ),
  3851.                          ctlpt( E2,  0.0,  0.0 ) ),
  3852.                    list( KV_OPEN ) );
  3853.  cross = coerce( cross, e3 );
  3854.  s = sFromCrvs( list( cross,
  3855.                       cross * trans( vector( 0.5, 0, 1 ) ),
  3856.                       cross * trans( vector( 0, 0, 2 ) ) ), 3 );
  3857.  view( list( s, axes ), on );
  3858.  
  3859.  UCrvtrZXY = scrvtr( s, E3, row );
  3860.  VCrvtrZXY = scrvtr( s, E3, col );
  3861.  UCrvtrXYZ = UCrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 0.001 ) );
  3862.  VCrvtrXYZ = VCrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 10 ) );
  3863.  color( UCrvtrXYZ, red );
  3864.  color( VCrvtrXYZ, magenta );
  3865.  
  3866.  view( list( UCrvtrXYZ, VCrvtrXYZ ), off );
  3867.  
  3868.  CrvtrZXY = scrvtr( s, E3, off );
  3869.  CrvtrXYZ = CrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 0.001 ) );
  3870.  color( CrvtrXYZ, green );
  3871.  
  3872.  view( CrvtrXYZ, off );
  3873. @\end{verbatim}
  3874.  
  3875.  Computes the sqaure of the normal curvature in the U and V direction, flips
  3876.  its scalar value from X to Z using rotations and scale the fields to
  3877.  reasonable values and display them.
  3878.    Then, display a total bound on the normal curvature as well.
  3879.  
  3880.  Due to the large degree of the resulting fields be warned that rational
  3881.  surfaces will compute into large degree curvature bound fields. See also
  3882.  IRITSTATE("InterpProd", FALSE); for faster symbolic computation.
  3883. @See Figure~\ref{fig-scrvtr}.
  3884. @\begin{figure}
  3885. @\vspace{2in}
  3886. @\special{psfile=user_man/scrvtr.ps hscale=100 vscale=100 hoffset=-50 voffset=-170}
  3887. @\caption{From left to right: original surface, normal curvature in the U
  3888. @         direction, normal curvature in the V direction, sum of square of
  3889. @         principle curvatures (different scales).
  3890. @         All computed using SCRVTR.}
  3891. @\label{fig-scrvtr}
  3892. @\end{figure}
  3893. $
  3894.  
  3895. @\subsubsection{SDERIVE}
  3896. !SDERIVE
  3897.  
  3898. @\begin{verbatim}
  3899.  SurfaceType SDERIVE( SurfaceType Srf, NumericType Dir )
  3900. @\end{verbatim}
  3901.  
  3902.    Returns a vector field surface representing the differentiated surface
  3903.  in the given direction (ROW or COL). Evaluation of the returned surface at
  3904.  a given parameter value will return a vector {\em tangent} to {\bf Srf} in
  3905.  {\bf Dir} at that parameter value.
  3906.  
  3907. @\begin{verbatim}
  3908.  DuSrf = SDERIVE( Srf, ROW );
  3909.  DvSrf = SDERIVE( Srf, COL );
  3910.  Normal = coerce( seval( DuSrf, 0.5, 0.5 ), VECTOR_TYPE ) ^
  3911.           coerce( seval( DvSrf, 0.5, 0.5 ), VECTOR_TYPE );
  3912. @\end{verbatim}
  3913.  
  3914.  computes the two partial derivatives of the surface {\bf Srf} and computes
  3915.  its normal as their cross product, at the parametric location (0.5, 0.5).
  3916. $
  3917.  
  3918. @\subsubsection{SDIVIDE}
  3919. !SDIVIDE
  3920.  
  3921. @\begin{verbatim}
  3922.  SurfaceType SDIVIDE( SurfaceType Srf, ConstantType Direction,
  3923.                                                           NumericType Param )
  3924. @\end{verbatim}
  3925.  
  3926.    Subdivides a surface into two at the specified parameter value {\bf Param}
  3927.  in the specified {\bf Direction} (ROW or COL). {\bf Srf} can be either a Bspline
  3928.  surface in which {\bf Param} must be conatined in the parametric domain of the
  3929.  surface, or a Bezier surface in which {\bf Param} must be in the range of zero
  3930.  to one.
  3931.  
  3932.    It returns a list of the two sub-surfaces. The individual surfaces may be
  3933.  extracted from the list using the {\bf NTH} command.
  3934.  
  3935.  Example:
  3936.  
  3937. @\begin{verbatim}
  3938.     SrfLst = SDIVIDE( Srf, ROW, 0.5 );
  3939.     Srf1 = nth( SrfLst, 1 );
  3940.     Srf2 = nth( SrfLst, 2 );
  3941. @\end{verbatim}
  3942.  
  3943.  subdivides {\bf Srf} at the parameter value of 0.5 in the ROW direction.
  3944. @See Figure~\ref{fig-sdivide}.
  3945. @\begin{figure}
  3946. @\vspace{2.9in}
  3947. @\special{psfile=user_man/sdivide.ps hscale=80 vscale=80 hoffset=-20 voffset=-130}
  3948. @\caption{A surface can be subdivided into two distinct regions using SDIVIDE.}
  3949. @\label{fig-sdivide}
  3950. @\end{figure}
  3951. $
  3952.  
  3953. @\subsubsection{SEDITPT}
  3954. !SEDITPT
  3955.  
  3956. @\begin{verbatim}
  3957.  SurfaceType SEDITPT( SurfaceType Srf, CtlPtType CPt, NumericType UIndex,
  3958.                                                       NumericType VIndex )
  3959. @\end{verbatim}
  3960.  
  3961.    Provides a simple mechanism to manually modify a single control point number
  3962.  {\bf UIndex} and {\bf VIndex} (base count is 0) in the control mesh of {\bf Srf}
  3963.  by substituting {\bf CtlPt} instead. CtlPt must have the same point type as
  3964.  the control points of {\bf Srf}. Original surface {\bf Srf} is not modified.
  3965.  
  3966.  Example:
  3967.  
  3968. @\begin{verbatim}
  3969.     CPt = ctlpt( E3, 1, 2, 3 );
  3970.     NewSrf = SEDITPT( Srf, CPt, 0, 0 );
  3971. @\end{verbatim}
  3972.  
  3973.  constructs a {\bf NewSrf} with the first control point of {\bf Srf} being
  3974.  {\bf CPt}.
  3975. $
  3976.  
  3977. @\subsubsection{SEVAL}
  3978. !SEVAL
  3979.  
  3980. @\begin{verbatim}
  3981.  CtlPtType SEVAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
  3982. @\end{verbatim}
  3983.  
  3984.    Evaluates the provided surface {\bf Srf} at the given {\bf UParam} and
  3985.  {\bf VParam} values. Both {\bf UParam} and {\bf VParam} should be contained
  3986.  in the surface parametric domain if {\bf Srf} is a Bspline surface, or
  3987.  between zero and one if {\bf Srf} is a Bezier surface. The returned control
  3988.  point has the same type as the control points of {\bf Srf}.
  3989.  
  3990.  Example:
  3991.  
  3992. @\begin{verbatim}
  3993.     CPt = SEVAL( Srf, 0.25, 0.22 );
  3994. @\end{verbatim}
  3995.  
  3996.  evaluates {\bf Srf} at the parameter values of (0.25, 0.22).
  3997. $
  3998.  
  3999. @\subsubsection{SFROMCRVS}
  4000. !SFROMCRVS
  4001.  
  4002. @\begin{verbatim}
  4003.  SurfaceType SFROMCRVS( ListType CrvList, NumericType OtherOrder )
  4004. @\end{verbatim}
  4005.  
  4006.    Constructs a surface by substituting the curves in {\bf CrvList} as rows
  4007.  in a control mesh of a surface. Curves in {\bf CrvList} are made compatible
  4008.  by promoting Bezier curves to Bsplines if necessary, and raising degree
  4009.  and refining as required before substituting the control polygons of the
  4010.  curves as rows in the mesh. The other direction order is set by
  4011.  {\bf OtherOrder}, which cannot be larger than the number of curves.
  4012.  
  4013.    The surface interpolates the first and last curves only.
  4014.  
  4015.  Example:
  4016.  
  4017. @\begin{verbatim}
  4018.     Crv1 = cbspline( 3,
  4019.                      list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  4020.                            ctlpt( E3, 1.0, 0.0, 0.0 ),
  4021.                            ctlpt( E3, 1.0, 1.0, 0.0 ) ),
  4022.                      list( KV_OPEN ) );
  4023.     Crv2 = Crv1 * trans( vector( 0.0, 0.0, 1.0 ) );
  4024.     Crv3 = Crv2 * trans( vector( 0.0, 1.0, 0.0 ) );
  4025.     Srf = SFROMCRVS( list( Crv1, Crv2, Crv3 ), 3 );
  4026. @\end{verbatim}
  4027. @See Figure~\ref{fig-sfromcrvs}.
  4028. @\begin{figure}
  4029. @\vspace{3.2in}
  4030. @\special{psfile=user_man/sfromcrvs.ps hscale=100 vscale=100 hoffset=0 voffset=-85}
  4031. @\caption{A surface can be constructed from a list of curves substituted
  4032. @         as rows into its mesh using SFROMCRVS. The surface does not
  4033. @         necessarily interpolate the curves.}
  4034. @\label{fig-sfromcrvs}
  4035. @\end{figure}
  4036. $
  4037.  
  4038. @\subsubsection{SINTERP}
  4039. !SINTERP
  4040.  
  4041. @\begin{verbatim}
  4042.  SurfaceType SINTERP( ListType PtList, NumericType UOrder, NumericType VOrder,
  4043.                       NumericType USize, NumericType VSize,
  4044.                       ConstantType Param)
  4045. @\end{verbatim}
  4046.  
  4047.    Computes a Bspline polynomial surface that interpolates or approximates
  4048.  the rectangular grid of points in {\bf PtList}. The Bspline surface will
  4049.  have orders {\bf UOrder} and {\bf VOrder} and mesh of size {\bf USize} by
  4050.  {\bf VSize} control points. The knots will be spaced according to
  4051.  {\bf Param} which can be one of PARAM\_UNIFORM, PARAM\_CHORD or
  4052.  PARAM\_CENTRIP. The former prescribed a uniform knot sequence and the
  4053.  latters specified a knot spacing accoridng to the chord length and a square
  4054.  root of the chord length. Currently only PARAM\_UNIFORM is supported.
  4055.    {\bf PtList} is a list of list of points where all lists should carry the
  4056.  same amount of points in them, defining a rectangular grid. All points in
  4057.  {\bf PtList} must be of type (E1-E5, P1-P5) control point, or regular
  4058.  PointType. If {\bf USize} and {\bf VSize} are equal to the number of points
  4059.  in the grid {\bf PtList} the resulting curve will {\em interpolate} the
  4060.  data set. Otherwise, if {\bf USize} or {\bf VSize} is less than the number
  4061.  of points in {\bf PtList} the point data set will be least square
  4062.  approximated. In no time can {\bf USize} or {\bf VSize} be larger that the
  4063.  number of points in {\bf PtList} or lower than {\bf UOrder} and {\bf VOrder},
  4064.  respectively. If {\bf USize} or {\bf VSize} are zero, the grid size
  4065.  is used, forcing an interpolation of the data set.
  4066.  
  4067.    All interior knots will be distinct preserving maximal continuity.
  4068.  The resulting Bspline surface will have open end conditions.
  4069.  
  4070.  Example:
  4071.  
  4072. @\begin{verbatim}
  4073.     pl = nil();
  4074.     pll = nil();
  4075.     for ( x = -5, 1, 5,
  4076.           pl = nil():
  4077.           for ( y = -5, 1, 5,
  4078.                 snoc( point( x, y, sin( x * Pi / 2 ) * cos( y * Pi / 2 ) ),
  4079.                       pl )
  4080.           ):
  4081.           snoc( pl, pll ) );
  4082.  
  4083.     s1 = sinterp( pll, 3, 3, 8, 8, PARAM_UNIFORM );
  4084.     s2 = sinterp( pll, 3, 3, 11, 11, PARAM_UNIFORM );
  4085. @\end{verbatim}
  4086.  
  4087.  Samples an explicit surface sin(x) * cos(y) at a grid of 11 by 11 points,
  4088.  least square fit with a grid of size of 8 by 8 surface {\bf s1}, and
  4089.  interpolate surface {\bf s2} using this data set.
  4090. @See Figure~\ref{fig-sinterp}.
  4091. @\begin{figure}
  4092. @\vspace{1.6in}
  4093. @\special{psfile=user_man/sinterp.ps hscale=95 vscale=95 hoffset=-30 voffset=-130}
  4094. @\caption{A surface least square fitting a data set with insufficient
  4095. @         degrees of freedom (left) and actually interpolating the data
  4096. @         set (right), all using SINTERP.}
  4097. @\label{fig-sinterp}
  4098. @\end{figure}
  4099. $
  4100.  
  4101. @\subsubsection{SMERGE}
  4102. !SMERGE
  4103.  
  4104. @\begin{verbatim}
  4105.  SurfaceType SMERGE( SurfaceType Srf1, SurfaceType Srf2,
  4106.                      NumericType Dir, NumericType SameEdge )
  4107. @\end{verbatim}
  4108.  
  4109.  Merges two surfaces along the requested direction (ROW or COL). If
  4110.  SameEdge is non-zero (ON or TRUE), then the common edge is assumed to be
  4111.  identical and copied only once. Otherwise (OFF or FALSE), a ruled surface
  4112.  is constructed between the two surfaces along the (not) common edge.
  4113.  
  4114.  Example:
  4115.  
  4116. @\begin{verbatim}
  4117.  MergedSrf = SMERGE( Srf1, Srf2, ROW, TRUE );
  4118. @\end{verbatim}
  4119. $
  4120.  
  4121. @\subsubsection{SMORPH}
  4122. !SMORPH
  4123.  
  4124. @\begin{verbatim}
  4125.  SurfaceType SMORPH( SurfaceType Srf1, SurfaceType Srf2, NumericType Blend )
  4126. @\end{verbatim}
  4127.  
  4128.  Creates a new surface which is a {\em convex blend} of the two given surfaces.
  4129.  The two given surfaces must be compatible (see FFCOMPAT) before this blend
  4130.  is invoked. Very useful if a sequence that "morphs" one surface to another
  4131.  is to be created.
  4132.  
  4133.  Example:
  4134.  
  4135. @\begin{verbatim}
  4136.  for ( i = 0.0, 1.0, 11.0,
  4137.         Msrf = SMORPH( Srf1, Srf2, i / 11.0 ):
  4138.         color( Msrf, white ):
  4139.         attrib( Msrf, "rgb", "255,255,255" ):
  4140.         attrib( Msrf, "reflect", "0.7" ):
  4141.         save( "morp1-" + i, Msrf )
  4142.  );
  4143. @\end{verbatim}
  4144.  
  4145.  creates a sequence of 12 surfaces, morphed from {\bf Srf1} to {\bf Srf2}
  4146.  and saves them in the files "morph-0.dat" to "morph-11.dat".
  4147.  See also CMORPH.
  4148. @See Figure~\ref{fig-smorph}.
  4149. @\begin{figure}
  4150. @\vspace{1.2in}
  4151. @\special{psfile=user_man/smorph.ps hscale=100 vscale=100 hoffset=-50 voffset=-150}
  4152. @\caption{A morphing sequence between a bottle and a glass. Snapshots computed
  4153. @        using SMORPH.}
  4154. @\label{fig-smorph}
  4155. @\end{figure}
  4156. $
  4157.  
  4158. @\subsubsection{SNORMAL}
  4159. !SNORMAL
  4160.  
  4161. @\begin{verbatim}
  4162.  VectorType SNORMAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
  4163. @\end{verbatim}
  4164.  
  4165.    Computes the normal vector to {\bf Srf} at the parameter values {\bf UParam}
  4166.  and {\bf VParam}. The returned vector has a unit length.
  4167.  
  4168.  Example:
  4169.  
  4170. @\begin{verbatim}
  4171.     Normal = SNORMAL( Srf, 0.5, 0.5 );
  4172. @\end{verbatim}
  4173.  
  4174.  computes the normal to {\bf Srf} at the parameter values (0.5, 0.5).
  4175.  See also SNRMLSRF.
  4176. $
  4177.  
  4178. @\subsubsection{SNRMLSRF}
  4179. !SNRMLSRF
  4180.  
  4181. @\begin{verbatim}
  4182.  SurfaceType SNRMLSRF( SurfaceType Srf )
  4183. @\end{verbatim}
  4184.  
  4185.  Symbolically computes a vector field surface representing the non-normalized
  4186.  normals of the given surface. That is the normal surface, evaluated at
  4187.  $(u, v)$, provides a vector in the direction of the normal of the original
  4188.  surface at $(u, v)$. The normal surface is computed as the symbolic cross
  4189.  product of the two surfaces representing the partial derivatives of the
  4190.  original surface.
  4191.  
  4192.  Example:
  4193.  
  4194. @\begin{verbatim}
  4195.  NrmlSrf = SNRMLSRF( Srf );
  4196. @\end{verbatim}
  4197. @See Figure~\ref{fig-snrmlsrf}.
  4198. @\begin{figure}
  4199. @\vspace{2.7in}
  4200. @\special{psfile=user_man/snrmlsrf.ps hscale=80 vscale=80 hoffset=10 voffset=-140}
  4201. @\caption{A vector field normal (right) computed for a unit sphere using SNRMLSRF.
  4202. @        The normal field degenerates at the norph and south poles because the
  4203. @        surface is not regular there.}
  4204. @\label{fig-snrmlsrf}
  4205. @\end{figure}
  4206. $
  4207.  
  4208. @\subsubsection{SPHERE}
  4209. !SPHERE
  4210.  
  4211. @\begin{verbatim}
  4212.  PolygonType SPHERE( VectorType Center, NumericType Radius )
  4213. @\end{verbatim}
  4214.  
  4215.    Creates a SPHERE geometric object, defined by {\bf Center} as the center of
  4216.  the SPHERE, and with {\bf Radius} as the radius of the SPHERE.
  4217.    See RESOLUTION for accuracy of SPHERE approximation as a polygonal model. 
  4218. $
  4219.  
  4220. @\subsubsection{SRAISE}
  4221. !SRAISE
  4222.  
  4223. @\begin{verbatim}
  4224.  SurfaceType SRAISE( SurfaceType Srf, ConstantType Direction,
  4225.                                                       NumericType NewOrder )
  4226. @\end{verbatim}
  4227.  
  4228.    Raises {\bf Srf} to the specified {\bf NewOrder} in the specified
  4229.  {\bf Direction}.
  4230.  
  4231.  Example:
  4232.  
  4233. @\begin{verbatim}
  4234.     Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.0 ),
  4235.                                    ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
  4236.                     cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
  4237.                                    ctlpt( E3,  0.5,  0.5, 0.0 ) ) ) );
  4238.     Srf = SRAISE( SRAISE( Srf, ROW, 3 ), COL, 3 );
  4239. @\end{verbatim}
  4240.  
  4241.  constructs a bilinear flat ruled surface and raises both its directions to be
  4242.  a bi-quadratic surface.
  4243. $
  4244.  
  4245. @\subsubsection{SREFINE}
  4246. !SREFINE
  4247.  
  4248. @\begin{verbatim}
  4249.  SurfaceType SREFINE( SurfaceType Srf, ConstantType Direction,
  4250.                       NumericType Replace, ListType KnotList )
  4251. @\end{verbatim}
  4252.  
  4253.    Provides the ability to {\bf Replace} a knot vector of {\bf Srf} or refine 
  4254.  it in the specified direction {\bf Direction} (ROW or COL).
  4255.    {\bf KnotList} is a list of knots to refine {\bf Srf} at. All knots should be
  4256.  contained in the parametric domain of {\bf Srf} in {\bf Direction}. If the knot
  4257.  vector is replaced, the length of {\bf KnotList} should be identical to the
  4258.  length of the original knot vector of {\bf Srf} in {\bf Direction}. If {\bf Srf}
  4259.  is a Bezier surface, it is automatically promoted to be a Bspline surface.
  4260.  
  4261.  Example:
  4262.  
  4263. @\begin{verbatim}
  4264.     Srf = SREFINE( SREFINE( Srf,
  4265.                             ROW, FALSE, list( 0.333, 0.667 ) ),
  4266.                    COL, FALSE, list( 0.333, 0.667 ) );
  4267. @\end{verbatim}
  4268.  
  4269.  refines {\bf Srf} in both directions by adding two more knots at 0.333 and
  4270.  0.667.
  4271. $
  4272.  
  4273. @\subsubsection{SREGION}
  4274. !SREGION
  4275.  
  4276. @\begin{verbatim}
  4277.  SurfaceType SREGION( SurfaceType Srf, ConstantType Direction,
  4278.                                   NumericType MinParam, NumericType MaxParam )
  4279. @\end{verbatim}
  4280.  
  4281.    Extracts a region of {\bf Srf} between {\bf MinParam} and {\bf MaxParam}
  4282.  in the specified {\bf Direction}. Both {\bf MinParam} and {\bf MaxParam}
  4283.  should be contained in the parametric domain of {\bf Srf} in {\bf Direction}.
  4284.  
  4285.  Example:
  4286.  
  4287. @\begin{verbatim}
  4288.     Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.5 ),
  4289.                                    ctlpt( E3,  0.0,  0.5, 0.0 ),
  4290.                                    ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
  4291.                     cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
  4292.                                    ctlpt( E3,  0.0,  0.0, 0.0 ),
  4293.                                    ctlpt( E3,  0.5,  0.5, 0.5 ) ) ) );
  4294.     SubSrf = SREGION( Srf, ROW, 0.3, 0.6 );
  4295. @\end{verbatim}
  4296.  
  4297.  extracts the region of {\bf Srf} from the parameter value 0.3 to the
  4298.  parameter value 0.6 along the ROW direction. the COLumn direction is
  4299.  extracted as a whole.
  4300. @See Figure~\ref{fig-sregion}.
  4301. @\begin{figure}
  4302. @\vspace{2.2in}
  4303. @\special{psfile=user_man/sregion.ps hscale=100 vscale=100 hoffset=-40 voffset=-190}
  4304. @\caption{A region can be extracted from a freeform surface using SREGION.}
  4305. @\label{fig-sregion}
  4306. @\end{figure}
  4307. $
  4308.  
  4309. @\subsubsection{SREPARAM}
  4310. !SREPARAM
  4311.  
  4312. @\begin{verbatim}
  4313.  SurfaceType SREPARAM( SurfaceType Srf, ConstantType Direction,
  4314.                                   NumericType MinParam, NumericType MaxParam )
  4315. @\end{verbatim}
  4316.  
  4317.    Reparametrize {\bf Srf} over a new domain from {\bf MinParam} to {\bf MaxParam},
  4318.  in the prescribed {\bf Direction}. This operation does not affect the geometry
  4319.  of the surface and only affine transforms its knot vectors. A Bezier surface
  4320.  will automatically be promoted into a Bspline surface by this function.
  4321.  
  4322.  Example:
  4323.  
  4324. @\begin{verbatim}
  4325.     srf = sbspline( 2, 4,
  4326.                      list( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  4327.                                  ctlpt( E2, 0.0, 1.0 ),
  4328.                                  ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  4329.                            list( ctlpt( E2, 1.0, 0.0 ),
  4330.                                  ctlpt( E3, 1.0, 1.0, 2.0 ),
  4331.                                  ctlpt( E2, 1.0, 2.0 ) ),
  4332.                            list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  4333.                                  ctlpt( E2, 2.0, 1.0 ),
  4334.                                  ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  4335.                            list( ctlpt( E2, 3.0, 0.0 ),
  4336.                                  ctlpt( E3, 3.0, 1.0, 2.0 ),
  4337.                                  ctlpt( E2, 3.0, 2.0 ) ),
  4338.                            list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  4339.                                  ctlpt( E2, 4.0, 1.0 ),
  4340.                                  ctlpt( E3, 4.0, 2.0, 1.0 ) ) ),
  4341.                      list( list( KV_OPEN ),
  4342.                            list( KV_OPEN ) ) );
  4343.     
  4344.     srf = sreparam( sreparam( srf, ROW, 0, 1 ), COL, 0, 1 );
  4345. @\end{verbatim}
  4346.  
  4347.  Ensures that the Bspline surface is defined over the unit size parametric
  4348.  domain.
  4349. $
  4350.  
  4351. @\subsubsection{STANGENT}
  4352. !STANGENT
  4353.  
  4354. @\begin{verbatim}
  4355.  VectorType STANGENT( SurfaceType Srf, ConstantType Direction,
  4356.                       NumericType UParam, NumericType VParam )
  4357. @\end{verbatim}
  4358.  
  4359.    Computes the tangent vector to {\bf Srf} at the parameter values {\bf UParam}
  4360.  and {\bf VParam} in {\bf Direction}. The returned vector has a unit length.
  4361.  
  4362.  Example:
  4363.  
  4364. @\begin{verbatim}
  4365.     Tang = STANGENT( Srf, ROW, 0.5, 0.6 );
  4366. @\end{verbatim}
  4367.  
  4368.  computes the tangent to {\bf Srf} in the ROW direction at the parameter
  4369.  values (0.5, 0.6).
  4370. $
  4371.  
  4372. @\subsubsection{STRIMSRF}
  4373. !STRIMSRF
  4374.  
  4375. @\begin{verbatim}
  4376.  SurfaceType STRIMSRF( TrimSrfType TSrf )
  4377. @\end{verbatim}
  4378.  
  4379.    Extracts the surface of a trimmed surface {\bf TSrf}.
  4380.  
  4381.  Example:
  4382.  
  4383. @\begin{verbatim}
  4384.     Srf = STRIMSRF( TrimSrf ); 
  4385. @\end{verbatim}
  4386.  
  4387.  extracts the surface of {\bf TrimSrf}.
  4388. $
  4389.  
  4390. @\subsubsection{STRIVAR}
  4391. !STRIVAR
  4392.  
  4393. @\begin{verbatim}
  4394.  SurfaceType STRIVAR( TrivarType TV )
  4395. @\end{verbatim}
  4396.  
  4397.    Extracts an iso surface from a trivariate function {\bf TV}.
  4398.  
  4399.  Example:
  4400.  
  4401. @\begin{verbatim}
  4402.     TV1 = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
  4403.                                      ctlpt( E3, 0.2, 0.1, 2.4 ) ),
  4404.                                list( ctlpt( E3, 0.3, 2.2, 0.2 ),
  4405.                                      ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
  4406.                          list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
  4407.                                      ctlpt( E3, 2.2, 0.7, 2.3 ) ),
  4408.                                list( ctlpt( E3, 2.3, 2.6, 0.5 ),
  4409.                                      ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );
  4410.     Srf = STRIVAR( TV1, col, 0.4 ); 
  4411. @\end{verbatim}
  4412.  
  4413.  extracts an iso surface of {\bf TV1}, in the {\bf col} direction at
  4414.  parameter value 0.4.
  4415. @See Figure~\ref{fig-strivar}.
  4416. @\begin{figure}
  4417. @\vspace{2.5in}
  4418. @\special{psfile=user_man/strivar.ps hscale=100 vscale=100 hoffset=-35 voffset=-170}
  4419. @\caption{Extracts an iso bilinear surface from a trilinear function,
  4420. @    using STRIVAR.}
  4421. @\label{fig-strivar}
  4422. @\end{figure}
  4423. $
  4424.  
  4425. @\subsubsection{SURFPREV}
  4426. !SURFPREV
  4427.  
  4428. @\begin{verbatim}
  4429.  SurfaceType SURFPREV( CurveType Object )
  4430. @\end{verbatim}
  4431.  
  4432.  Same as SURFREV but approximates the surface of revolution as a
  4433.  {\em polynomial} surface. Object must be a polynomial curve.
  4434.  See SURFREV.
  4435. $
  4436.  
  4437. @\subsubsection{SURFREV}
  4438. !SURFREV
  4439.  
  4440. @\begin{verbatim}
  4441.  PolygonType SURFREV( PolygonType Object )
  4442.  
  4443.  or
  4444.  
  4445.  SurfaceType SURFREV( CurveType Object )
  4446. @\end{verbatim}
  4447.  
  4448.    Creates a surface of revolution by rotating the first polygon/curve of the
  4449.  given {\bf Object}, around the Z axis. Use the linear transformation function
  4450.  to position a surface of revolution in a different orientation.
  4451.  
  4452.  Example:
  4453.  
  4454. @\begin{verbatim}
  4455.     VTailAntn = SURFREV( ctlpt( E3, 0.001, 0.0, 1.0 ) +
  4456.                          ctlpt( E3, 0.01,  0.0, 1.0 ) +
  4457.                          ctlpt( E3, 0.01,  0.0, 0.8 ) +
  4458.                          ctlpt( E3, 0.03,  0.0, 0.7 ) +
  4459.                          ctlpt( E3, 0.03,  0.0, 0.3 ) +
  4460.                          ctlpt( E3, 0.001, 0.0, 0.0 ) );
  4461. @\end{verbatim}
  4462.  
  4463.  constructs a piecewise linear Bspline curve in the XZ plane and uses it to
  4464.  construct a surface of revolution by rotating it around the Z axis.
  4465.    See also SURFPREV.
  4466. @See Figure~\ref{fig-surfrev}.
  4467. @\begin{figure}
  4468. @\vspace{2.4in}
  4469. @\special{psfile=user_man/surfrev.ps hscale=100 vscale=100 hoffset=-60 voffset=-140}
  4470. @\caption{A surface of revolution, VTailAntn in surfrev documentation, can be
  4471. @        constructed using SURFREV or SURFPREV.}
  4472. @\label{fig-surfrev}
  4473. @\end{figure}
  4474. $
  4475.  
  4476. @\subsubsection{SWEEPSRF}
  4477. !SWEEPSRF
  4478.  
  4479. @\begin{verbatim}
  4480.  SurfaceType SWEEPSRF( CurveType CrossSection, CurveType Axis,
  4481.                      CurveType FrameCrv | VectorType FrameVec | ConstType OFF )
  4482. @\end{verbatim}
  4483.  
  4484.    Constructs a generalized cylinder surface. This function sweeps a specified
  4485.  cross-section {\bf CrossSection} along the provided {\bf Axis}.
  4486.    By default, when frame specification is {\bf OFF}, the orientation
  4487.  of the cross section is computed using the {\bf Axis} curve tangent and
  4488.  normal. However, unlike the Frenet frame, attempt is made to minimize
  4489.  the normal change, as can happen along inflection points in {\bf Axis}.
  4490.    If a VectorType {\bf FrameVec} is provided as a frame orientation setting,
  4491.  it is used to fix the binormal direction to this value. In other words, the
  4492.  orientation frame has a fixed binormal. If a CurveType {\bf FrameCrv} is
  4493.  specified as a frame orientation setting, this vector field curve is
  4494.  evaluated at each placement of the cross-section to yield the needed binormal.
  4495.  
  4496.    The resulting sweep is only an approximation of the real sweep. The
  4497.  resulting sweep surface will not be exact, in general.
  4498.    Refinement of the axis curve at the proper location, where accuracy is
  4499.  important, should improve the accuracy of the output. The parametric domains
  4500.  of {\bf FrameCrv} do not have to match the parametric domain of {\bf Axis},
  4501.  and its parametric domain is automatically made compatible by this function.
  4502.  
  4503.  Example:
  4504.  
  4505. @\begin{verbatim}
  4506.     Cross = arc( vector( 0.2, 0.0, 0.0 ),
  4507.                  vector( 0.2, 0.2, 0.0 ),
  4508.                  vector( 0.0, 0.2, 0.0 ) ) +
  4509.             arc( vector( 0.0, 0.4, 0.0 ),
  4510.                  vector( 0.1, 0.4, 0.0 ),
  4511.                  vector( 0.1, 0.5, 0.0 ) ) +
  4512.             arc( vector( 0.8, 0.5, 0.0 ),
  4513.                  vector( 0.8, 0.3, 0.0 ),
  4514.                  vector( 1.0, 0.3, 0.0 ) ) +
  4515.             arc( vector( 1.0, 0.1, 0.0 ),
  4516.                  vector( 0.9, 0.1, 0.0 ),
  4517.                  vector( 0.9, 0.0, 0.0 ) ) +
  4518.             ctlpt( E2, 0.2, 0.0 );
  4519.     Axis = arc( vector( -1.0, 0.0, 0.0 ),
  4520.                 vector(  0.0, 0.0, 0.1 ),
  4521.                 vector(  1.0, 0.0, 0.0 ) );
  4522.     Axis = crefine( Axis, FALSE, list( 0.25, 0.5, 0.75 ) );
  4523.     Srf1 = SWEEPSRF( Cross, Axis, OFF );
  4524.     Srf2 = SWEEPSRF( Cross, Axis, vector( 0.0, 1.0, 1.0 ) );
  4525.     Srf3 = SWEEPSRF( Cross, Axis,
  4526.                      cbezier( list( ctlpt( E3,  1.0, 0.0, 0.0 ),
  4527.                                     ctlpt( E3,  0.0, 1.0, 0.0 ),
  4528.                                     ctlpt( E3, -1.0, 0.0, 0.0 ) ) ) );
  4529. @\end{verbatim}
  4530.  
  4531.  constructs a rounded rectangle cross-section and sweeps it along an arc,
  4532.  while orienting it several ways. The axis curve {\bf Axis} is manually
  4533.  refined to better approximate the requested shape.
  4534.  
  4535.  See also SWPSCLSRF for sweep with scale.
  4536. @See Figure~\ref{fig-sweepsrf}.
  4537. @\begin{figure}
  4538. @\vspace{1.4in}
  4539. @\special{psfile=user_man/sweepsrf.ps hscale=100 vscale=100 hoffset=-30 voffset=-210}
  4540. @\caption{Three examples of the use of SWEEPSRF (Srf1, Srf2, Srf3 from left to right
  4541. @        in sweepsrf documentation).}
  4542. @\label{fig-sweepsrf}
  4543. @\end{figure}
  4544. $
  4545.  
  4546. @\subsubsection{SWPSCLSRF}
  4547. !SWPSCLSRF
  4548.  
  4549. @\begin{verbatim}
  4550.  SurfaceType SWPSCLSRF( CurveType CrossSection, CurveType Axis,
  4551.                         NumericType Scale | CurveType ScaleCrv,
  4552.                         CurveType FrameCrv | VectorType FrameVec
  4553.                                                           | ConstType OFF,
  4554.                         NumericType ScaleRefine )
  4555. @\end{verbatim}
  4556.  
  4557.    Constructs a generalized cylinder surface. This function sweeps a specified
  4558.  cross-section {\bf CrossSection} along the provided {\bf Axis}.
  4559.  The cross-section may be scaled by a constant value {\bf Scale}, or scaled
  4560.  along the {\bf Axis} parametric direction via a scaling curve {\bf ScaleCrv}.
  4561.    By default, when frame specification is {\bf OFF}, the orientation
  4562.  of the cross section is computed using the {\bf Axis} curve tangent and
  4563.  normal. However, unlike the Frenet frame, attempt is made to minimize
  4564.  the normal change, as can happen along inflection points in {\bf Axis}.
  4565.    If a VectorType {\bf FrameVec} is provided as a frame orientation setting,
  4566.  it is used to fix the binormal direction to this value. In other words, the
  4567.  orientation frame has a fixed binormal. If a CurveType {\bf FrameCrv} is
  4568.  specified as a frame orientation setting, this vector field curve is
  4569.  evaluated at each placement of the cross-section to yield the needed binormal.
  4570.    {\bf ScaleRefine} is an integer value to define possible refinement of the
  4571.  {\bf Axis} to reflect the information in {\bf ScalingCrv}. Value of zero will
  4572.  force no refinement while value of $n > 0$ will insert $n$ times the
  4573.  number of control points in {\bf ScaleCrv} into {\bf Axis}, better emulating
  4574.  the scaling requested.
  4575.    The resulting sweep is only an approximation of the real sweep. The
  4576.  scaling and axis placement will not be exact, in general.
  4577.    Manual refinement (in addition to {\bf ScaleRefine}) of the axis curve at
  4578.  the proper location, where accuracy is important, should improve the accuracy
  4579.  of the output. The parametric domains of {\bf ScaleCrv} and {\bf FrameCrv} do
  4580.  not have to match the parametric domain of {\bf Axis}, and their domains are
  4581.  made compatible by this function.
  4582.  
  4583.  Example:
  4584.  
  4585. @\begin{verbatim}
  4586.     Cross = arc( vector( -0.11, -0.01, 0.0 ),
  4587.                  vector( -0.1,  -0.1,  0.0 ),
  4588.                  vector( -0.1,  -0.11, 0.0 ) ) +
  4589.             arc( vector(  0.1,  -0.11, 0.0 ),
  4590.                  vector(  0.1,  -0.1,  0.0 ),
  4591.                  vector(  0.11, -0.1,  0.0 ) ) +
  4592.             arc( vector(  0.11,  0.1,  0.0 ),
  4593.                  vector(  0.1,   0.1,  0.0 ),
  4594.                  vector(  0.1,   0.11, 0.0 ) ) +
  4595.             arc( vector( -0.1,   0.11, 0.0 ),
  4596.                  vector( -0.1,   0.1,  0.0 ),
  4597.                  vector( -0.11,  0.1,  0.0 ) ) +
  4598.             ctlpt( E2, -0.11, -0.1 );
  4599.     scaleCrv = cbspline( 3,
  4600.                          list( ctlpt( E2, 0.05, 1.0 ),
  4601.                                ctlpt( E2, 0.1,  0.0 ),
  4602.                                ctlpt( E2, 0.2,  2.0 ),
  4603.                                ctlpt( E2, 0.3,  0.0 ),
  4604.                                ctlpt( E2, 0.4,  2.0 ),
  4605.                                ctlpt( E2, 0.5,  0.0 ),
  4606.                                ctlpt( E2, 0.6,  2.0 ),
  4607.                                ctlpt( E2, 0.7,  0.0 ),
  4608.                                ctlpt( E2, 0.8,  2.0 ),
  4609.                                ctlpt( E2, 0.85, 1.0 ) ),
  4610.                          list( KV_OPEN ) );
  4611.     Axis = circle( vector( 0, 0, 0 ), 1 );
  4612.     Frame = circle( vector( 0, 0, 0 ), 1 )
  4613.             * rotx( 90 ) * trans( vector( 1.5, 0.0, 0.0 ) );
  4614.  
  4615.     Srf1 = SWPSCLSRF( Cross, Axis, scaleCrv, off, 0 );
  4616.     Srf2 = SWPSCLSRF( Cross, Axis, scaleCrv, off, 2 );
  4617.     Srf3 = SWPSCLSRF( Cross, Axis, 1.0, Frame, 0 );
  4618. @\end{verbatim}
  4619.  
  4620.  constructs a rounded rectangle cross-section and sweeps it along a circle,
  4621.  while scaling and orienting in several ways. The axis curve {\bf Axis} is
  4622.  automatically refined in {\bf Srf2} to better approximate the requested
  4623.  scaling.
  4624.  
  4625.  See also SWEEPSRF for sweep with no scale.
  4626. @See Figure~\ref{fig-swpsclsrf}.
  4627. @\begin{figure}
  4628. @\vspace{1.2in}
  4629. @\special{psfile=user_man/swpsclsrf.ps hscale=100 vscale=100 hoffset=-35 voffset=-170}
  4630. @\caption{Three examples of the use of SWPSCLSRF (Srf1, Srf2, Srf3 from left to right
  4631. @        in swpsclsrf documentation).}
  4632. @\label{fig-swpsclsrf}
  4633. @\end{figure}
  4634. $
  4635.  
  4636. @\subsubsection{SYMBPROD}
  4637. !SYMBPROD
  4638.  
  4639. @\begin{verbatim}
  4640.  CurveType SYMBPROD( CurveType Crv1, CurveType Crv2 )
  4641.  
  4642.  or
  4643.  
  4644.  SurfaceType SYMBPROD( SurfaceType Srf1, SurfaceType Srf2 )
  4645. @\end{verbatim}
  4646.  
  4647.  Computes the symbolic product of the given two curves or surfaces as
  4648.  a curve or surface. The product is computed coordinate-wise.
  4649.  
  4650.  Example:
  4651.  
  4652. @\begin{verbatim}
  4653.  ProdSrf = SYMBPROD( Srf1, Srf2 )
  4654. @\end{verbatim}
  4655. $
  4656.  
  4657. @\subsubsection{SYMBDPROD}
  4658. !SYMBDPROD
  4659.  
  4660. @\begin{verbatim}
  4661.  CurveType SYMBDPROD( CurveType Crv1, CurveType Crv2 )
  4662.  
  4663.  or
  4664.  
  4665.  SurfaceType SYMBDPROD( SurfaceType Srf1, SurfaceType Srf2 )
  4666. @\end{verbatim}
  4667.  
  4668.  Computes the symbolic dot (inner) product of the given two curves or surfaces
  4669.  as a {\em scalar} curve or surface.
  4670.  
  4671.  Example:
  4672.  
  4673. @\begin{verbatim}
  4674.  DiffCrv = symbdiff( Crv1, Crv2 )
  4675.  DistSqrCrv = SYMBDPROD( DiffCrv, DiffCrv )
  4676. @\end{verbatim}
  4677.  
  4678.  Computes a scalar curve that at parameter $t$ is equal to the distance
  4679.  square between Crv1 at $t$ and Crv2.
  4680. $
  4681.  
  4682. @\subsubsection{SYMBCPROD}
  4683. !SYMBCPROD
  4684.  
  4685. @\begin{verbatim}
  4686.  CurveType SYMBCPROD( CurveType Crv1, CurveType Crv2 )
  4687.  
  4688.  or
  4689.  
  4690.  SurfaceType SYMBCPROD( SurfaceType Srf1, SurfaceType Srf2 )
  4691. @\end{verbatim}
  4692.  
  4693.  Computes the symbolic cross product of the given two curves or surfaces as
  4694.  a curve or surface.
  4695.  
  4696.  Example:
  4697.  
  4698. @\begin{verbatim}
  4699.  NrmlSrf = SYMBCPROD( sderive( Srf, ROW ), sderive( Srf, COL ) )
  4700. @\end{verbatim}
  4701.  
  4702.  computes a normal surface as the cross product of the surface two partial
  4703.  derivatives (see SNRMLSRF).
  4704. $
  4705.  
  4706. @\subsubsection{SYMBSUM}
  4707. !SYMBSUM
  4708.  
  4709. @\begin{verbatim}
  4710.  CurveType SYMBSUM( CurveType Crv1, CurveType Crv2 )
  4711.  
  4712.  or
  4713.  
  4714.  SurfaceType SYMBSUM( SurfaceType Srf1, SurfaceType Srf2 )
  4715. @\end{verbatim}
  4716.  
  4717.  Computes the symbolic sum of the given two curves or surfaces as
  4718.  a curve or surface. The sum is computed coordinate-wise.
  4719.  
  4720.  Example:
  4721.  
  4722. @\begin{verbatim}
  4723.  SumCrv = SYMBSUM( Crv1, Crv2 )
  4724. @\end{verbatim}
  4725. $
  4726.  
  4727. @\subsubsection{SYMBDIFF}
  4728. !SYMBDIFF
  4729.  
  4730. @\begin{verbatim}
  4731.  CurveType SYMBDIFF( CurveType Crv1, CurveType Crv2 )
  4732.  
  4733.  or
  4734.  
  4735.  SurfaceType SYMBDIFF( SurfaceType Srf1, SurfaceType Srf2 )
  4736. @\end{verbatim}
  4737.  
  4738.  Computes the symbolic difference of the given two curves or surfaces as
  4739.  a curve or surface. The difference is computed coordinate-wise.
  4740.  
  4741.  Example:
  4742.  
  4743. @\begin{verbatim}
  4744.  DiffCrv = SYMBDIFF( Crv1, Crv2 )
  4745.  DistSqrCrv = symbdprod( DiffCrv, DiffCrv )
  4746. @\end{verbatim}
  4747. $
  4748.  
  4749. @\subsubsection{TBEZIER}
  4750. !TBEZIER
  4751.  
  4752. @\begin{verbatim}
  4753.  TrivarType TBEZIER( ListType CtlMesh )
  4754. @\end{verbatim}
  4755.  
  4756.    Creates a Bezier trivariate using the provided control mesh. {\bf CtlMesh}
  4757.  is a list of planes, each of which is a list of rows, each of which is a list
  4758.  of control points. All control points must be of type (E1-E5, P1-P5), or
  4759.  regular PointType defining the trivariate's control mesh. Surface's point
  4760.  type will be of a space which is the union of the spaces of all points.
  4761. @
  4762. @The created trivariate is the piecewise polynomial (or rational) function,
  4763. @\begin{equation}
  4764. @     T(u, v, w) = \sum_{i=0}^m \sum_{j=0}^n \sum_{k=0}^l
  4765. @                        P_{ijk} B_i(u) B_j(v) B_k(w)
  4766. @\end{equation}
  4767. @where $P_{ijk}$ are the control points {\bf CtlMesh}. and $l$, $m$ and $n$
  4768. @are the degrees of the trivariate, which are one less than the number of
  4769. @points in the appropriate direction.
  4770.  
  4771.  Example:
  4772.  
  4773. @\begin{verbatim}
  4774.    TV = TBEZIER( list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  4775.                                    ctlpt( E3, 0.2, 0.5, 1.1 ),
  4776.                                    ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  4777.                              list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  4778.                                    ctlpt( E3, 0.5, 1.7, 1.7 ),
  4779.                                    ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  4780.                              list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  4781.                                    ctlpt( E3, 0.8, 2.6, 1.4 ),
  4782.                                    ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  4783.                        list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  4784.                                    ctlpt( E3, 1.3, 0.2, 1.7 ),
  4785.                                    ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  4786.                              list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  4787.                                    ctlpt( E3, 1.9, 1.4, 1.2 ),
  4788.                                    ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  4789.                              list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  4790.                                    ctlpt( E3, 1.6, 2.5, 1.7 ),
  4791.                                    ctlpt( E3, 1.8, 2.7, 2.5 ) ) ) ) );
  4792. @\end{verbatim}
  4793.  
  4794.  creats a trivariate Bezier which is linear in the first direction, and
  4795.  quadratic in the second and third.
  4796. @See Figure~\ref{fig-tbezier}.
  4797. @\begin{figure}
  4798. @\vspace{3.2in}
  4799. @\special{psfile=user_man/tbezier.ps hscale=100 vscale=100 hoffset=-60 voffset=-100}
  4800. @\caption{A trivariate Bezier of degree 2 by 3 by 3 (left) and a trilinear
  4801. @     Bspline (right). Both share the same control mesh.}
  4802. @\label{fig-tbezier}
  4803. @\end{figure}
  4804. $
  4805.  
  4806. @\subsubsection{TBSPLINE}
  4807. !TBSPLINE
  4808.  
  4809. @\begin{verbatim}
  4810.  TrivarType TBSPLINE( NumericType UOrder,
  4811.                       NumericType VOrder,
  4812.                       NumericType WOrder,
  4813.                       ListType CtlMesh,
  4814.                       ListType KnotVectors )
  4815. @\end{verbatim}
  4816.  
  4817.    Creates a Bspline trivariate with the provided {\bf UOrder}, {\bf VOrder}
  4818.  and {\bf WOrder} orders, the control mesh {\bf CtlMesh}, and the three knot
  4819.  vectors in {\bf KnotVectors}.
  4820.    {\bf CtlMesh} is a list of planes, each of which is a list of rows, each
  4821.  of which is a list of control points. All control points must be of point
  4822.  type (E1-E5, P1-P5), or regular PointType defining the trivariate's control
  4823.  mesh. Trivariate's point type will be of a space which is the union of the
  4824.  spaces of all points.
  4825.    {\bf KnotVectors} is a list of three knot vectors. Each knot vector is a
  4826.  list of NumericType knots of length {\bf \#CtlPtList} plus the {\bf Order}.
  4827.  If, however, the length of the knot vector is equal to {\bf \#CtlPtList +
  4828.  Order + Order - 1} the curve is assumed {\em periodic.} 
  4829.    The knot vector may also be a list of a single constant KV\_OPEN or
  4830.  KV\_FLOAT or KV\_PERIODIC, in which a uniform knot vector with the
  4831.  appropriate length and with open, floating or periodic end condition
  4832.  will be constructed automatically.
  4833. @
  4834. @The created surface is the piecewise polynomial (or rational) surface,
  4835. @\begin{equation}
  4836. @     T(u, v, w) = \sum_{i=0}^m \sum_{j=0}^n \sum_{k=0}^l P_{ijk}
  4837. @                               B_{i,\chi}(u) B_{j,\xi}(v) B_{k,\phi}(w)
  4838. @\end{equation}
  4839. @where $P_{ijk}$ are the control points {\bf CtlMesh}, and $l$, $m$ and $n$
  4840. @are the degrees of the surface, which are one less than {\bf UOrder},
  4841. @{\bf VOrder} and {\bf WOrder} and $\chi$, $\xi$ and $\phi$ are the three
  4842. @knot vectors of the trivariate.
  4843.  
  4844.  Example:
  4845.  
  4846. @\begin{verbatim}
  4847.    TV = TBSPLINE( 2, 2, 2,
  4848.                   list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  4849.                                     ctlpt( E3, 0.2, 0.5, 1.1 ),
  4850.                                     ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  4851.                               list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  4852.                                     ctlpt( E3, 0.5, 1.7, 1.7 ),
  4853.                                     ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  4854.                               list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  4855.                                     ctlpt( E3, 0.8, 2.6, 1.4 ),
  4856.                                     ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  4857.                         list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  4858.                                     ctlpt( E3, 1.3, 0.2, 1.7 ),
  4859.                                     ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  4860.                               list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  4861.                                     ctlpt( E3, 1.9, 1.4, 1.2 ),
  4862.                                     ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  4863.                               list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  4864.                                     ctlpt( E3, 1.6, 2.5, 1.7 ),
  4865.                                     ctlpt( E3, 1.8, 2.7, 2.5 ) ) ) ),
  4866.                   list( list( KV_OPEN ),
  4867.                         list( KV_OPEN ),
  4868.                         list( KV_OPEN ) ) );
  4869. @\end{verbatim}
  4870.  
  4871.  constructs a trilinear Bspline trivariate with open end conditions.
  4872. @See Figure~\ref{fig-tbezier}.
  4873. $
  4874.  
  4875. @\subsubsection{TDERIVE}
  4876. !TDERIVE
  4877.  
  4878. @\begin{verbatim}
  4879.  TrivarType TDERIVE( TrivarType TV, NumericType Dir )
  4880. @\end{verbatim}
  4881.  
  4882.    Returns a vector field trivariate representing the differentiated 
  4883.  trivariate in the given direction (ROW, COL, or DEPTH). Evaluation of the
  4884.  returned trivariate at a given parameter value will return a vector
  4885.  representing the partial derivative of {\bf TV} in {\bf Dir} at that
  4886.  parameter value.
  4887.  
  4888. @\begin{verbatim}
  4889.  TV = tbezier( list( list( list( ctlpt( E1, 0.1 ),
  4890.                                  ctlpt( E1, 0.2 ) ),
  4891.                            list( ctlpt( E1, 0.3 ),
  4892.                                  ctlpt( E1, 0.4 ) ) ),
  4893.                      list( list( ctlpt( E1, 2.4 ),
  4894.                                  ctlpt( E1, 2.2 ) ),
  4895.                            list( ctlpt( E1, 2.3 ),
  4896.                                  ctlpt( E1, 2.1 ) ) ) ) );
  4897.  
  4898.  DuTV = TDERIVE( TV, ROW );
  4899.  DvTV = TDERIVE( TV, COL );
  4900.  DwTV = TDERIVE( TV, DEPTH );
  4901. @\end{verbatim}
  4902.  
  4903.  computes the gradiate of a scalar trivariate field, by computing its
  4904.  partials with respect to u, v, and w.
  4905. $
  4906.  
  4907. @\subsubsection{TDIVIDE}
  4908. !TDIVIDE
  4909.  
  4910. @\begin{verbatim}
  4911.  TrivarType TDIVIDE( TrivarType TV, ConstantType Direction,
  4912.                                                           NumericType Param )
  4913. @\end{verbatim}
  4914.  
  4915.    Subdivides a trivariate into two at the specified parameter value {\bf Param}
  4916.  in the specified {\bf Direction} (ROW, COL, or DEPTH). {\bf TV} can be either
  4917.  a Bspline trivairate in which {\bf Param} must be conatined in the parametric
  4918.  domain of the trivariate, or a Bezier trivariate in which {\bf Param} must be
  4919.  in the range of zero to one.
  4920.  
  4921.    It returns a list of the two sub-trivariates. The individual trivariates
  4922.  may be extracted from the list using the {\bf NTH} command.
  4923.  
  4924.  Example:
  4925.  
  4926. @\begin{verbatim}
  4927.     TvDiv = TDIVIDE( Tv2, depth, 0.3 );
  4928.     Tv2a = nth( TvDiv, 1 ) * tx( -2.2 );
  4929.     Tv2b = nth( TvDiv, 2 ) * tx( 2.0 );
  4930. @\end{verbatim}
  4931.  
  4932.  subdivides {\bf Tv2} at the parameter value of 0.3 in the DEPTH direction,
  4933. @See Figure~\ref{fig-tdivide}.
  4934. @\begin{figure}
  4935. @\vspace{2.6in}
  4936. @\special{psfile=user_man/tdivide.ps hscale=110 vscale=110 hoffset=-60 voffset=-135}
  4937. @\caption{A trivariate can be subdivided into two distinct regions using TDIVIDE.}
  4938. @\label{fig-tdivide}
  4939. @\end{figure}
  4940. $
  4941.  
  4942. @\subsubsection{TEVAL}
  4943. !TEVAL
  4944.  
  4945. @\begin{verbatim}
  4946.  CtlPtType TEVAL( TrivarType TV,
  4947.                   NumericType UParam,
  4948.                   NumericType VParam,
  4949.                   NumericType WParam )
  4950. @\end{verbatim}
  4951.  
  4952.    Evaluates the provided trivariate {\bf TV} at the given {\bf UParam},
  4953.  {\bf VParam}  and {\bf WParam} values. {\bf UParam}, {\bf VParam},
  4954.  {\bf WParam} must be contained in the surface parametric domain if {\bf TV}
  4955.  is a Bspline surface, or between zero and one if {\bf TV} is a Bezier
  4956.  trivariate. The returned control point has the same type as the control
  4957.  points of {\bf TV}.
  4958.  
  4959.  Example:
  4960.  
  4961. @\begin{verbatim}
  4962.     CPt = TEVAL( TV1, 0.25, 0.22, 0.7 );
  4963. @\end{verbatim}
  4964.  
  4965.  evaluates {\bf TV} at the parameter values of (0.25, 0.22, 0.7).
  4966. $
  4967.  
  4968. @\subsubsection{TINTERP}
  4969. !TINTERP
  4970.  
  4971. @\begin{verbatim}
  4972.  TrivarType TINTERP( TrivarType TV );
  4973. @\end{verbatim}
  4974.  
  4975.    Given a trivariate data structure, computes a new trivariate in the
  4976.  same function space (i.e. same knot sequences and orders) that interpolates
  4977.  the given triavriate, {\bf TV}, at the node parameter values.
  4978.  
  4979.  Example:
  4980.  
  4981. @\begin{verbatim}
  4982.      tv = tbspline( 3, 3, 2,
  4983.                     list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  4984.                                       ctlpt( E3, 0.2, 0.5, 1.1 ),
  4985.                                       ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  4986.                                 list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  4987.                                       ctlpt( E3, 0.5, 1.7, 1.7 ),
  4988.                                       ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  4989.                                 list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  4990.                                       ctlpt( E3, 0.8, 2.6, 1.4 ),
  4991.                                       ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  4992.                           list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  4993.                                       ctlpt( E3, 1.3, 0.2, 1.7 ),
  4994.                                       ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  4995.                                 list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  4996.                                       ctlpt( E3, 1.9, 1.4, 1.2 ),
  4997.                                       ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  4998.                                 list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  4999.                                       ctlpt( E3, 1.6, 2.5, 1.7 ),
  5000.                                       ctlpt( E3, 1.8, 2.7, 2.5 ) ) ),
  5001.                           list( list( ctlpt( E3, 2.8, 0.1, 0.4 ),
  5002.                                       ctlpt( E3, 2.6, 0.7, 1.3 ),
  5003.                                       ctlpt( E3, 2.4, 0.2, 2.2 ) ),
  5004.                                 list( ctlpt( E3, 2.2, 1.1, 0.4 ),
  5005.                                       ctlpt( E3, 2.9, 1.2, 1.5 ),
  5006.                                       ctlpt( E3, 2.7, 1.3, 2.6 ) ),
  5007.                                 list( ctlpt( E3, 2.5, 2.9, 0.7 ),
  5008.                                       ctlpt( E3, 2.3, 2.8, 1.7 ),
  5009.                                       ctlpt( E3, 2.1, 2.7, 2.7 ) ) ) ),
  5010.                     list( list( KV_OPEN ),
  5011.                           list( KV_OPEN ),
  5012.                           list( KV_OPEN ) ) );
  5013.     tvi = TINTERP( tv );
  5014. @\end{verbatim}
  5015.  
  5016.  creates a quadratic by quaratic by linear trivairatiate {\bf tvi} that
  5017.  interpolates the control points of {\bf tv} at the node parameter values.
  5018. $
  5019.  
  5020. @\subsubsection{TORUS}
  5021. !TORUS
  5022.  
  5023. @\begin{verbatim}
  5024.  PolygonType TORUS( VectorType Center, VectorType Normal,
  5025.                     NumericType MRadius, NumericType mRadius )
  5026. @\end{verbatim}
  5027.  
  5028.    Creates a TORUS geometric object, defined by {\bf Center} as the center
  5029.  of the TORUS, {\bf Normal} as the normal to the main plane of the TORUS,
  5030.  {\bf MRadius} and {\bf mRadius} as the major and minor radii of the TORUS.
  5031.    See RESOLUTION for the accuracy of the TORUS approximation as a polygonal
  5032.  model. 
  5033.  
  5034.  Example:
  5035.  
  5036. @\begin{verbatim}
  5037.     T = TORUS( vector( 0.0, 0.0, 0.0), vector( 0.0, 0.0, 1.0), 0.5, 0.2 );
  5038. @\end{verbatim}
  5039.  
  5040.  constructs a torus with major plane as the $XY$ plane, major radius of 0.5,
  5041.  and minor radius of 0.2.
  5042. @See Figure~\ref{fig-torus}.
  5043. @\begin{figure}
  5044. @\vspace{2.2in}
  5045. @\special{psfile=user_man/torus.ps hscale=100 vscale=100 hoffset=-40 voffset=-140}
  5046. @\caption{A torus primitive can be constructed using a TORUS constructor...}
  5047. @\label{fig-torus}
  5048. @\end{figure}
  5049. $
  5050.  
  5051. @\subsubsection{TREFINE}
  5052. !TREFINE
  5053.  
  5054. @\begin{verbatim}
  5055.  TrivarType TREFINE( TrivarType TV, ConstantType Direction,
  5056.                      NumericType Replace, ListType KnotList )
  5057. @\end{verbatim}
  5058.  
  5059.    Provides the ability to {\bf Replace} a knot vector of {\bf TV} or refine 
  5060.  it in the specified direction {\bf Direction} (ROW, COL, or DEPTH).
  5061.    {\bf KnotList} is a list of knots to refine {\bf TV} at. All knots should be
  5062.  contained in the parametric domain of {\bf TV} in {\bf Direction}. If the knot
  5063.  vector is replaced, the length of {\bf KnotList} should be identical to the
  5064.  length of the original knot vector of {\bf TV} in {\bf Direction}. If {\bf TV}
  5065.  is a Bezier trivariate, it is automatically promoted to be a Bspline
  5066.  trivariate.
  5067.  
  5068.  Example:
  5069.  
  5070. @\begin{verbatim}
  5071.     TV = TREFINE( TREFINE( TREFINE( TV,
  5072.                                     ROW, FALSE, list( 0.333, 0.667 ) ),
  5073.                            COL, FALSE, list( 0.333, 0.667 ) ),
  5074.                   DEPTH, FALSE, list( 0.333, 0.667 ) );
  5075. @\end{verbatim}
  5076.  
  5077.  refines {\bf TV} in all directions by adding two more knots at 0.333 and
  5078.  0.667.
  5079. $
  5080.  
  5081. @\subsubsection{TREGION}
  5082. !TREGION
  5083.  
  5084. @\begin{verbatim}
  5085.  TrivarType TREGION( TrivarType Srf, ConstantType Direction,
  5086.                      NumericType MinParam, NumericType MaxParam )
  5087. @\end{verbatim}
  5088.  
  5089.    Extracts a region of {\bf TV} between {\bf MinParam} and {\bf MaxParam}
  5090.  in the specified {\bf Direction}. Both {\bf MinParam} and {\bf MaxParam}
  5091.  should be contained in the parametric domain of {\bf TV} in {\bf Direction}.
  5092.  
  5093.  Example:
  5094.  
  5095. @\begin{verbatim}
  5096.     Tv1 = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
  5097.                                      ctlpt( E3, 0.2, 0.1, 2.4 ) ),
  5098.                                list( ctlpt( E3, 0.3, 2.2, 0.2 ),
  5099.                                      ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
  5100.                          list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
  5101.                                      ctlpt( E3, 2.2, 0.7, 2.3 ) ),
  5102.                                list( ctlpt( E3, 2.3, 2.6, 0.5 ),
  5103.                                      ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );
  5104.  
  5105.     Tv1r1 = TREGION( Tv1, row, 0.1, 0.2 );
  5106.     Tv1r2 = TREGION( Tv1, row, 0.4, 0.6 );
  5107.     Tv1r3 = TREGION( Tv1, row, 0.99, 1.0 );
  5108. @\end{verbatim}
  5109.  
  5110.  extracts three regions of {\bf Tv1} along the ROW direction.
  5111. @See Figure~\ref{fig-tregion}.
  5112. @\begin{figure}
  5113. @\vspace{3.3in}
  5114. @\special{psfile=user_man/tregion.ps hscale=100 vscale=100 hoffset=-40 voffset=-110}
  5115. @\caption{A region can be extracted from a freeform trivariate using TREGION.}
  5116. @\label{fig-tregion}
  5117. @\end{figure}
  5118. $
  5119.  
  5120. @\subsubsection{TRIMSRF}
  5121. !TRIMSRF
  5122.  
  5123. @\begin{verbatim}
  5124.  TrimSrfType TRIMSRF( SurfaceType Srf,
  5125.                       CurveType TrimCrv,
  5126.                       NumericType UpperLevel )
  5127.  
  5128.  or
  5129.  
  5130.  TrimSrfType TRIMSRF( SurfaceType Srf,
  5131.                       ListType TrimCrvs,
  5132.                       NumericType UpperLevel )
  5133. @\end{verbatim}
  5134.  
  5135.    Creates a trimmed surface from the provided surface {\bf Srf} and the
  5136.  trimming curve {\bf TrimCrv} or curves {\bf TrimCrvs}. If {\bf UpperLevel},
  5137.  an additional trimming curve is automatically being added that contains the
  5138.  entire parametric domain of {\bf Srf}. No validity test is performed on the
  5139.  trimming curves which are assumed two dimensional curves contained in
  5140.  the parametric domain of {\bf Srf}.
  5141.  
  5142.  Example:
  5143.  
  5144. @\begin{verbatim}
  5145.     spts = list( list( ctlpt( E3, 0.1, 0.0, 1.0 ),
  5146.                        ctlpt( E3, 0.3, 1.0, 0.0 ),
  5147.                        ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  5148.                  list( ctlpt( E3, 1.1, 0.0, 0.0 ),
  5149.                        ctlpt( E3, 1.3, 1.5, 2.0 ),
  5150.                        ctlpt( E3, 1.0, 2.1, 0.0 ) ),
  5151.                  list( ctlpt( E3, 2.1, 0.0, 2.0 ),
  5152.                        ctlpt( E3, 2.3, 1.0, 0.0 ),
  5153.                        ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  5154.                  list( ctlpt( E3, 3.1, 0.0, 0.0 ),
  5155.                        ctlpt( E3, 3.3, 1.5, 2.0 ),
  5156.                        ctlpt( E3, 3.0, 2.1, 0.0 ) ),
  5157.                  list( ctlpt( E3, 4.1, 0.0, 1.0 ),
  5158.                        ctlpt( E3, 4.3, 1.0, 0.0 ),
  5159.                        ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
  5160.     sb = sbspline( 3, 3, spts, list( list( KV_OPEN ), list( KV_OPEN ) ) );
  5161.     
  5162.     TCrv1 = cbspline( 2,
  5163.                       list( ctlpt( E2, 0.3, 0.3 ),
  5164.                             ctlpt( E2, 0.7, 0.3 ),
  5165.                             ctlpt( E2, 0.7, 0.7 ),
  5166.                             ctlpt( E2, 0.3, 0.7 ),
  5167.                             ctlpt( E2, 0.3, 0.3 ) ),
  5168.                       list( KV_OPEN ) );
  5169.     TCrv2 = circle( vector( 0.5, 0.5, 0.0 ), 0.25 );
  5170.     TCrv3 = cbspline( 3,
  5171.                       list( ctlpt( E2, 0.3, 0.3 ),
  5172.                             ctlpt( E2, 0.7, 0.3 ),
  5173.                             ctlpt( E2, 0.7, 0.7 ),
  5174.                             ctlpt( E2, 0.3, 0.7 ) ),
  5175.                       list( KV_PERIODIC ) );
  5176.     
  5177.     TSrf1 = TRIMSRF( sb, TCrv1, false );
  5178.     TSrf2 = TRIMSRF( sb, TCrv1, true );
  5179.     TSrf3 = TRIMSRF( sb, list( TCrv1, TcRv2 * ty( 1 ), TCrv3 * ty( 2 ) ),
  5180.                       false );
  5181. @\end{verbatim}
  5182.  
  5183.  constructs three trimmed surfaces. {\bf Tsrf1} contains the out boundary
  5184.  and excludes what is inside {\bf TCrv1}, {\bf TSrf2} contains only the
  5185.  domain inside {\bf TCrv1}. {\bf TCrv3} has three holes corresponds to the
  5186.  three trimming curves.
  5187. @See Figure~\ref{fig-trimsrf}.
  5188. @\begin{figure}
  5189. @\vspace{3.3in}
  5190. @\special{psfile=user_man/trimsrf.ps hscale=100 vscale=100 hoffset=-40 voffset=-140}
  5191. @\caption{Three trimmed surfaces created from the same Bspline surface. In
  5192. @    thin lines is the original surface while in thick lines are the trimmed
  5193. @    surfaces.}
  5194. @\label{fig-trimsrf}
  5195. @\end{figure}
  5196. $
  5197.  
  5198. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5199.  
  5200. @\subsection{Object transformation functions}
  5201. &Object transformation functions
  5202.  
  5203.  All the routines in this section construct a 4 by 4 homogeneous
  5204.  transformation matrix representing the required transform. These matrices
  5205.  may be concatenated to achieve more complex transforms using the matrix
  5206.  multiplication operator $*$. For example, the expression
  5207.  
  5208. @\begin{verbatim}
  5209.     m = trans( vector( -1, 0, 0 ) ) * rotx( 45 ) * trans( vector( 1, 0, 0 ) );
  5210. @\end{verbatim}
  5211.  
  5212.  constructs a transform to rotate an object around the X = 1 line, 45 degrees.
  5213.  A matrix representing the inverse transformation can be computed as:
  5214. @\begin{verbatim}
  5215.     InvM = m ^ -1
  5216. @\end{verbatim}
  5217.  See also overloading of the - operator.
  5218. $
  5219.  
  5220. @\subsubsection{HOMOMAT}
  5221. !HOMOMAT
  5222.  
  5223. @\begin{verbatim}
  5224.  MatrixType HOMOMAT( ListType MatData )
  5225. @\end{verbatim}
  5226.  
  5227.    Creates an arbitrary homogeneous transformation matrix by manually providing
  5228.  its 16 coefficients.
  5229.  Example:
  5230.  
  5231. @\begin{verbatim}
  5232.  for ( a = 1, 1, 720 / step,
  5233.        view_mat = save_mat *
  5234.                   HOMOMAT( list( list( 1, 0, 0, 0 ),
  5235.                                  list( 0, 1, 0, 0 ),
  5236.                                  list( 0, 0, 1, -a * step / 500 ),
  5237.                                  list( 0, 0, 0, 1 ) ) ):
  5238.        view(list(view_mat, b, axes), on)
  5239.  );
  5240. @\end{verbatim}
  5241.  
  5242.  looping and viewing through a sequence of perspective transforms, created
  5243.  using the HOMOMAT constructor.
  5244. $
  5245.  
  5246. @\subsubsection{ROTX}
  5247. !ROTX
  5248.  
  5249. @\begin{verbatim}
  5250.  MatrixType ROTX( NumericType Angle )
  5251. @\end{verbatim}
  5252.  
  5253.    Creates a rotation around the X transformation matrix with {\bf Angle} degrees.
  5254. $
  5255.  
  5256. @\subsubsection{ROTY}
  5257. !ROTY
  5258.  
  5259. @\begin{verbatim}
  5260.  MatrixType ROTY( NumericType Angle )
  5261. @\end{verbatim}
  5262.  
  5263.    Creates a rotation around te Y transformation matrix with {\bf Angle} degrees.
  5264. $
  5265.  
  5266. @\subsubsection{ROTZ}
  5267. !ROTZ
  5268.  
  5269. @\begin{verbatim}
  5270.  MatrixType ROTZ( NumericType Angle )
  5271. @\end{verbatim}
  5272.  
  5273.    Creates a rotation around the Z transformation matrix with {\bf Angle} degrees.
  5274. $
  5275.  
  5276. @\subsubsection{SCALE}
  5277. !SCALE
  5278.  
  5279. @\begin{verbatim}
  5280.  MatrixType SCALE( VectorType ScaleFactors )
  5281. @\end{verbatim}
  5282.  
  5283.    Creates a scaling by the {\bf ScaleFactors} transformation matrix.
  5284. $
  5285.  
  5286. @\subsubsection{TRANS}
  5287. !TRANS
  5288.  
  5289. @\begin{verbatim}
  5290.  MatrixType TRANS( VectorType TransFactors )
  5291. @\end{verbatim}
  5292.  
  5293.    Creates a translation by the {\bf TransFactors} transformation matrix.
  5294. $
  5295.  
  5296. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5297. @\subsection{General purpose functions}
  5298. &General purpose functions  
  5299.  
  5300. @\subsubsection{ATTRIB}
  5301. !ATTRIB
  5302.  
  5303. @\begin{verbatim}
  5304.  ATTRIB( AnyType Object, StringType Name, AnyType Value )
  5305. @\end{verbatim}
  5306.  
  5307.    Provides a mechanism to add an attribute of any type to an {\bf Object},
  5308.  with name {\bf Name} and value {\bf Value}. This ATTRIB function is tuned
  5309.  and optimized toward numeric values or strings as {\bf Value} although any
  5310.  other object type can be saved as attribue.
  5311.  
  5312.    These attributes may be used to pass information to other programs about
  5313.  this object, and are saved with the objects in data files. For example,
  5314.  
  5315. @\begin{verbatim}
  5316.     ATTRIB(Glass, "rgb", "255,0,0");
  5317.     ATTRIB(Glass, "refract", 1.4);
  5318.         .
  5319.         .
  5320.         .
  5321.     RMATTR(Glass, "rgb");   # Removes "rgb" attribute.
  5322. @\end{verbatim}
  5323.  
  5324.  sets the RGB color and refraction index of the {\bf Glass} object and
  5325.  later removes the RGB attribute.
  5326.  
  5327.    Attribute names are case insensitive. Spaces are allowed in the {\bf Value}
  5328.  string, as well as the double quote itself, although the latter must be
  5329.  escaped:
  5330.  
  5331. @\begin{verbatim}
  5332.     ATTRIB(Glass, "text", "Say \"this is me\"");
  5333. @\end{verbatim}
  5334.  
  5335.    See also RMATTR for removal of attributes.
  5336. $
  5337.  
  5338. @\subsubsection{CHDIR}
  5339. !CHDIR
  5340.  
  5341. @\begin{verbatim}
  5342.  CHDIR( StringType NewDir )
  5343. @\end{verbatim}
  5344.  
  5345.    Sets the current working directory to be {\bf NewDir}.
  5346. $
  5347.  
  5348. @\subsubsection{CLNTCLOSE}
  5349. !CLNTCLOSE
  5350.  
  5351. @\begin{verbatim}
  5352.  CLNTCLOSE( NumericType Handler, NumericType Kill )
  5353. @\end{verbatim}
  5354.  
  5355.    Closes a communication channel to a client. {\bf Handler} contains the
  5356.  index of the communication channel opened via CLNTEXEC. If {\bf Kill}, the
  5357.  client is send an  exit request for it to die. Otherwise, the communication
  5358.  is closed and the client is running stand alone.  See also CLNTREAD,
  5359.  CLNTWRITE, and CLNTEXEC.
  5360.  
  5361.  Example:
  5362.  
  5363. @\begin{verbatim}
  5364.    h2 = clntexec( "nuldrvs -s-" );
  5365.        .
  5366.        .
  5367.        .
  5368.  
  5369.    CLNTCLOSE( h2,TRUE );
  5370. @\end{verbatim}
  5371.  
  5372.  closes the connection to the nuldrvs client, opened via CLNTEXEC.
  5373. $
  5374.  
  5375. @\subsubsection{CLNTWRITE}
  5376. !CLNTWRITE
  5377.  
  5378. @\begin{verbatim}
  5379.  CLNTWRITE( NumericType Handler, AnyType Object )
  5380. @\end{verbatim}
  5381.  
  5382.    Writes one object {\bf Object} to a communication channel of a client.
  5383.  {\bf Handler} contains the index of the communication channel opened via
  5384.  CLNTEXEC.  See also CLNTREAD, CLNTCLOSE, and CLNTEXEC.
  5385.  
  5386.  Example:
  5387.  
  5388. @\begin{verbatim}
  5389.    h2 = clntexec( "nuldrvs -s-" );
  5390.        .
  5391.        .
  5392.  
  5393.    CLNTWRITE( h2, Model );
  5394.        .
  5395.        .
  5396.  
  5397.    clntclose( h2,TRUE );
  5398. @\end{verbatim}
  5399.  
  5400.  writes the object named Model to client through communication channel h2.
  5401. $
  5402.  
  5403. @\subsubsection{COLOR}
  5404. !COLOR
  5405.  
  5406. @\begin{verbatim}
  5407.  COLOR( GeometricType Object, NumericType Color )
  5408. @\end{verbatim}
  5409.  
  5410.    Sets the color of the object to one of those specified below. Note that an
  5411.  object has a default color (see IRIT.CFG file) according to its origin -
  5412.  loaded with the LOAD command, PRIMITIVE, or BOOLEAN operation result.
  5413.    The system internally supports colors (although you may have a B\&W system)
  5414.  and the colors recognized are:
  5415.  {\bf BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, and WHITE}.
  5416.  
  5417.    See the ATTRIB command for more fine control of colors using the RGB
  5418.  attribute. 
  5419. $
  5420.  
  5421. @\subsubsection{COMMENT}
  5422. !COMMENT
  5423.  
  5424. @\begin{verbatim}
  5425.  COMMENT
  5426. @\end{verbatim}
  5427.  
  5428.  Two types of comments are allowed:
  5429.  
  5430.  1. One-line comment: starts anywhere in a line at the '\#' character, up to
  5431.     the end of the line.
  5432.  
  5433.  2. Block comment: starts at the COMMENT keyword followed by a unique
  5434.     character (anything but white space), up to the second occurrence of that
  5435.     character. This is a fast way to comment out large blocks.
  5436.  
  5437.  Example:
  5438.  
  5439. @\begin{verbatim}
  5440.     COMMENT $
  5441.       This is a comment
  5442.     $
  5443. @\end{verbatim}
  5444. $
  5445.  
  5446. @\subsubsection{ERROR}
  5447. !ERROR
  5448.  
  5449. @\begin{verbatim}
  5450.  ERROR( StringType Message);
  5451. @\end{verbatim}
  5452.  
  5453.  Breaks the execution and returns to IRIT main loop, after printing
  5454.  {\bf Message} to the screen. May be useful in user defined function to
  5455.  break execution in cases of fatal errors.
  5456. $
  5457.  
  5458. @\subsubsection{EXIT}
  5459. !EXIT
  5460.  
  5461. @\begin{verbatim}
  5462.  EXIT();
  5463. @\end{verbatim}
  5464.  
  5465.    Exits from the solid modeler. NO warning is given!
  5466. $
  5467.  
  5468. @\subsubsection{FOR}
  5469. !FOR
  5470.  
  5471. @\begin{verbatim}
  5472.  FOR( NumericType Start, NumericType Increment, NumericType End, AnyType Body )
  5473. @\end{verbatim}
  5474.  
  5475.    Executes the {\bf Body} (see below), while the FOR loop conditions hold.
  5476.    {\bf Start, Increment, End} are evaluated first, and the loop is executed
  5477.  while {\bf $<=$ End} if {\bf Increment $>$ 0}, or while {\bf $>=$ End} if {\bf Increment $<$ 0}.
  5478.    If {\bf Start} is of the form "Variable = Expression", then that variable is
  5479.  updated on each iteration, and can be used within the body.
  5480.    The body may consist of any number of regular commands, separated by
  5481.  COLONs, including nesting FOR loops to an arbitrary level.
  5482.  
  5483.  Example:
  5484.  
  5485. @\begin{verbatim}
  5486.  step = 10;
  5487.  rotstepx = rotx(step);
  5488.  FOR ( a = 1, 1, 360 / step,
  5489.      view_mat = rotstepx * view_mat:
  5490.      view( list( view_mat, b, axes ), ON )
  5491.  );
  5492. @\end{verbatim}
  5493.  
  5494.  Displays b and axes with a view direction that is rotated 10 degrees at a
  5495.  time around the X axis.
  5496. $
  5497.  
  5498. @\subsubsection{HELP}
  5499. !HELP
  5500.  
  5501. @\begin{verbatim}
  5502.  HELP( StringType Subject )
  5503. @\end{verbatim}
  5504.  
  5505.    Provides help on the specified Subject.
  5506.  
  5507.  Example:
  5508.  
  5509. @\begin{verbatim}
  5510.     HELP("");
  5511. @\end{verbatim}
  5512.  
  5513.  will list all {\em IRIT} help subjects.
  5514. $
  5515.  
  5516. @\subsubsection{FREE}
  5517. !FREE
  5518.  
  5519. @\begin{verbatim}
  5520.  FREE( GeometricType Object )
  5521. @\end{verbatim}
  5522.  
  5523.    Because of the usually huge size of geometric objects, this procedure
  5524.  may be used to free them. Reassigning a value (even of different type)
  5525.  to a variable automatically releases the old variable's allocated space
  5526.  as well.
  5527. $
  5528.  
  5529. @\subsubsection{FUNCTION}
  5530. !FUNCTION
  5531.  
  5532. @\begin{verbatim}
  5533.  FuncName = FUNCTION(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
  5534.      FuncBody;
  5535. @\end{verbatim}
  5536.  
  5537.  Defines a function named FuncName with N parameters and M local variables
  5538.  $(N, M >= 0)$. Here is a (simple) example of a function with no local variables
  5539.  and a single parameter that computes the square of a number:
  5540.  
  5541. @\begin{verbatim}
  5542.  sqr = FUNCTION(x):
  5543.     return = x * x;
  5544. @\end{verbatim}
  5545.  
  5546.    Functions can be defined with optional parameters and optional local
  5547.  variables. A function's body may contain an arbitrary set of expressions
  5548.  including for loops, (user) function calls, or even recursive function calls,
  5549.  all separated by colons.
  5550.    The returned value of the function is the value of an automatically defined
  5551.  local variable named return. The return variable is a regular local variable
  5552.  within the scope of the function and can be used as any other variable.
  5553.  
  5554.    If a variable's name is found in neither the local variable list nor
  5555.  the parameter list, it is searched in the global variable list (outside
  5556.  the scope of the function). Binding of names of variables is static as in the
  5557.  C programming language.
  5558.  
  5559.    Because binding of variables is performed in execution time, there is a
  5560.  somewhat less restrictive type checking of parameters of functions that are
  5561.  invoked within a user's defined function.
  5562.  
  5563.    A function can invoke itself, i.e., it can be recursive. However, since a
  5564.  function should be defined when it is called, a dummy function should be
  5565.  defined before the recursive one is defined:
  5566.  
  5567. @\begin{verbatim}
  5568.  factorial = function(x):return = x; # Dummy function.
  5569.  factorial = function(x):
  5570.      if (x <= 1, return = 1, return = x * factorial(x - 1));
  5571. @\end{verbatim}
  5572.  
  5573.    Overloading is valid inside a function as it is outside. For example, for
  5574.  
  5575. @\begin{verbatim}
  5576.  add = FUNCTION(x, y):
  5577.     return = x + y;
  5578. @\end{verbatim}
  5579.  
  5580.  the following function calls are all valid:
  5581.  
  5582. @\begin{verbatim}
  5583.  add(1, 2);
  5584.  add(vector(1,2,3), point(1,2,3));
  5585.  add(box(vector(-3, -2, -1), 6, 4, 2), box(vector(-4, -3, -2), 2, 2, 4));
  5586. @\end{verbatim}
  5587.  
  5588.  Finally, here is a more interesting example that computes an approximation
  5589.  of the length of a curve, using the sqr function defined above:
  5590.  
  5591. @\begin{verbatim}
  5592.  distptpt = FUNCTION(pt1, pt2):
  5593.      return = sqrt(sqr(coord(pt1, 1) - coord(pt2, 1)) +
  5594.                    sqr(coord(pt1, 2) - coord(pt2, 2)) +
  5595.                    sqr(coord(pt1, 3) - coord(pt2, 3)));
  5596.  
  5597.  crvlength = FUNCTION(crv, n):pd:t:t1:t2:dt:pt1:pt2:i:
  5598.      return = 0.0:
  5599.      pd = pdomain(crv):
  5600.      t1 = nth(pd, 1):
  5601.      t2 = nth(pd, 2):
  5602.      dt = (t2 - t1) / n:
  5603.      pt1 = coerce(ceval(crv, t1), e3):
  5604.      for (i = 1, 1, n,
  5605.           pt2 = coerce(ceval(crv, t1 + dt * i), e3):
  5606.           return = return + distptpt(pt1, pt2):
  5607.           pt1 = pt2);
  5608. @\end{verbatim}
  5609.  
  5610.  Try, for example:
  5611.  
  5612. @\begin{verbatim}
  5613.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 30) / 2;
  5614.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 100) / 2;
  5615.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 300) / 2;
  5616. @\end{verbatim}
  5617.  
  5618.  See PROCEDURE and IRITSTATE's "DebugFunc" for more.
  5619. $
  5620.  
  5621. @\subsubsection{IF}
  5622. !IF
  5623.  
  5624. @\begin{verbatim}
  5625.  IF( NumericType Cond, AnyType TrueBody { , AnyType FalseBody } )
  5626. @\end{verbatim}
  5627.  
  5628.    Executes {\bf TrueBody} (group of regular commands, separated by COLONs -
  5629.  see FOR loop) if the {\bf Cond} holds, i.e., it is a numeric value other than
  5630.  zero, or optionally, if it exists, executes {\bf FalseBody} if the {\bf Cond}
  5631.  does not hold, i.e., it evaluates to a numeric value equal to zero.
  5632.  
  5633.  Examples:
  5634.  
  5635. @\begin{verbatim}
  5636.     IF ( machine == IBMOS2, resolution = 5, resolution = 10 );
  5637.     IF ( a > b, max = a, max = b );
  5638. @\end{verbatim}
  5639.  
  5640.  sets the resolution to be 10, unless running on an IBMOS2 system, in which
  5641.  case the resolution variable will be set to 5 in the first statement, and
  5642.  set max to the maximum of a and b in the second statement.
  5643. $
  5644.  
  5645. @\subsubsection{INCLUDE}
  5646. !INCLUDE
  5647.  
  5648. @\begin{verbatim}
  5649.  INCLUDE( StringType FileName )
  5650. @\end{verbatim}
  5651.  
  5652.    Executes the script file {\bf FileName}. Nesting of include file is allowed up
  5653.  to 10 levels deep. If an error occurs, all open files in all nested files
  5654.  are closed and data are waited for at the top level (standard input).
  5655.  
  5656.    A script file can contain any command the solid modeler supports.
  5657.  
  5658.  Example:
  5659.  
  5660. @\begin{verbatim}
  5661.     INCLUDE( "general.irt" );
  5662. @\end{verbatim}
  5663.  
  5664.  includes the file "general.irt".
  5665. $
  5666.  
  5667. @\subsubsection{IRITSTATE}
  5668. !IRITSTATE
  5669.  
  5670. @\begin{verbatim}
  5671.  IRITSTATE( StringType State, AnyType Data )
  5672. @\end{verbatim}
  5673.  
  5674.    Sets a state variable in the {\em IRIT} solid modeller. Current supported
  5675.  state variables are,
  5676. # 13 3 1 1
  5677.  State Name
  5678.  Data Type
  5679.  Comments
  5680.  
  5681.  
  5682.  
  5683.  InterpProd
  5684.  ConstantType
  5685.  TRUE for Bspline sym. products via interpolation
  5686.  
  5687.  
  5688.  FALSE for Bspline sym. products via bezier
  5689.  DebugFunc
  5690.  NumericType
  5691.  $>0$ user func. debug information. $>2$ print params
  5692.  
  5693.  
  5694.  on entry, ret. val. on exit. $>4$ global var. list
  5695.  FloatFrmt
  5696.  StringType
  5697.  Specifies a new printf floating point format.
  5698.  InterCrv
  5699.  NumericType
  5700.  If TRUE Boolean operations creates only
  5701.  
  5702.  
  5703.  intersection curves. If FALSE, full Boolean
  5704.  
  5705.  
  5706.  operation results.
  5707.  Coplanar
  5708.  NumericType
  5709.  If TRUE, Coplanar polygons are handled by Boolean
  5710.  
  5711.  
  5712.  operations.
  5713.  PolySort
  5714.  NumericType
  5715.  Axis of Polygon Intersection sweep in Boolean
  5716.  
  5717.  
  5718.  operations: 0 for X axis, 1 for Y axis, 2 for
  5719.  
  5720.  
  5721.  Z axis.
  5722.  EchoSource
  5723.  NumericType
  5724.  If TRUE, irit scripts are echoed to stdout.
  5725.  DumpLevel
  5726.  NumericType
  5727.  Controls the way variables/expressions ar dumped.
  5728.  
  5729.  
  5730.  Only object names/types if $>=$ 0, Scalars and
  5731.  
  5732.  
  5733.  vectors are dumped if $>=$ 1, Curves and Surfaces
  5734.  
  5735.  
  5736.  are dumped if DumpLvl $>=$ 2, Polygons/lines are
  5737.  
  5738.  
  5739.  dumped if DumpLvl $>=$ 3, and List objects are
  5740.  
  5741.  
  5742.  traversed recursively if DumpLvl $>=$ 4.
  5743.  TrimCrvs
  5744.  NumericType
  5745.  Number of samples the higher order trimmed curves
  5746.  
  5747.  
  5748.  are sampled, in piecewise linear approximation.
  5749.  
  5750.  
  5751.  If zero, computed symbolically as composition.
  5752.  
  5753.  Example:
  5754.  
  5755. @\begin{verbatim}
  5756.     IRITSTATE( "DebugFunc", 3 );
  5757.     IRITSTATE( "FloatFrmt", "%8.5lg" );
  5758. @\end{verbatim}
  5759.  
  5760.  To print parameters of user defined functions on entry, and return value on
  5761.  exit. Also selects a floating point printf format of "%8.5lg".
  5762. $
  5763.  
  5764. @\subsubsection{INTERACT}
  5765. !INTERACT
  5766.  
  5767. @\begin{verbatim}
  5768.  INTERACT( GeometryTreeType Object )
  5769. @\end{verbatim}
  5770.  
  5771.    A user-defined function (see iritinit.irt) that does the following,
  5772.  in order:
  5773. @\begin{enumerate}
  5774. @\item
  5775.  Clear the display device.
  5776. @\item
  5777.  Display the given {\bf Object}.
  5778. @\item
  5779.  Pause for a keystroke.
  5780. @\end{enumerate}
  5781.  
  5782.    This user-defined function in version 4.0 of {\em IRIT} is an
  5783.  emulation of the INTERACT function that used to exist in previous versions.
  5784.  
  5785.  Example:
  5786.  
  5787. @\begin{verbatim}
  5788.  INTERACT( list( view_mat, Axes, Obj ) );
  5789. @\end{verbatim}
  5790.  
  5791.  displays and interacts with the object {\bf Obj} and the predefined object
  5792.  {\bf Axes}. VIEW\_MAT will be used to set the starting transformation.
  5793.  
  5794.    See VIEW and VIEWOBJ for more.
  5795. $
  5796.  
  5797. @\subsubsection{LIST}
  5798. !LIST
  5799.  
  5800. @\begin{verbatim}
  5801.  ListType LIST( AnyType Elem1, AnyType Elem2, ... )
  5802. @\end{verbatim}
  5803.  
  5804.    Constructs an object as a list of several other objects. Only a reference
  5805.  is made to the Elements, so modifying Elem1 after being included in the list
  5806.  will affect Elem1 in that list next time list is used!
  5807.  
  5808.    Each inclusion of an object in a list increases its internal {\bf used}
  5809.  reference. The object is freed iff in {\bf used} reference is zero.
  5810.    As a result, attempt to delete a variable (using FREE) which is referenced
  5811.  in a list removes the variable, but the object itself is freed only when the
  5812.  list is freed.
  5813. $
  5814.  
  5815. @\subsubsection{LOAD}
  5816. !LOAD
  5817.  
  5818. @\begin{verbatim}
  5819.  AnyType LOAD( StringType FileName )
  5820. @\end{verbatim}
  5821.  
  5822.    Loads an object from the given {\bf FileName}. The object may be any object
  5823.  defined in the system, including lists, in which the structure is recovered
  5824.  and reconstructed as well (internal objects are inserted into the global
  5825.  system object list if they have names). If no file type is provided, ".dat"
  5826.  is assumed.
  5827.  
  5828.    This command can also be used to load binary files. Ascii regular data
  5829.  files are usually loaded in much more time then binary files due the 
  5830.  the parsing required. Binary data files can be loaded directly like ascii
  5831.  files in {\em IRIT}, but can only be inspected through {\bf IRIT} tools such
  5832.  as dat2irit. A binary data file must have a ".bdt" (Binary DaTa) type in
  5833.  its name.
  5834.  
  5835.    Under unix, compressed files can be loaded if the given file name has
  5836.  a postfix of ".Z". The unix system's "zcat" will be invoked via a pipe
  5837.  for that purpose.
  5838. $
  5839.  
  5840. @\subsubsection{LOGFILE}
  5841. !LOGFILE
  5842.  
  5843. @\begin{verbatim}
  5844.  LOGFILE( NumericType Set )
  5845.  
  5846.  or
  5847.  
  5848.  LOGFILE( StringType FileName )
  5849. @\end{verbatim}
  5850.  
  5851.    If {\bf Set} is non zero (see TRUE/FALSE and ON/OFF), then everything
  5852.  printed in the input window, will go to the log file specified in the
  5853.  IRIT.CFG configuration file. This file will be created the first time
  5854.  logfile is turned ON. If a string {\bf FileName} is provided, it will
  5855.  be used as a log file name from now on. It also closes the current log
  5856.  file. A "LOGFILE( on );" must be issued after a log file name change.
  5857.  
  5858.  Example:
  5859.  
  5860. @\begin{verbatim}
  5861.     LOGFILE( "Data1" );    
  5862.     LOGFILE( on );    
  5863.     printf( "Resolution = %lf\\n", list( resolution ) );
  5864.     LOGFILE( off );    
  5865. @\end{verbatim}
  5866.  
  5867.  to print the current resolution level into file Data1.
  5868. $
  5869.  
  5870. @\subsubsection{MSLEEP}
  5871. !MSLEEP
  5872.  
  5873. @\begin{verbatim}
  5874.  MSLEEP( NumericType MilliSeconds )
  5875. @\end{verbatim}
  5876.  
  5877.  Causes the solid modeller to sleep for the prescribed time in milliseconds.
  5878.  
  5879.  Example:
  5880.  
  5881. @\begin{verbatim}
  5882.  for ( i = 1, 1, sizeof( crvs ),
  5883.      c = nth( crvs, i ):
  5884.      color( c, yellow ):
  5885.      msleep(20):
  5886.      viewobj( c )
  5887.  );
  5888. @\end{verbatim}
  5889.  
  5890.  Displays an animation sequence and sleeps for 20 milliseconds between
  5891.  iterations.
  5892. $
  5893.  
  5894. @\subsubsection{NTH}
  5895. !NTH
  5896.  
  5897. @\begin{verbatim}
  5898.  AnyType NTH( ListType ListObject, NumericType Index )
  5899. @\end{verbatim}
  5900.  
  5901.  Returns the {\bf Index} (base count 1) element of the list {\bf ListObject}.
  5902.  
  5903.  Example:
  5904.  
  5905. @\begin{verbatim}
  5906.     Lst = list( a, list( b, c ), d );
  5907.     Lst2 = NTH( Lst, 2 );
  5908. @\end{verbatim}
  5909.  
  5910.  and now {\bf Lst2} is equal to 'list( b, c )'.
  5911. $
  5912.  
  5913. @\subsubsection{PAUSE}
  5914. !PAUSE
  5915.  
  5916. @\begin{verbatim}
  5917.  PAUSE( NumericType Flush )
  5918. @\end{verbatim}
  5919.  
  5920.    Waits for a keystroke. Nice to have if a temporary stop in a middle of an
  5921.  included file (see INCLUDE) is required. If {\bf Flush} is TRUE, then the input
  5922.  is first flushed to guarantee that the actual stop will occur.
  5923. $
  5924.  
  5925. @\subsubsection{PRINTF}
  5926. !PRINTF
  5927.  
  5928. @\begin{verbatim}
  5929.  PRINTF( StringType CtrlStr, ListType Data )
  5930. @\end{verbatim}
  5931.  
  5932.  A formatted printing routine, following the concepts of the C programming
  5933.  language's {\em printf} routine. {\bf CtrlStr} is a string object for which
  5934.  the following special '\%' commands are supported:
  5935. #15 2 0 1
  5936.  \%d, \%i, %u
  5937.   Prints the numeric object as an integer or unsigned integer.
  5938.  \%o, \%x, \%X
  5939.   Prints the numeric object as an octal or hexadecimal integer.
  5940.  \%e, \%f, \%g,
  5941.   Prints the numeric object in several formats of
  5942.  \%E, \%F
  5943.   floating point numbers.
  5944.  \%s
  5945.   Prints the string object as a string.
  5946.  \%pe, \%pf, \%pg
  5947.   Prints the three coordinates of the point object.
  5948.  \%ve, \%vf, \%vg
  5949.   Prints the three coordinates of the vector object.
  5950.  \%Pe, \%Pf, \%Pg,
  5951.   Prints the four coordinates of the plane object.
  5952.  \%De, \%Df, \%Dg,
  5953.   Prints the given object in IRIT's data file format.
  5954. #
  5955.  
  5956.  All the '\%' commands can include any modifier that is valid in the C
  5957.  programming language printf routine, including l (long), prefix
  5958.  character(s), size, etc. The point, vector, plane, and object commands
  5959.  can also be modified in a similar way, to set the format of the
  5960.  numeric data printed.
  5961.  
  5962.  Also supported are the newline and tab using the backslash escape
  5963.  character:
  5964.  
  5965. @\begin{verbatim}
  5966. * PRINTF("\\tThis is the char \"\\%\"\\n", nil());
  5967. @\end{verbatim}
  5968.  
  5969.  Backslashes should be escaped themselves as can be seen in the above example.
  5970.  Here are few more examples:
  5971.  
  5972. @\begin{verbatim}
  5973. * PRINTF("this is a string \"%s\" and this is an integer %8d.\\n",
  5974. *       list("STRING", 1987));
  5975. * PRINTF("this is a vector [%8.5lvf]\\n", list(vector(1,2,3)));
  5976. * IritState("DumpLevel", 9);
  5977. * PRINTF("this is a object %8.6lDf...\\n", list(axes));
  5978. * PRINTF("this is a object %10.8lDg...\\n", list(axes));
  5979. @\end{verbatim}
  5980.  
  5981.  This implementation of PRINTF is somewhat different than the C programming
  5982.  language's version, because the backslash {\em always} escapes the next
  5983.  character during the processing stage of IRIT's parser. That is, the string
  5984.  
  5985. @\begin{verbatim}
  5986. *        '\\tThis is the char \"\\%\"\\n'
  5987. @\end{verbatim}
  5988.  
  5989.  is actually parsed by the IRIT's parser into
  5990.  
  5991. @\begin{verbatim}
  5992. *        '\tThis is the char "\%"\n'
  5993. @\end{verbatim}
  5994.  
  5995.  because this is the way the IRIT parser processes strings. The latter
  5996.  string is the one that PRINTF actually see.
  5997. $
  5998.  
  5999. @\subsubsection{PROCEDURE}
  6000. !PROCEDURE
  6001.  
  6002. @\begin{verbatim}
  6003.  ProcName = PROCEDURE(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
  6004.      ProcBody;
  6005. @\end{verbatim}
  6006.  
  6007.  A procedure is a function that does not return a value, and therefore the
  6008.  return variable (see FUNCTION) should not be used. A procedure is
  6009.  identical to a function in every other way. See FUNCTION for more.
  6010. $
  6011.  
  6012. @\subsubsection{RMATTR}
  6013. !RMATTR
  6014.  
  6015. @\begin{verbatim}
  6016.  RMATTR( AnyType Object, StringType Name )
  6017. @\end{verbatim}
  6018.  
  6019.    Removes attribute named {\bf Name} from object {\bf Object}. This function
  6020.  will have no affect on {\bf Object} if {\bf Object} have no attribute named
  6021.  {\bf Name}.
  6022.  
  6023.  See also ATTRIB.
  6024. $
  6025. @\subsubsection{SAVE}
  6026. !SAVE
  6027.  
  6028. @\begin{verbatim}
  6029.  SAVE( StringType FileName, AnyType Object )
  6030. @\end{verbatim}
  6031.  
  6032.    Saves the provided {\bf Object} in the specified file name {\bf FileName}.
  6033.  No extension type is needed (ignored if specified), and ".dat" is supplied
  6034.  by default. {\bf Object} can be any object type, including list, in which
  6035.  structure is saved recursively. See also LOAD. If a display device is
  6036.  actively running at the time SAVE is invoked, its transformation matrix
  6037.  will be saved with the same name but with extension type of ".mat" instead
  6038.  of ".dat".
  6039.  
  6040.    This command can also be used to save binary files. Ascii regular data
  6041.  files are usually loaded in much more time then binary files due the 
  6042.  the parsing required. Binary data files can be loaded directly like ascii
  6043.  files in {\em IRIT}, but must be inspected through {\bf IRIT} tools such
  6044.  as dat2irit. A binary data file must have a ".bdt" (Binary DaTa) type in
  6045.  its name.
  6046.  
  6047.    Under unix, files will be saved compressed if the given file name has
  6048.  a postfix of ".Z". The unix system's "compress" will be invoked via a pipe
  6049.  for that purpose.
  6050.  
  6051.    Example:
  6052.  
  6053. @\begin{verbatim}
  6054.  SAVE( "Obj1.bdt.Z", Obj1 );
  6055. @\end{verbatim}
  6056.  
  6057.  Saves Obj1 in the file Obj1.bdt.Z as compressed binary file.
  6058. $
  6059.  
  6060. @\subsubsection{SNOC}
  6061. !SNOC
  6062.  
  6063. @\begin{verbatim}
  6064.  SNOC( AnyType Object, ListType ListObject )
  6065. @\end{verbatim}
  6066.  
  6067.    Similar to the lisp cons operator but puts the new {\bf Object} in the
  6068.  {\em end} of the list {\bf ListObject} instead of the beginning, in place.
  6069.  
  6070.  Example:
  6071.  
  6072. @\begin{verbatim}
  6073.     Lst = list( axes );
  6074.     SNOC( Srf, Lst );
  6075. @\end{verbatim}
  6076.  
  6077.  and now {\bf Lst} is equal to the list 'list( axes, Srf )'.
  6078. $
  6079.  
  6080. @\subsubsection{SYSTEM}
  6081. !SYSTEM
  6082.  
  6083. @\begin{verbatim}
  6084.  SYSTEM( StringType Command )
  6085. @\end{verbatim}
  6086.  
  6087.    Executes a system command {\bf Command}. For example,
  6088.  
  6089. @\begin{verbatim}
  6090.     SYSTEM( "ls -l" );
  6091. @\end{verbatim}
  6092. $
  6093.  
  6094. @\subsubsection{TIME}
  6095. !TIME
  6096.  
  6097. @\begin{verbatim}
  6098.  TIME( NumericType Reset )
  6099. @\end{verbatim}
  6100.  
  6101.    Returns the time in seconds from the last time TIME was called with
  6102.  {\bf Reset} TRUE. This time is CPU time if such support is available
  6103.  from the system (times function), and is real time otherwise (time
  6104.  function).
  6105.    The time is automatically reset at the beginning of the execution of this
  6106.  program.
  6107.  
  6108.  Example:
  6109.  
  6110. @\begin{verbatim}
  6111.     Dummy = TIME( TRUE );
  6112.       .
  6113.       .
  6114.       .
  6115.     TIME( FALSE );
  6116. @\end{verbatim}
  6117.  
  6118.  prints the time in seconds between the above two time function calls.
  6119. $
  6120.  
  6121. @\subsubsection{VARLIST}
  6122. !VARLIST
  6123.  
  6124. @\begin{verbatim}
  6125.  VARLIST()
  6126. @\end{verbatim}
  6127.  
  6128.    List all the currently defined objects in the system.
  6129. $
  6130.  
  6131. @\subsubsection{VECTOR}
  6132. !VECTOR
  6133.  
  6134. @\begin{verbatim}
  6135.  VectorType VECTOR( NumericType X, NumericType Y, NumericType Z )
  6136. @\end{verbatim}
  6137.  
  6138.    Creates a vector type object, using the three provided NumericType scalars.
  6139. $
  6140.  
  6141. @\subsubsection{VIEW}
  6142. !VIEW
  6143.  
  6144. @\begin{verbatim}
  6145.  VIEW( GeometricTreeType Object, NumericType ClearWindow )
  6146. @\end{verbatim}
  6147.  
  6148.    Displays the (geometric) object(s) as given in {\bf Object}.
  6149.  
  6150.    If {\bf ClearWindow} is non-zero (see TRUE/FALSE and ON/OFF) the window is
  6151.  first cleared (before drawing the objects).
  6152.  
  6153.  Example:
  6154.  
  6155. @\begin{verbatim}
  6156.     VIEW( Axes, FALSE );
  6157. @\end{verbatim}
  6158.  
  6159.  displays the predefined object {\bf Axes} in the viewing window on top of
  6160.  what is drawn already.
  6161.  
  6162.  In version 4.0, this function is emulated (see iritinit.irt) using the
  6163.  VIEWOBJ function. In order to use the current viewing matrix, VIEW\_MAT
  6164.  should be provided as an additional parameter. For example,
  6165.  
  6166. @\begin{verbatim}
  6167.     VIEW( list( view_mat, Obj ), TRUE );
  6168. @\end{verbatim}
  6169.  
  6170.  However, since VIEW is a user defined function, the following will not
  6171.  use VIEW\_MAT as one would expect:
  6172.  
  6173. @\begin{verbatim}
  6174.     VIEW( view_mat, TRUE );
  6175. @\end{verbatim}
  6176.  
  6177.  because VIEW\_MAT will be renamed inside the VIEW user defined function to
  6178.  a local (to the user defined function) variable.
  6179.  
  6180.  In iritinit.irt one can find several other useful VIEW related functions:
  6181. # 15 2 0 1
  6182.  VIEWCLEAR
  6183.   Clears all data displayed on the display device.
  6184.  VIEWREMOVE
  6185.   Removes the object specified by name from display.
  6186.  VIEWDISC
  6187.   Disconnects from display device (which is still running)
  6188.  
  6189.   while allowing IRIT to connect to a new device.
  6190.  VIEWEXIT
  6191.   Forces the display device to exit.
  6192.  VIEWSAVE
  6193.   Request sdisplay device to save transformation matrix.
  6194.  BEEP
  6195.   An emulation of the BEEP command of versions prior to 4.0.
  6196.  VIEWSTATE
  6197.   Allows to change the state of the display device.
  6198. #
  6199.  
  6200.    For the above VIEW related functions, only VIEWREMOVE, VIEWSAVE, and
  6201.  VIEWSTATE require a parameter, which is the file name and view state
  6202.  respectively. The view state can be one of several commands. See the
  6203.  display device section for more.
  6204.  
  6205.  Examples:
  6206.  
  6207. @\begin{verbatim}
  6208.     VIEWCLEAR();
  6209.     VIEW( axes, off );
  6210.     VIEWSTATE( "LngrVecs" );
  6211.     VIEWSTATE( "DrawSolid" );
  6212.     VIEWSAVE( "matrix1" );
  6213.     VIEWREMOVE( "axes" );
  6214.     VIEWDISC();
  6215. @\end{verbatim}
  6216. $
  6217.  
  6218. @\subsubsection{VIEWOBJ}
  6219. !VIEWOBJ
  6220.  
  6221. @\begin{verbatim}
  6222.  VIEWOBJ( GeometricTreeType Object )
  6223. @\end{verbatim}
  6224.  
  6225.    Displays the (geometric) object(s) as given in {\bf Object}.
  6226.  {\bf Object} may be any GeometricType or a list of other
  6227.  GeometricTypes nested to an arbitrary level.
  6228.  
  6229.    Unlike {\em IRIT} versions prior to 4.0, VIEW\_MAT is not explicitly used
  6230.  as the transformation matrix. In order to display with a VIEW\_MAT view,
  6231.  VIEW\_MAT should be listed as an argument (in that exact name) to
  6232.  VIEWOBJ. Same is true for the perspective matrix PRSP\_MAT.
  6233.  
  6234.  Example:
  6235.  
  6236. @\begin{verbatim}
  6237.     VIEWOBJ( list( view_mat, Axes ) );
  6238. @\end{verbatim}
  6239.  
  6240.  displays the predefined object {\bf Axes} in the viewing window using the
  6241.  viewing matrix VIEW\_MAT.
  6242. $
  6243.  
  6244. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6245. @\subsection{System variables}
  6246. &System variables
  6247.  
  6248.  System variables are predefined objects in the system. Any time {\em IRIT} is
  6249.  executed, these variable are automatically defined and set to values which
  6250.  are sometimes machine dependent. These are {\em regular} objects in any other
  6251.  sense, including the ability to delete or overwrite them. One can modify,
  6252.  delete, or introduce other objects using the IRITINIT.IRT file.
  6253.  
  6254. @\subsubsection{AXES}
  6255. !AXES
  6256.    Predefined polyline object (PolylineType) that describes the $XYZ$ axes.
  6257. $
  6258.  
  6259. @\subsubsection{DRAWCTLPT}
  6260. !DRAWCTLPT
  6261.    Predefined Boolean variable (NumericType) that controls whether curves'
  6262.  control polygons and surfaces' control meshes are drawn (TRUE) or not
  6263.  (FALSE). Default is FALSE.
  6264. $
  6265.  
  6266. @\subsubsection{FLAT4PLY}
  6267. !FLAT4PLY
  6268.    Predefined Boolean object (NumericType) that controls the way almost flat
  6269.  surface patches are converted to polygons: four polygons (TRUE) or only
  6270.  two polygons (FALSE). Default value is FALSE.
  6271. $
  6272.  
  6273. @\subsubsection{MACHINE}
  6274. !MACHINE
  6275.    Predefined numeric object (NumericType) holding the machine type as one of
  6276.  the following constants: MSDOS, SGI, HP, SUN, APOLLO, UNIX, IBMOS2, IBMNT,
  6277.  and AMIGA.
  6278. $
  6279.  
  6280. @\subsubsection{ POLY\_APPROX\_OPT}
  6281. !POLY_APPROX_OPT
  6282.    A variable controlling the algorithm to convert surfaces to polygons.
  6283.    This two digit number control the method that is used to subdivide a surface
  6284.  into polygons.
  6285.    The first digit (units) can be one of:
  6286. # 4 2 0 1
  6287.  1
  6288.   An alternate U and V subdivision direction. Once U is
  6289.  
  6290.   subdivided and then V is subdivided.
  6291.  2
  6292.   A min max subdivision direction. In other words, the
  6293.  
  6294.   direction that minimizes the maximal error is selected.
  6295. #
  6296.  
  6297.    The second digit (tenths) can be one of:
  6298. # 4 2 0 1
  6299.  0
  6300.   A fixed sized regular grid. The side of the grid is set
  6301.  
  6302.   via the RESOLUTION variable.
  6303.  1
  6304.   This mode is {\em not} for general use.
  6305.  2
  6306.   Maximal distance between the surface and its polygonal
  6307.  
  6308.   approximation is bounded by bilinear surface fit.
  6309.  
  6310.   Maximal distance allowed is set via POLY\_APPROX\_TOL.
  6311.  
  6312.   {\em Recommended} choice for optimal polygonization.
  6313.  3
  6314.   This mode is {\em not} for general use.
  6315. #
  6316. $
  6317.  
  6318. @\subsubsection{POLY\_APPROX\_UV}
  6319. !POLY_APPROX_UV
  6320.    A Boolean predefined variable. If TRUE, UV values of surface polygonal
  6321.  approximation are placed on attribute lists of vertices.
  6322. $
  6323.  
  6324. @\subsubsection{POLY\_APPROX\_TOL}
  6325. !POLY_APPROX_TOL
  6326.    A numeric predefined tolerance control on the distance between the surface
  6327.  and its polygonal approximation in POLY\_APPROX\_OPT settings.
  6328. $
  6329.  
  6330. @\subsubsection{PRSP\_MAT}
  6331. !PRSP_MAT
  6332.    Predefined matrix object (MatrixType) to hold the perspective matrix
  6333.  used/set by VIEW and/or INTERACT commands. See also VIEW\_MAT.
  6334. $
  6335.  
  6336. @\subsubsection{RESOLUTION}
  6337. !RESOLUTION
  6338.    Predefined numeric object (NumericType) that sets the accuracy of the
  6339.  polygonal primitive geometric objects and the approximation of curves and
  6340.  surfaces. Holds the number of divisions a circle is divided into (with
  6341.  minimum value of 4). If, for example, RESOLUTION is set to 6, then a
  6342.  generated CONE will effectively be a six-sided pyramid.
  6343.    Also controls the fineness of freeform curves and surfaces when they are
  6344.  approximated as piecewise linear polylines, and the fineness of freeform
  6345.  surfaces when they are approximated as polygons.
  6346. $
  6347.  
  6348. @\subsubsection{VIEW\_MAT}
  6349. !VIEW_MAT
  6350.    Predefined matrix object (MatrixType) to hold the viewing matrix used/set
  6351.  by VIEW and/or INTERACT commands. See also PRSP\_MAT.
  6352. $
  6353.  
  6354. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6355. @\subsection{System constants}
  6356. &System constants
  6357.  
  6358.  The following constants are used by the various functions of the system to
  6359.  signal certain conditions. Internally, they are represented numerically,
  6360.  although, in general, their exact value is unimportant and may be changed
  6361.  in future versions. In the rare circumstance that  you need to know their
  6362.  values, simply type the constant as an expression.
  6363.  
  6364.  Example:
  6365.  
  6366. @\begin{verbatim}
  6367.     MAGENTA;
  6368. @\end{verbatim}
  6369.  
  6370. @\subsection{AMIGA}
  6371. !AMIGA
  6372.  A constant designating an AMIGA system, in the MACHINE variable.
  6373. $
  6374.  
  6375. @\subsubsection{APOLLO}
  6376. !APOLLO
  6377.  A constant designating an APOLLO system, in the MACHINE variable.
  6378. $
  6379.  
  6380. @\subsubsection{BLACK}
  6381. !BLACK
  6382.  A constant defining a BLACK color.
  6383. $
  6384.  
  6385. @\subsubsection{BLUE}
  6386. !BLUE
  6387.  A constant defining a BLUE color.
  6388. $
  6389.  
  6390. @\subsubsection{COL}
  6391. !COL
  6392.  A constant defining the COLumn direction of a surface or a trivariate mesh.
  6393. $
  6394.  
  6395. @\subsubsection{CTLPT\_TYPE}
  6396. !CTLPT_TYPE
  6397.  A constant defining an object of type control point.
  6398. $
  6399.  
  6400. @\subsubsection{CURVE\_TYPE}
  6401. !CURVE_TYPE
  6402.  A constant defining an object of type curve.
  6403. $
  6404.  
  6405. @\subsubsection{CYAN}
  6406. !CYAN
  6407.  A constant defining a CYAN color.
  6408. $
  6409.  
  6410. @\subsubsection{DEPTH}
  6411. !DEPTH
  6412.   A constant defining the DEPTH direction of a trivariate mesh.
  6413.  See TBEZIER, TBSPLINE.
  6414. $
  6415.  
  6416. @\subsubsection{E1}
  6417. !E1
  6418.  A constant defining an E1 (X only coordinate) control point type.
  6419. $
  6420.  
  6421. @\subsubsection{E2}
  6422. !E2
  6423.  A constant defining an E2 (X and Y coordinates) control point type.
  6424. $
  6425.  
  6426. @\subsubsection{E3}
  6427. !E3
  6428.  A constant defining an E3 (X, Y and Z coordinates) control point type.
  6429. $
  6430.  
  6431. @\subsubsection{E4}
  6432. !E4
  6433.  A constant defining an E4 control point type.
  6434. $
  6435.  
  6436. @\subsubsection{E5}
  6437. !E5
  6438.  A constant defining an E5 control point type.
  6439. $
  6440.  
  6441. @\subsubsection{FALSE}
  6442. !FALSE
  6443.  A zero constant. May be used as Boolean operand.
  6444. $
  6445.  
  6446. @\subsubsection{GREEN}
  6447. !GREEN
  6448.  A constant defining a GREEN color.
  6449. $
  6450.  
  6451. @\subsubsection{HP}
  6452. !HP
  6453.  A constant designating an HP system, in the MACHINE variable.
  6454. $
  6455.  
  6456. @\subsubsection{IBMOS2}
  6457. !IBMOS
  6458.  A constant designating an IBM system running under OS2, in the MACHINE
  6459.  variable.
  6460. $
  6461.  
  6462. @\subsubsection{IBMNT}
  6463. !IBMNT
  6464.  A constant designating an IBM system running under Windows NT, in the MACHINE
  6465.  variable.
  6466. $
  6467.  
  6468. @\subsubsection{KV\_FLOAT}
  6469. !KV_FLOAT
  6470.  A constant defining a floating end condition uniformly spaced knot vector.
  6471. $
  6472.  
  6473. @\subsubsection{KV\_OPEN}
  6474. !KV_OPEN
  6475.  A constant defining an open end condition uniformly spaced knot vector.
  6476. $
  6477.  
  6478. @\subsubsection{KV\_PERIODIC}
  6479. !KV_PERIODIC
  6480.  A constant defining a periodic end condition with uniformly spaced knot
  6481.  vector.
  6482. $
  6483.  
  6484. @\subsubsection{LIST\_TYPE}
  6485. !LIST_TYPE
  6486.  A constant defining an object of type list.
  6487. $
  6488.  
  6489. @\subsubsection{MAGENTA}
  6490. !MAGENTA
  6491.  A constant defining a MAGENTA color.
  6492. $
  6493.  
  6494. @\subsubsection{MATRIX\_TYPE}
  6495. !MATRIX_TYPE
  6496.  A constant defining an object of type matrix.
  6497. $
  6498.  
  6499. @\subsubsection{MSDOS}
  6500. !MSDOS
  6501.  A constant designating an MSDOS system, in the MACHINE variable.
  6502. $
  6503.  
  6504. @\subsubsection{NUMERIC\_TYPE}
  6505. !NUMERIC_TYPE
  6506.  A constant defining an object of type numeric.
  6507. $
  6508.  
  6509. @\subsubsection{OFF}
  6510. !OFF
  6511.  Synonym of FALSE.
  6512. $
  6513.  
  6514. @\subsubsection{ON}
  6515. !ON
  6516.  Synonym for TRUE.
  6517. $
  6518.  
  6519. @\subsubsection{P1}
  6520. !P2
  6521.  A constant defining a P1 (W and WX coordinates, in that order) rational
  6522.  control point type.
  6523. $
  6524.  
  6525. @\subsubsection{P2}
  6526. !P2
  6527.  A constant defining a P2 (W, WX, and WY coordinates, in that order) rational
  6528.  control point type.
  6529. $
  6530.  
  6531. @\subsubsection{P3}
  6532. !P3
  6533.  A constant defining a P3 (W, WX, WY, and WZ coordinates, in that order)
  6534.  rational control point type.
  6535. $
  6536.  
  6537. @\subsubsection{P4}
  6538. !P4
  6539.  A constant defining a P4 rational control
  6540.  point type.
  6541. $
  6542.  
  6543. @\subsubsection{P5}
  6544. !P5
  6545.  A constant defining a P5 rational control
  6546.  point type.
  6547. $
  6548.  
  6549. @\subsubsection{PARAM\_CENTRIP}
  6550. !PARAM_CENTRIP
  6551.  A constant defining a centripetal length parametrization.
  6552. $
  6553.  
  6554. @\subsubsection{PARAM\_CHORD}
  6555. !PARAM_CHORD
  6556.  A constant defining a chord length parametrization.
  6557. $
  6558.  
  6559. @\subsubsection{PARAM\_UNIFORM}
  6560. !PARAM_UNIFORM
  6561.  A constant defining an uniform parametrization.
  6562. $
  6563.  
  6564. @\subsubsection{PI}
  6565. !PI
  6566.  The constant of 3.141592...
  6567. $
  6568.  
  6569. @\subsubsection{PLANE\_TYPE}
  6570. !PLANE_TYPE
  6571.  A constant defining an object of type plane.
  6572. $
  6573.  
  6574. @\subsubsection{POINT\_TYPE}
  6575. !POINT_TYPE
  6576.  A constant defining an object of type point.
  6577. $
  6578.  
  6579. @\subsubsection{POLY\_TYPE}
  6580. !POLY_TYPE
  6581.  A constant defining an object of type poly.
  6582. $
  6583.  
  6584. @\subsubsection{RED}
  6585. !RED
  6586.  A constant defining a RED color.
  6587. $
  6588.  
  6589. @\subsubsection{ROW}
  6590. !ROW
  6591.   A constant defining the ROW direction of a surface or a trivariate mesh.
  6592. $
  6593.  
  6594. @\subsubsection{SGI}
  6595. !SGI
  6596.  A constant designating an SGI system, in the MACHINE variable.
  6597. $
  6598.  
  6599. @\subsubsection{STRING\_TYPE}
  6600. !STRING_TYPE
  6601.  A constant defining an object of type string.
  6602. $
  6603.  
  6604. @\subsubsection{SURFACE\_TYPE}
  6605. !SURFACE_TYPE
  6606.  A constant defining an object of type surface.
  6607. $
  6608.  
  6609. @\subsubsection{SUN}
  6610. !SUN
  6611.  A constant designating a SUN system, in the MACHINE variable.
  6612. $
  6613.  
  6614. @\subsubsection{TRIMSRF\_TYPE}
  6615. !TRIMSRF_TYPE
  6616.  A constant defining an object of type trimmed surface.
  6617. $
  6618.  
  6619. @\subsubsection{TRIVAR\_TYPE}
  6620. !TRIVAR_TYPE
  6621.  A constant defining an object of type trivariate function.
  6622. $
  6623.  
  6624. @\subsubsection{TRUE}
  6625. !TRUE
  6626.  A non zero constant. May be used as Boolean operand.
  6627. $
  6628.  
  6629. @\subsubsection{UNDEF\_TYPE}
  6630. !UNDEF_TYPE
  6631.  A constant defining an object of no type (yet).
  6632. $
  6633.  
  6634. @\subsubsection{UNIX}
  6635. !UNIX
  6636.  A constant designating a generic UNIX system, in the MACHINE variable.
  6637. $
  6638.  
  6639. @\subsubsection{VECTOR\_TYPE}
  6640. !VECTOR_TYPE
  6641.  A constant defining an object of type vector.
  6642. $
  6643.  
  6644. @\subsubsection{WHITE}
  6645. !WHITE
  6646.  A constant defining a WHITE color.
  6647. $
  6648.  
  6649. @\subsubsection{YELLOW}
  6650. !YELLOW
  6651.  A constant defining a YELLOW color.
  6652. $
  6653.  
  6654. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6655.  
  6656. @\section{Animation}
  6657. @\label{sec-animation}
  6658. !Animation
  6659.  
  6660.  The animation tool adds the capability of animating objects using
  6661.  forward kinematics, exploiting animation curves.  Each object has
  6662.  different attributes, that prescribe its motion, scale, and visibility
  6663.  as a function of time. Every attribute has a name, which designates
  6664.  it's role. For instance an attribute animation curve named MOV\_X
  6665.  describes a translation motion along the X axis.
  6666.  
  6667. @\subsection{How to create animation curves in IRIT}
  6668. !How to create animation curves in IRIT
  6669.  
  6670.  Let OBJ be an object in IRIT to animate.
  6671.  
  6672.  Animation curves are either scalar (E1/P1) curves or three dimensional
  6673.  (E3/P3) curves with one of the following names:
  6674. # 30 2 1 1
  6675.   MOV\_X, MOV\_Y, MOV\_Z
  6676.    Translation along one axis
  6677.   MOV\_XYZ
  6678.    Arbitrary translation along all three axes
  6679.   ROT\_X, ROT\_Y, ROT\_Z
  6680.    Rotating around a single axis (degrees)
  6681.   SCL\_X, SCL\_Y, SCL\_Z
  6682.    Scale along a single axis
  6683.   SCL
  6684.    Global scale
  6685.   VISIBLE
  6686.    Visibility
  6687. #
  6688.  
  6689.  The visibility curve is a scalar curve that enables the display of
  6690.  the object if the visibility curve is positive at time t and disables
  6691.  the display (hide) the object if the visibility curve is negative at
  6692.  time t.
  6693.  
  6694.  The animation curves are all attached as an attribute named "animation"
  6695.  to the object OBJ.
  6696.  
  6697.  Example:
  6698. @\begin{verbatim}
  6699.     mov_x = cbezier( ctlpt( E1, 0.0 ),
  6700.                      ctlpt( E1, 1.0 ) );
  6701.     scl   = cbezier( ctlpt( E1, 1.0 ),
  6702.                      ctlpt( E1, 0.1 ) );
  6703.     rot_y = cbezier( ctlpt( E1, 0.0 ),
  6704.                      ctlpt( E1, 0.0 ) );
  6705.                      ctlpt( E1, 360.0 ) );
  6706.     attrib(OBJ, "animation", list( mov_x, scl, rot_y ) );
  6707. @\end{verbatim}
  6708.  
  6709.  To animate OBJ between time zero and one (Bezier curves are always
  6710.  between zero and one), by moving it a unit size in the X direction,
  6711.  scaling it to %10 of its original size and rotating it at increasing
  6712.  angular speed from zero to 360 degrees.
  6713.  
  6714.  OBJ can now be save into a file or displayed via one of the regular
  6715.  viewing commands in IRIT (i.e. VIEWOBJ).
  6716.  
  6717.  Animation is not always between zero and one. To that end one can
  6718.  apply the CREPARAM function to modify the parametric domain of the
  6719.  animation curve. The convention is that if the time is below the
  6720.  starting value of the parametric domain, the starting value of the
  6721.  curve is used.  Similarly if the time is beyond the end of the
  6722.  parameter domain of the animation curve, the end value of the
  6723.  animation curve is used.
  6724.  
  6725.  Example:
  6726. @\begin{verbatim}
  6727.     CREPARAM( mov_x, 3.0, 5.0 );
  6728. @\end{verbatim}
  6729.  
  6730.  to set the time of the motion in the x axis to be from $t = 3$ to
  6731.  $t = 5$.  for $t < 3$, mov\_x(3) is used, and for $t > 5$, mov\_x(5) is
  6732.  employed.
  6733.  
  6734.  the animation curves are regular objects in the IRIT system. Hence,
  6735.  only one object named mov\_x or scl can exist at one time. If you
  6736.  create a new object named mov\_x, the old one is overwritten! To
  6737.  preserve old animation curves you can detach the old ones by executing
  6738.  'free(mov\_x)' that removes the object named mov\_x from IRIT's object
  6739.  list but not from its previous used locations within other list
  6740.  objects, if any. For example:
  6741.  
  6742. @\begin{verbatim}
  6743.     mov_x = cbezier( ctlpt( E1, 0.0 ),
  6744.                      ctlpt( E1, 1.0 ) );
  6745.     attrib(obj1, "animation", list( mov_x ) );
  6746.     free(mov_x);
  6747.  
  6748.     mov_x = cbezier( ctlpt( E1, 2.0 ),
  6749.                      ctlpt( E1, 3.0 ) );
  6750.     attrib(obj2, "animation", list( mov_x ) );
  6751.     free(mov_x);
  6752. @\end{verbatim}
  6753.  
  6754. @\subsection{A more complete animation example}
  6755. !A more complete animation example
  6756.  
  6757. @\begin{verbatim}
  6758.   a = box( vector( 0, 0, 0 ), 1, 1, 1 );
  6759.   b = box( vector( 0, 0, 0 ), 1, 1, 1 );
  6760.   c = box( vector( 0, 0, 0 ), 1, 1, 1 );
  6761.   d = sphere( vector( 0, 0, 0), 0.7 );
  6762.   
  6763.   pt0   =  ctlpt( e1,  0.0 );
  6764.   pt1   =  ctlpt( e1,  1.0 );
  6765.   pt2   =  ctlpt( e1,  2.0 );
  6766.   pt6   =  ctlpt( e1,  6.0 );
  6767.   pt360 =  ctlpt( e1,  360.0 );
  6768.   
  6769.   pt10 = ctlpt( e1, -4.0 );
  6770.   pt11 = ctlpt( e1,  1.0 );
  6771.   pt12 = ctlpt( e1,  4.0 );
  6772.   pt13 = ctlpt( e1, -1.0 );
  6773.   
  6774.   visible = creparam( cbezier( list( pt10,  pt11 ) ), 0.0, 5.0 );
  6775.   mov_x   = creparam( cbezier( list( pt0, pt6, pt2 ) ), 0.0, 1.2 );
  6776.   mov_y   = mov_x;
  6777.   mov_z   = mov_x;
  6778.   rot_x   = creparam( cbspline( 2,
  6779.                                 list( pt0, pt360, pt0 ),
  6780.                                 list( KV_OPEN ) ),
  6781.                       1.2, 2.5 ); 
  6782.   rot_y   = rot_x;
  6783.   rot_z   = rot_x;
  6784.   scl     = creparam( cbezier( list( pt1, pt2, pt1, pt2, pt1 ) ),
  6785.                       2.5, 4.0 );
  6786.   scl_x   = scl;
  6787.   scl_y   = scl;
  6788.   scl_z   = scl;
  6789.   mov_xyz = creparam( circle( vector( 0, 0, 0 ), 2.0 ), 4.0, 5.0 );
  6790.   
  6791.   attrib( d, "animation", list( mov_xyz, visible ) );
  6792.   free( visible );
  6793.   
  6794.   visible = creparam( cbezier( list( pt12,  pt13 ) ), 0.0, 5.0 );
  6795.   
  6796.   attrib( a, "animation", list( rot_x, mov_x, scl, scl_x, visible ) );
  6797.   attrib( b, "animation", list( rot_y, mov_y, scl, scl_y, visible ) );
  6798.   attrib( c, "animation", list( rot_z, mov_z, scl, scl_z, visible ) );
  6799.   
  6800.   color( a, red );
  6801.   color( b, green );
  6802.   color( c, blue );
  6803.   color( d, cyan );
  6804.   
  6805.   demo = list( a, b, c, d );
  6806.   
  6807.   interact( demo );
  6808.   viewanim( 0, 5, 0.01 );
  6809. @\end{verbatim}
  6810.  
  6811.  In this example, we create four objects, three cubes and one sphere.
  6812.  Animation curves to translate the three cubes along the three axes for
  6813.  the time period of t = 0 to t = 1.2 are created. Rotation curves to
  6814.  rotate the three cubes along the three axes are then created for time
  6815.  period of t = 1.2 to t = 2.5. Finally, for the time period of t = 2.5
  6816.  to t = 4.0. the cubes are (not only) unifomly scaled. For the time
  6817.  period of t = 4 to t = 5, the cubes become invisible and the sphere,
  6818.  that becomes visible, is rotated along a circle of radius 2.
  6819.  
  6820. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6821.  
  6822. @\section{Display devices}
  6823. !Display devices
  6824.  
  6825.  The following display device drivers are available,
  6826. # 22 3 0 1
  6827.  Device Name
  6828.   Invocation
  6829.    Environment
  6830.  
  6831.  
  6832.  
  6833.  xgldrvs
  6834.   xgldrvs -s-
  6835.    SGI 4D GL regular driver.
  6836.  xogldrvs
  6837.   xogldrvs -s-
  6838.    SGI 4D Open GL/Motif driver.
  6839.  xgladap
  6840.   xgladap -s-
  6841.    SGI 4D GL adaptive isocurve
  6842.  
  6843.  
  6844.    experimental driver.
  6845.  x11drvs
  6846.   x11drvs -s-
  6847.    X11 driver.
  6848.  xmtdrvs
  6849.   xmtdrvs -s-
  6850.    X11 Motif driver.
  6851.  xglmdrvs
  6852.   xglmdrvs -s-
  6853.    SGI 4D GL and X11/Motif driver.
  6854.  wntdrvs
  6855.   wntdrvs -s-
  6856.    IBM PC Windows NT driver.
  6857.  wntgdrvs
  6858.   wntgdrvs -s-
  6859.    IBM PC Windows NT Open GL driver.
  6860.  os2drvs
  6861.   os2drvs -s-
  6862.    IBM PC OS2 2.x driver.
  6863.  amidrvs
  6864.   amidrvs -s-
  6865.    AmigaDOS 2.04+ driver.
  6866.  nuldrvs
  6867.   nuldrvs -s- [-d] [-D]
  6868.    A device to print the
  6869.  
  6870.  
  6871.    object stream to stdout.
  6872. #
  6873.  
  6874.  All display devices are clients communicating with the server ({\em IRIT})
  6875.  using IPC (inter process communication). On Unix and Window NT sockets are
  6876.  used. A Windows NT client can talk to a server ({\em IRIT}) on a unix host if
  6877.  hooked to the same netwrok. On OS2 pipes are used, and both the client and
  6878.  server must run on the same machine. On AmigaDOS exec messages are used,
  6879.  and both the client and server must run on the same machine.
  6880.  
  6881.    The server ({\em IRIT}) will automatically start a client display device
  6882.  if the IRIT\_DISPLAY environment variable is set to the name and options of
  6883.  the display device to run. For example:
  6884.  
  6885. @\begin{verbatim}
  6886.     setenv IRIT_DISPLAY xgldrvs -s-
  6887. @\end{verbatim}
  6888.  
  6889.    The display device must be in a directory that is in the {\bf path}
  6890.  environment variable. Most display devices require the '-s-' flags to run
  6891.  in a non-standalone mode, or a client-server mode. Most drivers can also
  6892.  be used to display data in a standalone mode (i.e., no server). For
  6893.  example:
  6894.  
  6895. @\begin{verbatim}
  6896.     xgldrvs -s solid1.dat irit.mat
  6897. @\end{verbatim}
  6898.  
  6899.     Effectively, all the display devices are also data display programs
  6900.  (poly3d, which was the display program prior to version 4.0, is retired
  6901.  in 4.0). Therefore some functionality is not always as expected. For
  6902.  example, the quit button will always force the display device to quit,
  6903.  even if poped up from {\em IRIT}, but will not cause {\em IRIT} to
  6904.  quit as might logically expected. In fact, the next time {\em IRIT} will
  6905.  try to communicate with the display device, it will find the broken
  6906.  connection and will start up a new display device.
  6907.  
  6908.     Most display devices recognize attributes found on objects. The following
  6909.  attributes are usually recognized (depending on the device capability.):
  6910.  
  6911. @\begin{itemize}
  6912. @\item
  6913.   {\bf COLOR}: Selects the drawn color of the object to be one of the 8/16
  6914.         predefined colors in the {\em IRIT} system: white, red, green, blue,
  6915.         yellow, cyan, magenta, black.
  6916.   {\bf RGB}: Overwrites (if supported) the COLOR attribute (if given) and
  6917.         sets the color of the object to the exact prescribed RGB set.
  6918.   {\bf DWIDTH}: Sets the width in pixels of the drawn object, when drawn as
  6919.         a wireframe.
  6920. @\end{itemize}
  6921.  
  6922.     All display devices recognize all the command line flags and all the
  6923.  configuration options in a configuration file, as described below. The display
  6924.  devices will make attemps to honor the requests, to the best of their ability.
  6925.     For example, only xgldrvs can render shaded models, and so only it will
  6926.  honor a {\bf DrawSolid} configuration options.
  6927.  
  6928. @\subsection{Command Line Options}
  6929. !Command Line Options
  6930.  
  6931. @\begin{verbatim}
  6932.  ???drvs [-s] [-u] [-n] [-N] [-i] [-c] [-C] [-m] [-a] [-g x1,x2,y1,y2]
  6933.          [-G x1,x2,y1,y2] [-I #IsoLines] [-F PolygonOpti FineNess] 
  6934.          [-f PolylineOpti SampPerCrv] [-l LineWidth] [-r] [-B] [-2]
  6935.          [-d] [-D] [-L NormalLen] [-4] [-b BackGround] [-S LgtSrcPos]
  6936.          [-Z ZMin ZMax] [-M] [-P] [-x ExecAnim] [-z] DFiles
  6937. @\end{verbatim}
  6938.  
  6939. @\begin{itemize}
  6940. @\item
  6941.   {\bf -s}: Runs the driver in a Standalone mode. Otherwise, the driver will
  6942.         attempt to communicate with the {\em IRIT} server.
  6943. @\item
  6944.   {\bf -u}: Forces a Unit matrix. That is, input data are {\em not}
  6945.         transformed at all.
  6946. @\item
  6947.   {\bf -n}: Draws normals of vertices.
  6948. @\item
  6949.   {\bf -N}: Draws normals of polygons.
  6950. @\item
  6951.   {\bf -i}: Draws internal edges (created by {\em IRIT}) - default is not to
  6952.         display them, and this option will force displaying them as well.
  6953. @\item
  6954.   {\bf -c}: Sets depth cueing on. Drawings that are closer to the viewer will
  6955.         be drawn in more intense color.
  6956. @\item
  6957.   {\bf -C}: Cache the piecewise linear geometry so curves and surface can
  6958.         be redisplay faster. Purging it will free memory, on the other hand.
  6959. @\item
  6960.   {\bf -m}: Provides some more information on the data file(s) parsed.
  6961. @\item
  6962.   {\bf -a}: Sets the support of antialiased lines.
  6963. @\item
  6964.   {\bf -g x1,x2,y1,y2}: Prescribes the position and location of the
  6965.         transformation window by prescribing the domain of the window in
  6966.         screen space pixels.
  6967. @\item
  6968.   {\bf -G x1,x2,y1,y2}: Prescribes the position and location of the
  6969.         viewing window by prescribing the domain of the window in
  6970.         screen space pixels.
  6971. @\item
  6972.   {\bf -I \#IsoLines}: Specifies number of isolines per surface, per direction.
  6973.         A specification of zero isolines is possible only on the command line
  6974.         and it denotes the obvious.
  6975. @\item
  6976.   {\bf -F PolyOpti FineNess}: Controls the method used to approximate surfaces
  6977.         into polygons. See the variable POLY\_APPROX\_OPT for the meaning of
  6978.         FineNess. See also -4.
  6979. @\item
  6980.   {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
  6981.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  6982.         Otherwise, an adaptive subdivision that optimizes the samples is
  6983.         employed.
  6984. @\item
  6985.   {\bf -l LineWidth}: Sets the linewidth, in pixels. Default is one pixel wide.
  6986. @\item
  6987.   {\bf -r}: Rendered mode. Draws object as solid.
  6988. @\item
  6989.   {\bf -B}: Back face culling of polygons.
  6990. @\item
  6991.   {\bf -2}: Double buffering. Prevents screen flicker on the expense of
  6992.         possibly less colors.
  6993. @\item
  6994.   {\bf -d}: Debug objects. Prints to stderr all objects read from communcation
  6995.         port with the server {\em IRIT}. 
  6996. @\item
  6997.   {\bf -D}: Debug input. Prints to stderr all characters read from communcation
  6998.         port with the server {\em IRIT}. Lowest level of communication.
  6999. @\item
  7000.   {\bf -L NormalLen}: Sets the length of the drawn normals in thousandths of
  7001.         a unit.
  7002. @\item
  7003.   {\bf -4}: Forces four polygons per almost flat region in the surface to
  7004.         polygon conversion. Otherwise two polygons only.
  7005. @\item
  7006.   {\bf -b BackGround}: Sets the background color as three RGB integers in the
  7007.         range of 0 to 255.
  7008. @\item
  7009.   {\bf -S LgtSrcPos}: Sets the lighting via the light source position.
  7010. @\item
  7011.   {\bf -Z ZMin ZMax}: Sets the near and far Z clipping planes.
  7012. @\item
  7013.   {\bf -M}: Draw control mesh/polygon of curves and surfaces, as well.
  7014. @\item
  7015.   {\bf -x ExecAnim}: Command to execute as a subprocess every iteration of
  7016.         display of an animation sequence. This command can for example save
  7017.         the display into an image file, saving the animation sequence.
  7018.         One parameter is passed, which is an running index starting from one.
  7019. @\item
  7020.   {\bf -P}: Draws curves and surfaces (surfaces are drawn using a set of
  7021.         isocurves, see -I, or polygons, see -f).
  7022. @\item
  7023.   {\bf -z}: Prints version number and current defaults.
  7024. @\end{itemize}
  7025.  
  7026. @\subsection{Configuration Options}
  7027. !Configuration Options
  7028.  
  7029.  The configuration file is read {\em before} the command line options are
  7030.  processed. Therefore, all options in this section can be overriden
  7031.  by the appropriate command line option, if any.
  7032.  
  7033. @\begin{itemize}
  7034. @\item
  7035.   {\bf TransPrefPos:} Preferred location (Xmin, YMin, Xmax, Ymax) of the
  7036.         transformation window.
  7037. @\item
  7038.   {\bf ViewPrefPos:} Preferred location (Xmin, YMin, Xmax, Ymax) of the
  7039.         viewing window.
  7040. @\item
  7041.   {\bf BackGround:} Background color. Same as '-b'.
  7042. @\item
  7043.   {\bf Internal:} Draws internal edges. Same as '-i'.
  7044. @\item
  7045.   {\bf DrawVNormal:} Draws normals of vertices. Same as '-n'.
  7046. @\item
  7047.   {\bf DrawPNormal:} Draws normals of polygons. Same as '-n'.
  7048. @\item
  7049.   {\bf MoreVerbose:} Provides some more information on the data file(s)
  7050.         parsed. Same as '-m'.
  7051. @\item
  7052.   {\bf UnitMatrix:} Forces a Unit matrix. That is, input data are {\em not}
  7053.         transformed at all. Same as '-u'.
  7054. @\item
  7055.   {\bf DrawSolid:} Requests a shaded surface rendering, as opposed to isocurve
  7056.         surface representation.
  7057. @\item
  7058.   {\bf BFaceCull:} Requests the removal of back facing polygons, for better
  7059.         visibility.
  7060. @\item
  7061.   {\bf DoubleBuffer:} Requests drawing using a double buffer, if any.
  7062. @\item
  7063.   {\bf NumOfIsolines:}  Specifies number of isolines per surface, per
  7064.         direction. Same as '-I'.
  7065. @\item
  7066.   {\bf SamplesPerCurve:} Specifies the samples per (iso)curve. See '-f'.
  7067. @\item
  7068.   {\bf PolylineOpti:} Controls the method used to subdivide a curve into
  7069.         polylines that approximate it. See '-f'.
  7070. @\item
  7071.   {\bf LineWidth:} Sets the linewidth, in pixels. Default is one pixel
  7072.        wide. Same as '-l'
  7073. @\item
  7074.   {\bf AdapIsoDir:} Selects the direction of the adaptive isoline
  7075.         rendering.
  7076. @\item
  7077.   {\bf FineNess:} Controls the fineness of the surface to polygon subdivision.
  7078.         See '-F'.
  7079. @\item
  7080.   {\bf PolygonOpti:} Controls the method used to subdivide a surface into
  7081.         polygons that approximate it. See '-F'.
  7082. @\item
  7083.   {\bf DepthCue:} Set depth cueing on. Drawings that are closer to the
  7084.         viewer will be drawn in more intense color. Same as '-c'.
  7085. @\item
  7086.   {\bf FourPerFlat:} Forces four polygons per almost flat region in the
  7087.         surface to polygon conversion. Otherwise two polygons only. Same as
  7088.         '-4'.
  7089. @\item
  7090.   {\bf AntiAlias:} Request the drawing of anti aliased lines.
  7091. @\item
  7092.   {\bf DrawSurfaceMesh:} Draws control mesh/polygon of curves and surfaces,
  7093.         as well. Same as '-M'.
  7094. @\item
  7095.   {\bf DrawSurfacePoly:} Draws curves and surfaces (surfaces are drawn using
  7096.         a set of isocurves, see -I, or polygons, see -f). Same as '-P'.
  7097. @\item
  7098.   {\bf StandAlone:} Runs the driver in a Stand alone mode. Otherwise, the
  7099.         driver will attempt to communicate with the {\em IRIT} server. Same
  7100.         as '-s'.
  7101. @\item
  7102.   {\bf TransMode:} Selects between object space transformations and screen
  7103.         space transformation.
  7104. @\item
  7105.   {\bf ViewMode:} Selects between perspective and orthographic views.
  7106. @\item
  7107.   {\bf NormalLength:} Sets the length of the drawn normals in thousandths of
  7108.         a unit. Same as '-L'.
  7109. @\item
  7110.   {\bf DebugObjects:} Debug objects. Prints to stderr all objects read
  7111.         from the communcation port with the server {\em IRIT}. Same as '-d'.
  7112. @\item
  7113.   {\bf DebugEchoInput:} Debug input. Prints to stderr all characters read
  7114.         from the communcation port with the server {\em IRIT}. Lowest level of
  7115.         communications.
  7116. @\item
  7117.   {\bf LightSrcPos:} Sets the location of the (first) light source as a rational
  7118.         four coefficient location. W of zero sets the light source at infinity.
  7119. @\end{itemize}
  7120.  
  7121. @\subsection{Interactive mode setup}
  7122. !Interactive mode setup
  7123.  
  7124.    Commands that affect the status of the display device can also be sent
  7125.  via the communication port with the {\em IRIT} server. The following commands
  7126.  are recognized as string objects with object name of "COMMAND\_":
  7127. # 20 2 0 1
  7128.  {\bf BEEP}
  7129.   Makes some sound.
  7130.  {\bf CLEAR}
  7131.   Clears the display area. All objects are deleted.
  7132.  {\bf DCLEAR}
  7133.   Delayed clear. Same as CLEAR but delayed until next
  7134.  
  7135.   object is sent from the server. Useful for animation.
  7136.  {\bf DISCONNECT}
  7137.   Closes connection with the server, but does not quit.
  7138.  {\bf EXIT}
  7139.   Closes connection with the server and quits.
  7140.  {\bf GETOBJ NAME}
  7141.   Requests the object named NAME that is returned in the
  7142.  
  7143.   output channel to the server.
  7144.  {\bf MSAVE NAME}
  7145.   Saves the transformation matrix file by the name NAME.
  7146.  {\bf REMOVE NAME}
  7147.   Request the removal of object named NAME from display.
  7148.  {\bf ANIMATE TMin TMax Dt}
  7149.   Animates current scene from TMin to TMax in Dt steps.
  7150.  {\bf STATE COMMAND}
  7151.   Changes the state of the display device. See below.
  7152. #
  7153.    The following commands are valid for the STATE COMMAND above,
  7154. # 16 2 0 1
  7155.  {\bf MoreSense:}
  7156.    More sensitive mouse control.
  7157.  {\bf LessSense:}
  7158.    Less sensitive mouse control.
  7159.  {\bf ScrnObject:}
  7160.    Toggle screen/object transformation mode.
  7161.  {\bf PerspOrtho:}
  7162.    Toggles perspective/orthographic trans. mode.
  7163.  {\bf DepthCue:}
  7164.    Toggles depth cueing drawing.
  7165.  {\bf DrawSolid:}
  7166.    Toggles isocurve/shaded solid drawing.
  7167.  {\bf BFaceCull:}
  7168.    Cull back facing polygons.
  7169.  {\bf DblBuffer:}
  7170.    Toggles single/double buffer mode.
  7171.  {\bf AntiAlias:}
  7172.    Toggles anti aliased lines.
  7173.  {\bf DrawIntrnl:}
  7174.    Toggles drawing of internal lines.
  7175.  {\bf DrawVNrml:}
  7176.    Toggles drawing of normals of vertices.
  7177.  {\bf DrawPNrml:}
  7178.    Toggles drawing of normals of polygons.
  7179.  {\bf DSrfMesh:}
  7180.    Toggles drawing of control meshes/polygons.
  7181.  {\bf DSrfPoly:}
  7182.    Toggles drawing of curves/surfaces.
  7183.  {\bf 4PerFlat:}
  7184.    Toggles 2/4 polygons per flat surface regions.
  7185.  {\bf MoreIso:}
  7186.    Doubles the number of isolines in a surface.
  7187.  {\bf LessIso:}
  7188.    Halves the number of isolines in a surface.
  7189.  {\bf FinrAprx:}
  7190.    Doubles the number of samples per curve.
  7191.  {\bf CrsrAprx:}
  7192.    Halves the number of samples per curve.
  7193.  {\bf LngrVecs:}
  7194.    Doubles the length of displayed normal vectors.
  7195.  {\bf ShrtrVecs:}
  7196.    Halves the length of displayed normal vectors.
  7197.  {\bf WiderLns:}
  7198.    Doubles the width of the drawn lines.
  7199.  {\bf NarrwLns:}
  7200.    Halves the width of the drawn lines.
  7201.  {\bf FinrAdapIso:}
  7202.    Doubles the number of adaptive isocurves.
  7203.  {\bf CrsrAdapIso:}
  7204.    Halves the number of adaptive isocurves.
  7205.  {\bf FinerRld:}
  7206.    Doubles number of ruled surfaces in adaptive isocurves.
  7207.  {\bf CrsrRld:}
  7208.    Halves number of ruled surfaces in adaptive isocurves.
  7209.  {\bf RuledSrfApx:}
  7210.    Toggles ruled surface approx. in adaptive isocurves.
  7211.  {\bf AdapIsoDir:}
  7212.    Toggles the row/col direction of adaptive isocurves.
  7213.  {\bf Front:}
  7214.    Selects a front view.
  7215.  {\bf Side:}
  7216.    Selects a side view.
  7217.  {\bf Top:}
  7218.    Selects a top view.
  7219.  {\bf Isometry:}
  7220.    Selects an isometric view.
  7221.  {\bf Clear:}
  7222.    Clears the viewing area.
  7223. #
  7224.  Obviously not all state options are valid for all drivers.
  7225.    The {\em IRIT} server defines in iritinit.irt several user-defined
  7226.  functions that exercise some of the above state commands, such as
  7227.  VIEWSTATE and VIEWSAVE.
  7228.  
  7229.    In addition to state modification via communication with the {\em IRIT}
  7230.  server, modes can be interactively modified on most of the display devices
  7231.  using a pop-up menu that is activated using the {\em right button in the
  7232.  transformation window}.
  7233.    This pop up menu is somewhat different in different drivers, but its
  7234.  entries closely follow the entries of the above state command table.
  7235.  
  7236. @\subsection{Animation Mode}
  7237. !Animation Mode
  7238.  
  7239.    All the display drivers are now able to animate objects with animation
  7240.  curves' attributes on them. For more on the way animation curves can be
  7241.  created see the Animation Section of this manual
  7242. @(Section~\ref{sec-animation}).
  7243.  
  7244.    Once a scene with animation curves' attributes is being loaded into
  7245.  a display device, one can enter "animation" mode using the "Animation"
  7246.  button available in all display devices. The user is then prompt (either
  7247.  graphically or in a textual based interface) for the starting time,
  7248.  termination time and step size of the animation. The parameter space of
  7249.  the animation curve is serving as the time domain. The default staring
  7250.  and terminating times are set as the minimal and maximal parametric
  7251.  domain values of all animation curves. An object at time t below the
  7252.  minimal parametric value will be placed at the starting value of the
  7253.  animation curve. Similarly, an object at time t above the
  7254.  maximal parametric value will be placed at the termination value of the
  7255.  animation curve. The user can also set a bouncing back and forth mode,
  7256.  the number of repetitions, and if desired, request the saving of all
  7257.  the different scenes in the animation as seperate files so a high quality
  7258.  animation can be created.
  7259.  
  7260. @\subsection{Specific Comments}
  7261. !Specific Comments
  7262.  
  7263. @\begin{itemize}
  7264. @\item
  7265.    The x11drvs supports the following X Defaults (searched at ~/.Xdefaults):
  7266. @\begin{verbatim}
  7267.         #ifndef COLOR
  7268.         irit*MaxColors:                    1
  7269.         irit*Trans*BackGround:             Black
  7270.         irit*Trans*BorderColor:            White
  7271.         irit*Trans*TextColor:              White
  7272.         irit*Trans*SubWin*BackGround:      Black
  7273.         irit*Trans*SubWin*BorderColor:     White
  7274.         irit*Trans*CursorColor:            White
  7275.         irit*View*BackGround:              Black
  7276.         irit*View*BorderColor:             White
  7277.         irit*View*CursorColor:             White
  7278.         #else
  7279.         irit*MaxColors:                    15
  7280.         irit*Trans*BackGround:             NavyBlue
  7281.         irit*Trans*BorderColor:            Red
  7282.         irit*Trans*TextColor:              Yellow
  7283.         irit*Trans*SubWin*BackGround:      DarkGreen
  7284.         irit*Trans*SubWin*BorderColor:     Magenta
  7285.         irit*Trans*CursorColor:            Green
  7286.         irit*View*BackGround:              NavyBlue
  7287.         irit*View*BorderColor:             Red
  7288.         irit*View*CursorColor:             Red
  7289.         #endif
  7290.         irit*Trans*BorderWidth:            3
  7291.         irit*Trans*Geometry:               =150x500+510+0
  7292.         irit*View*BorderWidth:             3
  7293.         irit*View*Geometry:                =500x500+0+0
  7294. @\end{verbatim}
  7295. @\item
  7296.  The Motif-based display drivers contain three types of gadgets which can be
  7297.  operated in the following manner. Scales: can be dragged or clicked outside
  7298.  button for single (mouse's middle button) or continuous (mouse's left
  7299.  button) action. Pushbuttons: activated by clicking the mouse's left button.
  7300.  The control panel: allowes rotation, translation of the objects in three
  7301.  axes, determine perspective ratio, viewing object from top, side, front or
  7302.  isometrically, determining scale factor and clipping settings, and operate
  7303.  the matrix stack. 
  7304.  
  7305.    The environment window toggles between screen/object translation, depth
  7306.  cue on/off, orthographic/perspective projection, wireframe/solid display,
  7307.  single/doubble buffering,  showing/hiding normals, including/excluding
  7308.  surface mesh, surface isolines/polygons, and four/two per flat. Xglmdrvs
  7309.  allowes inclusion/exclusion of internal edges, and in xmtdrvs pro/anti
  7310.  aliasing. Scales set normals length, lines width, buttons sensitivity,
  7311.  the number of islolines and samples.
  7312. @\item
  7313.    The locations of windows as set via [-g] and [-G] and/or via the
  7314.  configuration file overwrites in x11drvs the Geometry X11 defaults.
  7315.  To use the Geometry X11 default use '-G " "' and '-g " "' or set the
  7316.  string to empty size in the configuration file.
  7317. @\item
  7318.    In os2drvs, only -G is used to specify the dimensions of the parent window
  7319.  that holds both the viewing and the transformation window.
  7320. @\end{itemize}
  7321.  
  7322. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7323.  
  7324. @\section{Utilities - General Usage}
  7325. !Utilities - General Usage
  7326.  
  7327.    The {\em IRIT} solid modeler is accompanied by quite a few utilities. They
  7328.  can be subdivided into two major groups. The first includes auxiliary tools
  7329.  such as illustrt and poly3d-h. The second includes filters such as irit2ray
  7330.  and irit2ps.
  7331.  
  7332.    All these tools operate on input files, and most of the time produce
  7333.  data files. In all utilities that read files, the dash ('-') can be used
  7334.  to read stdin.
  7335.  
  7336.  Example:
  7337.  
  7338. @\begin{verbatim}
  7339.  poly3d-h solid1.dat | irit2ps - > solid1.ps
  7340. @\end{verbatim}
  7341.  
  7342.    All the utilities have command line options. If an option is set by a '-x'
  7343.  then '-x-' resets the option. The command line options overwrite the settings
  7344.  in config files, and the reset option is useful for cases where the option
  7345.  is set by default, in the configuration file.
  7346.  
  7347.    All utilities can read a sequence of data files. However, the {\em last}
  7348.  transformation matrices found (VIEW\_MAT and PRSP\_MAT) are actually used.
  7349.  
  7350.  Example:
  7351.  
  7352. @\begin{verbatim}
  7353.  poly3d-h solid1.dat | x11drvs solid1.dat - solid1.mat 
  7354. @\end{verbatim}
  7355.  
  7356.  x11drvs will display the original solid1.dat file with its hidden version,
  7357.  as computed by poly3d-h, all with the solid1.mat, ignoring all other matrices
  7358.  in the data stream.
  7359.  
  7360.  Under unix, compressed files with a postfix ".Z" will be {\em automatically}
  7361.  uncompressed on read and write. The following is legal under unix,
  7362.  
  7363. @\begin{verbatim}
  7364.  poly3d-h solid1.dat.Z | x11drvs solid1.dat.Z - solid1.mat
  7365. @\end{verbatim}
  7366.  
  7367.  where solid1.dat.Z was saved from within IRIT using the command
  7368.  
  7369. @\begin{verbatim}
  7370.  save( "solid1.dat.Z", solid1 );
  7371. @\end{verbatim}
  7372.  
  7373.  or similar. The unix system's "compress" and "zcat" are used for the purpose
  7374.  of (un)compressing the data via pipes. See also SAVE and LOAD.
  7375. $
  7376.  
  7377. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7378.  
  7379. @\section{poly3d-h - Hidden Line Removing Program}
  7380. !poly3d-h - Hidden Line Removing Program
  7381.  
  7382. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7383.  
  7384.  
  7385. @\subsection{Introduction}
  7386. &Introduction
  7387.  
  7388.     poly3d-h is a program to remove hidden lines from a given polygonal model.
  7389.  Freeform objects are preprocessed into polygons with controlled fineness.
  7390. @See Figure~\ref{fig-poly3dh} for some output examples of using this tool.
  7391. @\begin{figure}
  7392. @\vspace{4.3in}
  7393. @\special{psfile=user_man/solid2h.ps hscale=50 vscale=50 hoffset=-20 voffset=50}
  7394. @\special{psfile=user_man/molecule.ps hscale=50 vscale=50 hoffset=130 voffset=-40}
  7395. @\special{psfile=user_man/dodechdr.ps hscale=50 vscale=50 hoffset=240 voffset=80}
  7396. @\caption{Some examples of the use of hidden line removal tool poly3d-h to
  7397. @         remove hidden lines.}
  7398. @\label{fig-poly3dh}
  7399. @\end{figure}
  7400.  
  7401.     The program performs 4 passes over the input:
  7402.  
  7403.  1. Preprocesses and maps all polygons in a scene, and sorts them.
  7404.  
  7405.  2. Generates edges out of the polygonal model and sorts them (preprocessing
  7406.     for the scan line algorithm) into buckets.
  7407.  
  7408.  3. Intersects edges, and splits edges with non-homogeneous visibility (the
  7409.     scan line algorithm).
  7410.  
  7411.  4. Applies a visibility test of each edge.
  7412.  
  7413.         This program can handle CONVEX polygons only. From {\em IRIT} one can
  7414.  ensure that a model consists of convex polygons only using the CONVEX command:
  7415. @\begin{verbatim}
  7416.   CnvxObj = convex( Obj );
  7417. @\end{verbatim}
  7418.  just before saving it into a file. Surfaces are always decomposed into
  7419.  triangles.
  7420.  
  7421.     poly3d-h output is in the form of polylines. It is a regular {\em IRIT} data
  7422.  file that can be viewed using any of the display devices, for example.
  7423.  
  7424. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7425. @\subsection{Command Line Options}
  7426. &Command line options
  7427.  
  7428. @\begin{verbatim}
  7429.  poly3d-h [-b] [-m] [-i] [-e #Edges] [-H] [-4] [-W Width]
  7430.         [-F PolyOpti FineNess] [-q] [-o OutName] [-c] [-z] DFiles > OutFile
  7431. @\end{verbatim}
  7432.  
  7433. @\begin{itemize}
  7434. @\item
  7435.   {\bf -b}: BackFacing - if an object is closed (such as most models created by
  7436.        {\em IRIT}), back facing polygons can be deleted, therefore speeding up
  7437.        the process by at least a factor of two.
  7438. @\item
  7439.   {\bf -m}: More - provides some more information on the data file(s) parsed.
  7440. @\item
  7441.   {\bf -i}: Internal edges (created by {\em IRIT}) - default is not to
  7442.        display them, and this option will force displaying them as well.
  7443. @\item
  7444.   {\bf -e n}: Number of edges to use from each given polygon (default all).
  7445.        Handy as '-e 1 -4' for freeform data.
  7446. @\item
  7447.   {\bf -H}: Dumps both visible lines and hidden lines as separated objects.
  7448.        Hidden lines will be dumped using a different (dimmer) color and (a
  7449.        narrower) line width.
  7450. @\item
  7451.   {\bf -4}: Forces four polygons per almost flat region in the surface to
  7452.        polygon conversion. Otherwise two polygons only.
  7453. @\item
  7454.   {\bf -W Width}: Selects a default width for visible lines in inches.
  7455. @\item
  7456.   {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
  7457.        surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  7458.        FineNess. See also -4.
  7459. @\item
  7460.   {\bf -q}: Quiet mode. No printing aside from fatal errors. Disables -m.
  7461. @\item
  7462.   {\bf -o OutName}: Name of output file. Default is stdout.
  7463. @\item
  7464.   {\bf -z}: Prints version number and current defaults.
  7465. @\item
  7466.   {\bf -c}: Clips data to screen (default). If disabled ('-c-'), data
  7467.        outside the view screen ([-1, 1] in x and y) are also processed.
  7468. @\end{itemize}
  7469.  
  7470.    Some of the options may be turned on in poly3d-h.cfg. They can be then
  7471.  turned off in the command line as '-?-'.
  7472.  
  7473. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7474. @\subsection{Configuration}
  7475. &Configuration
  7476.  
  7477.    The program can be configured using a configuration file named poly3d-h.cfg.
  7478.    This is a plain ASCII file you can edit directly and set the parameters
  7479.  according to the comments there. 'poly3d-h -z' will display the current
  7480.  configuration as read from the configuration file.
  7481.  
  7482.    The configuration file is searched in the directory specified by the
  7483.  IRIT\_PATH environment variable. For example,
  7484.  'setenv IRIT\_PATH /u/gershon/irit/bin/'.
  7485.    If the IRIT\_PATH variable is not set, the current directory is searched.
  7486.  
  7487. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7488. @\subsection{Usage}
  7489. &Usage
  7490.  
  7491.    As this program is not interactive, usage is quite simple, and the only
  7492.  control available is using the command line options.
  7493. $
  7494.  
  7495. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7496.  
  7497. @\section{poly3d-r - A Simple Data Rendering Program}
  7498. !poly3d-r - A Simple Data Rendering Program
  7499.  
  7500.  Retired. Sources can be found in the contrib directory, but this program is
  7501.  no longer supported. A new renderer is expected soon.
  7502.  
  7503. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7504. @\section{Illustrt - Simple line illustration filter}
  7505. !Illustrt - Simple line illustration filter
  7506.  
  7507. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7508.  
  7509. @\subsection{Introduction}
  7510. &Introduction
  7511.  
  7512.  illustrt is a filter that processes IRIT data files and dumps out modified
  7513.  IRIT data files. illustrt can be used to make simple nice illustrations of
  7514.  data. The features of illustrt include depth sorting, hidden line clipping 
  7515.  at intersection points, and vertex enhancements. illustrt is designed to
  7516.  closely interact with irit2ps, although it is not neceessary to use irit2ps
  7517.  on illustrt output.
  7518.  
  7519. @See Figure~\ref{fig-illustrt} for some output examples of using this tool.
  7520. @\begin{figure}
  7521. @\vspace{3in}
  7522. @\special{psfile=user_man/solid1.ps hscale=50 vscale=50 hoffset=0 voffset=-50}
  7523. @\special{psfile=user_man/icosahdr.ps hscale=50 vscale=50 hoffset=220 voffset=-50}
  7524. @\caption{Some examples of the use of the illustration tool illustrt.}
  7525. @\label{fig-illustrt}
  7526. @\end{figure}
  7527.  
  7528. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7529. @\subsection{Command Line Options}
  7530. &Command line options
  7531.  
  7532. @\begin{verbatim}
  7533.    illustrt [-I #IsoLines] [-S #SampPerCrv] [-s] [-M] [-P] [-p]
  7534.             [-l MaxLnLen] [-a] [-t TrimInter] [-o OutName] [-Z InterSameZ]
  7535.             [-m] [-z] DFiles
  7536. @\end{verbatim}
  7537.  
  7538. @\begin{itemize}
  7539. @\item
  7540.   {\bf -I \#IsoLines}: Specifies number of isolines per surface, per direction.
  7541. @\item
  7542.   {\bf -S \#SampPerCrv}: Specifies the samples per (iso)curve.
  7543. @\item
  7544.   {\bf -s}: sorts the data in Z depth order that emulates hidden line removal
  7545.         once the data are drawn.
  7546. @\item
  7547.   {\bf -M}: Dumps the control mesh/polygon as well.
  7548. @\item
  7549.   {\bf -P}: Dumps the curve/surface as isocurves.
  7550. @\item
  7551.   {\bf -p}: Dumps vertices of polygons/lines as points.
  7552. @\item
  7553.   {\bf -l MaxLnLen}: breaks long lines into shorter ones with maximal length
  7554.         of MaxLnLen. This option is necessary to achieve good depth depending
  7555.         line width in the '-d' option of irit2ps.
  7556. @\item
  7557.   {\bf -a}: takes into account the angle between the two (poly)lines that
  7558.         intersect when computing how much to trim. See also -t.
  7559. @\item
  7560.   {\bf -t TrimInter}: Each time two (poly)line segments intersect in the
  7561.         projection plane, the (poly)line that is farther away from the
  7562.         viewer is clipped TrimInter amount from both sides. See also -a.
  7563. @\item
  7564.   {\bf -o OutName}: Name of output file. Default is stdout.
  7565. @\item
  7566.   {\bf -Z InterSameZ}: The maximal Z depth difference of intersection curves
  7567.         to be be considered invalid.
  7568. @\item
  7569.   {\bf -m}: More talkative mode. Prints processing information.
  7570. @\item
  7571.   {\bf -z}: Prints version number and current defaults.
  7572. @\end{itemize}
  7573.  
  7574. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7575. @\subsection{Usage}
  7576. &Usage
  7577.  
  7578.     illustrt is a simple line illustration tool. It process geometry such
  7579.  as polylines and surfaces and dumps geometry with attributes that will make
  7580.  nice line illustrations. illustrt is geared mainly toward its use with
  7581.  irit2ps to create postscript illustrations. Here is a simple example:
  7582.  
  7583. @\begin{verbatim}
  7584.  illustrt -s -l 0.1 solid1.dat | irit2ps -W 0.05 -d 0.2 0.6 -u - > solid.ps
  7585. @\end{verbatim}
  7586.  
  7587.  make sure all segments piped into irit2ps are shorter than 0.1 and sort them
  7588.  in order to make sure hidden surface removal is correctly applied. Irit2ps
  7589.  is invoked with depth cueing activated, and a default width of 0.05.
  7590.  
  7591.     illustrt dumps out regular {\em IRIT} data files, so output can be handled
  7592.  like any other data set. illustrt does the following processing to the input
  7593.  data set:
  7594.  
  7595. @\begin{itemize}
  7596. @\item
  7597.   Converts surfaces to isocurves ('-I' flag) and isocurves and curves to
  7598.   polylines ('-S' flag), and converts polygons to polylines.
  7599.     Polygonal objects are considered closed and even though each edge is
  7600.   shared by two polygons, only a single one is generated.
  7601. @\item
  7602.   Finds the intersection location in the projection plane of all segments in
  7603.   the input data set and trims away the far segment at both sides of the
  7604.   intersection point by an amount controlled by the '-t' and '-a' flags.
  7605. @\item
  7606.   Breaks polylines and long lines into short segments, as specified via the
  7607.   '-l' flag, so that width depth cueing can be applied more accurately
  7608.   (see irit2ps's '-d' flag) as well as the Z sorting.
  7609. @\item
  7610.   Generates vertices of polygons in the input data set as points in output data
  7611.   controlled via the '-p' flag.
  7612.   set.
  7613. @\item
  7614.   Applies a Z sort to the output data, if '-s', so drawing in order of the data
  7615.   will produce a properly hidden surface removal drawing.
  7616. @\end{itemize}
  7617.  
  7618.  Here is a more complex example. Make sure tubular is properly set via
  7619.  "attrib(solid1, "tubular", 0.7);" and invoke:
  7620.  
  7621. @\begin{verbatim}
  7622.  illustrt -s -p -l 0.1 -t 0.05 solid1.dat |
  7623.      irit2ps -W 0.05 -d 0.2 0.6 -p h 0.05 -u - > solid.ps
  7624. @\end{verbatim}
  7625.  
  7626.  makes sure all segments piped into irit2ps are shorter than 0.1, generates
  7627.  points for the vertices, sorts the data in order to make sure hidden surface
  7628.  removal is correctly applied, and trims the far edge by 0.05 at an
  7629.  intersection point. Irit2ps is invoked with depth cueing activated and a
  7630.  default width of 0.05, points are drawn as hollowed circles of default
  7631.  size 0.05, and lines are drawn tubular.
  7632.  
  7633.  Objects in the input stream that have an attribute by the name of
  7634.  "IllustrtNoProcess" are passed to the output unmodified.
  7635.    Objects in the input stream that have an attribute by the name of
  7636.  "SpeedWave" will have a linear segments added that emulate fast
  7637.  motion with the following attributes
  7638.  "Randomness,DirX,DirY,DirZ,Length,Distance,LengthRandom,DistanceRandom,Width"
  7639.    Objects in the input stream that have an attribute by the name of
  7640.  "HeatWave" will have a spiral curves added that emulate a heat wave
  7641.  in the +Z axis with the following attributes
  7642.  "Randomness,Length,Distance,LengthRandom,DistanceRandom,Width".
  7643.  Examples:
  7644.  
  7645. @\begin{verbatim}
  7646.  attrib(Axis, "IllustrtNoProcess", "");
  7647.  attrib(Obj, "SpeedWave", "0.0005,1,0,0,5,3,3,2,0.05");
  7648.  attrib(Obj, "HeatWave", "0.015,0.1,0.03,0.06,0.03,0.002");
  7649. @\end{verbatim}
  7650. $
  7651.  
  7652. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7653. @\section{Dat2Bin - Data To Binary Data file filter}
  7654. !DAT2BIN - Data To Binary Data file filter
  7655.  
  7656. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7657. @\subsection{Command Line Options}
  7658. &Command line options
  7659.  
  7660. @\begin{verbatim}
  7661.    dat2bin [-t] [-z] DFiles
  7662. @\end{verbatim}
  7663.  
  7664. @\begin{itemize}
  7665. @\item
  7666.   {\bf -t}: Dumps data to stdout as text instead of binary.
  7667.   {\bf -z}: Print version number and current defaults.
  7668. @\end{itemize}
  7669.  
  7670. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7671. @\subsection{Usage}
  7672. &Usage
  7673.  
  7674.     It may be sometimes desired to convert .dat data files into a binary form,
  7675.  for example, for fast loading of files with large geometry. Binary files can
  7676.  be somewhat larger, are unreadable in editors but are much faster to load in.
  7677.  A binary file must have a '.bdt' file type.
  7678.  
  7679.  Example:
  7680.  
  7681. @\begin{verbatim}
  7682.    dat2bin b58polys.dat > b58polys.bdt
  7683.    dat2bin -t b58polys.bdt | more
  7684. @\end{verbatim}
  7685.  
  7686.  to convert a text file b58polys.dat into a binary file b58polys.bdt and
  7687.  to view the content of the binary file by converting it back to text. At
  7688.  this time data through pipes must be in text. That is, the following is
  7689.  {\em illegal}:
  7690.  
  7691. @\begin{verbatim}
  7692.    dat2bin b58polys.dat | xglmdrvs -
  7693. @\end{verbatim}
  7694.  
  7695.  It should be remembered that the binary format is not documented and
  7696.  it might change in the future. Moreover, it is machine dependent and can
  7697.  very well may be unreadible between different platforms.
  7698. $
  7699.  
  7700. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7701. @\section{Dat2Irit - Data To IRIT file filter}
  7702. !DAT2IRIT - Data To IRIT file filter
  7703.  
  7704.   Converts '.dat' and '.bdt' data files to '.irt' {\em IRIT} scripts.
  7705.  
  7706. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7707. @\subsection{Command Line Options}
  7708. &Command line options
  7709.  
  7710. @\begin{verbatim}
  7711.    dat2irit [-z] DFiles
  7712. @\end{verbatim}
  7713.  
  7714. @\begin{itemize}
  7715. @\item
  7716.   {\bf -z}: Print version number and current defaults.
  7717. @\end{itemize}
  7718.  
  7719. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7720. @\subsection{Usage}
  7721. &Usage
  7722.  
  7723.     It may be sometimes desired to convert .dat data files into a form that
  7724.  can be fed back to {\em IRIT} - a '.irt' file. This filter does exactly that.
  7725.  
  7726.  Example:
  7727.  
  7728. @\begin{verbatim}
  7729.    dat2irit b58.dat > b58-new.irt
  7730. @\end{verbatim}
  7731. $
  7732.  
  7733. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7734. @\section{Dxf2Irit - DXF (Autocad) To IRIT filter}
  7735. !DXF2IRIT - DXF (Autocad) To IRIT filter
  7736.  
  7737.    Due to lack of real documentation on the DXF format (for surfaces), this
  7738.  filter is not really complete. It only work for polygons, and is provided
  7739.  here only for those desperate enough to try and fix it...
  7740. $
  7741.  
  7742. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7743. @\section{Irit2Dxf - IRIT To DXF (Autocad) filter}
  7744. !IRIT2DXF - IRIT To DXF (Autocad) filter
  7745.  
  7746.    Due to lack of real documentation on the DXF format (for surfaces), this
  7747.  filter is not really complete. It works only for polygons, and is provided
  7748.  here only for those desperate enough to try and fix it...
  7749. $
  7750.  
  7751. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7752. @\section{Irit2Iv - IRIT To SGI's Inventor filter}
  7753. !IRIT2IV - IRIT To SGI's Inventor filter
  7754.  
  7755.  IV is the format used by the Inventor modeling/rendering package from SGI.
  7756.  
  7757. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7758. @\subsection{Command Line Options}
  7759. &Command line options
  7760.  
  7761. @\begin{verbatim}
  7762.   irit2iv [-l] [-4] [-P] [-F PolyOpti FineNess] [-f PolyOpti SampPerCrv]
  7763.                                                              [-T] [-z] DFiles
  7764. @\end{verbatim}
  7765.  
  7766. @\begin{itemize}
  7767. @\item
  7768.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  7769.        by a single polygon along their linear direction.
  7770.        Although, most of the time, linear direction can be exactly represented
  7771.        using a single polygon, even a bilinear surface can have a free form
  7772.        shape (saddle like) that is not representable using a single polygon.
  7773.        Note that although this option will better emulate the surface shape,
  7774.        it will create unnecessary polygons in cases where one is enough.
  7775. @\item
  7776.   {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
  7777. @\item
  7778.   {\bf -P}: Polygonize freeform shapes. Default is to leave freeform curves
  7779.        and surfaces as is.
  7780. @\item
  7781.   {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
  7782.        surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  7783.        FineNess. See also -4.
  7784. @\item
  7785.   {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
  7786.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  7787.         Otherwise, an adaptive subdivision that optimizes the samples is
  7788.         employed.
  7789. @\item
  7790.   {\bf -T}: Talkative mode. Prints processing information.
  7791. @\item
  7792.   {\bf -z}: Prints version number and current defaults.
  7793. @\end{itemize}
  7794.  
  7795. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7796. @\subsection{Usage}
  7797. &Usage
  7798.  
  7799.     Irit2Iv converts freeform surfaces and polygons into polygons and
  7800.  saved in iv Inventor's ascii file format.
  7801.   
  7802.  Example:
  7803.  
  7804. @\begin{verbatim}
  7805.  irit2iv solid1.dat > solid1.iv
  7806. @\end{verbatim}
  7807.  
  7808.     Surfaces are converted to polygons with fineness control:
  7809.   
  7810. @\begin{verbatim}
  7811.  irit2iv -F 0 16 - view.mat < saddle.dat > saddle.iv
  7812. @\end{verbatim}
  7813.  
  7814.     Note the use of '-' for stdin.
  7815. $
  7816.  
  7817. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7818. @\section{Irit2Nff - IRIT To NFF filter}
  7819. !IRIT2NFF - IRIT To NFF filter
  7820.  
  7821. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7822. @\subsection{Command Line Options}
  7823. &Command line options
  7824.  
  7825. @\begin{verbatim}
  7826.   irit2nff [-l] [-4] [-c] [-F PolyOpti FineNess] [-o OutName] [-T] [-g]
  7827.                                                                   [-z] DFiles
  7828. @\end{verbatim}
  7829.  
  7830. @\begin{itemize}
  7831. @\item
  7832.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  7833.        by a single polygon along their linear direction.
  7834.        Although, most of the time, linear direction can be exactly represented
  7835.        using a single polygon, even a bilinear surface can have a free-form
  7836.        shape (saddle-like) that is not representable using a single polygon.
  7837.        Note that although this option will better emulate the surface shape,
  7838.        it will create unnecessary polygons in cases where one is enough.
  7839. @\item
  7840.   {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
  7841. @\item
  7842.   {\bf -c}: Output files should be filtered by cpp. When set, the usually
  7843.        huge geometry file is separated from the main nff file that contains
  7844.        the surface properties and view parameters. By default all data,
  7845.        including the geometry, are saved into a single file with type extension
  7846.        '.nff'. Use of '-c' will pull out all the geometry into a file with
  7847.        the same name but a '.geom' extension, which will be included using the
  7848.        '\#include' command. The '.nff' file should, in that case, be
  7849.        preprocessed using cpp before being piped into the nff renderer.
  7850. @\item
  7851.   {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
  7852.        surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  7853.        FineNess. See also -4.
  7854. @\item
  7855.   {\bf -o OutName}: Name of output file. By default the name of the first data
  7856.        file from the {\em DFiles} list is used.  See below on the output files.
  7857. @\item
  7858.   {\bf -g}: Generates the geometry file only. See below.
  7859. @\item
  7860.   {\bf -T}: Talkative mode. Prints processing information.
  7861. @\item
  7862.   {\bf -z}: Prints version number and current defaults.
  7863. @\end{itemize}
  7864.  
  7865. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7866. @\subsection{Usage}
  7867. &Usage
  7868.  
  7869.     Irit2Nff converts freeform surfaces into polygons in a format that can
  7870.  be used by an NFF renderer. Usually, one file is created with '.nff' type
  7871.  extension. Since the number of polygons can be extremely large, a '-c'
  7872.  option is provided, which separates the geometry from the surface
  7873.  properties and view specification, but requires preprocessing by cpp.
  7874.  The geometry is isolated in a file with extension '.geom' and included
  7875.  (via '\#include') in the main '.nff' file. The latter holds the surface
  7876.  properties for all the geometry as well as the viewing specification.
  7877.  This allows for the changing of shading or the viewing properties while
  7878.  editing small ('.nff') files.
  7879.  
  7880.     If '-g' is specified, only the '.geom' file is created, preserving the
  7881.  current '.nff' file. The '-g' flag can be specified only with '-c'.
  7882.  
  7883.     In practice, it may be useful to create a low resolution approximation
  7884.  of the model, change viewing/shading parameters in the '.nff' file until
  7885.  a good view and/or surface quality is found, and then run Irit2Nff once more
  7886.  to create a high resolution approximation of the geometry using '-g'.
  7887.  
  7888.  Example:
  7889.  
  7890. @\begin{verbatim}
  7891.  irit2nff -c -l -F 0 8 b58.dat
  7892. @\end{verbatim}
  7893.  
  7894.  creates b58.nff and b58.geom with low resolution (FineNess of 5).
  7895.  
  7896.  Once done with parameter setting, a fine approximation of the model can
  7897.  be created with:
  7898.  
  7899. @\begin{verbatim}
  7900.  irit2nff -c -l -g -F 0 64 b58.dat
  7901. @\end{verbatim}
  7902.  
  7903.  which will only recreate b58.geom (because of the -g option).
  7904.  
  7905.  One can overwrite the viewing matrix by appending a new matrix in the
  7906.  end of the command line, created by a display device:
  7907.  
  7908. @\begin{verbatim}
  7909.  xgldrvs b58.dat
  7910.  irit2nff -l -F 0 32 b58.dat irit.mat
  7911. @\end{verbatim}
  7912.  
  7913.  where irit.mat is the viewing matrix created by xgldrvs.
  7914.  
  7915. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7916. @\subsection{Advanced Usage}
  7917. &Advanced Usage
  7918.  
  7919.    One can specify surface qualities for individual surfaces of a model.
  7920.  Several such attributes are supported by Irit2Nff and can be set within
  7921.  {\em IRIT}. See also the ATTRIB {\em IRIT} command.
  7922.  
  7923.    If a certain surface should be finer than the rest of the scene, one can
  7924.  set a "resolution" attribute which specifies the {\em relative} FineNess
  7925.  resolution of this specific surface.
  7926.  
  7927.  Example:
  7928.  
  7929. @\begin{verbatim}
  7930.  attrib( srf1, "resolution", 2 );
  7931. @\end{verbatim}
  7932.  
  7933.  will force srf1 to have twice the default resolution, as set via the '-f'
  7934.  flag.
  7935.  
  7936.    Almost flat patches are converted to polygons. The rectangle can be
  7937.  converted into two polygons (by subdividing along one of its diagonals) or
  7938.  into four by introducing a new point at the center of the patch. This
  7939.  behavior is controlled by the '-4' flag, but can be overwritten for
  7940.  individual surfaces by setting a "twoperflat" or a "fourperflat" attribute.
  7941.  
  7942.    NFF specific properties are controlled via the following attributes:
  7943.  "kd", "ks", "shine", "trans", "index". Refer to the NFF manual for detail.
  7944.  
  7945.  Example:
  7946.  
  7947. @\begin{verbatim}
  7948.  attrib( srf1, "kd", 0.3 );
  7949.  attrib( srf1, "shine", 30 );
  7950. @\end{verbatim}
  7951.  
  7952.    Surface color is controlled in two levels. If the object has an RGB
  7953.  attribute, it is used. Otherwise, a color, as set via the {\em IRIT} COLOR
  7954.  command, is used if set.
  7955.  
  7956.  Example:
  7957.  
  7958. @\begin{verbatim}
  7959.  attrib( tankBody, "rgb", "244,164,96" );
  7960. @\end{verbatim}
  7961. $
  7962.  
  7963. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7964. @\section{Irit2Plg - IRIT To PLG (REND386) filter}
  7965. !IRIT2PLG - IRIT To PLG (REND386) filter
  7966.  
  7967.  PLG is the format used by the rend386 real time renderer for the IBM PC.
  7968.  
  7969. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7970. @\subsection{Command Line Options}
  7971. &Command line options
  7972.  
  7973. @\begin{verbatim}
  7974.   irit2plg [-l] [-4] [-F PolyOpti FineNess] [-T] [-z] DFiles
  7975. @\end{verbatim}
  7976.  
  7977. @\begin{itemize}
  7978. @\item
  7979.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  7980.        by a single polygon along their linear direction.
  7981.        Although, most of the time, linear direction can be exactly represented
  7982.        using a single polygon, even a bilinear surface can have a free form
  7983.        shape (saddle like) that is not representable using a single polygon.
  7984.        Note that although this option will better emulate the surface shape,
  7985.        it will create unnecessary polygons in cases where one is enough.
  7986. @\item
  7987.   {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
  7988. @\item
  7989.   {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
  7990.        surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  7991.        FineNess. See also -4.
  7992. @\item
  7993.   {\bf -T}: Talkative mode. Prints processing information.
  7994. @\item
  7995.   {\bf -z}: Prints version number and current defaults.
  7996. @\end{itemize}
  7997.  
  7998. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7999. @\subsection{Usage}
  8000. &Usage
  8001.  
  8002.     Irit2Plg converts freeform surfaces and polygons into polygons in a
  8003.  format that can be used by the REND386 renderer. 
  8004.   
  8005.  Example:
  8006.  
  8007. @\begin{verbatim}
  8008.  irit2plg solid1.dat > solid1.plg
  8009. @\end{verbatim}
  8010.  
  8011.     Surfaces are converted to polygons with fineness control:
  8012.   
  8013. @\begin{verbatim}
  8014.  irit2plg -F 0 16 - view.mat < saddle.dat > saddle.plg
  8015. @\end{verbatim}
  8016.  
  8017.     Note the use of '-' for stdin.
  8018. $
  8019.  
  8020. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8021. @\section{Irit2Ps - IRIT To PS filter}
  8022. !IRIT2PS - IRIT To PS filter
  8023.  
  8024. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8025. @\subsection{Command Line Options}
  8026. &Command line options
  8027.  
  8028. @\begin{verbatim}
  8029.   irit2ps [-l] [-4] [-s Size] [-I #UIso[:#VIso[:#WIso]]] [-F PolyOpti FineNess]
  8030.           [-f PolyOpti SampPerCrv] [-M] [-G] [-P] [-W LineWidth]
  8031.           [-w WidenLen WidenWidth] [-b R G B] [-c] [-C] [-T] [-i] [-o OutName]
  8032.           [-d [Zmin Zmax]] [-D [Zmin Zmax]] [-p PtType PtSize] [-u] [-z] DFiles
  8033. @\end{verbatim}
  8034.  
  8035. @\begin{itemize}
  8036. @\item
  8037.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  8038.         by a single polygon along their linear direction.
  8039.          Although most of the time, linear direction can be exactly represented
  8040.         using a single polygon, even a bilinear surface can have a free-form
  8041.         shape (saddle-like) that is not representable using a single polygon.
  8042.           Note that although this option will better emulate the surface shape,
  8043.         it will create unnecessary polygons in cases where one is enough.
  8044. @\item
  8045.   {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
  8046. @\item
  8047.   {\bf -s Size}: Controls the size of the postscript output in inches.
  8048.         Default is to fill the entire screen.
  8049. @\item
  8050.   {\bf -I \#UIso[:\#VIso[:\#WIso]]}: Specifies the number of isolines per
  8051.         surface/trivariate, per direction. If \#VIso or \#WIso is not
  8052.         specified, \#UIso is used for \#VIso etc.
  8053. @\item
  8054.   {\bf -F PolygonOpti FineNess}: Optimality of polygonal approximation of
  8055.         surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  8056.         FineNess. See also -4.
  8057. @\item
  8058.   {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
  8059.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  8060.         Otherwise, an adaptive subdivision that optimizes the samples is
  8061.         employed.
  8062. @\item
  8063.   {\bf -M}: Dumps the control mesh/polygon as well.
  8064. @\item
  8065.   {\bf -G}: Dumps the curve/surface (as freeform geometry). Default. See -I,
  8066.         -C, -f for control on polyline approximation.
  8067. @\item
  8068.   {\bf -P}: Dumps the curve/surface (as polygons). See -F, -l, -4 for control
  8069.         on polygonal approximation.
  8070. @\item
  8071.   {\bf -W \#LineWidth}: Sets the line drawing width in inches. Default is
  8072.         as thin as possible. This option will overwrite only those objects
  8073.         that do {\em not} have a "width" attribute. See also -d. If LineWidth
  8074.         is negative its absolute value is used to scale the current width
  8075.         of the object if has one, or the default width otherwise.
  8076. @\item
  8077.   {\bf -w WidenLen WidenWidth}: If end points of polylines should be made
  8078.         wider, and if so to what width.
  8079. @\item
  8080.   {\bf -b R G B}: Sets a colored background. RGB are three integers prescribing
  8081.         the Red, Green, and Blue coefficients. if no -c (i.e. a gray level
  8082.         drawing) this color is converted to a gray level using RGB to
  8083.         T.V. Y(IQ) channel conversion.
  8084. @\item
  8085.   {\bf -c}: Creates a {\em color} postscript file.
  8086. @\item
  8087.   {\bf -C}: Curve mode. Dumps freeform curves and surfaces as cubic
  8088.        Bezier curves. Higher order curves and surfaces and/or rationals are
  8089.        approximated by cubic Bezier curves. This option generates data
  8090.        files that are roughly a third of piecewise linear postscript files
  8091.        (by disabling this feature, -C-), but takes a longer time to compute.
  8092. @\item
  8093.   {\bf -T}: Talkative mode. Prints processing information.
  8094. @\item
  8095.   {\bf -i}: Internal edges (created by {\em IRIT}) - the default is not to
  8096.        display them, and this option will force displaying them as well.
  8097. @\item
  8098.   {\bf -o OutName}: Name of output file. Default is stdout.
  8099. @\item
  8100.   {\bf -d [Zmin Zmax]}: Sets the ratios between the depth cue and the width of
  8101.         the dumped data. See also -W, -p. Closer lines/points will be drawn
  8102.         wider/larger. Zmin and Zmax are optional. The object's bounding
  8103.         box is otherwise computed and used.
  8104. @\item
  8105.   {\bf -D [Zmin Zmax]}: Same as -d, but depth cue the color or gray scale
  8106.         instead of width. You might need to consider the sorting option
  8107.         of the illustrt tool (-s of illustrt) for proper drawings.
  8108.         Only one of -d and -D can be used.
  8109. @\item
  8110.   {\bf -p PtType PtSize}: Specifies the way points are drawn.
  8111.         PtType can be one of H, F, C for Hollow circle, Full Circle, or
  8112.         Cross. PtSize specifies the size of the point to be drawn, in inches.
  8113.         Vectors will also be drawn as points, but with an additional thin
  8114.         line to the origin. See also -d.
  8115. @\item
  8116.   {\bf -u}: Forces a unit matrix transformation, i.e. no transformation.
  8117. @\item
  8118.   {\bf -z}: Prints version number and current defaults.
  8119. @\end{itemize}
  8120.  
  8121. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8122. @\subsection{Usage}
  8123. &Usage
  8124.  
  8125.     Irit2Ps converts freeform surfaces and polygons into a postscript file.
  8126.   
  8127.  Example:
  8128.  
  8129. @\begin{verbatim}
  8130.  irit2ps solid1.dat > solid1.ps
  8131. @\end{verbatim}
  8132.  
  8133.     Surfaces are converted to polygons with fineness control:
  8134.   
  8135. @\begin{verbatim}
  8136.  irit2ps -f 0 32 -c -W 0.01 saddle.dat > saddle.ps
  8137. @\end{verbatim}
  8138.  
  8139.  creates a postscript file for the saddle model, in color, and with
  8140.  lines 0.01 inch thick.
  8141.  
  8142. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8143. @\subsection{Advanced Usage}
  8144. &Advanced Usage
  8145.  
  8146.    One can specify several attributes that affect the way the postscript
  8147.  file is generated. The attributes can be generated within {\em IRIT}.
  8148.  See also the ATTRIB {\em IRIT} command.
  8149.  
  8150.    If a certain object should be thinner or thicker than the rest of the scene,
  8151.  one can set a "width" attribute which specifies the line width in inches of
  8152.  this specific object.
  8153.  
  8154.  Example:
  8155.  
  8156. @\begin{verbatim}
  8157.  attrib( srf1, "width", 0.02 );
  8158. @\end{verbatim}
  8159.  
  8160.  will force srf1 to have this width, instead of the default as set via the
  8161.  '-W' flag.
  8162.  
  8163.  If a (closed) object, a polygon for example, needs to be filled, a "fill"
  8164.  attribute should be set, with a value equal to the gray level desired.
  8165.  
  8166.  Example:
  8167.  
  8168. @\begin{verbatim}
  8169.  attrib( poly, "fill", 0.5 );
  8170. @\end{verbatim}
  8171.  
  8172.  will fill poly with \%50 gray.
  8173.  
  8174.  If an object, a polygon for example, needs to be painted in a gray level
  8175.  instead of black, a "gray" attribute should be set, with a value equal
  8176.  to the gray level desired.
  8177.  
  8178.  Example:
  8179.  
  8180. @\begin{verbatim}
  8181.  attrib( poly, "gray", 0.5 );
  8182. @\end{verbatim}
  8183.  
  8184.  will draw poly with \%50 gray.
  8185.  
  8186.  Dotted or dashed line effects can be created using a "dash" attribute which
  8187.  is a direct PostScript dash string. A simple form of this string is "[a b]"
  8188.  in which a is the drawing portion (black) in inches, followed by b inches
  8189.  of white space. See the postScript manual for more about the format of this
  8190.  string. Here is an example for a dotted-dash line.
  8191.  
  8192. @\begin{verbatim}
  8193.  attrib( poly, "dash", "[0.006 0.0015 0.001 0.0015] 0" );
  8194. @\end{verbatim}
  8195.  
  8196.    Surface color is controlled (for color postscript only - see -c) in two
  8197.  levels. If the object has an RGB attribute, it is used. Otherwise, a color as
  8198.  set via the {\em IRIT} COLOR command is used.
  8199.  
  8200.  Example:
  8201.  
  8202. @\begin{verbatim}
  8203.  attrib( Ball, "rgb", "255,0,0" );
  8204. @\end{verbatim}
  8205.  
  8206.     An object can be drawn as ``tubes'' instead of full lines. The ratio
  8207.  between the inner and the outer radii of the tube is provided as the
  8208.  TUBULAR attribute:
  8209.  
  8210. @\begin{verbatim}
  8211.  attrib( final, "tubular", 0.7 );
  8212. @\end{verbatim}
  8213. $
  8214.  
  8215. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8216. @\section{Irit2Ray - IRIT To RAYSHADE filter}
  8217. !IRIT2RAY - IRIT To RAYSHADE filter
  8218.  
  8219. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8220. @\subsection{Command Line Options}
  8221. &Command line options
  8222.  
  8223. @\begin{verbatim}
  8224.   irit2ray [-l] [-4] [-G GridSize] [-F PolyOpti FineNess]
  8225.            [-f PolyOpti SampPerCrv] [-o OutName] [-g] [-p Zmin Zmax] [-P]
  8226.            [-M] [-T] [-I #UIso[:#VIso[:#WIso]]] [-s ObjSeq#] [-z] DFiles
  8227. @\end{verbatim}
  8228.  
  8229. @\begin{itemize}
  8230. @\item
  8231.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  8232.         by a single polygon along their linear direction.
  8233.          Although most of the time, linear direction can be exactly represented
  8234.         using a single polygon, even a bilinear surface can have a free-form
  8235.         shape (saddle-like) that is not representable using a single polygon.
  8236.           Note that although this option will better emulate the surface shape,
  8237.         it will create unnecessary polygons in cases where one is enough.
  8238. @\item
  8239.   {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
  8240. @\item
  8241.   {\bf -G GridSize}: Usually objects are grouped as {\em lists} of polygons.
  8242.         This flags will coerce the usage of the RAYSHADE {\em grid} structure,
  8243.         with {\em GridSize} being used as the grid size along the object
  8244.         bounding box's largest dimension.
  8245. @\item
  8246.   {\bf -F PolygonOpti FineNess}: Optimality of polygonal approximation of
  8247.         surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  8248.         FineNess. See also -4.
  8249. @\item
  8250.   {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
  8251.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  8252.         Otherwise, an adaptive subdivision that optimizes the samples is
  8253.         employed.
  8254. @\item
  8255.   {\bf -o OutName}: Name of output file. By default the name of the first data
  8256.         file from the {\em DFiles} list is used.  See below on the output
  8257.         files.
  8258. @\item
  8259.   {\bf -g}: Generates the geometry file only. See below.
  8260. @\item
  8261.   {\bf -p Zmin Zmax}: Sets the ratios between the depth cue and the width of
  8262.         the dumped {\em polylines}. See also -P. Closer lines will be drawn
  8263.         wider.
  8264. @\item
  8265.   {\bf -P}: Forces dumping polygons as polylines with thickness controlled
  8266.         by -p.
  8267. @\item
  8268.   {\bf -M}: If -P (see -P and -p) then converts the control mesh/polygon
  8269.         to polylines which are represented as a sequence of truncated
  8270.         cones.
  8271. @\item
  8272.   {\bf -T}: Talkative mode. Prints processing information.
  8273. @\item
  8274.   {\bf -I \#UIso[:\#VIso[:\#WIso]]}: Specifies the number of isolines per
  8275.         surface/trivariate, per direction. If \#VIso or \#WIso is not
  8276.         specified, \#UIso is used for \#VIso etc.
  8277. @\item
  8278.   {\bf -s ObjSeq\#}: Sets object sequence number if no object name. Default 1.
  8279. @\item
  8280.   {\bf -z}: Prints version number and current defaults.
  8281. @\end{itemize}
  8282.  
  8283. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8284. @\subsection{Usage}
  8285. &Usage
  8286.  
  8287.     Irit2Ray converts freeform surfaces into polygons in a format that can
  8288.  be used by RAYSHADE. Two files are created, one with a '.geom' extension and
  8289.  one with '.ray'. Since the number of polygons can be extremely large,
  8290.  the geometry is isolated in the '.geom' file and is included
  8291.  (via '\#include') in the main '.ray' file. The latter holds the surface
  8292.  properties for all the geometry as well as viewing and RAYSHADE specific
  8293.  commands. This allows for the changing of the shading or the viewing
  8294.  properties while editing small ('.ray') files.
  8295.  
  8296.     If '-g' is specified, only the '.geom' file is created, preserving the
  8297.  current '.ray' file.
  8298.  
  8299.     In practice, it may be useful to create a low resolution approximation
  8300.  of the model, change the viewing/shading parameters in the '.ray' file until
  8301.  a good view and/or surface quality is found, and then run Irit2Ray once more
  8302.  to create a high resolution approximation of the geometry using '-g'.
  8303.  
  8304.  Example:
  8305.  
  8306. @\begin{verbatim}
  8307.  irit2ray -l -F 0 8 b58.dat
  8308. @\end{verbatim}
  8309.  
  8310.  creates b58.ray and b58.geom with low resolution (FineNess of 5).
  8311.    At such low resolution it can very well may happen that triangles will have
  8312.  normals "over the edge" since a single polygon may approximate a highly
  8313.  curved surface. That will cause RAYSHADE to issue an
  8314.  "Inconsistent triangle normals" warning. This problem will not exist if
  8315.  high fineness is used.
  8316.    One can ray trace this scene using a command similar to:
  8317.  
  8318. @\begin{verbatim}
  8319.  RAYSHADE -p -W 256 256 b58.ray > b58.rle
  8320. @\end{verbatim}
  8321.  
  8322.  Once done with parameter setting for RAYSHADE, a fine approximation of the
  8323.  model can be created with:
  8324.  
  8325. @\begin{verbatim}
  8326.  irit2ray -l -g -F 0 64 b58.dat
  8327. @\end{verbatim}
  8328.  
  8329.  which will only recreate b58.geom (because of the -g option).
  8330.  
  8331.  Interesting effects can be created using the depth cue support and polyline
  8332.  conversion of irit2ray. For example
  8333.  
  8334. @\begin{verbatim}
  8335.  irit2ray -G 5 -P -p -0.0 0.5 solid1.dat
  8336. @\end{verbatim}
  8337.  
  8338.  will dump solid1 as a set of polylines (represented as truncated cones in
  8339.  RAYSHADE) with varying thickness according to the $z$ depth. Another example
  8340.  is
  8341.  
  8342. @\begin{verbatim}
  8343.  irit2ray -G 5 -P -p -0.1 1.0 saddle.dat
  8344. @\end{verbatim}
  8345.  
  8346.  which dumps the isolines extracted from the saddle surface with varying
  8347.  thickness.
  8348.  
  8349.    Each time a data file is saved in {\em IRIT}, it can be saved with the
  8350.  viewing matrix of the last INTERACT by saving the VIEW\_MAT object as well.
  8351.  I.e.:
  8352.  
  8353. @\begin{verbatim}
  8354.  save( "b58", b58 );
  8355. @\end{verbatim}
  8356.  
  8357.    However one can overwrite the viewing matrix by appending a new matrix
  8358.  in the end of the command line, created by the display devices:
  8359.  
  8360. @\begin{verbatim}
  8361.  os2drvs b58.dat
  8362.  irit2ray -l -F 0 16 b58.dat irit.mat
  8363. @\end{verbatim}
  8364.  
  8365.  where irit.mat is the viewing matrix created by os2drvs. The output name,
  8366.  by default, is the last input file name, so you might want to provide an
  8367.  explicit name with the -o flag.
  8368.  
  8369. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8370. @\subsection{Advanced Usage}
  8371. &Advanced Usage
  8372.  
  8373.    One can specify surface qualities for individual surfaces of a model.
  8374.  Several such attributes are supported by Irit2Ray and can be set within
  8375.  {\em IRIT}. See also the ATTRIB {\em IRIT} command.
  8376.  
  8377.    If a certain surface should be finer than the rest of the scene, one can
  8378.  set a "resolution" attribute which specifies the {\em relative} FineNess
  8379.  resolution of this specific surface.
  8380.  
  8381.  Example:
  8382.  
  8383. @\begin{verbatim}
  8384.  attrib( srf1, "resolution", 2 );
  8385. @\end{verbatim}
  8386.  
  8387.  will force srf1 to have twice the default resolution, as set via the '-f'
  8388.  flag.
  8389.  
  8390.    Almost flat patches are converted to polygons. The rectangle can be
  8391.  converted into two polygons (by subdividing along one of its diagonals) or
  8392.  into four by introducing a new point at the patch center. This behavior is
  8393.  controlled by the '-4' flag, but can be overwritten for individual surfaces
  8394.  bu setting "twoperflat" or "fourperflat".
  8395.  
  8396.    RAYSHADE specific properties are controlled via the following attributes:
  8397.  "specpow", "reflect", "transp", "body", "index", and "texture". The value of
  8398.  this attributes must be strings as it is copied verbatim. Refer to
  8399.  RAYSHADE's manual for their meaning.
  8400.  
  8401.   Example:
  8402.  
  8403. @\begin{verbatim}
  8404.  attrib( srf1, "transp", "0.3" );
  8405.  attrib( srf1, "texture", "wood" );
  8406. @\end{verbatim}
  8407.  
  8408.    Surface color is controlled in two levels. If the object has an RGB
  8409.  attribute, it is used. Otherwise a color as set via the {\em IRIT} COLOR
  8410.  command is being used if set.
  8411.  
  8412.  Example:
  8413.  
  8414. @\begin{verbatim}
  8415.  attrib( tankBody, "rgb", "244,164,96" );
  8416. @\end{verbatim}
  8417. $
  8418.  
  8419. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8420. @\section{Irit2Scn - IRIT To SCENE (RTrace) filter}
  8421. !IRIT2Scn - IRIT To SCENE (RTrace) filter
  8422.  
  8423.  SCENE is the format used by the RTrace ray tracer. This filter was donated
  8424.  by Antonio Costa (acc@asterix.inescn.pt), the author of RTrace.
  8425.  
  8426. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8427. @\subsection{Command Line Options}
  8428. &Command line options
  8429.  
  8430. @\begin{verbatim}
  8431.   irit2scn [-l] [-4] [-F PolyOpti FineNess] [-o OutName] [-g] [-T] [-z] DFiles
  8432. @\end{verbatim}
  8433.  
  8434. @\begin{itemize}
  8435. @\item
  8436.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  8437.        as a single polygon along their linear direction.
  8438.          Although most of the time, linear direction can be exactly represented
  8439.        using a single polygon, even a bilinear surface can have a free-form
  8440.        shape (saddle-like) that is not representable using a single polygon.
  8441.          Note that although this option will better emulate the surface shape,
  8442.        it will create unnecessary polygons in cases where one is enough.
  8443. @\item
  8444.   {\bf -4}: Four - Generates four polygons per flat patch.
  8445. @\item
  8446.   {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
  8447.        surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  8448.        FineNess. See also -4.
  8449. @\item
  8450.   {\bf -o OutName}: Name of output file. By default the name of the first data
  8451.        file from {\em DFiles} list is used.  See below on the output files.
  8452. @\item
  8453.   {\bf -g}: Generates the geometry file only. See below.
  8454. @\item
  8455.   {\bf -T}: Talkative mode. Prints processing information.
  8456. @\item
  8457.   {\bf -z}: Prints version number and current defaults.
  8458. @\end{itemize}
  8459.  
  8460. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8461. @\subsection{Usage}
  8462. &Usage
  8463.  
  8464.     Irit2Scn converts freeform surfaces and polygons into polygons in a format
  8465.  that can be used by RTrace. Two files are created, one with a '.geom'
  8466.  extension and one with '.scn'. Since the number of polygons can be extremely
  8467.  large, the geometry is isolated in the '.geom' file and is included
  8468.  (via '\#include') in the main '.scn' file. The latter holds the surface
  8469.  properties for all the geometry as well as viewing and RTrace specific
  8470.  commands. This allows for the changing of the shading or the viewing
  8471.  properties while editing small ('.scn') files.
  8472.  
  8473.     If '-g' is specified, only the '.geom' file is created, preserving the
  8474.  current '.scn' file.
  8475.  
  8476.     In practice, it may be useful to create a low resolution approximation
  8477.  of the model, change the viewing/shading parameters in the '.scn' file
  8478.  until a good view and/or surface quality is found, and then run Irit2Scn once
  8479.  more to create a high resolution approximation of the geometry using '-g'.
  8480.  
  8481.  Example:
  8482.  
  8483. @\begin{verbatim}
  8484.  irit2scn -l -F 0 8 b58.dat
  8485. @\end{verbatim}
  8486.  
  8487.  creates b58.scn and b58.geom with low resolution (FineNess of 5).
  8488.  
  8489.    One can ray trace this scene after converting the scn file to a sff file,
  8490.  using scn2sff provided with the RTrace package.
  8491.  
  8492.  Once done with the parameter setting of RTrace, a fine approximation of the
  8493.  model can be created with:
  8494.  
  8495. @\begin{verbatim}
  8496.  irit2scn -l -g -F 0 64 b58.dat
  8497. @\end{verbatim}
  8498.  
  8499.  which will only recreate b58.geom (because of the -g option).
  8500.  
  8501.    One can overwrite the viewing matrix by appending a new matrix
  8502.  in the end of the command line, created by the display devices:
  8503.  
  8504. @\begin{verbatim}
  8505.  wntdrvs b58.dat
  8506.  irit2scn -l -F 0 8 b58.dat irit.mat
  8507. @\end{verbatim}
  8508.  
  8509.  where irit.mat is the viewing matrix created by wntdrvs. The output name,
  8510.  by default, is the last input file name, so you might want to provide an
  8511.  explicit name with the -o flag.
  8512.  
  8513. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8514. @\subsection{Advanced Usage}
  8515. &Advanced Usage
  8516.  
  8517.    One can specify surface qualities for individual surfaces of a model.
  8518.  Several such attributes are supported by Irit2Scn and can be set within 
  8519.  {\em IRIT}. See also the ATTRIB {\em IRIT} command.
  8520.  
  8521.    If a certain surface should be finer than the rest of the scene, one can
  8522.  set a "resolution" attribute which specifies the {\em relative} FineNess
  8523.  resolution of this specific surface.
  8524.  
  8525.  Example:
  8526.  
  8527. @\begin{verbatim}
  8528.  attrib( srf1, "resolution", 2 );
  8529. @\end{verbatim}
  8530.  
  8531.  will force srf1 to have twice the default resolution, as set via the '-f'
  8532.  flag.
  8533.  
  8534.    Almost flat patches are converted to polygons. The patch can be converted
  8535.  into two polygons (by subdividing along one of its diagonals) or into four
  8536.  by introducing a new point at the patch center. This behavior is controlled
  8537.  by the '-4' flag, but can be overwritten for individual surfaces bu setting
  8538.  "twoperflat" or "fourperflat".
  8539.  
  8540.    RTrace specific properties are controlled via the following attributes:
  8541.  "SCNrefraction", "SCNtexture", "SCNsurface. Refer to the RTrace manual for
  8542.  their meaning.
  8543.  
  8544.  Example:
  8545.  
  8546. @\begin{verbatim}
  8547.  attrib( srf1, "SCNrefraction", 0.3 );
  8548. @\end{verbatim}
  8549.  
  8550.    Surface color is controlled in two levels. If the object has an RGB
  8551.  attribute, it is used. Otherwise a color as set via {\em IRIT} COLOR command
  8552.  is used if set.
  8553.  
  8554.  Example:
  8555.  
  8556. @\begin{verbatim}
  8557.  attrib( tankBody, "rgb", "244,164,96" );
  8558. @\end{verbatim}
  8559. $
  8560.  
  8561. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8562. @\section{Irit2Xfg - IRIT To XFIG filter}
  8563. !IRIT2Xfg - IRIT To XFIG filter
  8564.  
  8565. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8566. @\subsection{Command Line Options}
  8567. &Command line options
  8568.  
  8569. @\begin{verbatim}
  8570.   irit2xfg [-s Size] [-t XTrans YTrans] [-I #UIso[:#VIso[:#WIso]]]
  8571.        [-f PolyOpti SampPerCrv] [-F PolyOpti FineNess] [-M] [-G] [-T]
  8572.        [-i] [-o OutName] [-z] DFiles
  8573. @\end{verbatim}
  8574.  
  8575. @\begin{itemize}
  8576. @\item
  8577.   {\bf -s Size}: Size in inches of the page. Default is 7 inches.
  8578. @\item
  8579.   {\bf -t XTrans YTrans}: X and Y translation. of the image. Default is (0, 0).
  8580. @\item
  8581.   {\bf -I \#UIso[:\#VIso]}: Specifies the number of isolines per surface, per
  8582.         direction. If \#VIso is not specified, \#UIso is used for \#VIso as
  8583.         well.
  8584. @\item
  8585.   {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
  8586.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  8587.         Otherwise, an adaptive subdivision that optimizes the samples is
  8588.         employed.
  8589. @\item
  8590.   {\bf -F PolygonOpti FineNess}: Optimality of polygonal approximation of
  8591.         surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  8592.         FineNess. See also -4. This enforces the dump of freefrom geometry
  8593.         as polygons.
  8594. @\item
  8595.   {\bf -M}: Dumps the control mesh/polygon as well.
  8596. @\item
  8597.   {\bf -G}: Dumps the freeform geometry.
  8598. @\item
  8599.   {\bf -T}: Talkative mode. Prints processing information.
  8600. @\item
  8601.   {\bf -i}: Internal edges (created by {\em IRIT}) - default is not to
  8602.        display them, and this option will force displaying them as well.
  8603. @\item
  8604.   {\bf -o OutName}: Name of output file. By default the name of the first data
  8605.        file from {\em DFiles} list is used.  See below on the output files.
  8606. @\item
  8607.   {\bf -z}: Prints version number and current defaults.
  8608. @\end{itemize}
  8609.  
  8610. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8611. @\subsection{Usage}
  8612. &Usage
  8613.  
  8614.     Irit2Xfg converts freeform surfaces and polygons into polylines in a format
  8615.  that can be used by XFIG.
  8616.   
  8617.  Example:
  8618.  
  8619. @\begin{verbatim}
  8620.  irit2Xfg -l -f 0 16  saddle.dat > saddle.xfg
  8621. @\end{verbatim}
  8622.  
  8623.    However, one can overwrite the viewing matrix by appending a new matrix
  8624.  in the end of the command line, created by the display devices:
  8625.  
  8626. @\begin{verbatim}
  8627.  x11drvs b58.dat
  8628.  irit2Xfg -l -f 0 16 b58.dat irit.mat > saddle.xfg
  8629. @\end{verbatim}
  8630.  
  8631.  where irit.mat is the viewing matrix created by x11drvs.
  8632.  
  8633. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8634. @\section{Data File Format}
  8635. !DATAFILE Format
  8636.  
  8637.    This section describes the data file format used to exchange data between
  8638.  {\em IRIT} and its accompanying tools.
  8639.  
  8640. @\begin{verbatim}
  8641.  [OBJECT {ATTRS} OBJNAME
  8642.      [NUMBER n]
  8643.  
  8644.    | [VECTOR x y z]
  8645.  
  8646.    | [CTLPT POINT_TYPE {w} x y {z}]
  8647.  
  8648.    | [STRING "a string"]
  8649.  
  8650.    | [MATRIX m00 ... m03
  8651.              m10 ... m13
  8652.              m20 ... m23
  8653.              m30 ... m33]
  8654.  
  8655.      ;A polyline should be drawn from first point to last. Nothing is drawn
  8656.      ;from last to first (in a closed polyline, last point is equal to first).
  8657.    | [POLYLINE {ATTRS} #PTS                   ;#PTS = number of points.
  8658.          [{ATTRS} x y z]
  8659.          [{ATTRS} x y z]
  8660.             .
  8661.             .
  8662.             .
  8663.          [{ATTRS} x y z]
  8664.      ]
  8665.  
  8666.      ;Defines a closed planar region. Last point is NOT equal to first,
  8667.      ;and a line from last point to first should be drawn when the boundary
  8668.      ;of the polygon is drawn.
  8669.    | [POLYGON {ATTRS} #PTS
  8670.          [{ATTRS} x y z]
  8671.          [{ATTRS} x y z]
  8672.             .
  8673.             .
  8674.             .
  8675.          [{ATTRS} x y z]
  8676.      ]
  8677.  
  8678.      ;Defines a "cloud" of points.
  8679.    | [POINTLIST {ATTRS} #PTS
  8680.          [{ATTRS} x y z]
  8681.          [{ATTRS} x y z]
  8682.             .
  8683.             .
  8684.             .
  8685.          [{ATTRS} x y z]
  8686.      ]
  8687.  
  8688.      ;Defines a Bezier curve with #PTS control points. If the curve is
  8689.      ;rational, the rational component is introduced first.
  8690.    | [CURVE BEZIER {ATTRS} #PTS POINT_TYPE
  8691.          [{ATTRS} {w} x y z ...]
  8692.          [{ATTRS} {w} x y z ...]
  8693.             .
  8694.             .
  8695.             .
  8696.          [{ATTRS} {w} x y z ...]
  8697.      ]
  8698.  
  8699.      ;Defines a Bezier surface with #UPTS * #VPTS control points. If the
  8700.      ;surface is rational, the rational component is introduced first.
  8701.      ;Points are printed row after row (#UPTS per row), #VPTS rows.
  8702.    | [SURFACE BEZIER {ATTRS} #UPTS #VPTS POINT_TYPE
  8703.          [{ATTRS} {w} x y z ...]
  8704.          [{ATTRS} {w} x y z ...]
  8705.             .
  8706.             .
  8707.             .
  8708.          [{ATTRS} {w} x y z ...]
  8709.      ]
  8710.  
  8711.      ;Defines a Bezier trivariate with #UPTS * #VPTS * #WPTS control
  8712.      ;points. If the trivariate is rational, the rational component is
  8713.      ;introduced first. Points are printed row after row (#UPTS per row),
  8714.      ;#VPTS rows, #WPTS layers (depth).
  8715.    | [TRIVAR BEZIER {ATTRS} #UPTS #VPTS #WPTS POINT_TYPE
  8716.          [{ATTRS} {w} x y z ...]
  8717.          [{ATTRS} {w} x y z ...]
  8718.             .
  8719.             .
  8720.             .
  8721.          [{ATTRS} {w} x y z ...]
  8722.      ]
  8723.  
  8724.      ;Defines a Bspline curve of order ORDER with #PTS control points. If the
  8725.      ;curve is rational, the rational component is introduced first.
  8726.      ;Note length of knot vector is equal to #PTS + ORDER.
  8727.      ;If curve is periodic KVP prefix the knot vector that has length of
  8728.      ;'Length + Order + Order - 1'.
  8729.    | [CURVE BSPLINE {ATTRS} #PTS ORDER POINT_TYPE
  8730.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                    ;Knot vector
  8731.          [{ATTRS} {w} x y z ...]
  8732.          [{ATTRS} {w} x y z ...]
  8733.             .
  8734.             .
  8735.             .
  8736.          [{ATTRS} {w} x y z ...]
  8737.      ]
  8738.  
  8739.      ;Defines a Bspline surface with #UPTS * #VPTS control points, of order
  8740.      ;UORDER by VORDER. If the surface is rational, the rational component
  8741.      ;is introduced first.
  8742.      ;Points are printed row after row (#UPTS per row), #VPTS rows.
  8743.      ;If surface is periodic in some direction KVP prefix the knot vector
  8744.      ;that has length of 'Length + Order + Order - 1'.
  8745.    | [SURFACE BSPLINE {ATTRS} #UPTS #VPTS UORDER VORDER POINT_TYPE
  8746.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
  8747.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
  8748.          [{ATTRS} {w} x y z ...]
  8749.          [{ATTRS} {w} x y z ...]
  8750.             .
  8751.             .
  8752.             .
  8753.          [{ATTRS} {w} x y z ...]
  8754.      ]
  8755.  
  8756.      ;Defines a Bspline trivariate with #UPTS * #VPTS * #WPTS control
  8757.      ;points. If the trivariate is rational, the rational component is
  8758.      ;introduced first. Points are printed row after row (#UPTS per row),
  8759.      ;#VPTS rows, #WPTS layers (depth).
  8760.      ;If trivariate is periodic in some direction KVP prefix the knot vector
  8761.      ;that has length of 'Length + Order + Order - 1'.
  8762.    | [TRIVAR BSPLINE {ATTRS} #UPTS #VPTS #WPTS UORDER VORDER WORDER POINT_TYPE
  8763.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
  8764.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
  8765.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;W Knot vector
  8766.          [{ATTRS} {w} x y z ...]
  8767.          [{ATTRS} {w} x y z ...]
  8768.             .
  8769.             .
  8770.             .
  8771.          [{ATTRS} {w} x y z ...]
  8772.      ]
  8773.  
  8774.      ;Defines a trimmed surface. Encapsulates a surface (can be either a
  8775.      ;Bspline or a Bezier surface) and prescribes its trimming curves.
  8776.      ;There can be an arbitrary number of trimming curves (either Bezier
  8777.      ; or Bspline). Each trimming curve contains an arbitrary number of
  8778.      ;trimming curve segments, while each trimming curve segment contains
  8779.      ;a parameteric representation optionally followed by a Euclidean
  8780.      ;representation of the trimming curve segment.
  8781.    | [TRIMSRF
  8782.          [SURFACE ...
  8783.          ]
  8784.          [TRIMCRV
  8785.              [TRIMCRVSEG
  8786.                  [CURVE ...
  8787.                  ]
  8788.              ]
  8789.                 .
  8790.                 .
  8791.                 .
  8792.              [TRIMCRVSEG
  8793.                  [CURVE ...
  8794.                  ]
  8795.              ]
  8796.          ]
  8797.              .
  8798.              .
  8799.              .
  8800.          [TRIMCRV
  8801.              [TRIMCRVSEG
  8802.                  [CURVE ...
  8803.                  ]
  8804.              ]
  8805.                 .
  8806.                 .
  8807.                 .
  8808.              [TRIMCRVSEG
  8809.                  [CURVE ...
  8810.                  ]
  8811.              ]
  8812.          ]
  8813.      ]
  8814.  ]
  8815.  
  8816.  POINT_TYPE -> E1 | E2 | E3 | E4 | E5 | P1 | P2 | P3 | P4 | P5
  8817.  
  8818.  ATTRS -> [ATTRNAME ATTRVALUE]
  8819.           | [ATTRNAME]
  8820.           | [ATTRNAME ATTRVALUE] ATTRS
  8821.  
  8822. @\end{verbatim}
  8823.  
  8824.  Some notes:
  8825.  
  8826.  * This definition for the text file is designed to minimize the
  8827.    reading time and space. All information can be read without backward
  8828.    or forward referencing.
  8829.  
  8830.  * An OBJECT must noever hold different geometry or other entities.
  8831.    I.e. CURVEs, SURFACEs, and POLYGONs must all be in different OBJECTs.
  8832.  
  8833.  * Attributes should be ignored if not needed. The attribute list may have
  8834.    any length and is always terminated by a token that is NOT '\verb+[+'. This
  8835.    simplifies and disambiguates the parsing.
  8836.  
  8837.  * Comments may appear between '\verb+[+OBJECT ...\verb+]+' blocks, or
  8838.    immediately after OBJECT OBJNAME, and only there.
  8839.  
  8840.    A comment body can be anything not containing the '\verb+[+' or the
  8841.    '\verb+]+' tokens (signals start/end of block). Some of the comments in
  8842.    the above definition are {\em illegal} and appear there only of the sake
  8843.    of clarity.
  8844.  
  8845.  * It is preferred that geometric attributes such as NORNALs will be saved in
  8846.    the geometry structure level (POLYGON, CURVE or vertices) while graphical
  8847.    and others such as COLORs will be saved in the OBJECT level.
  8848.  
  8849.  * Objects may be contained in other objects to an arbitrary level.
  8850.  
  8851.  Here is an example that exercises most of the data format:
  8852.  
  8853. @\begin{verbatim}
  8854.  This is a legal comment in a data file.
  8855.  [OBJECT DEMO
  8856.      [OBJECT REAL_NUM
  8857.          And this is also a legal comment.
  8858.          [NUMBER 4]
  8859.      ]
  8860.  
  8861.      [OBJECT A_VECTOR
  8862.          [VECTOR 1 2 3]
  8863.      ]
  8864.  
  8865.      [OBJECT CTL_POINT
  8866.          [CTLPT E3 1 2 3]
  8867.      ]
  8868.  
  8869.      [OBJECT STR_OBJ
  8870.          [STRING "string"]
  8871.      ]
  8872.  
  8873.      [OBJECT UNIT_MAT
  8874.          [MATRIX
  8875.             1 0 0 0
  8876.             0 1 0 0
  8877.             0 0 1 0
  8878.             0 0 0 1
  8879.          ]
  8880.      ]
  8881.  
  8882.      [OBJECT [COLOR 4] POLY1OBJ
  8883.          [POLYGON [PLANE 1 0 0 0.5] 4
  8884.              [-0.5 0.5 0.5]
  8885.              [-0.5 -0.5 0.5]
  8886.              [-0.5 -0.5 -0.5]
  8887.              [-0.5 0.5 -0.5]
  8888.          ]
  8889.          [POLYGON [PLANE 0 -1 0 0.5] 4
  8890.              [0.5 0.5 0.5]
  8891.              [-0.5 0.5 0.5]
  8892.              [-0.5 0.5 -0.5]
  8893.              [0.5 0.5 -0.5]
  8894.          ]
  8895.      ]
  8896.  
  8897.      [OBJECT [COLOR 63] ACURVE
  8898.          [CURVE BSPLINE 16 4 E2
  8899.              [KV 0 0 0 0 1 1 1 2 3 4 5 6 7 8 9 10 11 11 11 11]
  8900.              [0.874 0]
  8901.              [0.899333 0.0253333]
  8902.              [0.924667 0.0506667]
  8903.              [0.95 0.076]
  8904.              [0.95 0.76]
  8905.              [0.304 1.52]
  8906.              [0.304 1.9]
  8907.              [0.494 2.09]
  8908.              [0.722 2.242]
  8909.              [0.722 2.318]
  8910.              [0.38 2.508]
  8911.              [0.418 2.698]
  8912.              [0.57 2.812]
  8913.              [0.57 3.42]
  8914.              [0.19 3.572]
  8915.              [0 3.572]
  8916.          ]
  8917.      ]
  8918.  
  8919.      [OBJECT [COLOR 2] SOMESRF
  8920.          [SURFACE BEZIER 3 3 E3
  8921.              [0 0 0]
  8922.              [0.05 0.2 0.1]
  8923.              [0.1 0.05 0.2]
  8924.  
  8925.              [0.1 -0.2 0]
  8926.              [0.15 0.05 0.1]
  8927.              [0.2 -0.1 0.2]
  8928.  
  8929.              [0.2 0 0]
  8930.              [0.25 0.2 0.1]
  8931.              [0.3 0.05 0.2]
  8932.          ]
  8933.      ]
  8934.  ]
  8935. @\end{verbatim}
  8936. $
  8937.  
  8938. @\section{Bugs and Limitations}
  8939. !BUGS and LIMITATIONS
  8940.  
  8941.    Like any program of more than one line, it is far from being perfect.
  8942.  Some limitations, as well as simplifications, are laid out below.
  8943.  
  8944.  *  If the intersection curve of two objects falls exactly on polygon
  8945.     boundaries, for all polygons, the system will scream that the two objects
  8946.     do not intersect at all. Try to move one by EPSILON into the other.
  8947.     I probably should fix this one - it is supposed to be relatively easy.
  8948.  
  8949.  *  Avoid degenerate intersections that result with a point or a line.
  8950.     They will probably cause wrong propagation of the inner and outer part of
  8951.     one object relative to the other. Always extend your object beyond the
  8952.     other object.
  8953.  
  8954.  *  If two objects have no intersection in their boundary, {\em IRIT} assumes they
  8955.     are disjoint: a union simply combines them, and the other Boolean
  8956.     operators return a NULL object. One should find a FAST way (3D Jordan
  8957.     theorem) to find the relation between the two (A in B, B in A, A
  8958.     disjoint B) and according to that, make a decision.
  8959.  
  8960.  *  Since the boolean sum implementation constructs ruled surfaces with
  8961.     uniform speed, it might return a somewhat incorrect answer, given
  8962.     non-uniform input curves.
  8963.  
  8964.  *  The parser is out of hand and is difficult to maintain. There are several
  8965.     memory leaks there that one should fix.
  8966.  
  8967.  *  The X11 driver has no menu support (any easy way to have menus using
  8968.     Xlib!?).
  8969.  
  8970.  *  IBM R6000 fails to run the drivers in -s- mode.
  8971.  
  8972.  *  Rayshade complains a lot about degenerate polygons on irit2ray output.
  8973.     To alleviate the problem, change the 'equal' macro in common.h in libcommon
  8974.     of rayshade from EPSILON (1e-5) to 1e-7 or even lower.
  8975.  
  8976.  *  On the motif-based drivers (xmtdrvs etc.) clicking the mouse left and
  8977.     right of the scale's button produces stepped transformations. This
  8978.     step size is constant, and is not proportional to the distance between
  8979.     the mouse's position and the position of the button. The reason for the
  8980.     flaw is incorrect callback information returned from the scale in
  8981.     repeattive mode.
  8982.  
  8983.  *  Binary data files are not documented, nor will they be. They might
  8984.     change in the future and are in fact machine dependend. Hence, one
  8985.     platform might fail to read the other's binary data file.
  8986. $
  8987.  
  8988. @\end{document}
  8989.  
  8990.