home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / PLOT / IRIT386E.ZIP / IRIT.HLP < prev    next >
Encoding:
Text File  |  1992-03-10  |  111.7 KB  |  3,059 lines

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