
   HELP Avialable on ( Usage: HELP("SUBJECT"); where SUBJECT is: ):
 +       -       *       /       ^       =
 ABS     ACOS    ALIAS   AREA    ASIN    ATAN    ATAN2   AXES    BEEP    BOX
 COLOR   COMMENT CONE    CONVEX  CHDIR   CROSSEC CYLIN   COS     CPOLY   DIR
 EDIT    EXIT    EXP     EXTRUDE FALSE   FOR     FREE    GBOX    GDUMP   HELP
 IF      INCLUDE INTERACT        INTERCRV	 INTERNAL        LIST    LN
 LOAD    LOG     LOGFILE MDUMP   NORMAL  OFF     ON      PAUSE   PI      PLANE
 POLY	 PROCEDURES      RESOLUTION      ROTX    ROTY    ROTZ    SCALE   SIN
 SPHERE  SQRT    SURFREV SYSTEM  TAN     TIME    TORUS   TRANS   TRUE    TYPES
 VARLIST VECTOR  VIEW    VIEW_MAT        VOLUME
$

TYPES
  TYPES defined in the system:
 GeometricType - Object consists of Polygons/Polylines.
 NumericType   - Scalar real type.
 VectorType    - 3D real type vector (points/vectors).
 MatrixType    - 4 by 4 matrix (transformation matrix).
 StringType    - sequence of characters within double quotes - "A string".
		 Current implementation is limited to 80 chars.
 ObjListType   - list of (any of the above type) objects. Current
		 implementation is limited to 20 objects.
$

PROCEDURES
         Mathematic functions:
 ABS     ACOS    AREA    ASIN    ATAN    ATAN2   COS     CPOLY   EXP
 LN      LOG     SIN     SQRT    TAN     VOLUME

         Geometric Primitiv procedures:
 BOX     CROSSEC CONE    CYLIN   EXTRUDE GBOX    PLANE   POLY    SPHERE
 SURFREV TORUS

         Transformation procedures:
 ROTX    ROTY    ROTZ    SCALE   TRANS   VECTOR

         Mescallaneoues procedures:
 ALIAS   BEEP    CHDIR   COLOR   COMMENT CONVEX  DIR     EDIT    EXIT
 FOR     FREE    GDUMP   HELP    IF      INCLUDE INTERACT        LIST
 LOAD    LOGFILE MDUMP   NORMAL  PAUSE   SYSTEM  TIME    VARLIST VIEW
$

+
   Overloaded above the following domains:
 NumericType   + NumericType   -> NumericType
 VectorType    + VectorType    -> VectorType
 MatrixType    + MatrixType    -> MatrixType
 GeometricType + GeometricType -> GeometricType (Boolean OR operation)

 Note: Boolean OR of two disjoint object (no common volume) will result the
 two objects combined. It is USER responsibility to make sure that the non
 intersecting object are also disjoint - system only test for no intersection.
$

-
   Diadic overloaded above the following domains:
 NumericType   - NumericType   -> NumericType
 VectorType    - VectorType    -> VectorType
 MatrixType    - MatrixType    -> MatrixType
 GeometricType - GeometricType -> GeometricType (Boolean SUBTRACT operation)

   Monadic overloaded above the following domains:
 - NumericType   -> NumericType
 - VectorType    -> VectorType
 - MatrixType    -> MatrixType    (Scaling all matrix by -1)
 - GeometricType -> GeometricType (Boolean NEGATION operation)

 Note: Boolean SUBTRACT of two disjoint object (no common volume) will result
 empty object. See '+' overloading note on system test for disjoint objects
$

*
   Overloaded above the following domains:
 NumericType   * NumericType   -> NumericType
 VectorType    * VectorType    -> NumericType   (Scalar multiplication)
 MatrixType    * MatrixType    -> MatrixType
 MatrixType    * NumericType   -> MatrixType    (Matrix Scaling)
 MatrixType    * VectorType    -> VectorType    (Vector transform)
 MatrixType    * GeometricType -> GeometricType (Object transform)
 GeometricType * GeometricType -> GeometricType (Boolean AND operation)

 Note: Boolean AND of two disjoint object (no common volume) will result
 empty object. See '+' overloading note on system test for disjoint objects
$

/
   Overloaded above the following domain:
 NumericType / NumericType   -> NumericType
$

^
   Overloaded above the following domains:
 NumericType ^ NumericType   -> NumericType
 MatrixType  ^ NumericType   -> MatrixType
$

=
   Assignments are allowed as side effects, any place in expressions: If
 Expr is expression, then (var = Expr) is the exactly the same expression
 with the side effect of setting Var to that value. There is no guarantee
 on the order of evaluation, so using Vars that are set within same
 expression is bad practice.
   Any assignment which is not at top level, MUST be within parenthesis.
$

ABS
 RealType ABS( Operand )
 RealType Operand;
   Returns the absolute value of the given operand.
$

ACOS
 RealType ACOS( Operand )
 RealType Operand;
   Returns the arc cosine value (in radians) of the given operand.
$

AREA
 RealType AREA( Object )
 GeometricType Object;
   Return the area of the given object (in object units). This returns the
 real area of the polygonal object - not the primitive it might approximate.
 That means that the area of the sphere here will be actually of its sphere
 polygonal approximation.
$

ASIN
 RealType ASIN( Operand )
 RealType Operand;
   Returns the arc sin value (in radians) of the given operand.
$

ATAN
 RealType ATAN( Operand )
 RealType Operand;
   Returns the arc tang. value (in radians) of the given operand.
$

ATAN2
 RealType ATAN2( Operand1, Operand2 )
 RealType Operand1; RealType Operand2;
   Returns the arc tang. value (in radians) of the given ratio:
 Operand1 / Operand2, over the whole angle circle.
$

COS
 RealType COS( Operand )
 RealType Operand;
   Returns the cosine value of the given operand (in radians).
$

CPOLY
 RealType CPOLY( Object )
 GeometricType Object;
   Returns the number of polygons in the given geometric object.
$

EXP
 RealType EXP( Operand )
 RealType Operand;
   Returns the natural exponent value of the given operand.
$

LN
 RealType LN( Operand )
 RealType Operand;
   Returns the natural logarithm value of the given operand.
$

LOG
 RealType LOG( Operand )
 RealType Operand;
   Returns the base 10 logarithm value of the given operand.
$

SIN
 RealType SIN( Operand )
 RealType Operand;
   Returns the sin value of the given operand (in radians).
$

SQRT
 RealType SQRT( Operand )
 RealType Operand;
   Returns the square root value of the given operand.
$

TAN
 RealType TAN( Operand )
 RealType Operand;
   Returns the tang. value of the given operand (in radians).
$

BOX
 GeometricType BOX( Point, Dx, Dy, Dz )
 VectorType Point; RealType Dx; RealType Dy; RealType Dz;
   Create a main planes parallel BOX geometric object, defined by Point as
 base position, and Dx, Dy, Dz as BOX dimensions. Note negative dimensions
 are allowed.
$

GBOX
 GeometricType GBOX( Point, Dx, Dy, Dz )
 VectorType Point; VectorType Vx; VectorType Vy; VectorType Dz;
   Create a generalized BOX geometric object, defined by Point as base
 position, and Dx, Dy, Dz as 3 3D vectors to define the 6 faces of this
 generalized BOX. The regular BOX object is special case of GBOX where
 Dx = vector(Dx, 0, 0) ,   Dy = vector(0, Dy, 0) ,   Dz = vector(0, 0, Dz)
   Note Dx, Dy, Dz must be non-coplanar in order to create fisible object.
$

CONE
 GeometricType CONE( Center, Direction, Radius )
 VectorType Center; VectorType Direction; RealType Radius;
   Create a CONE geometric object, defined by Center as CONE base center,
 CONE axes Direction, and CONE base radius Radius. Note Direction magnitude
 also sets the CONE height. Direction can be any 3D vector.
   See RESOLUTION for accuracy of CONE approximation as polygonal model. 
$

CROSSEC
 GeometricType CROSSEC( Object )
 GeometricType Object;
   Invoke interactive mode to edit/create a polygon in the plane Z = 0. The
 polygon must be in the domain [0..1] in X,Y. The first polygon of the given
 Object is copied to begin with. If the given operand is NOT a geometric
 object, but false (numeric 0.0), a new polygon is created. Returns an (open)
 object with this one polygon only and inside side of +Z. Note that if the
 given polygon (first polygon of Object) is not on XY plane it is transformed
 to it before editing, and transformed back after.
   Unfortunately, this feature is NOT implemented...
$

CYLIN
 GeometricType CYLIN( Center, Direction, Radius )
 VectorType Center; VectorType Direction; RealType Radius;
   Create a CYLINder geometric object, defined by Center as CYLIN base center,
 CYLIN axes Direction, and CONE base radius Radius. Note Direction magnitude
 also sets the CYLIN height. Direction can be any 3D vector.
   See RESOLUTION for accuracy of CYLIN approximation as polygonal model.
$

PLANE
 GeometricType PLANE( Normal, Trans, Radius )
 VectorType Normal; VectorType Trans; RealType Radius;
   As in this solid modeller, open objects are allowed (although any
 intersection should not terminate in a middle of polygon), a plane (open!)
 object also exists. The plane is defined with the given Normal, and includes
 the Trans point. It is implemented as a FINITE circle with resolution (see
 RESOLUTION) edges, radius Radius and center Trans on that plane. It is the
 user responsibility to make sure that any boolean operation on it (or any
 other open object) will create closed loops as intersecting curves and/or
 open loops terminated on its boundary (no termination in middle of it is
 allowed)
$

POLY
 GeometricType POLY( ObjectList )
 ObjListType ObjectList;
   Create a single polygon (and therefore open) object, defined by the
 vertices which respectively defined by the objects in ObjectList (see LIST).
 All elements in ObjectList must be of VertorType type. No validity test is
 made and it is the user responsibility. see PLANE for stricts exists on
 open objects.
$

EXTRUDE
 GeometricType EXTRUDE( Object, Dir )
 GeometricType Object; VectorType Dir;
   Create an object by extrusion the first polygon of the given object, in
 Dir direction. No limitation exists on the polygon (can be non-convex), but
 the Dir cannt be in the polygon plane. The new object is created from the
 given polygon, the polygon translated by Dir, and polygons that wrap the
 two along that Dir.
$

SPHERE
 GeometricType SPHERE( Center, Radius )
 VectorType Center; RealType Radius;
   Create a SPHERE geometric object, defined by Center as SPHERE Center,
 and with radius Radius.
   See RESOLUTION for accuracy of SPHERE approximation as polygonal model. 
$

SURFREV
 GeometricType SURFREV( Object )
 GeometricType Object;
   Create an object by rotating the first polygon of the given object, around
 Z axes. No limitation exists on the polygon (can be non-convex), but the
 polygon should not be in a plane of the form Z = Const.
$

TORUS
 GeometricType TORUS( Center, Normal, MRadius, mRadius )
 VectorType Center; VectorType Normal; RealType MRadius, RealType mRadius;
   Create a TORUS geometric object, defined by Center as TORUS center, Normal
 as main TORUS plane normal, MRadius as major radius, and mRadius as minor.
   See RESOLUTION for accuracy of TORUS approximation as polygonal model. 
$

ROTX
 MatrixType ROTX( Angle )
 RealType Angle;
   Create rotation tranformation matrix (around X) with Angle degrees.
$

ROTY
 MatrixType ROTY( Angle )
 RealType Angle;
   Create rotation tranformation matrix (around Y) with Angle degrees.
$

ROTZ
 MatrixType ROTZ( Angle )
 RealType Angle;
   Create rotation tranformation matrix (around Z) with Angle degrees.
$

SCALE
 MatrixType SCALE( ScaleFactors )
 VectorType ScaleFactors;
   Create scaling tranformation matrix of ScaleFactor scaling factors.
$

TRANS
 MatrixType TRANS( TransFactors )
 VectorType TransFactors;
   Create translation tranformation matrix of TransFactor translating amounts.
$

VECTOR
 VectorType VECTOR( Operand1, Operand2, Operand3 )
 RealType Operand1; RealType Operand2; RealType Operand3;
   Create vector type object, out of 3 RealType scalars.
$

VOLUME
 RealType VOLUME( Object )
 GeometricType Object;
   Return the volume of the given object (in object units). This returns the
 real volume of the polygonal object - not the primitive it might approximate.
 That means that the volume of the sphere here will be actually of its sphere
 polygonal approximation. This routine decompose all non convex polygons to
 convex ones as side effect.
$

 **************************************************************************
 * General Purpose routines:						  *
 **************************************************************************

ALIAS
 ALIAS( Name, Value );
 StringType Name; StringType Value;
   Defines a text substitution: each occurance of Name will be replaced by
 the given value. Unlike the rest of the system, this is CASE SENSITIVE.
 It is a good practice, therefore, to defines the aliases names to be upper
 case, and rest of program including alias values in lower case. For example
 alias("ED", "edit(\"file.irt\");");  (note '\' may be used as escape char)
 defines the alias "ED" to be 'edit("file.irt");'. Using "ed" instead, will
 cause endless loop as "ed" will be expanded for ever... The aliases will be
 expanded until line is too long or 100 expantions occured in line.
   If Name is empty string, a list of all defined aliases is printed.
   if Name is not empty, but Value is, that alias is deleted. This is the
 only case you need to specify the alias Name in LOWER case (otherwise it
 will be expanded...) - the alias Name comparison is case insensetive.
$

BEEP
 BEEP( Frequency, Time )
 RealType Frequency; RealType Time;
   Generates a tone with the given Frequency (in Hz), for the given period
 of Time (in miliseconds).
$

CHDIR
 CHDIR( NewPath )
 StringType NewPath;
   Change current working directory to NewPath (if exists...)
   Note the entry directory is recovered on exit.
$

COLOR
 COLOR( Object, Color )
 GeometricType Object; RealType Color;
   Set the color of the object to one of the specifed below. Note that an
 object has a default color (see irit.cfg file) according to his source -
 loaded with LOAD command, PRIMITIV, or BOOLEAN operation result.
   The system internaly supports colors (although you may have B&W system)
 and the colors recognized are:
 BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW & WHITE
$

COMMENT
 COMMENT
 Two types of comments are allowed:
 1. One lines comment: starts any where is a line at the '#' char up to the
    end of the line.
 2. Block comment: starts by the COMMENT keyword follows by a unique
    character (anything but white space), up to the second occurance of that
    character. This is a fast way to comment big blocks. For example:
    COMMENT $
      This is a comment
    $
$
CONVEX
 GeometricType CONVEX( Object )
 GeometricType Object;
   Coerce non convex polygons in Object, into convex one. The current
 implementation is definitely not optimal, but it works... The boolean
 opeartions require the input to have convex polygons only (although it may
 return non convex polygons...) and non convex input polygons are
 automatically coerced to convex ones, using this same routine.
$

DIR
 DIR( MatchPattern )
 StringType MatchPattern;
   Print the file match the MatchPattern in the current working directory.
   MatchPattern may have wild characters as in regular dos DIR - '*', '?'
$

EDIT
 EDIT( FileName );
 StringType FileName;
   Invoke the editor (defined in the irit.cfg configuration file) as a child
 process if the solid modeller. Only one parameter is passed to the editor
 which is the FileName to edit. As the solid modeller is still resident, the
 child process (the editor) will get only the remained memory - as seen by
 the core left.
$

EXIT
 EXIT();
   Exits from the solid modeller. NO warning is given!
$

FOR
 FOR( Start, Increment, End, Body )
 RealType Start; RealType Increment; RealType End; AnyType Body;
   Execute the Body (see below), while the FOR loop conditions hold.
   Start, Increment, End are evaluated first and the loop will be executed
 while End <= Start if Increment > 0 or while End >= Start if Increment < 0.
   If Start is of the form "(Variable = Expression)" then that variable is
 updated on each iteration, and can be used within the body.
   The body may consist of any number of regular commands, seperated by
 COLONs, including nesting FOR loops to any level.
   No new variables should be introduced in loops - Use only old
 variables and/or the iteration variable defined in Start (feature...).
$

FREE
 FREE( Object )
 GeometricType Object;
   Because of the usually huge size of geometric objects, this procedure
 may be used to free them. Note however that reassigning a value (even
 of different type) will automatically release its old allocated data.
$

GDUMP
 GDUMP( FileName, Object )
 StringType FileName; GeometricType Object;
   Dumps Geometric type object into specified file FileName. No extension
 type is needed (ignored if specified), and '.PLY' is always used.
$

HELP
 HELP( Subject )
 StringType Subject;
   You probably know this one... Try Help(""); for more help.
$

IF
 IF( Left, Cond, Right, Body )
 RealType Left; StringType Cond; RealType Right; AnyType Body;
   Executes Body (group of regular commands, seperated by COLONs - see FOR)
 if the condition holds: Left & Right are evaluated and tested against the
 specified condition Cond which may be: "=", ">", "<", "<>", ">=", "<=".
$

INCLUDE
 INCLUDE( FileName )
 StringType FileName;
   Executes the script file FileName. Nesting of include file is allowed up
 to 10 levels deep. If error occurs, all open files are closed back to the
 top level (standard input).
$

INTERACT
 INTERACT( ObjectList, UpdateViewMat )
 ObjListType ObjectList; RealType UpdateViewMat;
   Invoke interactive mode to manipulate (transform) the given (geometric)
 object(s). See LIST command - how to create list of objects.
   If UpdateViewMat is non zero (see TRUE/FALSE and ON/OFF) then the
 global viewing matrix VIEW_MAT is updated to the last view from INTERACT.
   INTERACT open an interactive menu to rotate/translate/scale an object(s).
 Each transformation has zero influence in middle of its box, and maximum
 (and opposite) on box ends. Screen transformation transform according to
 the screen - X is horizontal, y vertical, z into screen. Object
 transformation transform in object own coordinate system - you probably
 want to display AXES object with it (see AXES).
   Left mouse button (return) is used to select transformation. Right mouse
 button (space bar) is used to stop long display (abort) in the middle.
 Use numeric keyboard pad (with/without shift) to move if no mouse available.
$

LIST
 ObjListType LIST( Elem1, Elem2, ... )
 Where Elem? may be any object type, but must be variable (no expressions).
   Note no copy is made of the Elements, so modifing Elem1 after used in
 list, will affect the Elem1 in that list, next time list is used!
   In addition, attempt to delete a variable (using FREE) referenced in a
 list will fail, until the list itself is deleted (again using FREE).
$

LOAD
 ObjectType LOAD( FileName )
 StringType FileName;
   Load the object from the given FileName. The object may be matrix object
 (if ".MAT" type was specified in the FileName), or geometric object (if
 ".PLY" type was specified in the FileName). If no type is given, ".PLY' is
assumed.
$

LOGFILE
 LOGFILE( Set )
 RealType Set;
   If Set is non zero (see TRUE/FALSE and ON/OFF) then everything printed in
 the InputWindow, will go to the log file specifed in irit.cfg configuration
 file. This file will be created only if logfile was turned on at list once.
$

MDUMP
 MDUMP( FileName, Matrix )
 StringType FileName; MatrixType Matrix;
   Dumps Matrix type object into specified file FileName. No extension type
 is needed (ignored if specified), and '.MAT' is always used.
$

NORMAL
 NORMAL( Set, Size, Color )
 RealType Set; RealType Size; RealType Color;
   If Set is non zero (see TRUE/FALSE and ON/OFF) then the normals to the
 polygons are also displayed. Normals should always points INTO the object.
 Size sets the length of the normals, and Color their color.
$

PAUSE
 PAUSE( Flush )
 RealType Flush;
   Waits for keystroke. Nice to have if temporary stopping in middle of
 included file (see INCLUDE) is needed. If Flush is non zero (see TRUE/FALSE
 and ON/OFF) then the input is first flushed to guarantee we will wait.
$

SYSTEM
 SYSTEM();
   Invoke the current command processor (usually COMMAND.COM) as defined by
 the COMSPEC environment variable. As the solid modeller is still resident,
 the child process (the command processor) will get only the remained memory
 - as seen by the core left.
$

TIME
 TIME( Reset );
 RealType Reset;
   Returns the real time (in seconds) from the last time TIME was called with
 Reset non zero (see TRUE/FALSE and ON/OFF). Note this is real time and not
 cpu time so running in a multi processes system will return values, which not
 necessarliy reflects this program execution time. As mentioned above if Reset
 is non zero the time count is reset. The time is automatically reset to
 beginning of execution of this program, when the program is first invoked.
$

VARLIST
 VARLIST()
   List all the currently defined objects.
$

VIEW
 VIEW( ObjectList, ClearWindow )
 ObjListType ObjectList; RealType ClearWindow;
   Display the (geometric) object(s) in the given ObjectList. See LIST command
 - how to create list of objects.
   If ClearWindow is non zero (see TRUE/FALSE and ON/OFF) the window is
 first cleared (before drawing the objects).
   The global viewing matrix VIEW_MAT is used as the transformation matrix.
   See INTERACT for mouse/keyboard functionallity.
$

PI
 PI - System defined constant...
$

ON
 ON - Synonym for TRUE
$

OFF
 OFF - Synonys of FALSE
$

TRUE
 TRUE - System defined non zero RealType value. May be used as boolean.
$

FALSE
 FALSE - System defined zero RealType value. May be used as boolean.
$

AXES
 AXES
   Predefined geometric object that holds the axes system. May be viewed.
$

INTERCRV
 INTERCRV
   Predefined numeric object (RealType) that if not zero force the boolean
 geometry operators to return the intersection curves instead of the result
 model. Its defult value is zero (or off or false).
$

INTERNAL
 INTERNAL
   Predefined numeric object (RealType) that if not zero enables displaying
 internal polygon edges (edges created by the convex polygon splitting for
 example). One usually does not want to see these edges, and its default
 value is zero (or off or false).
$

RESOLUTION
 RESOLUTION
   Predefined numeric object (RealType) that sets the accuracy of the
 primitive geometric objects generated. Holds the number of divisions a
 circle is divided into (with minimum value of 4). If, for example, is set
 to 6, then a CONE generated, will effectivly be 6 sided pyramid.
$

VIEW_MAT
 VIEW_MAT
   Predefined matrix object (MatrixType) to hold the viewing matrix used by
 VIEW and/or INTERACT.
$
