Users' Manual - IRIT

Users' Manual - IRIT


A Solid modeling Program

(C) Copyright 1989-2000 Gershon Elber


EMail: gershon@cs.technion.ac.il
Join IRIT mailing list: gershon@cs.technion.ac.il
Mailing list: irit-mail@cs.technion.ac.il
Bug reports: irit-bugs@cs.technion.ac.il
WWW Page: http://www.cs.technion.ac.il/~irit





This manual is for IRIT Version 8.0




 Copyright (C) 1989-2000 Gershon Elber
 EMail: gershon@cs.technion.ac.il
 Join IRIT mailing list: gershon@cs.technion.ac.il
 Mailing list: irit-mail@cs.technion.ac.il
 Bug reports: irit-bugs@cs.technion.ac.il
 WWW Page: http://www.cs.technion.ac.il/~irit

Introduction

IRIT is a solid modeler developed for educational purposes. Although small, it is now powerful enough to create quite complex scenes.

IRIT started as a polygonal solid modeler and was originally developed on an IBM PC under MSDOS. Version 2.0 was also ported to X11 and version 3.0 to SGI 4D systems. Version 3.0 also includes quite a few free form curves and surfaces tools. See the UPDATE.NEW file for more detailed update information. In Version 4.0, the display devices were enhanced, freeform curves and surfaces have further support, functions can be defined, and numerous improvement and optimizations are added.


Copyrights

BECAUSE IRIT AND ITS SUPPORTING TOOLS AS DOCUMENTED IN THIS DOCUMENT ARE LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, I GERSHON ELBER PROVIDE THE IRIT PROGRAM AND ITS SUPPORTING TOOLS "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THESE PROGRAMS IS WITH YOU. SHOULD THE IRIT PROGRAMS PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL GERSHON ELBER, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR A FAILURE OF THE PROGRAMS TO OPERATE WITH PROGRAMS NOT DISTRIBUTED BY GERSHON ELBER) THE PROGRAMS, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.

IRIT is a freeware solid modeler. It is not public domain since I hold copyrights on it. However, unless you are to sell or attempt to make money from any part of this code and/or any model you made with this solid modeler, you are free to make anything you want with it.

IRIT can be compiled and executed on numerous Unix systems as well as OS2, Windows NT/95 and AmigaDOS. However, beware the MSDOS support is fading away.

You are not obligated to me or to anyone else in any way by using IRIT. You are encouraged to share any model you made with it, but the models you made with it are yours, and you have no obligation to share them. You can use this program and/or any model created with it for non commercial and non profit purposes only. An acknowledgement on the way the models were created would be nice but is not required.


Command Line Options and Set Up

The IRIT program reads a file called irit.cfg each time it is executed. This file configures the system. It is a regular text file with comments, so you can edit it and properly modify it for your environment. This file is being searched for in the directory specified by the IRIT_PATH environment variable. For example 'setenv IRIT_PATH /u/gershon/irit/bin/'. Note IRIT_PATH must terminate with '/'. If the variable is not set only the current directory is being searched for irit.cfg.

In addition, if it exists, a file by the name of iritinit.irt will be automatically executed before any other '.irt' file. This file may contain any IRIT command. It is the proper place to put your predefined functions and procedures if you have some. This file will be searched much the same way IRIT.CFG is. The name of this initialization file may be changed by setting the StartFile entry in the configuration file. This file is far more important starting at version 4.0, because of the new function and procedure definition that has been added, and which is used to emulate BEEP, VIEW, and INTERACT for example.

The solid modeler can be executed in text mode (see the .cfg and the -t flag below) on virtually any system with a C compiler.

Under all systems the following environment variables must be set and updated:
path Add to path the directory where IRIT's binaries are.
IRIT_PATH Directory with config., help and IRIT's binary files.
IRIT_DISPLAY The graphics driver program/options. Must be in path.
IRIT_BIN_IPC If set, uses binary Inter Process Communication.


For example,

   set path = (path /u/gershon/irit/bin)
   setenv IRIT_PATH  /u/gershon/irit/bin/
   setenv IRIT_DISPLAY "xgldrvs -s-"
   setenv IRIT_BIN_IPC 1

to set /u/gershon/irit/bin as the binary directory and to use the sgi's gl driver. If IRIT_DISPLAY is not set, the server (i.e., the IRIT program) will prompt and wait for you to run a client (i.e., a display driver). if IRIT_PATH is not set, none of the configuration files, nor the help file will be found.

If IRIT_BIN_IPC is not set, text based IPC is used, which is far slower. No real reason not to use IRIT_BIN_IPC, unless it does not work for you.

In addition, the following optional environment variables may be set.
IRIT_MALLOC If set, apply dynamic memory consistency testing.
Programs will execute much slower in this mode.
IRIT_MALLOC_PTR Set to a pointer address and the program will scream
once this pointer is allocated, if IRIT_MALLOC is set.
IRIT_NO_SIGNALS If set, no signals are caught by IRIT.
IRIT_SERVER_HOST Internet Name of IRIT server (used by graphics driver).
IRIT_SERVER_PORT Used internally to the TCP socket number. Should not
be set by users.
IRIT_TIME_OUT Integer (seconds) for timing out when trying from IRIT
to execute a display device. Default is 10 seconds.
IRIT_INCLUDE A semicolon seperated list of directories where to look
for irt files to include. See INCLUDE command.
LD_LIBRARY_PATH If shared libraries are created, this variable must be
updated to point to the shared libraries' directory.


For example,

   setenv IRIT_MALLOC 1
   setenv IRIT_MALLOC_PTR 1234567890
   setenv IRIT_NO_SIGNALS 1
   setenv IRIT_SERVER_HOST irit.cs.technion.ac.il
   setenv IRIT_INCLUDE "/d2/gershon/irit/irit/scripts;/tmp"

IRIT_MALLOC is useful for programmers, or when reporting a memory fatal error occurrence. This variable, when set as a non zero value will activate the following (hexadecimal bit settings with any combination of the following):
0x01 A test for overwriting before the dynamic memory
allocated or immediately after it. Cheap in time.
0x02 Savings of all allocated objects in a table for the
detection of freeing unallocated objects and consistency
of the entire dynamic memory. Expensive in time.
0x04 Zeros every freed object, once it is freed.


IRIT_NO_SIGNALS is also useful for debugging when contorl-C is used within a debugger. The IRIT_SERVER_HOST/PORT controls the server/client (IRIT/Display device) communication.

IRIT_SERVER_HOST and IRIT_SERVER_PORT are used in the unix and Window NT ports of IRIT.

See the section on the graphics drivers for more details.

A session can be logged into a file as set via LogFile in the configuration file. See also the LOGFILE command.

The following command line options are available:

   IRIT [-t] [-z] [file.irt]

-t Puts IRIT into text mode. No graphics will be displayed and
the display commands will be ignored. Useful when one needs to
execute an irt file to create data on a tty device...
-z Prints usage message and current configuration/version
information.
file.irt A file to invoke directly instead of waiting to input from
stdin.

IBM PC OS2 Specific Set Up

Under OS2 the IRIT_DISPLAY environment variable must be set (if set) to os2drvs.exe without any option (-s- will be passed automatically). os2drvs.exe must be in a directory that is in the PATH environment variable. IRIT_BIN_IPC can be used to signal binary IPC which is faster. Here is a complete example:

 set IRIT_PATH=c:\irit\bin\
 set IRIT_DISPLAY=os2drvs -s-
 set IRIT_BIN_IPC=1

assuming the directory specified by IRIT_PATH holds the executables of IRIT and is in PATH.

If IRIT_BIN_IPC is not set, text based IPC is used which is far slower. No real reason not to use IRIT_BIN_IPC unless it does not work for you.

The OS2 executables are typically built using the EMX port of gnu C compiler. The distribution of the executables does not include the run time library of EMX and attempt to run IRIT will fail with error message like "File EMX does not exist". You will need to get the run time from

ftp to ftp-os2.nmsu.edu (aliased also as hobbes.NMSU.Edu) cd to os2/unix/emx09c (or a newer version number/level) get emxrt.zip and place its dlls in a place they would be found.


IBM PC Window NT Specific Set Up

The NT port uses sockets and is, in this respect, similar to the unix port. The envirnoment variables IRIT_DISPLAY, IRIT_SERVER_HOST, IRIT_BIN_IPC should all be set in a similar way to the Unix specific setup. As a direct result, the server (IRIT) and the display device may be running on different hosts. For example the server might be running on an NT system while the display device will be running on an SGI4D exploiting the graphic's hardware capabilities. Here is a complete example:

 set IRIT_PATH=c:\irit\bin\
 set IRIT_DISPLAY=wntgdrvs -s-
 set IRIT_BIN_IPC=1


Unix Specific Set Up

Under UNIX using X11 (x11drvs driver) add the following options to your .Xdefaults. Most are self explanatory. The Trans attributes control the transformation window, while the View attributes control the view window. SubWin attributes control the subwindows within the Transformation window.
#if COLOR
irit*Trans*BackGround: NavyBlue
irit*Trans*BorderColor: Red
irit*Trans*BorderWidth: 3
irit*Trans*TextColor: Yellow
irit*Trans*SubWin*BackGround: DarkGreen
irit*Trans*SubWin*BorderColor: Magenta
irit*Trans*Geometry: =150x500+500+0
irit*Trans*CursorColor: Green
irit*View*BackGround: NavyBlue
irit*View*BorderColor: Red
irit*View*BorderWidth: 3
irit*View*Geometry: =500x500+0+0
irit*View*CursorColor: Red
irit*MaxColors: 15
#else
irit*Trans*Geometry: =150x500+500+0
irit*Trans*BackGround: Black
irit*View*Geometry: =500x500+0+0
irit*View*BackGround: Black
irit*MaxColors: 1
#endif



First Usage

Commands to IRIT are entered using a textual interface, usually from the same window the program was executed from.

Some important commands to begin with are,

1. include("file.irt"); - will execute the commands in file.irt. Note include can be recursive up to 10 levels. To execute the demo (demo.irt) simply type 'include("demo.irt");'. Another way to run the demo is by typing demo(); which is a predefined procedure defined in iritinit.irt.

2. help(""); - will print all available commands and how to get help on them. A file called irit.hlp will be searched as irit.cfg is being searched (see above), to provide the help.

3. exit(); - close everything and exit IRIT.

Most operators are overloaded. This means that you can multiply two scalars (numbers), or two vectors, or even two matrices, with the same multiplication operator (*). To get the on-line help on the operator '*' type 'help("*");'

The best way to learn this program (like any other program...) is by trying it. Print the manual and study each of the commands available. Study the demo programs (*.irt) provided as well.

The "best" mode to use irit is via the emacs editor. With this distribution an emacs mode for irit files (irt postfix) is provided (irit.el). Make your .emacs load this file automatically. Loading file.irt will switch emacs into Irit mode that supports the following three keystrokes:
Meta-E Executes the current line
Meta-R Executes the current Region (Between Cursor and Mark)
Meta-S Executes a single line from input buffer
The first time one of the above keystrokes is hit, emacs will fork an Irit process so that Irit's stdin is controlled via the above commands. This emacs mode was tested under various unix environments, under OS2 2.x/3.x, and under Windows NT 3.x/4.x and Windows 95.


Line Editing

The IRIT interpreter provides full line editing capabilities. The following are the control options that are available:
^a Beginning of line
^e End of line
^f Forward one character
^b Backward one character
^d Delete current character
^h (Backspace) Delete backward one character
^i (Tab) Toggles overwrite/insert mode
^k Kill to end of line
^p Get previous history line
^n Get next history line
^j (LineFeed) Done with this line
Only lines entered from stdin would enter the history queue. The above control capabilities are fully configurable via the irit.cfg configuration file.


Data Types

These are the Data Types recognized by the solid modeler. They are also used to define the calling sequences of the different functions below:
ConstantType Scalar real type that cannot be modified.
NumericType Scalar real type.
VectorType 3D real type vector.
PointType 3D real type point.
CtlPtType Control point of a freeform curve or surface.
MatrixType 4 by 4 matrix (homogeneous transformation matrix).
PolygonType Object consists of polygons.
PolylineType Object consists of polylines.
CurveType Object consists of curves.
SurfaceType Object consists of surfaces.
TrimSrfType Object consists of trimmed surfaces.
TriSrfType Object consists of triangular surfaces
TrivarType Object consists of trivariate functions.
MultivarType Object consists of multivariate functions.
FreeformType One of CurveType, SurfaceType, TrimSrfType,
TrivarType, MultivarType, TriSrfType.
GeometricType One of Polygon/lineType, FreeformType.
InstanceType Object with a GeometryType and a Transformation.
GeometricTreeType A list of GeometricTypes or GeometricTreeTypes.
StringType Sequence of chars within double quotes - "A string".
Current implementation is limited to 80 chars.
AnyType Any of the above.
ListType List of (any of the above type) objects. List
size is dynamically increased, as needed.
Although points and vectors are not the same, IRIT does not destinguish between them, most of the time. This might change in the future.


Commands summary

These are all the commands and operators supported by the IRIT solid modeler:
+ CCINTER CYLIN LOGFILE ROTVEC SURFREVAX2
- CCRVTR CZEROS MATDECOMP ROTX SVISIBLE
* CDERIVE DSTPTLN MATPOSDIR ROTY SWEEPSRF
/ CDIVIDE DSTPTPLN MBISECTOR ROTZ SWPSCLSRF
^ CEDITPT DSTLNLN MDERIVE ROTZ2V SWUNGASUM
= CENVOFF ERROR MDIVIDE ROTZ2V2 SYMBCPROD
== CEVAL EVOLUTE MERGEPOLY RRINTER SYMBDIFF
!= CEXTREMES EXEC MESHSIZE RULEDSRF SYMBDPROD
< CHDIR EXIT MEVAL RULEDTV SYMBIPROD
> CINFLECT EXP MFROMMESH SACCESS SYMBPROD
<= CINTERP EXTRUDE MFROMMV SAVE SYMBSUM
>= CINTEG FFCOMPAT MMERGE SBEZIER SYSTEM
ABS CIRCLE FFCTLPTS MOFFSET SBISECTOR TAN
ACOS CIRCPOLY FFEXTREME MOMENT SBSPLINE TBEZIER
ADAPISO CLNTCLOSE FFKNTVEC MPROMOTE SCALE TBSPLINE
ADWIDTH CLNTCRSR FFMATCH MRAISE SCRVTR TCRVTR
ALGSUM CLNTEXEC FFMERGE MRCHCUBE SDERIVE TDERIVE
ANIMEVAL CLNTREAD FFMESH MREFINE SDIVIDE TDIVIDE
AOFFSET CLNTWRITE FFMSIZE MREGION SEDITPT TEDITPT
ARC CMESH FFORDER MREPARAM SETNAME TEVAL
ARC360 CMOEBIUS FFPOLES MREVERSE SEVAL TEXTGEOM
AREA CMORPH FFPTDIST MSLEEP SFOCAL TFROMSRFS
ASIN CMULTIRES FFPTTYPE MZERO SFROMCRVS TIME
ATAN CNORMAL FFSPLIT NIL SGAUSS TINTERP
ATAN2 CNRMLCRV FLOOR NREF SILHOUETTE THISOBJ
ATTRIB CNVXHULL FMOD NRMLCONE SIN TMORPH
ATTRPROP COERCE FOR NTH SINTERP TORUS
AWIDTH COLOR FREE OFFSET SIZEOF TRAISE
BBOX COMMENT FUNCTION ORTHOTOMC SKEL2DINT TRANS
BLOSSOM COMPOSE GBOX PAUSE SMEANSQR TREFINE
BOOLONE CON2 GETATTR PCIRCLE SMERGE TREGION
BOOLSUM CONE GETLINE PDECIMATE SMESH TREPARAM
BOX CONICSEC GETNAME PDOMAIN SMOEBIUS TRIANGL
BSCTCONCON CONTOUR GGINTER PLANE SMOOTHNRML TRIMSRF
BSCTCONLN CONVEX GPOLYGON PLN3PTS SMORPH TRMSRFS
BSCTCONPL COORD GPOLYLINE PMORPH SNOC TSBEZIER
BSCTCONPT COS HELP POINT SNORMAL TSBSPLINE
BSCTCONSPR COVERISO HERMITE POLY SNRMLSRF TSDERIVE
BSCTCYLPL COVERPT HOMOMAT POWER SPARABOLC TSEVAL
BSCTCYLPT CPOLY IF PPINTER SPHERE TSGREGORY
BSCTCYLSPR CPOWER INCLUDE PRINTF SQRT TSNORMAL
BSCTPLNLN CRAISE INSTANCE PRISA SRAISE TVLOAD
BSCTPLNPT CREDUCE INTERACT PROCEDURE SREFINE TVZRJACOB
BSCTSPRLN CREFINE IQUERY PT3BARY SREGION VARLIST
BSCTSPRPL CREGION IRITSTATE PTHMSPR SREPARAM VECTOR
BSCTSPRPT CREPARAM ISGEOM PTLNPLN SREVERSE VIEW
BSCTSPRSPR CROSSEC ISOCLINE PTPTLN SRINTER VIEWOBJ
BSCTTRSPT CRV2TANS KNOTCLEAN PTS2PLLN SSINTER VIEWSET
BSCTTRSSPR CRVLNDST KNOTREMOVE PTSLNLN STANGENT VOLUME
BSP2BZR CRVPTDST LINTERP QUADRIC STRIMSRF WHILE
BZR2BSP CRVPTTAN LIST RANDOM STRIVAR ZCOLLIDE
CAREA CSURFACE LN RAYTRAP SURFPREV
CBEZIER CTANGENT LOAD RFLCTLN SURFREV
CBISECTOR CTLPT LOFFSET RESET SURFREVAXS
CBSPLINE CTRIMSRF LOG RMATTR SURFREV2



Functions and Variables

Functions that return a NumericType:
ABS COS EXP POWER THISOBJ
ACOS CLNTEXEC FLOOR RANDOM VOLUME
AREA CPOLY FMOD SIN
ASIN DSTPTLN LN SIZEOF
ATAN DSTPTPLN LOG SQRT
ATAN2 DSTLNLN MESHSIZE TAN


Functions that return a GeometricType:
ADAPISO CMOEBIUS FFSPLIT PPINTER STRIMSRF
ALGSUM CMORPH GBOX PRISA STRIVAR
AOFFSET CMULTIRES GETATTR PROCEDURE SURFPREV
ARC CNORMAL GETLINE PT3BARY SURFREV
ARC360 CNRMLCRV GETNAME PTHMSPR SURFREVAXS
BBOX CNVXHULL GGINTER PTLNPLN SURFREV2
BLOSSOM COERCE GPOLYGON PTPTLN SURFREVAX2
BOOLONE COMPOSE GPOLYLINE PTSLNLN SVISIBLE
BOOLSUM CON2 HERMITE QUADRIC SWEEPSRF
BOX CONE INSTANCE RAYTRAP SWPSCLSRF
BSCTCONCON CONICSEC IRITSTATE RFLCTLN SWUNGASUM
BSCTCONLN CONTOUR ISGEOM RRINTER SYMBCPROD
BSCTCONPL CONVEX ISOCLINE RULEDSRF SYMBDIFF
BSCTCONPT COORD KNOTCLEAN RULEDTV SYMBDPROD
BSCTCONSPR COVERISO KNOTREMOVE SACCESS SYMBIPROD
BSCTCYLPL COVERPT LINTERP SBEZIER SYMBPROD
BSCTCYLPT CPOWER LOFFSET SBISECTOR SYMBSUM
BSCTCYLSPR CRAISE MATDECOMP SBSPLINE TBEZIER
BSCTPLNLN CREDUCE MBISECTOR SCRVTR TBSPLINE
BSCTPLNPT CREFINE MDERIVE SDERIVE TCRVTR
BSCTSPRLN CREGION MDIVIDE SDIVIDE TDERIVE
BSCTSPRPL CREPARAM MERGEPOLY SEDITPT TDIVIDE
BSCTSPRPT CROSSEC MEVAL SEVAL TEDITPT
BSCTSPRSPR CRV2TANS MFROMMESH SFOCAL TEVAL
BSCTTRSPT CRVLNDST MFROMMV SFROMCRVS TEXTGEOM
BSCTTRSSP CRVPTDST MMERGE SGAUSS TFROMSRFS
BSP2BZR CRVPTTAN MOFFSET SILHOUETTE TINTERP
BZR2BSP CSURFACE MOMENT SINTERP TMORPH
CAREA CTANGENT MPROMOTE SKEL2DINT TORUS
CBEZIER CTRIMSRF MRAISE SMEANSQR TRAISE
CBISECTOR CTLPT MRCHCUBE SMERGE TREFINE
CBSPLINE CYLIN MREFINE SMESH TREGION
CCINTER CZEROS MREGION SMOEBIUS TREPARAM
CCRVTR EVOLUTE MREPARAM SMOOTHNRML TRIANGL
CDERIVE EXTRUDE MREVERSE SMORPH TRIMSRF
CDIVIDE FFCOMPAT MZERO SNORMAL TRMSRFS
CEDITPT FFCTLPTS NIL SNRMLSRF TSBEZIER
CENVOFF FFEXTREME OFFSET SPARABOLC TSBSPLINE
CEVAL FFKNTVEC ORTHOTOMC SPHERE TSDERIVE
CEXTREMES FFMATCH PCIRCLE SRAISE TSEVAL
CINFLECT FFMERGE PDECIMATE SREFINE TSGREGORY
CINTERP FFMESH PDOMAIN SREGION TSNORMAL
CIRCLE FFMSIZE PLANE SREPARAM TVLOAD
CIRCPOLY FFORDER PLN3PTS SREVERSE TVZRJACOB
CLNTCRSR FFPOLES PMORPH SRINTER ZCOLLIDE
CLNTREAD FFPTDIST POINT SSINTER
CMESH FFPTTYPE POLY STANGENT


Functions that create linear transformation matrices:
HOMOMAT ROTVEC ROTY ROTZ2V SCALE
MATPOSDIR ROTX ROTZ ROTZ2V2 TRANS


Miscellaneous functions:
ADWIDTH COMMENT INCLUDE NTH SYSTEM
ANIMEVAL ERROR INTERACT PAUSE TIME
ATTRIB EXEC IQUERY PRINTF VARLIST
ATTRPROP EXIT LIST PROCEDURE VECTOR
AWIDTH FOR LOAD RESET VIEW
CHDIR FREE LOGFILE RMATTR VIEWOBJ
CLNTCLOSE FUNCTION MSLEEP SAVE VIEWSET
CLNTWRITE HELP NREF SETNAME WHILE
COLOR IF NRMLCONE SNOC


Variables that are predefined in the system:
AXES MACHINE POLY_APPROX_TOL VIEW_MAT
DRAWCTLPT POLY_APPROX_OPT PRSP_MAT
FLAT4PLY POLY_APPROX_UV RESOLUTION


Constants that are predefined in the system:
AMIGA E3 LIST_TYPE P7 SGI
APOLLO E4 MAGENTA P8 STRING_TYPE
BEZIER_TYPE E5 MATRIX_TYPE P9 SURFACE_TYPE
BLACK E6 MSDOS PARAM_CENTRIP SUN
BLUE E7 MULTIVAR_TYPE PARAM_CHORD TRIMSRF_TYPE
BSPLINE_TYPE E8 NUMERIC_TYPE PARAM_NIELFOL TRISRF_TYPE
CLIENTS_ALL E9 OFF PARAM_UNIFORM TRIVAR_TYPE
COL FALSE ON PI TRUE
CTLPT_TYPE GREEN P1 PLANE_TYPE UNDEF_TYPE
CURVE_TYPE HP P2 POINT_TYPE UNIX
CYAN IBMOS2 P3 POLY_TYPE VECTOR_TYPE
DEPTH IBMNT P4 POWER_TYPE WHITE
E1 KV_FLOAT P5 RED YELLOW
E2 KV_OPEN P6 ROW



Language description

The front end of the IRIT solid modeler is an infix parser that mimics some of the C language behavior. The infix operators that are supported are plus (+), minus (-), multiply (*), divide (/), and power (^), for numeric operators, with the same precedence as in C.

However, unlike the C language, these operators are overloaded, or different action is taken, based upon the different operands. This means that one can write '1 + 2', in which the plus sign denotes a numeric addition, or one can write 'PolyObj1 + PolyObj2', in which case the plus sign denotes the Boolean operation of a union between two geometric objects. The exact way each operator is overloaded is defined below.

In this environment, reals, integers, and even Booleans, are all represented as real types. Data are automatically promoted as necessary. For example, the constants TRUE and FALSE are defined as 1.0 and 0.0 respectively.

Each expression is terminated by a semicolon. An expression can be as simple as 'a;' which prints the value of variable a, or as complex as:

    for ( t = 1.1, 0.1, 1.9,
            cb1 = csurface( sb, COL, t ):
            color( cb1, green ):
            snoc( cb1, cb_all )
        );

While an expression is terminated with a semicolon, a colon is used to terminate mini-expressions within an expression.

Once a complete expression is read in (i.e., a semicolon is detected) and parsed correctly (i.e. no syntax errors are found), it is executed. Before each operator or a function is executed, parameter type matching tests are made to make sure the operator can be applied to these operand(s), or that the function gets the correct set of arguments.

The parser is totally case insensitive, so Obj, obj, and OBJ will refer to the same object, while MergePoly, MERGEPOLY, and mergePoly will refer to the same function.

Objects (Variables if you prefer) need not be declared. Simply use them when you need them. Object names may be any alpha-numeric (and underscore) string of at most 30 characters. By assigning to an old object, the old object will be automatically deleted and if necessary its type will be modified on the fly.

Example:

    V = sin( 45 * pi / 180.0 );
    V = V * vector( 1, 2, 3 );
    V = V * rotx( 90 );
    V = V * V;

will assign to V a NumericType equal to the sine of 45 degrees, the VectorType ( 1, 2, 3 ) scaled by the sine of 45, rotate that vector around the X axis by 90 degrees, and finally a NumericType which is the dot (inner) product of V with itself.

The parser will read from stdin, unless a file is specified on the command line or an INCLUDE command is executed. In both cases, when the end of file is encountered, the parser will again wait for input from stdin. In order to execute a file and quit in the end of the file, put an EXIT command as the last command in the file.


Operator overloading


Overloading +

The + operator is overloaded above the following domains:

  NumericType + NumericType -> NumericType
  PointType   + PolygonType -> PolygonType  (Point polyline profiling)
  VectorType  + VectorType  -> VectorType   (Vector addition)
  MatrixType  + MatrixType  -> MatrixType   (Matrix addition)
  PolygonType + PolygonType -> PolygonType  (Boolean UNION operation)
  CurveType   + CurveType   -> CurveType    (Curve curve profiling)
  CurveType   + CtlPtType   -> CurveType    (Curve control point profiling)
  CtlPtType   + CtlPtType   -> CurveType    (Control points profiling)
  ListType    + ListType    -> ListType     (Append lists operator)
  StringType  + StringType  -> StringType   (String concat)
  StringType  + RealType    -> StringType   (String concat, real as int string)

Note: Boolean UNION of two disjoint objects (no common volume) will result with the two objects combined. It is the USER responsibility to make sure that the non intersecting objects are also disjoint - this system only tests for no intersection. Boolean UNION of two polyline objects will merge the list of polylines.


Overloading -

The - operator is overloaded above the following domains:

As a binary operator:

  NumericType - NumericType -> NumericType
  VectorType  - VectorType  -> VectorType   (Vectoric difference)
  MatrixType  - MatrixType  -> MatrixType   (Matrix difference) 
  PolygonType - PolygonType -> PolygonType  (Boolean SUBTRACT operation)

As a unary operator:

  - NumericType -> NumericType
  - VectorType  -> VectorType    (Scale vector by -1)
  - MatrixType  -> MatrixType    (Scale matrix by -1)
  - PolygonType -> PolygonType   (Boolean NEGATION operation)
  - CurveType   -> CurveType     (Curve parameterization is reversed)
  - SurfaceType -> SurfaceType   (Surface parameterization is reversed)

Note: Boolean SUBTRACT of two disjoint objects (no common volume) will result with an empty object. For both a curve and a surface parameterization, reverse operation (binary minus) causes the object normal to be flipped as a side effect.


Overloading *

The * operator is overloaded above the following domains:

  NumericType  * NumericType   -> NumericType
  VectorType   * NumericType   -> VectorType    (Vector scaling)
  VectorType   * CurveType     -> CurveType     (Inner product projection)
  VectorType   * SurfaceType   -> SurfaceType   (Inner product projection)
  VectorType   * VectorType    -> NumericType   (Inner product)
  MatrixType   * NumericType   -> MatrixType    (Matrix Scaling)
  MatrixType   * PointType     -> PointType     (Point transformation)
  MatrixType   * CtlPtType     -> CtlPtType     (Ctl Point transformation)
  MatrixType   * VectorType    -> VectorType    (Vector transformation)
  MatrixType   * MatrixType    -> MatrixType    (Matrix multiplication)
  MatrixType   * GeometricType -> GeometricType (Object transformation)
  MatrixType   * ListType      -> ListType      (Object hierarchy transform.)
  PolygonType  * PolygonType   -> PolygonType   (Boolean INTERSECTION operation)
  InstanceType * MatrixType    -> InstanceType  (Transform of Instance's matrix)

Note: Boolean INTERSECTION of two disjoint objects (no common volume) will result with an empty object. Object hierarchy transform transforms any transformable object (GeometricType) found in the list recursively. Boolean INTERSECTION of two planar (XY plane) polyline objects will compute the intersection points of the two lists of polylines.


Overloading /

The / operator is overloaded above the following domains:

  NumericType / NumericType -> NumericType
  PointType   / PointType   -> PolyType      (Polyline between two pts)
  PointType   / PolygonType -> PolygonType   (Point polyline profiling)
  PolygonType / PolygonType -> PolygonType   (Boolean CUT operation)

Note: Boolean CUT of two disjoint objects (no common volume) will result with an empty object.


Overloading ^{ }

The ^ operator is overloaded above the following domains:

  NumericType ^ NumericType -> NumericType
  VectorType  ^ VectorType  -> VectorType  (Cross product)
  MatrixType  ^ NumericType -> MatrixType  (Matrix to the (int) power)
  PolygonType ^ PolygonType -> PolygonType (Boolean MERGE operation)
  StringType  ^ StringType  -> StringType  (String concat)
  StringType  ^ RealType    -> StringType  (String concat, real as real string)

Note: Boolean MERGE simply merges the two sets of polygons without any intersection tests. Matrix powers must be positive integers or -1, in which case the matrix inverse (if it exists) is computed.


Overloading Equal (Assignments)

Assignments are allowed as side effects, in any place in an expression. If "Expr" is an expression, then "var = Expr" is the exact 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 the same expression is a bad practice. Use parentheses to force the order of evaluation, i.e., "( var = Expr )".


Comparison operators ==, !=, <, >, <=, >=

The conditional comparison operators can be applied to the following domains (o for a comparison operator):

  NumericType  o NumericType  -> NumericType
  StringType   o StringType   -> NumericType
  PointType    o PointType    -> NumericType
  VectorType   o VectorType   -> NumericType
  PlaneType    o PlaneType    -> NumericType
  CtlPtType    o CtlPtType    -> NumericType
  MatrixType   o MatrixType   -> NumericType
  CurveType    o CurveType    -> NumericType
  SurfaceType  o SurfaceType  -> NumericType
  TrivarType   o TrivarType   -> NumericType
  TriSrfType   o TriSrfType   -> NumericType
  MultivarType o MultivarType -> NumericType

The returned NumericType is non-zero if the condition holds, or zero if not. The comparison operators other than == and != can be used on NumericTypes and StringType only.


Logical operators &&, |, !

Complex logical expressions can be defined using the logical and (&&), logical or (||) and logical not (!). These operators can be applied to NumericTypes that are considered Boolean results. That is, true for a non-zero value, and false otherwise. The returned NumericType is true if both operands are true for the and operator, at least one is true for the or operator, and the operand is false for the not operator. In all other cases, a false is returned. To make sure Logical expressions are readable, the and and or operators are defined to have the same priority. Use parentheses to disambiguate a logical expression and to make it more readable.


Geometric Boolean Operations

The IRIT solid modeling system supports Boolean operations between polyhedra objects. Freeform objects will be automaticaly converted to a polygonal representation when used in Boolean operations. The +, *, and - are overloaded to denote Boolean union, intersection and subtraction when operating on geometric entities. - can also be used as an unary operator to reverse the object orientation inside out.

IRIT supports Boolean operations on polyhedra models. A polyhedra based model is simply a collection of polygons. While a polyhedra is simply a set of polygons, this set must conform to certain conditions:

Every polygon has known adjacent polygons, for all its edges.

Every polygon has a normal that points into the model. That normal is inside/outside consistent with its adjacent polygons. In other words, for every polygon, one can locally determine the inside or the outside of the model. Moreover, every polygon has neighbors for all its edges, forming a closed object that consistently delineates inside from outside, globally.

The Boolean operations are set operations conducted between two such models, M_1 and M_2, that delineate inside from outside. Boolean Union, Boolean Intersection and Boolean Subtraction are the three common operations that resemble the exact semantic that is expected, when treating M_1 and M_2 as three dimensional point sets.

The Boolean operations can be formulated into a binary tree structure also known as Constructive Solid Geometry (CSG) tree.

Example:

    resolution = 20;
    B = box(vector(-1, -1, -0.25), 2, 1.2, 0.5);
    C = con2(vector(0, 0, -1.5), vector(0, 0, 3), 0.7, 0.3);

    D = convex(B - C);
    E = convex(C - B);
    F = convex(B + C);
    G = convex(B * C);

    tr = rotx( -90 ) * roty( 40 ) * rotx( -30 );

    All = list( D * tr * trans( vector(  0.6,  0.5, 0.0 ) ),
                E * tr * trans( vector(  3.0,  0.0, 0.0 ) ),
                F * tr * trans( vector( -2.0,  0.0, 0.0 ) ),
                G * tr * trans( vector(  0.7, -1.0, 0.0 ) ) )
            * scale( vector( 0.25, 0.25, 0.25 ) )
            * trans( vector( -0.1, -0.3, 0.0 ) );
    view_mat = rotx( 0 );
    view( list( view_mat, All ), on );
    save( "booleans", list( view_mat, All ) );

A complete example to compute the union, intersection and both differences of a box and a truncated cone.

Special cases can be very difficult to handle when considering Boolean operations. Consider an axes parallel bounding cube. Consider a second cube rotated alpha degrees from the first cube. At large angles, the Boolean operations are fairly simple to compute. Nevertheless, as alpha approaches zero, the almost coplanar planes of the two intersecting cubes make it very difficult to robustly and consistently compute their intersection.

There are several flags to control the Boolean operations. See IRITSTATE command for the "InterCrv", "Coplanar", and "PolySort" states.


Priority of operators

The following table lists the priority of the different operators.
Lowest Operator Name of operator
priority , comma
: colon
&&, || logical and, logical or
=,==,!=,<=,>=,<,> assignment, equal, not equal, less
equal, greater equal, less, greater
+, - plus, minus
*, / multiply, divide
Highest ^ power
priority -, ! unary minus, logical not



Grammar

The grammar of the IRIT parser follows similar guidelines as the C language for simple expressions. However, complex statements differ. See the IF, FOR, FUNCTION, and PROCEDURE below for the usage of these clauses.


Function Description


NumericType returning functions


ABS

 NumericType ABS( NumericType Operand )

Returns the absolute value of the given Operand.


ACOS

 NumericType ACOS( NumericType Operand )

Returns the arc cosine value (in radians) of the given Operand.


AREA

 NumericType AREA( PolygonType Object )

Returns the area of the given Object (in object units). Returned is the area of the polygonal object, not the area of the primitive it might approximate.

This means that the area of a polygonal approximation of a sphere will be returned, not the exact area of the sphere.


ASIN

 NumericType ASIN( NumericType Operand )

Returns the arc sine value (in radians) of the given Operand.


ATAN

 NumericType ATAN( NumericType Operand )

Returns the arc tangent value (in radians) of the given Operand.


ATAN2

 NumericType ATAN2( NumericType Operand1, NumericType Operand2 )

Returns the arc tangent value (in radians) of the given ratio: Operand1 / Operand2, over the whole circle.


COS

 NumericType COS( NumericType Operand )

Returns the cosine value of the given Operand (in radians).


CLNTEXEC

 NumericType CLNTEXEC( StringType ClientName )

Initiate communication channels to a client named ClientName. ClientName is executed by this function as a sub process and two communication channels are opened between the IRIT server and the new client, for read and write. See also CLNTCRSR, CLNTREAD, CLNTWRITE, and CLNTCLOSE. if ClientName is an empty string, the user is provided with the new communication port to be used and the server blocks for the user to manualy executed the client after setting the proper IRIT_SERVER_HOST/PORT environment variables.

Example:

   h1 = CLNTEXEC( "" );
   h2 = CLNTEXEC( "nuldrvs -s-" );

executes two clients, one is named nuldrvs and the other one is prompted for by the user. As a result of the second invokation of CLNTEXEC, the user will be prompted with a message similar to,

    Irit: Startup your program - I am waiting...

    setenv IRIT_SERVER_PORT 2182

and he/she will need to set the proper environment variable and execute their client manually.


CPOLY

 NumericType CPOLY( PolygonType Object )

Returns the number of polygons in the given polygonal Object.


DSTPTLN

 NumericType DSTPTLN( PointType Pt, PointType LineOrig, VectorType LineRay )

Returns the distance between a given point Pt and line LineOrig, LineRay. See also PTPTLN.


DSTPTPLN

 NumericType DSTPTPLN( PointType Pt, PlaneType Plane )

Returns the distance between a given point Pt and plane Plane.


DSTLNLN

 NumericType DSTLNLN( PointType Line1Orig, VectorType Line1Ray,
                      PointType Line2Orig, VectorType Line2Ray )

Returns the distance between two lines defined by point LineiOrig and ray LineiRay. See also PTSLNLN.


EXP

 NumericType EXP( NumericType Operand )

Returns the natural exponent value of the given Operand.


FLOOR

 NumericType FLOOR( NumericType Operand )

Returns the largest integer not greater than Operand.


FMOD

 NumericType FMOD( NumericType Operand, NumericType Mod )

Returns the floating point remainder of the division of Operand by Mod.


LN

 NumericType LN( NumericType Operand )

Returns the natural logarithm value of the given Operand.


LOG

 NumericType LOG( NumericType Operand )

Returns the base 10 logarithm value of the given Operand.


MESHSIZE

 NumericType MESHSIZE( FreeformType Freeform, ConstantType Direction )

Returns the size of the Freeform's mesh in Direction, which is one of COL or ROW or DEPTH. For the case of a multivariate Freeform, the Direction is an integer value starting from 0. See also FFMSIZE. Examples:

   Len = MESHSIZE( Crv, COL );
   RSize = MESHSIZE( Sphere, ROW );
   CSize = MESHSIZE( Sphere, COL );
   TVSize = MESHSIZE( TV, COL ) * MESHSIZE( TV, ROW ) * MESHSIZE( TV, DEPTH );
   MVSize1 = MESHSIZE( MV, 1 );


POWER

 NumericType POWER( NumericType Operand, NumericType Exp )

Returns Operand to the power of Exp.


RANDOM

 NumericType RANDOM( NumericType Min, NumericType Max )

Returns a randomized value between Min and Max.


SIN

 NumericType SIN( NumericType Operand )

Returns the sine value of the given Operand (in radians).


SIZEOF

 NumericType SIZEOF( ListType List | PolygonType Poly |
                     CurveType Crv | StringType Str )

Returns the length of a list if List, the number of polygons if Poly, the length of the control polygon if Crv, or the number of characters in string if Str. If, however, only one polygon is in Poly, it returns the number of vertices in that polygon.

Example:

   len = SIZEOF( list( 1, 2, 3 ) );
   numPolys = SIZEOF( axes );
   numCtlpt = SIZEOF( circle( vector( 0, 0, 0 ), 1 ) );

will assign the value of 3 to the variable len, set numPolys to the number of polylines in the axes object, and set numCtlPt to 9, the number of control points in a circle.


SQRT

 NumericType SQRT( NumericType Operand )

Returns the square root value of the given Operand.


TAN

 NumericType TAN( NumericType Operand )

Returns the tangent value of the given Operand (in radians).


THISOBJ

 NumericType THISOBJ( StringType Object )

Returns the object type of the given name of an Object. This can be one of the constants,
UNDEF_TYPE POINT_TYPE CURVE_TYPE TRIVAR_TYPE
NUMERIC_TYPE CTLPT_TYPE SURFACE_TYPE MULTIIVAR_TYPE
STRING_TYPE MATRIX_TYPE TRISRF_TYPE
VECTOR_TYPE POLY_TYPE TRIMSRF_TYPE
This is also a way to ask if an object by a given name do exist (if the returned type is UNDEF_TYPE or not).


VOLUME

 NumericType VOLUME( PolygonType Object )

Returns the volume of the given Object (in object units). It returns the volume of the polygonal object, not the volume of the object it might approximate.

This routine decomposes all non-convex polygons to convex ones as a side effect (see CONVEX).


GeometricType returning functions


ADAPISO

 CurveType ADAPISO( SurfaceType Srf, NumericType Dir, NumericType Eps,
                    NumericType FullIso, NumericType SinglePath )

Constructs a coverage to Srf using isocurve in the Dir direction, so that for any point p on surface Srf, there exists a point on one of the isocurves that is close to p within Eps. If FullIso, the extracted isocurves span the entire surface domain, otherwise they may span only a subset of the domain. If SinglePath, an approximation to a single path (Hamiltonian path) that visits all isocurves is constructed (not supported). See also COVERPT, COVERISO.

    srf = sbezier( list( list( ctlpt( E3, -0.5, -1.0,  0.0 ),
                               ctlpt( E3,  0.4,  0.0,  0.1 ),
                               ctlpt( E3, -0.5,  1.0,  0.0 ) ),
                         list( ctlpt( E3,  0.0, -0.7,  0.1 ),
                               ctlpt( E3,  0.0,  0.0,  0.0 ),
                               ctlpt( E3,  0.0,  0.7, -0.2 ) ),
                         list( ctlpt( E3,  0.5, -1.0,  0.1 ),
                               ctlpt( E3, -0.4,  0.0,  0.0 ),
                               ctlpt( E3,  0.5,  1.0, -0.2 ) ) ) );
    aiso = ADAPISO( srf, COL, 0.1, FALSE, FALSE );

Constructs an adaptive isocurve approximation with tolerance of 0.1 to surface srf in direction COL. Isocurves are allowed to span a subset of the surface domain. No single path is needed.

The SinglePath option is currently not supported.


ALGSUM

 SurfaceType ALGSUM( CurveType Crv1, CurveType Crv2 )

Given two curves, compute a surface that is their algebraic sum:

                        S(u, v) = C1(u) + C2(v)




Example:

 c1 = circle( vector( 0.0, 0.0, 0.0 ), 0.7 );
 c2 = ctlpt( E3, -0.2, -0.5, -1.5 ) + ctlpt( E3, 0.2, 0.5, 1.5 );

 s1 = algsum( c1, c2 );

 c2 = cbspline( 3,
                list( ctlpt( E3, 0.0, 0.0, 0.0 ),
                      ctlpt( E3, 0.0, 0.0, 0.7 ),
                      ctlpt( E3, 0.0, 1.5, 1.0 ),
                      ctlpt( E3, 0.0, 0.0, 1.3 ),
                      ctlpt( E3, 0.0, 0.0, 2.0 ) ),
                list( KV_OPEN ) );

 s2 = algsum( c1, c2 );

Creates two algebraic sum surfaces, one in the shape of a cylinder as a sum of a line and a circle and one circular sweep like.


ARC

 CurveType ARC( VectorType StartPos, VectorType Center, VectorType EndPos )

Constructs an arc between the two end points StartPos and EndPos, centered at Center. Arc will always be less than 180 degrees, so the shortest circular path from StartPos to EndPos is selected. The case where StartPos, Center, and EndPos are collinear is illegal, since it attempts to define a 180 degrees arc. Arc is constructed as a single rational quadratic Bezier curve.

Example:

    Arc1 = ARC( vector( 1.0, 0.0, 0.0 ),
                vector( 1.0, 1.0, 0.0 ),
                vector( 0.0, 1.0, 0.0 ) );

constructs a 90 degrees arc, tangent to both the X and Y axes at coordinate 1. See also ARC360


ARC360

 CurveType ARC360( VectorType Center, NumericType Radius,
                   NumericType StartAngle, NumericType EndAngle )

Constructs an arc between the two angles (degrees) StartAngle and EndAngle, centered at Center. Arc will always be less than 360 degrees. Arc is constructed as a rational quadratic Bspline curve.

Example:

    Arc2 = ARC360( vector( 0.0, 0.0, 0.0 ), 1.0, 75, 355 );

constructs a 280 degrees arc. See also ARC.


AOFFSET

 CurveType AOFFSET( CurveType Crv, NumericType OffsetDistance,
                    NumericType Epsilon, NumericType TrimLoops,
                    NumericType BezInterp )

Computes an offset of OffsetDistance with globally bounded error (controlled by Epsilon). The smaller Epsilon is, the better the approximation to the offset. The bounded error is achieved by adaptive refinement of the Crv. If TrimLoops is TRUE or on, the regions of the object that self-intersect as a result of the offset operation are trimmed away. If BezInterp is TRUE, each curve's segment is interpolated instead of approximated.

Example:

    OffCrv1 = AOFFSET( Crv, 0.5, 0.01, FALSE, FALSE );
    OffCrv2 = AOFFSET( Crv, 0.5, 0.01, TRUE, FALSE );

computes an adaptive offset to Crv with OffsetDistance of 0.5 and Epsilon of 0.01 and trims the self-intersection loops in the second instrance. See also OFFSET, LOFFSET, and MOFFSET.


BBOX

 ListType BBOX( GeometricTreeType Geom )

Given a (tree of) geometry, Geom computes its bounding box and return it as a list of six numbers: XMin/Max, YMin/Max, ZMin/Max, in this order.

Example:

 B1 = BBOX( axes );


BLOSSOM

 CtlPtType BLOSSOM( CurveType Crv, ListType BlossomVals )

Computes the blossom of the given Crv and the given blossom values BlossomVals.

Example:

 c1 = cbezier( list( ctlpt( E2, 1.7, 0.0 ),
                     ctlpt( E2, 0.7, 0.7 ),
                     ctlpt( E2, 1.7, 0.3 ),
                     ctlpt( E2, 1.5, 0.8 ),
                     ctlpt( E2, 1.6, 1.0 ) ) );

 BLOSSOM( c1, list( 0, 0, 0, 0 ) ) == coord( c1, 0 ) &&
 BLOSSOM( c1, list( 0, 0, 0, 1 ) ) == coord( c1, 1 ) &&
 BLOSSOM( c1, list( 0, 0, 1, 1 ) ) == coord( c1, 2 ) &&
 BLOSSOM( c1, list( 0, 1, 1, 1 ) ) == coord( c1, 3 ) &&
 BLOSSOM( c1, list( 1, 1, 1, 1 ) ) == coord( c1, 4 );

Extracts the control points of an quartic Bezier curve via blossoming and compare to the results obtained via a traditional extraction approach (via the COORD function).


BOOLONE

 SurfaceType BOOLONE( CurveType Crv )

Given a closed curve, the curve is subdivided into four segments equally spaced in the parametric space that are fed into BOOLSUM. Useful if a surface should "fill" the area enclosed by a closed curve.

Example:

 Srf = BOOLONE( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );

Creates a disk surface containing the area enclosed by the unit circle.


BOOLSUM

 SurfaceType BOOLSUM( CurveType Crv1, CurveType Crv2,
                      CurveType Crv3, CurveType Crv4 )

Construct a surface using the provided four curves as its four boundary curves. Curves do not have to have the same order or type, and will be promoted to their least common denominator. The end points of the four curves should match as follows:
Crv1 start point, to Crv3 start point.
Crv1 end point, to Crv4 start point.
Crv2 start point, to Crv3 end point.
Crv2 end point, to Crv4 end point.
where Crv1 and Crv2 are the two boundaries in one parametric direction, and Crv3 and Crv4 are the two boundaries in the other parametric direction.

Example:

    Cbzr1 = cbezier( list( ctlpt( E3, 0.1, 0.1, 0.1 ),
                           ctlpt( E3, 0.0, 0.5, 1.0 ),
                           ctlpt( E3, 0.4, 1.0, 0.4 ) ) );
    Cbzr2 = cbezier( list( ctlpt( E3, 1.0, 0.2, 0.2 ),
                           ctlpt( E3, 1.0, 0.5, -1.0 ),
                           ctlpt( E3, 1.0, 1.0, 0.3 ) ) );
    Cbsp3 = cbspline( 4,
                      list( ctlpt( E3, 0.1,  0.1, 0.1 ),
                            ctlpt( E3, 0.25, 0.0, -1.0 ),
                            ctlpt( E3, 0.5,  0.0, 2.0 ),
                            ctlpt( E3, 0.75, 0.0, -1.0 ),
                            ctlpt( E3, 1.0,  0.2, 0.2 ) ),
                      list( KV_OPEN ) );
    Cbsp4 = cbspline( 4,
                      list( ctlpt( E3, 0.4,  1.0, 0.4 ),
                            ctlpt( E3, 0.25, 1.0, 1.0 ),
                            ctlpt( E3, 0.5,  1.0, -2.0 ),
                            ctlpt( E3, 0.75, 1.0, 1.0 ),
                            ctlpt( E3, 1.0,  1.0, 0.3 ) ),
                      list( KV_OPEN ) );
    Srf = BOOLSUM( Cbzr1, Cbzr2, Cbsp3, Cbsp4 );


BOX

 PolygonType BOX( VectorType Point,
                  NumericType Dx, NumericType Dy, NumericType Dz )

Creates a BOX polygonal object, whose boundary is coplanar with the XY, XZ, and YZ planes. The BOX is defined by Point as base position, and Dx, Dy, Dz as BOX dimensions. Negative dimensions are allowed.

Example:

    B = BOX( vector( 0, 0, 0 ), 1, 1, 1);

creates a unit cube from 0 to 1 in all axes.


BSCTCONCON

 CurveType | ListType BSCTCONCON( VectorType ConeDir1, NumericType ConeAngle1,
                                  VectorType ConeDir2, NumericType ConeAngle2,
                                  NumericType Size )

Computes the bisector surface of two cones that share the same apex. The cones' directions are ConeDir1 and ConeDir2 and spanning angles of ConeAngle1 and ConeAngle2. ConeDir1 and ConeDir2 must be in the northern hemisphere. I.e. their Z coefficient must be positive. Size controls the portion of the (infinite) bisector actually represented.

Example:

 BisectSrf = BSCTCONCON( vector( 0, 0, 1 ), 50,
                         vector( 0, 0, 1 ), 20, 1.0 );

Computes the bisector of two concentric cones, which is also a cone. See also BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTCONLN

 CurveType | ListType BSCTCONLN( VectorType ConeDir, NumericType ConeAngle,
                                 VectorType LineDir, NumericType Size )

Computes the bisector surface of a cone and a line through its apex. The cone's directions is ConeDir and its spanning angle is ConeAngle. ConeDir and LineDir must be in the northern hemisphere. I.e. their Z coefficient must be positive. Size controls the portion of the (infinite) bisector actually represented.

Example:

    BisectSrf = ( vector( 0, 0, 1 ), 45, vector( 0, 0.1, 1 ), 1 );

computes the bisector surface of a cone along the Z axis with spanning angle of 45 degrees, and a line through its apex in direction ( 0, 0.1, 1 ).

See also BSCTCONCON, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTCONPL

 CurveType | ListType BSCTCONPL( PointType ConeApex, VectorType ConeDir,
                                 NumericType ConeAngle, NumericType Size )

Computes the bisector surface of a general cone and the XY plane (Z = 0 plane). The cone's apex is at ConeApex, the cone's directions is ConeDir and its spanning angle is ConeAngle. Dir must be in the northern hemisphere. I.e. their Z coefficient must be positive. Size controls the portion of the (infinite) bisector actually represented.

Example:

    BisectSrf = BSCTCONPL( point( 0, 0, -0.3 ), vector( 1, 1, 1 ), 20, 1 );

computes the bisector surface of a cone with its apex at (0, 0, -0.3) along the axis (1, 1, 1) with spanning angle of 20 degrees, and the plane Z = 0.

See also BSCTCONCON, BSCTCONLN, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTCONPT

 CurveType | ListType BSCTCONPT( PointType ConeApex, VectorType ConeDir,
                                 NumericType ConeAngle, PointType Pt,
                                 NumericType Size )

Computes the bisector surface of a cone in general position and a point, Pt. The cone's apex is at ConeApex, the cone's directions is ConeDir and its spanning angle is ConeAngle. Size controls the portion of the (infinite) bisector actually represented.

Example:

   Bisect = BSCTCONPT( point( 0, 0, 0 ), vector( 0, 0, 1 ), 22,
                       point( 0, 0.2, 0.7 ), 1 );

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTCONSPR

 CurveType | ListType BSCTCONSPR( PointType ConeApex, VectorType ConeDir,
                                  NumericType ConeAngle, PointType SptCntr,
                                  NumericType SprRadius, NumericType Size )

Computes the bisector surface of a cone and a sphere. The cone's apex is at ConeApex, the cone's directions is ConeDir and its spanning angle is ConeAngle. The sphere is centered at SptCntr and has a radius of SprRadius. Size controls the portion of the (infinite) bisector actually represented.

Example:

    BisectSrf = BSCTCONSPR( point( 0, 0, 0 ), vector( 0, 0, 1 ),
                            45, point( 0, 0, 1 ), 0.5, 2.0 );

computes the bisector between a cone along the Z axis with 45 spanning angle and a sphere at (0, 0, 1) of radius 0.5.

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTCYLPL

 CurveType | ListType BSCTCYLPL( PointType CylPos, VectorType CylDir,
                                 NumericType CylRadius, Size )

Computes the bisector surface of a a cylinder and the XY plane (plane Z = 0). The cylinder is located at CylPos, in the direction of CylDir which also sets the length of the cylinder. The radius of the cylinder is CylRadius. Size controls the portion of the (infinite) bisector actually represented.

Example:

    Pt = point( 0.1, 0, 0.2 );
    BisectSrf = BSCTCYLPL( point( 0, 0, 0.5 ), vector( 0, 0, 1 ), 0.2, 1 );

computed the bisector surface between a cylinder of radius 0.2 along the Z axis and the XY plane.

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTCYLPT

 CurveType | ListType BSCTCYLPT( PointType CylPos, VectorType CylDir,
                                 NumericType CylRadius, PointType Pt,
                                 NumericType Size )

Computes the bisector surface of a a cylinder and a point, Pt. The cylinder is located at CylPos, in the direction of CylDir which also sets the length of the cylinder. The radius of the cylinder is CylRadius. Size controls the portion of the (infinite) bisector actually represented.

Example:

    Pt = point( 0.1, 0, 0.2 );
    BisectSrf = BSCTCYLPT( point( 0, 0, 0.5 ), vector( 0, 0, 1 ), 0.2, Pt, 1 );

computed the bisector surface between a cylinder of radius 0.2 along the Z axis and a point at (0.1, 0, 0.2).

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTCYLSPR

 CurveType | ListType BSCTCYLSPR( PointType CylPos, VectorType CylDir,
                                  NumericType CylRadius, PointType SprCntr,
                                  NumericType SprRadius, NumericType Size )

Computes the bisector surface of a cylinder and a sphere. The cylinder is located at CylPos, in the direction of CylDir which also sets the length of the cylinder. The radius of the cylinder is CylRadius. The sphere is centered at SptCntr and has a radius of SprRadius. Size controls the portion of the (infinite) bisector actually represented.

Example:

    BisectSrf = BSCTCYLSPR( point( 0, 0, 1.5 ), vector( 0, 0, 3 ), 0.2,
                            point( 0, 0, 0 ), 0.7, 3 );

computed the bisector surface between a cylinder of radius 0.2 along the Z axis and a sphere at the origin with radius 0.7.

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTPLNLN

 CurveType | ListType BSCTPLNLN( VectorType LineDir, NumericType Size )

Computes the bisector surface of the XY plane (plane Z = 0) and a line in direction LineDir. The plane and the line are assumed to intersect at the origin. Size controls the portion of the (infinite) bisector actually represented.

Example:

    BisectSrf = BSCTPLNLN( vector( 0, 0, 1 ), 1 );

computes the bisector of the XY plane and the Z axis (a cone).

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTPLNPT

 CurveType | ListType BSCTPLNPT( PointType Pt, NumericType Size )

Computes the bisector surface of the XY plane (plane Z = 0) and a point Pt. This surface is a paraboloid of revolution. Size controls the portion of the (infinite) bisector actually represented.

Example:

    BisectSrf = BSCTPLNPT( point( 0, 0, 1 ), 1 );

computes the bisector surface of the XY plane and the point (0, 0, 1).

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTSPRLN

 CurveType | ListType BSCTSPRLN( PointType SprCntr, NumericType SprRadius,
                                 NumericType Size )

Computes the bisector surface of a sphere and the Z axis line. The sphere is centered at SptCntr and has a radius of SprRadius. Size controls the portion of the (infinite) bisector actually represented.

Example:

    BisectSrf = BSCTSPRLN( vector( 2, 0, 0 ), 0.7, 1 );

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTSPRPL

 CurveType | ListType BSCTSPRPL( PointType SprCntr, NumericType SprRadius,
                                 NumericType Size )

Computes the bisector surface of the XP plane (the plane Z = 0) and a sphere. This bisector surface is a paraboloid of revolution. The sphere is centered at SptCntr and has a radius of SprRadius. Size controls the portion of the (infinite) bisector actually represented.

Example:

    BisectSrf = BSCTSPRPL( point( 0, 0, 1.5 ), 0.7, 0.5 );

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTSPRPT

 CurveType | ListType BSCTSPRPT( PointType SprCntr, NumericType SprRadius
                                 PointType Pt )

Computes the bisector surface of a sphere and a point, Pt. The sphere is centered at SptCntr and has a radius of SprRadius.

Example:

    Pt = point( 0, 0, 1 );
    BisectSrf = BSCTSPRPT( point( 0, 0, 0 ), 0.7, Pt );

computes the bisector of a sphere of radius 0.7 centered at the origin, and the point (0, 0, 1).

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRSPR, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTSPRSPR

 CurveType | ListType BSCTSPRSPR( PointType Spr1Cntr, NumericType Spr1Radius
                                  PointType Spr2Cntr, NumericType Spr2Radius )

Computes the bisector surface of a two spheres. The spheres are centered at Spt1Cntr and Spt2Cntr and has a radii of Spr1Radius and Spr2Radius, respectively.

Example:

    BisectSrf = ( point( 0, 0, 0 ), 0.7, point( 1, 0, 0 ), 0.2 );

compute the bisectors of a sphere at the origin with radius 0.7, and a sphere at (1, 0, 0) with a radius of 0.2.

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTTRSPT, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTTRSPT

 CurveType | ListType BSCTTRSPT( PointType TrsPos, VectorType TrsDir,
                                 NumericType TrsMjrRad, NumericType TrsMnrRad,
                                 PointType Pt )

Computes the bisector surface of a torus and a point, Pt. The torus is located at TrsPos, with is axis of symmetry been TrsDir, a major radius of TrsMajorRad and a minor radius pf TrsMinorRad.

Example:

    BisectSrf = BSCTTRSPT( point( 0.0, 0.0, 0.0 ), vector( 0.0, 0.0, 1.0 ),
                           0.7, 0.7, Pt );

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSSPR, CBISECTOR, SBISECTOR


BSCTTRSSPR

 CurveType | ListType BSCTTRSSPR( PointType TrsPos, VectorType TrsDir,
                                  NumericType TrsMjrRad, NumericType TrsMnrRad,
                                  PointType SprCntr, NumericType SprRadius )

Computes the bisector surface of a torus and a sphere. The torus is located at TrsPos, with is axis of symmetry been TrsDir, a major radius of TrsMajorRad and a minor radius pf TrsMinorRad. The sphere is centered at SptCntr and has a radius of SprRadius.

Example:

    BisectSrf = BSCTTRSSPR( point( 0.0, 0.0, 0.0 ), vector( 0.0, 0.0, 1.0 ),
                            0.7, 0.7, point( 0.7, 0.0, 0.0 ), 0.7);

See also BSCTCONCON, BSCTCONLN, BSCTCONPL, BSCTCONPT, BSCTCONSPR, BSCTCYLPL, BSCTCYLPT, BSCTCYLSPR, BSCTPLNLN, BSCTPLNPT, BSCTSPRLN, BSCTSPRPL, BSCTSPRPT, BSCTSPRSPR, BSCTTRSPT, CBISECTOR, SBISECTOR


BZR2BSP

 CurveType BZR2BSP( CurveType Crv )

 or

 SurfaceType BZR2BSP( SurfaceType Srf )

Creates a Bspline curve or a Bspline surface from the given Bezier curve or Bezier surface. The Bspline curve or surface is assigned open end knot vector(s) with no interior knots, in the parametric domain of zero to one.

Example:

    BspSrf = BZR2BSP( BzrSrf );


BSP2BZR

 CurveType | ListType BSP2BZR( CurveType Crv )

 or

 SurfaceType | ListType BSP2BZR( SurfaceType Srf )

Creates Bezier curve(s) or surface(s) from a given Bspline curve or a Bspline surface. The Bspline input is subdivided at all internal knots to create Bezier curves or surfaces. Therefore, if the input Bspline does have internal knots, a list of Bezier curves or surfaces is returned. Otherwise, a single Bezier curve or surface is returned.

Example:

    BzrCirc = BSP2BZR( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );

would subdivide the unit circle into four 90 degrees Bezier arcs returned in a list.


CAREA

 CurveType CAREA( CurveType Crv )

Compute the integral area curve, ACrv, of the given curve Crv, up to a sign. If Crv is a closed curve with domain t0 to t1 then the difference of ACrv(t1) - ACrv(t0) is the requested area. Example:

    Crv = pcircle( vector( 0, 0, 0 ), 1 );
    ACrv = CAREA( Crv );
    Pi = abs( coord( ceval( ACrv, 4 ), 1 ) - coord( ceval( ACrv, 0 ), 1 ) );

is yet another way of approximating the value of Pi.


CBEZIER

 CurveType CBEZIER( ListType CtlPtList )

Creates a Bezier curve out of the provided control point list. CtlPtList is a list of control points, all of which must be of type (E1-E9 P1-P9), or regular PointType defining the curve's control polygon. Curve's point type will be of a space which is the union of the spaces of all points.

Example:

    s45 = sin(pi / 4);
    Arc90 = CBEZIER( list( ctlpt( P2, 1.0, 0.0, 1.0 ),
                           ctlpt( P2, s45, s45, s45 ),
                           ctlpt( P1, 1.0, 1.0 ) ) );

constructs an arc of 90 degrees as a rational quadratic Bezier curve.

See also CBSPLINE, CPOWER and SBEZIER.


CBISECTOR

 { CurveType | SurfaceType } CBISECTOR( CurveType Crv,
                                        NumericType UseNrmlTan,
                                        NumericType Tolerance,
                                        NumericType NumerImprove,
                                        NumericType SameNormal )
 
 or
 
 { CurveType | SurfaceType } CBISECTOR( ListType TwoCrvs,
                                        NumericType UseNrmlTan,
                                        NumericType Tolerance,
                                        NumericType NumerImprove,
                                        NumericType SameNormal )
 
 or
 
 SurfaceType CBISECTOR( ListType CrvPt,
                        NumericType UseNrmlTan,
                        NumericType Tolerance,
                        NumericType NumerImprove,
                        NumericType SameNormal )

Computes the self bisector curve(s) for Crv or the bisector(s) of TwoCrvs or the bisector of a curve and a point, CrvPt. If UseNrmlTan is equal to zero or one, the bisector curves are computed using angular equality of tangents or normals of the given curve or curves, respectively. Tolerance controls the accuracy of the computation, with 10 as a good starting value. If Tolerance is negative, NumerImprove can be either TRUE or FALSE, allowing or disabling a final numerical imrpovement stage. SameNormal can also assume a TRUE or FALSE value, selecting only opposite facing normals, if TRUE.

Nevertheless, if UseNrmlTan equals -1, the bisector surface of the given two curves TwoCrvs or a curve and a point CrvPt is computed analytically. For two 3-space curves this is indeed the bisector surface while for two 2-space curves, the zero set of the returned surface provides the bisector curve. If UseNrmlTan equals -1, then NumerImprove, and SameNormal are all ignored. Tolerance is expected to be 1/2 for a proper bisector. If Tolerance varies between zero and one, an alpha-sector is created where for Tolerance equal zero the created surface will contain the first curve whereas for Tolerance equal one, the created surface will contain the second curve.

If UseNrmlTan equals -2 and the two curves are E2, a different bisector surface is computed whose zero set provides the bisector curve. If UseNrmlTan equals -2, then Tolerance, NumerImprove, and SameNormal are all ignored.

If UseNrmlTan equals -3 and the two curves are 3-space curves, an alpha bisector surface is computed, whose ratio is set via Tolerance relative to NumerImprove, such that the sum of Tolerance + NumerImprove is not zero. If UseNrmlTan equals -3, then SameNormal is ignored. See also SBISECTOR.

For a bisector between a curve and a point, the value of SameNormal controls the computation of the bisector surface in R3 (SameNormal = FALSE) or the computation of the planar bisector curve of planar curve and a point, all in the XY plane (SameNormal = TRUE).

Example:

    c1 = cbezier( list( ctlpt( E2, -0.5, -0.2 ),
                        ctlpt( E2,  0.0, -0.2 ),
                        ctlpt( E2,  0.6,  0.6 ) ) );
    c2 = cbezier( list( ctlpt( E2,  0.3, -0.7 ),
                        ctlpt( E2, -0.2, -0.7 ),
                        ctlpt( E2,  0.7,  0.6 ) ) );
    BisectCrvs = CBISECTOR( list( c1, c2 ), 0, 12, true, false );
    All = list( c1, c2, BisectCrvs );
    interact( list( All, view_mat2d ) );
    
    c1 = creparam( pcircle( vector( 0.0, 0.0, 0.0 ), 1 ), 0, 1 );
    c2 = cbezier( list( ctlpt( E3, -1.0, 0.0,  1.0 ),
                        ctlpt( E3,  1.0, 0.0, -1.0 ) ) );
    
    BisectSrf = CBISECTOR( list( c1, c2 ), -1, -1, true, false );
    interact( list( c1, c2, BisectSrf ) );

computes two bisectors, one for to planar curves as a set of bisector curves, and the other as a bisector surfce of a Z parallel line and a circle in the XY plane.


CBSPLINE

 CurveType CBSPLINE( NumericType Order, ListType CtlPtList,
                                                        ListType KnotVector )

Creates a Bspline curve out of the provided control point list, the knot vector, and the specified order. CtlPtList is a list of control points, all of which must be of type (E1-E9 P1-P9, or regular PointType defining the curve's control polygon. Curve's point type will be of a space which is the union of the spaces of all points. The length of the KnotVector must be equal to the number of control points in CtlPtList plus the Order. If, however, the length of the knot vector is equal to #CtlPtList + Order + Order - 1 the curve is assumed periodic. The knot vector list may be specified as either list( KV_OPEN ) or list( KV_FLOAT ) or list( KV_PERIODIC ) in which a uniform open, uniform floating or uniform periodic knot vector with the appropriate length is automatically constructed.

Example:

    s45 = sin(pi / 4);
    HalfCirc = CBSPLINE( 3,
                         list( ctlpt( P3,  1.0,  1.0,  0.0, 0.0 ),
                               ctlpt( P3,  s45,  s45,  s45, 0.0 ),
                               ctlpt( P3,  1.0,  0.0,  1.0, 0.0 ),
                               ctlpt( P3,  s45, -s45,  s45, 0.0 ),
                               ctlpt( P3,  1.0, -1.0,  0.0, 0.0 ) ),
                         list( 0, 0, 0, 1, 1, 2, 2, 2 ) );

constructs an arc of 180 degrees in the XZ plane as a rational quadratic Bspline curve.

Example:

    c = CBSPLINE( 4,
                  list( ctlpt( E2,  0.5,  0.5 ),
                        ctlpt( E2, -0.5,  0.5 ),
                        ctlpt( E2, -0.5, -0.5 ),
                        ctlpt( E2,  0.5, -0.5 ) ),
                  list( KV_PERIODIC ) );
    color( c, red );
    viewobj( c );
    
    c1 = cregion( c, 3, 4 );
    color( c1, green );
    c2 = cregion( c, 4, 5 );
    color( c2, yellow );
    c3 = cregion( c, 5, 6 );
    color( c3, cyan );
    c4 = cregion( c, 6, 7 );
    color( c3, magenta );
    viewobj( list( c1, c2, c3, c4 ) );

creates a periodic curve and extracts its four polynomial domains as four open end Bspline curves.

See also CBEZIER, CPOWER and SBSPLINE.


CCINTER

 ListType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
                                                       NumericType SelfInter )
 
 or
 
 SurfaceType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
                                                       NumericType SelfInter )

Computes the intersection point(s) of Crv1 and Crv2 in the XY plane. Since this computation involves numeric operations, Epsilon controls the accuracy of the parametric values of the result. It returns a list of PointTypes, each containing the parameter of Crv1 in the X coordinate, and the parameter of Crv2 in the Y coordinate. If, however, Epsilon is negative, a scalar field surface representing the square of the distance function is returned instead. If SelfInter is TRUE, Crv1 and Crv2 can be the same curve, and self-intersection points are searched instead.

Example:

 crv1 = cbspline( 3,
                  list( ctlpt( E2, 0, 0 ),
                        ctlpt( E2, 0, 0.5 ),
                        ctlpt( E2, 0.5, 0.7 ),
                        ctlpt( E2, 1, 1 ) ),
                  list( KV_OPEN ) );
 crv2 = cbspline( 3,
                  list( ctlpt( E2, 1, 0 ),
                        ctlpt( E2, 0.7, 0.25 ),
                        ctlpt( E2, 0.3, 0.5 ),
                        ctlpt( E2, 0, 1 ) ),
                  list( KV_OPEN ) );
 inter_pts = CCINTER( crv1, crv2, 0.0001, FALSE );

Computes the parameter values of the intersection point of crv1 and crv2 to a tolerance of 0.0001.


CCRVTR

 NumericType CCRVTR( CurveType Crv, NumericType Epsilon )

 or

 CurveType CCRVTR( CurveType Crv, NumericType Epsilon )

Computes the extreme curvature points on Crv in the XY plane. This set includes not only points of maximum (convexity) and mimumum (concavity) curvature, but also points of zero curvature such as inflection points. Since this operation is partially numeric, Epsilon is used to set the needed accuracy. It returns the parameter value(s) of the location(s) with extreme curvature along the Crv. If, however, Epsilon is negative, the curvature scalar field curve is returned as a two dimensional rational vector field curve, for which the first dimension is equal to the parameter, and the second is the curvature value at that parameter.

   This function computes the curvature scalar field for planar curves as,

          x' y'' - x'' y' 
   k(t) = ----------------
               2     2  3/2
           ( x'  + y'  )

 and computes kN for three dimensional curves as the following vector field,

                                  C' x C''     C'    (C' x C'') x C'
   k(t) N(t) = K(t) B(t) x T(t) = -------- x ----- = ---------------
                                        3    | C' |            4
                                   | C'|                 | C' |
The extremum values are extracted from the computed curvature field. This curvature field is a high order curve, even if the input geometry is of low order. This is especially true for rational curves, for which the quotient rule for differentiation is used and almost doubles the degree in every differentiation.

See also CZEROS, CEXTREMES, and SCRVTR.

Example:

 crv = cbezier( list( ctlpt( E2, -1.0,  0.5 ),
                      ctlpt( E2, -0.5, -2.0 ),
                      ctlpt( E2,  0.0,  1.0 ),
                      ctlpt( E2,  1.0,  0.0 ) ) ) * rotz( 30 );
 crvtr = CCRVTR( crv, 0.001 );
 pt_crvtr = nil();
 pt = nil();
 for ( i = 1, 1, sizeof( crvtr ),
     ( pt = ceval( crv, nth( crvtr, i ) ) ):
     snoc( pt, pt_crvtr )
 );
 interact( list( crv, pt_crvtr ) );

finds the extreme curvature points in Crv and displays them all with the curve.


CDERIVE

 CurveType CDERIVE( CurveType Curve )

Returns a vector field curve representing the differentiated curve, also known as the Hodograph curve.

Example:

 Circ = circle( vector( 0.0, 0.0, 0.0 ), 1.0 );
 Hodograph = CDERIVE( Circ );

See also CINTEG, SDERIVE, TDERIVE, and MDERIVE


CDIVIDE

 ListType CDIVIDE( CurveType Curve, NumericType Param )

Subdivides a curve into two sub-curves at the specified parameter value. Curve can be either a Bspline curve in which Param must be within the Curve's parametric domain, or a Bezier curve in which Param can be arbitrary, extrapolating if not in the range of zero to one.

Returns a list of the two sub-curves. The individual curves may be extracted from the list using the NTH command.

Example:

 CrvLst = CDIVIDE( Crv, 1.3 );
 Crv1 = nth( CrvLst, 1 );
 Crv2 = nth( CrvLst, 2 );

subdivides the curve Crv at the parameter value of 0.5. See also SDIVIDE, TDIVIDE, and MDIVIDE


CEDITPT

 CurveType CEDITPT( CurveType Curve, CtlPtType CtlPt, NumericType Index )

Provides a simple mechanism to manually modify a single control point number Index (base count is 0) in Curve, by substituting CtlPt instead. CtlPt must have the same point type as the control points of the Curve. Original curve Curve is not modified.

Example:

    CPt = ctlpt( E3, 1, 2, 3 );
    NewCrv = CEDITPT( Curve, CPt, 1 );

constructs a NewCrv with the second control point of Curve being CPt.


CENVOFF

 SurfaceType CENVOFF( CurveType Curve,
                      NumericType Height, NumericType Tolerance )
 
 or
 
 ListType CENVOFF( CurveType Curve, NumericType Height, NumericType Tolerance )

Computes the offset envelope of a given planar curve Curve. The offset envelope is the envelope of cones with apex on point on Curve in the Z direction. Height is the height of the cone which also equals the offset distance or the width of the cones. Tolerance controls the accuracy of the offset approximation.

If Curve is closed, two surfaces are created in the offset envelope, one for the inside and one for the outside. If Curve is open, a single envelope offset surface is computed wrapping around both sides.

Example:

    c1 = cbezier( list( ctlpt( E2, -0.8, 0.0 ),
                        ctlpt( E2, -0.2, 1.0 ),
                        ctlpt( E2,  0.2, 0.0 ),
                        ctlpt( E2,  0.8, 0.6 ) ) );
    s1 = CENVOFF( c1, 0.5, 0.01 );

Computes an envelope offset surface for a cubic Bezier curve c1 of Height of 0.5 and Tolerance of 0.01.


CEVAL

 CtlPtType CEVAL( CurveType Curve, NumericType Param )

Evaluates the provided Curve at the given Param value. Param should be in the curve's parametric domain if Curve is a Bspline curve, or between zero and one if Curve is a Bezier curve. The returned control point has the same point type as the control points of the Curve.

Example:

    CPt = CEVAL( Crv, 0.25 );

evaluates Crv at the parameter value of 0.25. See also SEVAL, MEVAL, TEVAL.


CEXTREMES

 ListType CEXTREMES( CurveType Crv, NumericType Epsilon, NumericType Axis )

Computes the extreme set of the given Crv in the given axis (1 for X, 2 for Y, 3 for Z). Since this computation is numeric, an Epsilon is also required to specify the desired tolerance. It returns a list of all the parameter values (NumericType) in which the curve takes an extreme value.

Example:

    extremes = CEXTREMES( Crv, 0.0001, 1 );

Computes the extreme set of curve crv, in the X axis, with error tolerance of 0.0001. See also CZERO.


CINFLECT

 ListType CINFLECT( CurveType Crv, NumericType Epsilon )

 or

 CurveType CINFLECT( CurveType Crv, NumericType Epsilon )

Computes the inflection points of Crv in the XY plane. Since this computation is numeric, an Epsilon is also required to specify the desired tolerance. It returns a list of all the parameter values (NumericType) in which the curve has an inflection point. If, however, Epsilon is negative, a scalar field curve representing the sign of the curvature of the curve is returned instead.

 The sign of curvature scalar field is equal to

       s(t) = x' y'' - x'' y' 

 Example:



    inflect = CINFLECT( crv, 0.001 );
    pt_inflect = nil();
    pt = nil();
    for ( i = 1, 1, sizeof( inflect ),
            pt = ceval( crv, nth( inflect, i ) ):
            snoc( pt, pt_inflect )
        );
    interact( list( axes, crv, pt_inflect ), 0);

Computes the set of inflection points of curve crv with error tolerance of 0.001. This set is then scanned in a loop and evaluated to the curve's locations which are then displayed with the crv. See also CZEROS, CEXTREMES, and CCRVTR.


CINTEG

 CurveType CINTEG( CurveType Crv );

Returns a vector field curve representing the integral curve. See also CDERIVE.


CINTERP

 CurveType CINTERP( ListType PtList, NumericType Order, NumericType Size,
                                     ConstantType Param, NumericType Periodic)

 or
 
 CurveType CINTERP( CurveType Crv, NumericType Order, NumericType Size,
                                     ConstantType Param, NumericType Periodic)

 or
 
 CurveType CINTERP( ListType PtList, NumericType Order, NumericType Size,
                                        ListType Params, NumericType Periodic)

 or
 
 CurveType CINTERP( CurveType Crv, NumericType Order, NumericType Size,
                                        ListType Params, NumericType Periodic)

Computes a Bspline curve that interpolates or approximates the list of points in PtList or a given curve Crv. The Bspline curve will have order Order and Size control points, and will be periodic if periodic is none zero. The knots will be spaced according to Param which can be one of PARAM_UNIFORM, PARAM_CHORD, PARAM_CENTRIP or PARAM_NEILFOL or lists of parameter values and knots (see below). The PARAM_UNIFORM prescribes a uniform knot sequence, PARAM_CHORD specifies knot spacing according to the chord length and PARAM_CENTRIP according to the square root of the chord length. Finally, PARAM_NEILFOL takes into consideration that angles between three consequtive points. A periodic curve will be coerced to have PARAM_UNIFORM knot sequence. If Params is a list object, it should contain two lists of numeric values. The first list contains the parameter values at which to approximate or interpolate the data points and hence the length of this list must equal the length of the PtList data. The second list specifies the knot vector of the construct Bspline curve. Use of Periodic end conditions can create cases with degenerated linear systems (determinant equal zero). Increase or decrease of the Order of the Bspline by one will resolve the problem. All points in PtList must be of type (E1-E9, P1-P9) control point, or regular PointType. If Size is equal to the number of points in PtList the resulting curve will interpolate the data set. Otherwise, if Size is less than the number of points in PtList the point data set will be least square approximated. In no time can Size be lower than Order. Size of zero forces interpolation by selecting Size to be the size of the data set. All interior knots will be distinct preserving maximal continuity. The resulting Bspline curve will have open end conditions.

Example:

    pl = nil();
    for ( x = 0, 1, 100,
          snoc(point(cos(x / 5), sin(x / 5), x / 50 - 1), pl)
    );
    c = CINTERP( pl, 3, 21, PARAM_UNIFORM, false );

Samples a helical curve at 100 points and least square fit a quadratic Bspline curve with 21 point to the data set. The curve will have a uniform knot spacing and is not periodic. See also SINTERP, TINTERP and LINTERP.


CIRCLE

 CurveType CIRCLE( VectorType Center, NumericType Radius )

Constructs a circle at the specified Center with the specified Radius. The returned circle is a Bspline curve of four piecewise Bezier 90 degree arcs. The construced circle is always parallel to the XY plane. Use the linear transformation routines to place the circle in the appropriate orientation and location.


CIRCPOLY

 PolygonType CIRCPOLY( VectorType Normal, VectorType Trans, NumericType Radius )

Defines a circular polygon in a plane perpendicular to Normal that contains the Trans point. Constructed polygon is centered at Trans. RESOLUTION vertices will be defined with Radius from distance from Trans.

Alternative ways to construct a polygon are manual construction of the vertices using POLY, or the construction of a flat ruled surface using RULEDSRF.


CLNTCRSR

 ListType CLNTCRSR( NumericType TimeOut )

Read coordinates of mouse as well as mouse events from displace devices, or time out after TimeOut miliseconds. Returned is a list object named "_PickCrsr_" of two sub-objects, a points and a vector. These point and vector defines the three dimensional line of the mouse in object space.

Mouse events are typically processed by the display device. However, by the command "CLNTPICKCRSR" (in iritinit.irt) which sends "PICKCRSR" request to the display devices, mouse events will be sent to the server. The server can be requested to keep mouse events for "CLNTCRSR" to read via the IritState command and the "CursorKeep" attribute.

Both the point and the vector will have a numeric attribute of "EventType" that will have the following meaning:

1 Mouse motion event
2 Mouse down event
5 Mouse up event
In case of a time out the returned list object will be empty and will have the name "_PickFail_".

Example:

   ClntPickCrsr( clients_all );

   IritState( "CursorKeep", 1 );

   Quit = 0;
   for ( i = 0, 1, 10,
       CLNTCRSR( 10000 ) );

   ClntPickDone( clients_all );
   IritState( "CursorKeep", 0 );

Asks all clients to send mouse events to server, ask the server to keep mouse events, and then read 10 mouse events.


CLNTREAD

 AnyType CLNTREAD( NumericType Handler, NumericType Block )

Reads one object from a communication channel of a client. Handler contains the index of the communication channel opened via CLNTEXEC. If no data is available in the communication channel, this function will block for at most Block millisecond until data is found or timeout occurs. In the latter, a single StringType object is returned with the content of "no data (timeout)". If Handler equals -1, the regular display device (forked via, for example, VIEWOBJ command) is used. See also VIEWSET, CLNTWRITE, CLNTCLOSE, and CLNTEXEC.

Example:

   h2 = clntexec( "xmtdrvs -s-" );
       .
       .

   Model = CLNTREAD( h2 );
       .
       .

   clntclose( h2,TRUE );

reads one object from client through communication channel h2 and save it in variable Model.


CMESH

 CurveType CMESH( SurfaceType Srf, ConstantType Direction, NumericType Index )

Returns a single ROW or COLumn as specified by the Direction and Index (base count is 0) of the control mesh of surface Srf.

The returned curve will have the same knot vector as Srf in the appropriate direction. See also CSURFACE.

This curve is not necessarily in the surface Srf.

Example:

    Crv = CMESH( Srf, COL, 0 );

extracts the first column of surface Srf as a curve. See also CSURFACE. See also SMESH, MFROMMESH.


CMOEBIUS

 CurveType CMOEBIUS( CurveType Crv, NumericType Ratio )

Rebalance the weights of a rational curve using the Moebius transformation. The shape of the curve remains identical while the speed is modified. Ratio controls the ratio between the last and the first weight. If Ratio = 0, the first and last weights are made equal.

See also SMOEBIUS.


CMORPH

 CurveType CMORPH( CurveType Crv1, CurveType Crv2,
                   NumericType Method, NumericType Blend )
 
 or
 
 ListType CMORPH( CurveType Crv1, CurveType Crv2,
                  NumericType Method, NumericType Blend )

Creates a new curve which is a metamorph of the two given curves. The two given curves must be compatible (see FFCOMPAT) before this blend is invoked. Very useful if a sequence that "morphs" one curve to another is to be created. Several methods of metamorphosis are supported according to the value of Method,

0 Simple convex blend.
1 Corner/Edge cutting scheme, scaled to same curve length.
2 Corner/Edge cutting scheme, scaled to same bounding box.
3 Same as 1 but with filtering out of tangencies.
4 Same as 2 but with filtering out of tangencies.
5 Multiresolution decompsition based metamorphosis. See CMULTRES.
In Method 1, Blend is a number between zero (Crv1) and one (Crv2) defining the similarity to Crv1 and Crv2, respectively. A single curve is returned.

In Methods 2 to 5, Blend is a step size for the metamorphosis operation and a whole list describing the entire metamorphosis operation is returned.

Examples:

    for ( i = 0, 1, 300,
        c = CMORPH( crv1a, crv1b, 0, i / 300.0 ):
        color( c, yellow ):
        viewobj( c )
    );
   
    crvs = CMORPH( crv1a, crv1b, 2, 0.003 );
    snoc( crv1b, crvs );
    for ( i = 1, 1, sizeof( crvs ),
        c = nth( crvs, i ):
        color( c, yellow ):
        viewobj( c )
    );

    Turtle2 = ffmatch( Wolf, Turtle, 20, 100, 2, false, 2 );
    ffcompat( Wolf, Turtle2 );
    for ( i = 0, 1, 25,
        c = CMORPH( Wolf, Turtle2, 0, i / 25 ):
        color( c, yellow ):
        viewobj( c )
    );

creates three metamorphosis animation sequences, one that is based on a convex blend, one that is based on corner/edge cutting scheme. See also PMORPH, SMORPH, TMORPH, and FFMATCH.


CMULTIRES

 ListType CMULTIRES( CurveType Crv, NumericType Discont )

Computes a multiresolution decomposition of curve Crv using least squares approximation. The resulting list of curves describes an hierarchy of curves in linear subspaces of the space Crv was in that can be sum algebraically to form Crv. Each of the curves in the hierarchy is a least squares approximation of Crv in the subspace it is defined in. Discont is a boolean flat that controls the way tangent discontinuities are computed throughout the decomposition.

Example:

    MRCrv = CMULTIRES( Animal, false );

    sum = nth( MRCrv, 1 );
    MRCrvs = list( sum * tx( 3.0 ) );
    for ( ( i = 2 ), 1, sizeof( MRCrv ),
        sum = symbsum( sum, nth( MRCrv, i ) ):
        snoc( sum * tx( ( 3 - i ) * 1.5 ), MRCrvs )
    );

    All = MRCrvs * sc ( 0.25 );
    view( All, on );

Computes a multiresolution decomposition to curve CrossSec as MRCrv and display all the decomposition levels by summing them all up. The use of none as on object name allows one to display an object in the display device without replacing the previous object in the display device, carrying the same name.

creates two metamorphosis animation sequences, one that is based on a convex blend and one that is based on corner/edge cutting scheme.


CNORMAL

 VectorType CNORMAL( CurveType Crv, NumericType TParam )

Computes the normal vector to curve Crv at the parameter values TParam. The returned vector has a unit length.

Example:

    Normal = CNORMAL( Crv, 0.5 );

computes the normal to Crv at the parameter value 0.5. See also CNRMLCRV.


CNRMLCRV

 CurveType CNRMLCRV( CurveType Crv )

Symbolically computes a vector field curve representing the non-normalized normals of the given curve. That is a normal vector filed, evaluated at t, provides a vector in the direction of the normal of the original curve at t. The normal curve computed is in fact equal to kN where k is the curvature of Crv and N is its normal.

Example:

 NrmlCrv = CNRMLCRV( Crv );


CNVXHULL

 PolygonType CNVXHULL( PolygonType Poly | PolylineType Poly,
                       NumericType FineNess );

 or

 CurveType CNVXHULL( CurveType Crv, NumericType FineNess );

Computes the convex hull of the given set of Poly or Curve with tolerance for curves only that is governed by the polygon subdivision accuracy as set via FineNess. FineNess is ignored for polylines. For curves, the result might be partial if the curve is not closed or periodic. See also CRV2TANS and CRVPTTAN.

Example:

    Pts1 = nil();
    Pts2 = nil();
    for ( i = 0, 1, 7,
        R = 0.2 + fmod( i, 2 ) / 2:
        Pt = ctlpt( E2, R * cos( i * 2 * pi / 8 ), R * sin( i * 2 * pi / 8 ) ):
        snoc( Pt, Pts1 ):
        snoc( coerce( Pt, point_type ),  Pts2 ) );
    Crv = coerce( cbspline( 4, Pts1, list( KV_PERIODIC ) ), KV_OPEN );
    CHPts = CNVXHULL( poly( Pts2, 0 ), 0 );
    CHCrv = CNVXHULL( Crv, 10 );

computes the convex hull of a given control polygon and freeform curve.


COERCE

 AnyType COERCE( AnyType Object, ConstantType NewType )

Provides a coercion mechanism between different objects or object types. PointType, VectorType, PlaneType, CtlPtType can be all coerced to each other by using the NewType of POINT_TYPE, VECTOR_TYPE, PLANE_TYPE, or one of E1-E9, P1-P9 (CtlPtType). Similarly, CurveType, SurfaceType, TrimSrfType, TriSrfType, TrivarType, and MultivarType can all be coerced to hold different CtlPtType of control points, or even different open end conditions from KV_PERIODIC to KV_FLOAT to KV_OPEN. Freefroms can be coerced to a Power, Bezier or a Bspline type via the NewType of POWER_TYPE, BEZIER_TYPE or the BSPLINE_TYPE. If a scalar (E1 or P1) curve is coerced to E2 or P2 curve or a scalar (E1 or P1) surface is coerced to E3 or P3 surface, the Y (YZ) coordinate(s) is (are) updated to hold the parametric domain of the curve (surface). That is X = U (Y = V). Curves, Surfaces, and Trivariates and be coerced to/from Multivariates using the CURVE_TYPE, SURFACE_TYPE, TRIVAR_TYPE and MULTIVAR_TYPE.

Example:

    CrvE2 = COERCE( Crv, E2 );
    MultiVar == COERCE( COERCE( MultiVar, surface_type ), multivar_type );
    BzrSrfs = COERCE( BspSrf, bezier_type );

coerce Crv to a new curve that will have an E2 CtlPtType control points. Coerction of a projective curve (P1-P9) to a Euclidean curve (E1-E9) does not preseve the shape of the curve. The second example coerces a bivariate MultiVar into a Srf and back and compare the result to the original multivariate MultiVar... The third example coerces a Bspline surface BspSrf to a Bezier form, returning one or more Bezier surfaces representing the same geometry as BspSrf.


COMPOSE

 CurveType COMPOSE( CurveType Crv1, CurveType Crv2 )

 or

 CurveType COMPOSE( SurfaceType Srf, CurveType Crv )

Symbolically compute the composition curve Crv1(Crv2(t)) or Srf(Crv(t)). In the above first form of Crv1(Crv2(t), Crv1 can be any curve while Crv2 is assumed to be a one-dimensional curve that is either E1 or P1 (higher dimensions ignored). In the above secon form of Srf(Crv(t)), Srf can be any surface, while Crv is assumed to be a two-dimensional curve, that is either E2 or P2 (higher dimensions ignored). Both Crv2 in the curve's composition, and Crv is the surface's composition must be contained in the curve or surface parametric domain.

Example:

   srf = sbezier( list( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
                              ctlpt( E3, 0.0, 0.5, 1.0 ),
                              ctlpt( E3, 0.0, 1.0, 0.0 ) ),
                        list( ctlpt( E3, 0.5, 0.0, 1.0 ),
                              ctlpt( E3, 0.5, 0.5, 0.0 ),
                              ctlpt( E3, 0.5, 1.0, 1.0 ) ),
                        list( ctlpt( E3, 1.0, 0.0, 1.0 ),
                              ctlpt( E3, 1.0, 0.5, 0.0 ),
                              ctlpt( E3, 1.0, 1.0, 1.0 ) ) ) );
   crv = circle( vector( 0.5, 0.5, 0.0 ), 0.4 );
   comp_crv = COMPOSE( srf, crv );

composes a circle Crv to be on the surface Srf.


CON2

 PolygonType CON2( VectorType Center, VectorType Direction,
                   NumericType Radius1, NumericType Radius2,
                   NumericType Caps )

Creates a truncated CONE geometric object, defined by Center as the center of the main base of the CONE, Direction as both the CONE's axis and the length of CONE, and the two radii Radius1/2 of the two bases of the CONE. If Caps equals zero no caps are created. If Caps equal one (two), only the bottom (top) cap is created. If Caps equal three, both the top and the bottom caps are created.

Unlike the regular cone (CONE) constructor which has inherited discontinuities in its generated normals at the apex, CON2 can be used to form a (truncated) cone with continuous normals. See RESOLUTION for the accuracy of the CON2 approximation as a polygonal model. See also CONE. See IRITSTATE's "PrimRatSrfs" and "PrimRatSrfs" state variables.

Example:

    Cone2 = CON2( vector( 0, 0, -1 ), vector( 0, 0, 4 ), 2, 1, 3 );

constructs a truncated cone with bases parallel to the XY plane at Z = -1 and Z = 3, and with radii of 2 and 1 respectively. Both caps are created.


CONE

 PolygonType CONE( VectorType Center, VectorType Direction,
                   NumericType Radius, NumericType Caps )

Creates a CONE geometric object, defined by Center as the center of the base of the CONE, Direction as the CONE's axis and height, and Radius as the radius of the base of the CONE. If Caps equals zero no cap is created. If Caps equal one, the bottom (top) cap is created. See RESOLUTION for accuracy of the CONE approximation as a polygonal model.

Example:

    Cone1 = CONE( vector( 0, 0, 0 ), vector( 1, 1, 1 ), 1, 1 );

constructs a cone based in an XY parallel plane, centered at the origin with radius 1 and with tilted apex at ( 1, 1, 1 ). Only bottom cap is created.

See IRITSTATE's "PrimRatSrfs" and "PrimRatSrfs" state variables. See also CON2.


CONICSEC

 CurveType CONICSEC( ListType ABCDEF,
                     NumericType ZLevel,
                     PointType StartPoint,
                     PointType EndPoint )

 or 

 {PolygonType | SurfaceType } CONICSEC( ListType TwoCurves,
                                        NumericType ZLevel,
                                        NumericType Dist,
                                        NumericType EvalCurve )

In the first form, constructs a quadratic form that represents the planar conic section prescribed by the list of six coefficients ABCDEF as:
     A x^2 + B xy + C y^2 + D x + E y + F = 0,
The conic will be parallel to the XY plane at Z level of Zlevel. The section of the curve will be from StartPoint to EndPoint, or alternatively, unlimited by specifying 'off' for StartPoint and EndPoint. The conic might be rational (for circles and ellipses, for example) or intergral (for parabolas).

Alternatively, in the second form, if the first list object parameter contains two planar curves in the XY plane, a piecewise linear curve at Z level of Zlevel is computed that presents the elliptic/hyperbolic distance Dist from the given two curves. The elliptic distance refers to the sum of distance (that equal Dist) to the two curves, while hyperbolic distance refers to the difference of distances. Finally, if EvalCurve = 0, the surface whose zero set is the desired curve, is returned instead. If EvalCurve = 1, distance curves are returned in the parametric space as correspondence between the two curve's parameters. If EvalCurve = 2, the conic curves themselves are returned.

Example:

    Circ2 = CONICSEC( list( 1, 0, 1, 0, -0.5, -1 ), 0.0,
                      point(  1.0, 0.0, 0.0 ) * ty( 0.25 ),
                      point( -0.707, -0.707, 0.0 ) * ty( 0.25 ) );
    Elp1 = CONICSEC( list( 1, 2, 4, 0.5, 2, -0.2 ), 0.0, off, off );
    Prb1 = CONICSEC( list( 0.1, 0, 0, 0, 1, -1 ), 2, off, off ) * sc( 0.1 );

Constructs a (portion of a) circle, and ellipse and a parabola as conic sections, and,

    c1 = cbspline( 3,
                   list( ctlpt( E2, -1, -1 ),
                         ctlpt( E2,  1, -1 ),
                         ctlpt( E2,  1,  1 ),
                         ctlpt( E2, -1,  1 ) ),
                   list( KV_OPEN ) );
    c2 = -c1 * sx( -1 ) * tx( 5 );
    view( list( c1, c2 ), 1 );
    
    resolution = 15;
    
    DistCrvE = list( CONICSEC( list( c1, c2 ), 1.0, 10, 2 ),
                     CONICSEC( list( c1, c2 ), 1.0,  9, 2 ),
                     CONICSEC( list( c1, c2 ), 1.0,  8, 2 ),
                     CONICSEC( list( c1, c2 ), 1.0,  7, 2 ),
                     CONICSEC( list( c1, c2 ), 1.0,  6, 2 ) );
    color( DistCrvE, green );

Computes conic distance to the two curves c1 and c2 at distances of 6, 7, 8, 9, and 10.


CONTOUR

 PolygonType CONTOUR( SurfaceType ContouredSrf, PlaneType ContourPlane )

 or

 PolygonType CONTOUR( SurfaceType ContouredSrf, PlaneType ContourPlane,
                      SurfaceType MappedSrf )

Contours surface ContouredSrf by intersecting plane ContourPlane with a polygonal approximating of ContouredSrf with resolution set via variable RESOLUTION (10 is a good starting resolutionvalue, 20 is extreme). If ContouredSrf is a scalar field surface of type E1 or P1 and MappedSrf is provided, ContouredSrf is contoured above its parametric domain (U is X, V is Y) and the resulting parametric curve is composed with MappedSrf to yield the returned value.

Example:

 resolution = 20;
 nglass = snrmlsrf( glass ) * vector( 1, 1, 1 );

 sils = contour( nglass, plane( 1, 0, 0, 0 ), glass );
 color( sils, cyan );
 attrib( sils, "dwidth", 4 );

 view( list( axes, glass, sils ), on );

Computes the normal field of the surface glass, project it onto the viewing direction of (1, 1, 1) and contour the resulting scalar field with the plane X = 0, to extract the silhouette curves from viewing direction (1, 1, 1).


CONVEX

 PolygonType CONVEX( PolygonType Object )

 or

 ListType CONVEX( ListType Object )

Converts non-convex polygons in Object, into convex ones. New vertices are introduced into the polygonal data during this process. The Boolean operations require the input to have convex polygons only (although it may return non convex polygons...) and it automatically converts non-convex input polygons to convex ones, using this same routine.

However, some external tools (like irit2ray and poly3d-h) require convex polygons. This function must be used on the objects to guarantee that only convex polygons are saved into data files for these external tools.

Example:

    CnvxObj = CONVEX( Obj );
    save( "data", CnvxObj );

converts non-convex polygons into convex ones, so that the data file can be used by external tools requiring convex polygons.


COORD

 AnyType COORD( AnyType Object, NumericType Index )

Extracts an element from a given Object, at index Index. From a PointType, VectorType, PlaneType, CtlPtType and MatrixType, a NumericType is returned with Index 0 for the X axis, 1 for the Y axis etc. Index 0 denotes the weight of CtlPtType. For a PolygonType that contains more than one polygon, the Indexth polygon is returned. For a PolygonType that contains a single Polygon, the Indexth vertex is returned. For a CurveType or a SurfaceType, the Indexth CtlPtType is returned. For a ListType, COORD behaves like NTH and returns the Indexth object in the list. For a StringType, the Indexth character is returned as its ASCII numeric code.

Example:

    a = vector( 1, 2, 3 );
    vector( COORD( a, 0 ), COORD( a, 1 ), COORD( a, 2 ) );
 
    a = ctlpt( P2, 6, 7, 8, 9 );
    ctlpt( P3, coord( a, 0 ), coord( a, 1 ), coord( a, 2 ), coord( a, 3 ) );
 
    a = plane( 10, 11, 12, 13 );
    plane( COORD( a, 0 ), COORD( a, 1 ), COORD( a, 2 ), COORD( a, 3 ) );

constructs a vector/ctlpt/plane and reconstructs it by extracting the constructed scalar components of the objects using COORD.

See also COERCE.


COVERISO

 CurveType COVERISO( TrivarType TV,
                     NumericType NewOfStrokes,
                     NumericType StrokeType,
                     PointType MinMaxPwrLen,
                     NumericType StepSize,
                     NumericType IsoVal,
                     VectorType ViewDir )

Computes a coverage for an iso surface of a trivariate function TV, using curves. NewOfStrokes strokes are distributed on the iso surface with length that is set via MinMaxPwrLen. MinMaxPwrLen is a triplet of the form (Min, Max, Power) that determines the length of the strokes as,

        Avg = (Max + Min) / 2,             Dev = (Max - Min) / 2

        Length = Avg + Dev * Random(0, 1) ^ Pwr.

 StepSize controls the steps size of the piecewise linear approximation
 formed and should be typically smaller than Min.
 StrokeType can be one of,
1 Draw strokes along minimal principal curvature.
2 Draw strokes along maximal principal curvature.
3 Draw strokes along both principal curvatures.
4 Draw strokes along constant X planes.
5 Draw strokes along constant Y planes.
6 Draw strokes along constant Z planes.
IsoVal controls the constant value of the iso surface level. See also ADAPISO, COVERPT, MRCHCUBE, TVLOAD. Finally, ViewDir is the direction of view, used for silhouette computation.

Example:

    IsoVal = 0.12;
    Cover = CoverIso( ThreeCyls, 500, 1, vector( 3, 10, 1.0 ), 0.2, IsoVal );

draws 500 strokes on the iso surface of trivariate ThreeCyls at iso value IsoVal and step size of 0.2. Strokes are drawn in length of 3 to 10 along line of curvatures of minimal curvature.


COVERPT

 PolygonType COVERPT( PolygonType Model,
                      NumericType NumOfPts,
                      VectorType ViewDir )

Computes a uniform point distribution on the given polygonal Model. Approximately NumOfPts points are uniformly distributed on the Model's surface, provided ViewDir is the zero vector. If ViewDir is a non zero vector, the distribution is made to be uniform from this given viewing direction. In all cases, NumOfPts is an upper bound the the real number of distributed points, which will be in the same order.

See also ADAPISO, COVERISO, FFPTDIST.

Example:

    Pts1 = CoverPt( solid1, 1000, vector( 0, 0, 0 ) );
    Pts2 = CoverPt( solid1, 3000, vector( 0, 0, -1 ) );

Computes two uniform distributions of 1000 and 3000 points on Solid1. Pts1 is uniform in three space, while Pts2 which is viewed uniform from the -Z direction.


CPOWER

 CurveType CPOWER( ListType CtlPtList )

Creates a polynomial/rational curve out of the provided control point list. The created curve is employing the monomial power basis. CtlPtList is a list of control points, all of which must be of type (E1-E9 P1-P9), or regular PointType defining the curve's control polygon. Curve's point type will be of a space which is the union of the spaces of all points.

Example:

 c = CPOWER( list( ctlpt( E3, 0, 1, 0 ),
                   ctlpt( E3, 1, 0, 0 ),
                   ctlpt( E3, 0, 0, 1 ) ) );
 c == coerce( coerce( c, bezier_type ), power_type );

constructs a quadratic power basis curve, coerce it to a bezier form, coerce the bezier form back to power basis and then compare the result for equality.

See also CBEZIER, CBSPLINE and SPOWER.


CRAISE

 CurveType CRAISE( CurveType Curve, NumericType NewOrder )

Raise Curve to the NewOrder Order specified.

Example:

    Crv = cbezier( list( ctlpt( E2, -0.7,  0.3 ),
                         ctlpt( E2,  0.0,  1.0 ),
                         ctlpt( E2,  0.7,  0.0 ) ) );
    Crv2 = CRAISE( Crv, 5 );

raises the 90 degrees corner Bezier curve Crv to be a quartic. See also CREDUCE, TRAISE, SRAISE, and MRAISE.


CREDUCE

 CurveType CREDUCE( CurveType Curve, NumericType NewOrder )

Reduce Curve to the NewOrder Order specified. This function approximates the lower order curve in the infinity norm sense, minimizing the maximal deviation between the original curve Curve and the low order curve NewOrder. NewOrder will identify with Curve only if Curve was degree raised before.

Example:

    Crv = cbezier( list( ctlpt( E2, -0.7,  0.3 ),
                         ctlpt( E2,  0.0,  1.0 ),
                         ctlpt( E2,  0.7,  0.0 ) ) );
    Crv2 = CREDUCE( craise( Crv, 5 ), 3 );
    Crv == Crv2;

Should restore the original quadratic order. I.e. Crv2 should identify with Crv and "Crv == Crv2;" should return TRUE.

See also CRAISE.


CREFINE

 CurveType CREFINE( CurveType Curve, NumericType Replace, ListType KnotList )

Provides the ability to Replace a knot vector of Curve, or refine it. KnotList is a list of knots to refine Curve at. All knots should be contained in the parametric domain of the Curve. If the knot vector is replaced, the length of KnotList should be identical to the length of the original knot vector of the Curve. If Curve is a Bezier curve, it is automatically promoted to be a Bspline curve.

Example:

    Crv2 = CREFINE( Crv, FALSE, list( 0.25, 0.5, 0.75 ) );

refines Crv and adds three new knots at 0.25, 0.5, and 0.75. See also SREFINE, TREFINE, and MREFINE.


CREGION

 CurveType CREGION( CurveType Curve, NumericType MinParam,
                                                       NumericType MaxParam )

Extracts a region from Curve between MinParam and MaxParam. Both MinParam and MaxParam should be contained in the parametric domain of the Curve, except for Bezier curves when MinParam and MaxParam can be arbitrary.

Example:

    SubCrv = CREGION( Crv, 0.3, 0.6 );

extracts the region from Crv from the parameter value 0.3 to the parameter value 0.6. See also SREGION, TREGION, and MREGION.


CREPARAM

 CurveType CREPARAM( CurveType Curve, NumericType MinParam,
                                                       NumericType MaxParam )

Reparametrize Curve over a new domain from MinParam to MaxParam. This operation does not affect the geometry of the curve and only affine transforms its knot vector. A Bezier curve will automatically be promoted into a Bspline curve by this function.

Example:

    arc1 = arc( vector( 0.0, 0.0, 0.0 ),
                vector( 0.5, 2.0, 0.0 ),
                vector( 1.0, 0.0, 0.0 ) );
    crv1 = arc( vector( 1.0, 0.0, 0.75 ),
                vector( 0.75, 0.0, 0.7 ),
                vector( 0.5,  0.0, 0.85 ) ) +
           arc( vector( 0.5,  0.0, 0.75 ),
                vector( 0.75, 0.0, 0.8 ),
                vector( 1.0,  0.0, 0.65 ) );

    arc1 = CREPARAM( arc1, 0, 10 );
    crv1 = CREPARAM( crv1, 0, 10 );

Sets the domain of the given two curves to be from zero to ten. The Bezier curve arc1 is promoted to a Bspline curve. See also SREPARAM, TREPARAM, and MREPARAM.


CROSSEC

 PolygonType CROSSEC( PolygonType Object )

This feature is NOT implemented.


CRV2TANS

 ListType CRV2TANS( CurveType Crv, NumericType FineNess )

Computes all the bi-tangents of Crv, in the XY plane. That is, all lines that are tangent to Crv at two different locations. Returned is a list of points with X and Y coefficients representinf the parametric locations on Crv of the bi-tangent. FineNess controls the numerical accuracy of the computation. A value of 10 will provide a good start and the larger this number is, the better the accuracy will be. See also CRVPTTAN and CNVXHULL.

Example:

    Tans = nil();
    Crv2Tns = Crv2Tans( Crv, 10 );
    for ( i = 1, 1, sizeof( Crv2Tns ),
        pt = nth( Crv2Tns, i ):
        snoc( ceval( Crv, coord( pt, 0 ) ) +
              ceval( Crv, coord( pt, 1 ) ), Tans ) );

finds the bi-tangents of Crv and convert them to a set of line segments.


CRVLNDST

 NumericType CRVLNDST( CurveType Crv, PointType PtOnLine, VectorType LnDir,
                                 NumericType IsMinDist, NumericType Epsilon )
 
 or
 
 ListType CRVLNDST( CurveType Crv, PointType PtOnLine, VectorType LnDir,
                                NumericType IsMinDist, NumericType Epsilon )

Computes the closest (if IsMinDist is TRUE, farthest if FALSE) point on Curve to the line specified by PtOnLine and LnDir as a point on the line and a line direction. Since this operation is partially numeric, Epsilon is used to set the needed accuracy. It returns the parameter value of the location on Crv closest to the line. If, however, Epsilon is negative, -Epsilon is used instead, and all local extrema in the distance function are returned as a list (both minima and maxima). If the line and the curve intersect, the point of intersection is returned as the minimum.

Example:

    Param = CRVLNDST( Crv, linePt, lineVec, TRUE, 0.001 );

finds the closest point on Crv to the line defined by linePt and lineVec.


CRVPTDST

 NumericType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
                                                         NumericType Epsilon )
 
 or
 
 ListType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
                                                         NumericType Epsilon )

Computes the closest (if IsMinDist is TRUE, farthest if FALSE) point on Crv to Point. Since this operation is partially numeric, Epsilon is used to set the needed accuracy. It returns the parameter value of the location on Crv closest to Point. If, however, Epsilon is negative, -Epsilon is used instead, and all local extrema in the distance function are returned as a list (both minima and maxima).

Example:

    Param = CRVPTDST( Crv, Pt, FALSE, 0.0001 ); 

finds the farthest point on Crv from point Pt.


CRVPTTAN

 ListType CRVPTTAN( CurveType Crv, PointType Pt, NumericType FineNess )

Computes all the tangents to Crv that goes through point Pt, all in the XY plane. Returned is a list of points with X and Y coefficients representinf the parametric locations on Crv of the bi-tangent. FineNess controls the numerical accuracy of the computation. A value of 0.01 will provide a good start and the smaller this number is, the better the accuracy will be. See also CRV2TANS and CNVXHULL.

Example:

    Tans = nil();
    Pt = point( 2, 0, 0 );
    CrvPtTns = CrvPtTan( Crv, Pt, 0.01 );
    for ( i = 1, 1, sizeof( CrvPtTns ),
        snoc( ceval( Crv, nth( CrvPtTns, i ) ) + coerce( Pt, e3 ), Tans ) );

finds the tangents of Crv through Pt and convert them to a set of line segments.


CSURFACE

 CurveType CSURFACE( SurfaceType Srf, ConstantType Direction,
                                                          NumericType Param )

 or

 CurveType CSURFACE( TriSrfType Srf, ConstantType Direction,
                                                          NumericType Param )

Extract an isoparametric curve out of Srf in the specified Direction (ROW or COL (or DEPTH for triangular surface) at the specified parameter value Param. Param must be contained in the parametric domain of Srf in Direction direction. The returned curve is in the surface Srf.

Example:

    Crv = CSURFACE( Srf, COL, 0.45 ); 

extracts an isoparametric curve in the COLumn direction at the parameter value of 0.15 from surface Srf. See also CMESH, COMPOSE, STRIVAR, MFROMMV.


CTANGENT

 VectorType CTANGENT( CurveType Curve, NumericType Param )

Computes the tangent vector to Curve at the parameter value Param. The returned vector has a unit length.

Example:

    Tang = CTANGENT( Crv, 0.5 );

computes the tangent vector to Crv at the parameter value of 0.5.


CTLPT

 CPt = CTLPT( ConstantType PtType, NumericType Coord1, ... )

Constructs a single control point to be used in the construction of curves and surfaces. Points can have from one to five dimensions, and may be either Euclidean or Projective (rational). Points' type is set via the constants E1 to E9 and P1 to P9. The coordinates of the point are specified in order, weight is first if rational.

Examples:

    CPt1 = CTLPT( E3, 0.0, 0.0, 0.0 );
    CPt2 = CTLPT( P2, 0.707, 0.707, 0.707 );

constructs an E3 point at the origin and a P2 rational point with a weight of 0.707. The Projective Pi points are specified as CTLPT(Pn, W, W X1, ... , W Xn).


CTRIMSRF

 ListType CTRIMSRF( TrimSrfType TSrf, NumericType Parametric )

Extract the trimming curves of a trimmed surface TSrf. If Parametric is not zero, then the trimming curves are extracted as parametric space curves of TSrf. Otherwise, the trimming curves are evaluated into Euclidean space as curves on surface TSrf.

Example:

    TrimCrvs = CTRIMSRF( TrimSrf, FALSE ); 

extracts the trimming curves of TrimSrf as Euclidean curves on TrimSrf.


CYLIN

 PolygonType CYLIN( VectorType Center, VectorType Direction,
                    NumericType Radius, NumericType Caps )

Creates a CYLINder geometric object, defined by Center as center of the base of the CYLINder, Direction as the CYLINder's axis and height, and Radius as the radius of the base of the CYLINder. If Caps equals zero no caps are created. If Caps equal one (two), only the bottom (top) cap is created. If Caps equal three, both the top and the bottom caps are created.

See RESOLUTION for the accuracy of the CYLINder approximation as a polygonal model. See IRITSTATE's "PrimRatSrfs" and "PrimRatSrfs" state variables.

Example:

    Cylinder1 = CYLIN( vector( 0, 0, 0 ), vector( 1, 0, 0 ), 10, 3 );

constructs a cylinder along the X axis from the origin to X = 10.


CZEROS

 ListType CZEROS( CurveType Crv, NumericType Epsilon, NumericType Axis )

Computes the zero set of the given Crv in the given axis (1 for X, 2 for Y, 3 for Z). Since this computation is numeric, an Epsilon is also required to specify the desired tolerance. It returns a list of all the parameter values (NumericType) the curve is zero.

Example:

    xzeros = CZEROS( cb, 0.001, 1 );
    pt_xzeros = nil();
    pt = nil();
    for ( i = 1, 1, sizeof( xzeros ),
            pt = ceval( cb, nth( xzeros, i ) ):
            snoc( pt, pt_xzeros )
        );
    interact( list( axes, cb, pt_xzeros ), 0 );

Computes the X zero set of curve cb with error tolerance of 0.001. This set is then scanned in a loop and evaluated to the curve's locations, which are then displayed. See also CINFLECT.


EVOLUTE

 CurveType EVOLUTE( CurveType Curve )

 or

 SurfaceType EVOLUTE( SurfaceType Curve )

Computes the evolute of a curve or a surface. For curves, the evolute is defined as,

               N(t)
 E(t) = C(t) + ----
               k(t)

 where N(t) is the unit normal of C(t) and k(t) is its curvature.
 E(t) is computed symbolically as the symbolic sum of C(t) and
 N(t) / k(t).
For surfaces, this function computes the mean evulate which is equal to,

                      n(u, v)
 E(u, v) = S(u, v) + ---------
                     2 H(u, v)

 where n(u, v) is the unit normal of S(u, v) and H(u, v) is its mean
 curvature. E(u, v) is computed symbolically.


The result of this symbolic computation is exact (upto machine precision) unlike a similar operations that are only approximated, like the OFFSET or the AOFFSET.

Example:

    crv = cbspline( 3,
                    list( ctlpt( E3, -1.0,  0.1,  0.2 ),
                          ctlpt( E3, -0.1,  1.0,  0.1 ),
                          ctlpt( E3,  0.1,  0.1,  1.0 ),
                          ctlpt( E3,  1.0,  0.1,  0.1 ),
                          ctlpt( E3,  0.1,  1.0,  0.2 ) ),
                    list( KV_OPEN ) );
    cev = EVOLUTE( Crv );


EXTRUDE

 PolygonType EXTRUDE( PolygonType Object, VectorType Dir, NumericType Caps )

 or
 
 SurfaceType EXTRUDE( CurveType Object, VectorType Dir, NumericType Caps )

 or
 
 TrivarType EXTRUDE( SurfaceType Object, VectorType Dir, NumericType Caps )

Creates an extrusion of the given Object. If Object is a PolygonObject, its first polygon is used as the base for the extrusion in Dir direction. If Object is a CurveType, an extrusion surface is constructed. If Object is a SurfaceType, an extrusion trivariate is constructed. If Caps equals zero no caps are created. If Caps equal one (two), only the bottom (top) cap is created. If Caps equal three, both the top and the bottom caps are created. Note that caps are created for closed Object only, so Object must be either a polygon or a closed curve for caps to be generated. Direction Dir cannot be coplanar with the polygon plane. The curve may be nonplanar.

Example:

    Cross = cbspline( 3,
                      list( ctlpt( E2, -0.018, 0.001 ),
                            ctlpt( E2,  0.018, 0.001 ),
                            ctlpt( E2,  0.019, 0.002 ),
                            ctlpt( E2,  0.018, 0.004 ),
                            ctlpt( E2, -0.018, 0.004 ),
                            ctlpt( E2, -0.019, 0.001 ) ),
                      list( KV_OPEN ) );
    Cross = Cross + -Cross * scale( vector( 1, -1, 1 ) );
    Napkin = EXTRUDE( Cross * scale( vector( 1.6, 1.6, 1.6 ) ),
                      vector( 0.02, 0.03, 0.2 ),
                      0 );

constructs a closed cross section Cross by duplicating one half of it in reverse and merging the two sub-curves. Cross is then used as the cross-section for the extrusion operation.


FFCOMPAT

 FFCOMPAT( CurveType Crv1, CurveType Crv2 )

 or

 FFCOMPAT( SurfaceType Srf1, SurfaceType Srf2 )

Makes the given two curves or surfaces compatible by making them share the same point type, same curve type, same degree, and the same continuity. Same point type is gained by promoting a lower dimension into a higher one, and non-rational to rational points. Bezier curves are promoted to Bspline curves if necessary, for curve type compatibility. Degree compatibility is achieved by raising the degree of the lower order curve. Continuity is achieve by refining both curves to the space with the same (unioned) knot vector. This function returns nothing and compatibility is made in place.

Example:

 FFCOMPAT( Srf1, Srf2 );

See also CMORPH and SMORPH.


FFCTLPTS

 ListType FFCTLPTS( FreeformType Freeform );

Returns all the control points of the given Freeform in a single list. See Also FFKNTVEC, FFMSIZE, FFORDER, FFPTTYPE.

Example:

 Ctls = FFCTLPTS( Srf1 );


FFEXTREME

 CtlPtType FFEXTREME( CurveType Crv, NumericType Minimum )

 or

 CtlPtType FFEXTREME( SurfaceType Srf, NumericType Minimum )

Computes a bound on the extreme values a curves Crv or surface Srf can assume. Returned control points provides a bound on the minimum (maximum) values that can be assumed if Minimum is TRUE (FALSE).

Example:

 Bound = FFEXTREME( Srf, false );

Computes a bound on the maximal values Srf can assume.


FFKNTVEC

 ListType FFKNTVEC( FreeformType Freeform )

Returns all the knot vector(s) of the given Freeform in a list of knot vector(s). See Also FFCTLPTS, FFMSIZE, FFORDER, FFPTTYPE.

Example:

 KVs = FFKNTVEC( Srf1 );


FFMATCH

 FFMATCH( CurveType Crv1, CurveType Crv2, NumericType Reduce,
          NumericType Samples, NumericType ReparamOrder,
          NumericType Rotate, NumericType NormType )

Computes a reparametrization to Crv2 so it fits Crv1, the best under some prescribed norm, NormType. Currently the following norms are valid for NormType
Value Description
1 Suitable for ruled and blended curves, for modeling.
See RULEDSRF.
2 Suitable for metamorphosis of curves. See CMORPH.
3 Distance norm in "walking the dog" notion.
4 Bisector (skeleton) matching norm for two curves.
Whenever negative norms can result (for example, in cases were self intersection cannot be prevented in ruled surface constructions), one can allow negativity with no extra penalty by applying negative NormType. Use of positive only norms would yield no output at all if no matching with positive weights can be established whereas allowing negative norm values would result in the globally optimal result, but with possibly self intersectiions.

The reparametrization is computed by sampling a fix set of size Samples off both curves, and fitting a Bspline curve of length Reduce as the reparametrization curve. Hence, Reduce must be less than or equal to Samples. The reparametrization curve will have order of ReparamOrder. If Rotate is TRUE or ON, then attempt is made to rotate the reparametrization of the curves. Rotation can be used on closed curves only.

See RULEDSRF and CMORPH for examples.


FFMERGE

 CurveType FFMERGE( ListType E1Curves, NumericType PointType )

 or

 SurfaceType FFMERGE( ListType E1Surfaces, NumericType PointType )

 or

 MultivarType FFMERGE( ListType E1Multivars, NumericType PointType )

Merges the scalar curves/surfaces/multivariates in the list of curves E1Curves or list of surfaces E1Surfaces or list of multivariates E1Multivars to one vector curve/surface/multivariate of point type PointType.

Example:

 Srf = FFMERGE( list( SrfW, SrfX, SrfY ), P2 );

merges three scalar surfaces into a single surface with point type P2. See also FFSPLIT, FFPTTYPE.


FFMESH

 ListType FFMESH( FreeformType Freeform )

Returns the control mesh/polygon of the given Freeform in a list. See Also FFCTLPTS, FFKNTVEC, FFORDER, FFPTTYPE, FFMSIZE.

Example:

 SrfMesh = FFMESH( Srf );


FFMSIZE

 ListType FFMSIZE( FreeformType Freeform )

Returns the size of the control mesh/polygon of the given freeform in a list. See Also MESHSIZE, FFMESH, FFCTLPTS, FFKNTVEC, FFORDER, FFPTTYPE, PDOMAIN.

Example:

 MSizes = FFMSIZE( Srf1 );


FFORDER

 ListType FFORDER( FreeformType Freeform )

Return all the orders of the given Freeform in a single list. See Also FFCTLPTS, FFKNTVEC, FFMSIZE, FFPTTYPE, PDOMAIN.

Example:

 Orders = FFORDER( Srf1 );


FFPOLES

 NumericType FFPOLES( FreeformType Freeform );

Returns TRUE in the given Freeform has poles, FALSE otherwise. Poles are zeros in the weights of rational functions.

Example:

 HasPoles = FFPOLES( Srf1 );


FFPTDIST

 ListType FFPTDIST( CurveType Crv, NumericType Param, NumericType NumOfPts )
 
 or
 
 ListType FFPTDIST( SurfaceType Srf, NumericType Param, NumericType NumOfPts )

Computes a uniform point distribution for a Crv or Srf. If Param is FALSE the distribution is selected to be uniform in the Euclidean space, otherwise if TRUE the distribution is made uniform in the parametric space. NumOfPts sets the number of points in the distribution.

The returned list of points prescribes parameters values in the freeforms. For Crv, the returned list is a list of reals, in the parameter space of Crv. For Srf, the returned list is a list of points, whose X and Y coefficients holds the U and V parameters of Srf. See also COVERPT.

Example:

    c1 = cbezier( list( ctlpt( E2, -1.0,  0.0 ),
                        ctlpt( E2, -1.0,  0.1 ),
                        ctlpt( E2, -0.9, -0.1 ),
                        ctlpt( E2,  0.9,  0.0 ) ) );
    color( c1, magenta );
    
    pts = FFPTDIST( c1, true, 300 );
    e2pts = nil();
    for ( i = 1, 10, sizeof( pts ),
            pt = ceval( c1, coord( nth( pts, i ), 0 ) ):
            snoc( pt, e2pts )
        );
    interact( list( e2pts, c1 ) );
    
    pts = FFPTDIST( c1, false, 300 );
    e2pts = nil();
    for ( i = 1, 10, sizeof( pts ),
            pt = ceval( c1, coord( nth( pts, i ), 0 ) ):
            snoc( pt, e2pts )
        );
    interact( list( e2pts, c1 ) );

Computes the distribution of 100 points in curve c1 which has highly nonuniform speed characteristics. Two distributions are computed, one to be uniform in the parametric space and one uniform in the Euclidean space.


FFPTTYPE

 NumericType FFPTTYPE( FreeformType Freeform )

Returns the point type (E2, P4 etc.) of the given freeform. See Also FFCTLPTS, FFKNTVEC, FFMSIZE, FFORDER, PDOMAIN.


FFSPLIT

 ListType FFSPLIT( CurveType Crv )

 or

 ListType FFSPLIT( SurfaceType Srf )

 or

 ListType FFSPLIT( MultivarType MV )

Splits the given curve Crv or surface Srf or multivariate MV into its scalar components that are returned as a list of scalar curves/surfaces/multivariates.

Example:

 E1Srfs = FFSPLIT( circle( vector( 0, 0, 0 ), 1 ) );

splits the circle which is a curve in P3 into four scalar curves (W, X, Y, Z) that are returned in a single list. See also FFMERGE, FFPTTYPE.


GBOX

 PolygonType GBOX( VectorType Point,
                   VectorType Dx, VectorType Dy, VectorType Dz )

Creates a parallelepiped - Generalized BOX polygonal 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 a special case of GBOX where Dx = vector(Dx, 0, 0), Dy = vector(0, Dy, 0), and Dz = vector(0, 0, Dz).

Dx, Dy, Dz must all be independent in order to create an object with positive volume.

Example:

    GB = GBOX( vector( 0.0, -0.35, 0.63 ), vector(  0.5, 0.0, 0.5 ),
                                           vector( -0.5, 0.0, 0.5 ),
                                           vector(  0.0, 0.7, 0.0 ) );


GETATTR

 AnyType GETATTR( AnyType Obj, StringType Name )

Provides a mechanism to fetch an attribute named Name from object Obj.

Example:

    attrib( axes, "test", 15 );
    a = GETATTR( axes, "test" );

will set the value of a to be 15.


GETLINE

 AnyType GETLINE( NumericType RequestedType )

Provides a method to get input from keyboard within functions and or subroutines. RequestedType can be one of NUMERIC_TYPE, POINT_TYPE, VECTOR_TYPE, or PLANE_TYPE in which the entered line will be parsed into one, three, or four numeric values (sperated by either spaces or commas) and the proper object will be created and returned. In any other case, including failure to parse the numeric input, a STRING_TYPE object will be constructed from the entered line.

Example:

    Pt = GETLINE( point_type );

to read one point (three numeric values) from stdin.


GETNAME

 StringType GETNAME( ListType ListObj, NumericType Index )

Gets the name of a sub object of index Index in list object ListObj. Index of first element is zero.

Example:

    A = list( XX, Second, C );
    GETNAME( A, 1 );

returns the name of the second element, "Second".

See also SETNAME.


GGINTER

 ListType GGINTER( CurveType Srf1Axis, CurveType Srf1Rad,
                   CurveType Srf2Aixs, CurveType Srf2Rad,
                   NumericType Tolerance, NumericType ZeroSetFunc )

Computes the intersection curves of the given two ring surfaces, defined as spine surfaces with axis SrfiAxis, i = 1, 2 and circular cross section along the normal plane of the axis curve with radii SrfiRad.

The ring ring intersection (RRI) problem is tranformed into a zero set finding on another function. If ZeroSetFunc is true, the function whose zero set provides the RRIsolution is returned. Otherwise, if ZeroSetFunc is false, the RRI solution itself is returned. The zero set is computed via numerical zero set finding methods and Tolerance controls the fineness of the approximated solution.

Example:

    s1 = cylinSrf( 4, 1 ) * tz( -2 );
    c1 = cbezier( list( ctlpt( E3, 0.0, 0.0, -1.0 ),
                        ctlpt( E3, 0.0, 0.0,  1.0 ) ) );
    r1 = cbezier( list( ctlpt( E1, 1.0 ) ) );

    s2 = cylinSrf( 4, 1 ) * tz( -2 ) * rx( 90 ) * tx( 0.5 );
    c2 = cbezier( list( ctlpt( E3, 0.5, -1.0, 0.0 ),
                        ctlpt( E3, 0.5,  1.0, 0.0 ) ) );
    r2 = cbezier( list( ctlpt( E1, 1.0 ) ) );

    ZeroSetSrf = coerce( GGINTER( c1, r1, c2, r2, 10, true ), e3 )
                                                * rotx( -90 ) * roty( -90 );
    resolution = 100;
    ZeroSet = contour( ZeroSetSrf, plane( 0, 0, 1, 0 ) );
    interact( list( ZeroSetSrf * sz( 0.1 ), ZeroSet, axes ) );

    c = nth( GGINTER( c1, r1, c2, r2, 100, false ), 1 );
    interact( list( s1, s2, c ) );

Constructs two cylinders as s1 and s2, define the same two cylinders as ring surface with axis spine of c1 and c2 and constant radius one in r1 and r2, and compute the zero set of the intersection and the intersection curve itself.


GPOLYGON

 PolygonType GPOLYGON( GeometryTreeType Object, NumericType Normals )

Approximates all Surface(s)/Trimmed surface(s)/Trivariate(s) in Object with polygons using the RESOLUTION and FLAT4PLY variables. The larger the RESOLUTION is, the finer (more polygons) the resulting approximation will be.

FLAT4PLY is a Boolean flag controlling the conversion of an (almost) flat patch into four (TRUE) or two (FALSE) polygons. Normals are computed to polygon vertices using surface normals, so Gouraud or Phong shading can be exploited. It returns a single polygonal object.

If Normals is set, surface normals will be evaluated at the vertices. Otherwise flat shading and constant normals across polygons are assumed.

Example:

    Polys = GPOLYGON( list( Srf1, Srf2, Srf3 ), off );

Converts to polygons the three surfaces Srf1, Srf2, and Srf3 with no normals.


GPOLYLINE

 PolylineType GPOLYLINE( GeometryTreeType Object, NumericType Optimal )

Converts all Curves(s), (Trimmed) Surface(s), and Trivariate(s) Object into polylines using the RESOLUTION variable. The larger the RESOLUTION is, the finer the resulting approximation will be. It returns a single polyline object.

If Optimal is false, the points are sampled at equally spaced interval in the parametric space. If Optimal true, a better, more expensive computationally, algorithm is used to derive optimal sampling locations as to minimize the maximal distance between the curve and piecewise linear approximation (L infinity norm).

Example:

    Polys = GPOLYLINE( list( Srf1, Srf2, Srf3, list( Crv1, Crv2, Crv3 ) ),
                       on );

converts to polylines the three surfaces Srf1, Srf2, and Srf3 and the three curves Crv1, Crv2, and Crv3.


HERMITE

 SurfaceType HERMITE( CurveType Bndry1, CurveType Bndry2,
                      CurveType Tan1, CurveType Tan2 )

 or

 CurveType HERMITE( PointType Bndry1, PointType Bndry2,
                    VectorType Tan1, VectorType Tan2 )

Constructs a cubic fit between Bndry1 and Bndry2 so that first derivative continuity constraints, as prescribed by Tan1 at Bndry1 and Tan2 at Bndry2, are preserved.

Returns either a curve or a surface, according to type of input parameters.

Example:

    h00 = HERMITE( point( 0, 0, 0 ),
                   point( 1, 1, 0 ),
                   vector( 1, 0, 0 ),
                   vector( 1, 0, 0 ) );

Constructs a curve in the shape of the first basis function of the cubic Hermite basis functions.


INSTANCE

 InstanceType INSTANCE( StringType GeomName, MatrixType Mat );

Creates an instance of the geometry prescribed by GeomName to be related to a different position as specified by matrix Mat.

The use of instances is advantageous where the same geometry is to be displayed/processed in several different locations in space. A modification of the original geometry Geom will affect all instances that reference it. The reference is by the original object's name. The original object can be a single object or a whole hierarchy of objects.

Example:

    Tea1 = INSTANCE( "Teapot", tx( 10 ) );
    Tea2 = INSTANCE( "Teapot", tx( 20 ) );
    Tea3 = INSTANCE( "Teapot", tx( 30 ) );
    viewobj( list( Teapot, Tea1, Tea2, Tea3 ) );

will display four teapots 10 units apart along X.


IRITSTATE

 AnyType IRITSTATE( StringType State, AnyType Data )

Sets a state variable in the IRIT solid modeller and returns the old value, if applicative. Current supported state variables are,

State Name Data Type Comments
Coplanar NumericType If TRUE, Coplanar polygons are handled by
Boolean
CursorKeep NumericType If TRUE, keep mouse events reported by the
display devices for CLNTCRSR to read.
DebugMalloc StringType If "Reset", memory allocation is cleared/reset.
No "Free unallocated pointer" test after
"Reset". If "Print", all allocated blocks are
printed. Otherwise, used as "address, n": ptr
address to search for with abort() called after
n mallocs.
DebugFunc NumericType >0 user func. debug information. >2 print params
on entry, ret. val. on exit. >4 global var. list
operations.
Dependency NumericType 0 for no object dependency propagations, 1 for
automatic dependency propagation, in evaluation.
DumpLevel NumericType Bitmask to control the way variables/expressions
are dumped. Only object names/types if all 0.
Scalars and vectors are dumped if 0x01.
Curves and Surfaces are dumped if 0x02.
Polygons/lines are dumped if DumpLvl 0x04.
List objects are traversed recursively if 0x10.
List objects are dumped verbatim if 0x20.
Dependency information is dumped if 0x40.
EchoSource NumericType If TRUE, irit scripts are echoed to stdout.
FastPolys NumericType If 0x01, surface polygons are computed fast and
are only approximated. If 0x02, surface normals
are computed fast and are only approximated. If
0x01 | 0x02, both are fast and approximated.
FloatFrmt StringType Specifies a new printf floating point format.
InterCrv NumericType If TRUE Boolean operations creates only
intersection curves. If FALSE, full Boolean
operation results.
InterpProd ConstantType TRUE for Bspline sym. products via
interpolation FALSE for Bspline sym. products
via Bezier.
State Name Data Type Comments
PolySort NumericType Axis of Polygon Intersection sweep in Boolean
operations: 0 for X axis, 1 for Y axis, 2 for
Z axis.
PrimRatSrfs NumericType TRUE for rational exact primitive surfaces,
FALSE for approximated polynomial (integral)
surfaces. See also PrimSrfs.
PrimSrfs NumericType TRUE for primitive construction as freeform
surfaces, FALSE for polygonal primitives.
See also PrimRatSrfs.
TrimCrvs NumericType Number of samples the higher order trimmed
curves are sampled, in piecewise linear
approximation. If zero, computed
symbolically as composition.
UVBoolean NumericType If TRUE, Boolean between surfaces returns UV
instead of Euclidean curves.
Example:

    IRITSTATE( "DebugFunc", 3 );
    IRITSTATE( "FloatFrmt", "%8.5lg" );

To print parameters of user defined functions on entry, and return value on exit. Also selects a floating point printf format of "%8.5lg".


ISGEOM

 ListType ISGEOM( AnyType Obj, NumericType GeomType, NumericType Eps )

Verifies if the given freeform geometry in Obj is a line, circle, plane, sphere, surface of revolution, extrusion, ruled surface, or a sweep surface, upto some tolerance Eps. GeomType prescribes the type to check for as one of the GEOM_LINE/CIRCLE etc. constants. The return value is a list of two objects. The first is a boolean value with the success/failure of the result. The second an a list with the construction entities of Obj, if any. For example, for a detected sphere, the center and radius will be returned.

Example:

    b = nth( ISGEOM( Crv, GEOM_LINE ), 1 ) ||
        nth( ISGEOM( Crv, GEOM_CIRCLE ), 1 );

checks if Crv is either line or a circle, ignoring the construction entities.


ISOCLINE

 SurfaceType ISOCLINE( SurfaceType Srf, VectorType ViewDir,
                       NumericType Theta, NumericType Euc )

Computes the isocline edges of the given Srf from the prescribed viewing direction ViewDir. Isocline curves are curve on the surface that the surface normal at those location forms a fixed angle, Theta, in degrees, with the prescribed viewing direction, ViewDir. The selection of 90 degrees for Theta results in the extraction of silhouette edges. The end result is a piecewise linear approximation of the exact isocline edges, and its accuracy is controlled via the RESOLUTION variable. If Euc is TRUE, the isocline edges are returned on the surface, in Euclidean space. Otherwise, the isocline edges are returned in the parametric space of Srf.

Example:

 Resolution = 10;
 Isocs = ISOCLINE( glass, vector( 1, -2, 1 ), 80, true );

Computes the isocline edges forming 80 degrees between the surface normal and the given viewing direction (1, -2, 1) for surface glass, and returns the isocline edges in the Euclidean space. See also SILHOUETTE.


KNOTCLEAN

 CurveType KNOTCLEAN( CurveType Crv, NumericType NormSamples )

Cleans unnecessary knots from the given curve Crv. The returned curve is identical to the given curve, but in, possibly, a sub space with less knots. The L2 norm difference is measured via a discrete set of NormSamples samples. Note this function can undo refinement operations.

   c1 = pcircle( vector( 0, 0, 0 ), 1 );
   c1r1 = crefine( c1, FALSE, list( 0.1, 0.3, 0.7, 1.5, 1.7, 1.7, 1.7, 1.7,
                                    2.3, 2.3, 2.7, 3.5, 3.5, 3.5 ) );

   c1r2 = KNOTCLEAN( c1r1, 100 );
   c1 == c1r2;

refines a polynomial circle approximation and then restore the original curve via the KNOTCLEAN operation. The last line validates this cleaning.


KNOTREMOVE

 CurveType KNOTREMOVE( CurveType Crv, NumericType GlobalLimit,
                       NumericType InterationLimit, NumericType NormSamples )

Removes knots from curve Crv so as to keep the global error less than GlobalLimit. This is an iterative process and in each iteration the maximum allowed error is InterationLimit. The error norm is computed using a discrete set of NormSamples samples.

The GlobalLimit can be positive, in which case the error is measured as the distance between the original and reduced curves. Alternatively, GlobalLimit can be negative, where it specifically states the number of knots to remove. In all case the L2 norm is employed.

   c1r1 = KNOTREMOVE( c1, -30, 10, 100 );
   c1r2 = KNOTREMOVE( c1, 0.01, 0.002, 100 );

assuming curve c1 has 50 knots, reduces curve c1 to curve c1r1 with 20 knots, by removing up to 10 knots per iteration; curve c1r2 is the curve with minimal number of knots possible such that the global error (distance between c1 and c1r2) is less than 0.01 and that in each iteration no error larger than 0.002 is introduced. See also KNOTCLEAN.


LINTERP

 ListType LINTERP( ListType PtList)

Computes a least squares fit of a line to a list of points, PtList. Returned is a list of three elements, a point on the fitted line, a unit vector in the direction of the line and the average distance between a point and the fitted line.

Example:

    R = 10;
    Rx = Random( -1, 1 );
    Ry = Random( -1, 1 );
    Rz = Random( -1, 1 );

    Pts = nil();
    Len = 1.0;
    NumPts = 100;
    for ( i = 1, 1, NumPts,
          Pt = ctlpt( E3, ( Random( -R, R ) + Rx * i * 2 ) / NumPts,
                          ( Random( -R, R ) + Ry * i * -5 ) / NumPts,
                          ( Random( -R, R ) + Rz * i * Pi ) / NumPts ):
          snoc( Pt, Pts ) );
    Pts = Pts * trans( vector( random( -10, -10 ),
                               random( -10, -10 ),
                               random( -10, -10 ) ) );

    LnFit = LINTERP( Pts );
    LnPos = nth( LnFit, 1 );
    LnDir = nth( LnFit, 2 );
    LnErr = nth( LnFit, 3 );

Randomly samples 100 points to be approximately along a line and compute a least squares fit of a line to this data. LnPos, LnDir, and LnErr contains a point on the fitted line, the unit direction of the fitten line and the average distance between a point and the line, respectively. See also CINTERP and SINTERP.


LOFFSET

 CurveType LOFFSET( CurveType Crv, NumericType OffsetDistance,
                    NumericType NumOfSamples, NumericType NumOfDOF,
                    NumericType Order )

Approximate an offset of OffsetDistance by sampling NumOfSamples samples along the offset curve and least square fitting them using a Bspline curve of order Order and NumOfDOF control points.

Example:

    OffCrv1 = LOFFSET( Crv, -0.4, 100, 10, 4 );

See also OFFSET, AOFFSET, and MOFFSET.


MATDECOMP

 ListType MATDECOMP( matrixType Mat );

Decomposes a given homogeneous transformation into its scaling and translation vectors, and pure (orthogonal rotation matrix.

Example:

    MATDECOMP( rx( 45 ) * sy( 3 ) * sx( 2 ) * tx( 5 ) * ty( 7 ) );

would result in the "(2, 3, 1)" scaling vector, "(5, 7, 0)" translation vector and a rotation around X matrix of 45 degrees, All in one returned list object.


MBISECTOR

 ListType MBISECTOR( MultivarType MV1, MultivarType MV2, NumericType RetType,
                     NumericType SubdivTol, NumericType NumerTol )

Computes the bisector surface in R3 of two surfaces or a curve and a surfaces, posed as multivariate functions.

The returned results depends upon the value of RetType. If RetType = 1, the algebraic constraints are returned as a list of multivariates. If RetType = 2, a list of points in R3 on the bisector sheet(s) is returned. Finally, if RetType = 3, a list of points in (u, v, x, y, z) space, as E5 points, is returned, where (u, v) are the respective parameter location of the (must be) surface MV1. This E5 points can then directly be employed by SINTERP to fit a surface through.

This bisector problem is posed as a set of two multivariate algebraic constraints with three variables. The simultaneous solution of these constraints is computed using the MZERO function. See MZERO for the meaning of the SubdivTol and NumerTol tolerance.

Example:

    s1 = sbezier(
            list( list( ctlpt( E3, 0,  0,  0 ),
                        ctlpt( E3, 2,  0,  0 ) ),
                  list( ctlpt( E3, 0,  2,  0 ),
                        ctlpt( E3, 2,  2,  0 ) ) ) ) * tx( -1 ) * ty( -1 );
    color( s1, red );
    
    s2 = sbezier(
            list( list( ctlpt( E3, 0,  0,  2 ),
                        ctlpt( E3, 1,  0,  1 ),
                        ctlpt( E3, 2,  0,  2 ) ),
                  list( ctlpt( E3, 0,  1,  1 ),
                        ctlpt( E3, 1,  1,  0 ),
                        ctlpt( E3, 2,  1,  1 ) ),
                  list( ctlpt( E3, 0,  2,  2 ),
                        ctlpt( E3, 1,  2,  1 ),
                        ctlpt( E3, 2,  2,  2 ) ) ) )* tx( -1 ) * ty( -1 );
    color( s2, magenta );
    
    ms1 = coerce( s1, multivar_type );
    ms2 = coerce( s2, multivar_type );
    
    mb1 = MBISECTOR( ms1, ms2, 3, 0.3, -0.001 );
    b1 = sinterp( mb1, 3, 3, 4, 4, PARAM_UNIFORM );
    
    mb2 = MBISECTOR( ms1, ms2, 2, 0.3, -0.001 );
    
    interact( list( s1, s2, mb2, b1 ) );

    c = cbezier( list( ctlpt( E3,  0,  0,  0 ),
                       ctlpt( E3,  0,  0,  2 ) ) );
    color( c, red );
    
    mc = coerce( c, multivar_type );
    
    mb1 = MBISECTOR( mc, ms1, 3, 0.2, -0.001 );
    b1 = sinterp( mb1, 3, 3, 8, 8, PARAM_UNIFORM );
    
    mb2 = MBISECTOR( mc, ms1, 2, 0.2, -0.001 );

    interact( list( c, s1, mb2, b1 ) );

Computes two examples of a bisector between a plane and a biquadratic surface and between a plane and a line. The cloud of points is computed twice, once interpolated by a surface, and also displayed as is.


MDERIVE

 MultivarType MDERIVE( MultivarType MV, NumericType Dir )

Returns a vector field multivariate representing the differentiated multivariate MV, in the given direction. Evaluation of the returned multivariate at a given parameter value will return a vector tangent to TV in Dir at that parameter value.

 DMV = MDERIVE( MV, 2 );

computes the partial derivative of the multivariate MV with respect to its second variable. See also CDERIVE, SDERIVE, and TDERIVE.


MDIVIDE

 MultivarType MDIVIDE( MultivarType MV, ConstantType Direction,
                                                          NumericType Param )

Subdivides a multivariate into two at the specified parameter value Param in the specified Direction. MV can be either a Bspline multivariate in which Param must be conatined in the parametric domain of the multivariate, or a Bezier multivariate in which Param must be in the range of zero to one.

It returns a list of the two sub-multivariates. The individual multivariates may be extracted from the list using the NTH command.

Example:

    MvDiv = MDIVIDE( Mv2, 3, 0.3 );
    Mv2a = nth( MvDiv, 1 ) * tx( -2.2 );
    Mv2b = nth( MvDiv, 2 ) * tx( 2.0 );

subdivides Mv2 at the parameter value of 0.3 in the direction 3 and the extracts the two subdivided multivariate. See also CDIVIDE, SDIVIDE, and TDIVIDE.


MERGPOLY

 PolygonType MERGEPOLY( ListType PolyList )

Merges a set of polygonal objects in PolyList list to a single polygonal object. All elements in ObjectList must be of PolygonType type. This function performs the same operation as the overloaded ^ operator would, but might be more convenient to use under some circumstances.

Example:

    Vrtx1 = vector( -3, -2, -1 );
    Vrtx2 = vector( 3, -2, -1 );
    Vrtx3 = vector( 3, 2, -1 );
    Vrtx4 = vector( -3, 2, -1 );
    Poly1 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false ); 
    
    Vrtx1 = vector( -3, 2, 1 );
    Vrtx2 = vector( 3, 2, 1 );
    Vrtx3 = vector( 3, -2, 1 );
    Vrtx4 = vector( -3, -2, 1 );
    Poly2 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false );
    
    Vrtx1 = vector( -3, -2, 1 );
    Vrtx2 = vector( 3, -2, 1 );
    Vrtx3 = vector( 3, -2, -1 );
    Vrtx4 = vector( -3, -2, -1 );
    Poly3 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false );
   
    PolyObj = MERGEPOLY( list( Poly1, Poly2, Poly3 ) );


MEVAL

 CtlPtType MEVAL( MultivarType MV, ListType Params )

Evaluates the provided multivariate MV at the given Params, values. Params is a list of NumericType's of length equal to the dimension lf the multivariate that must be contained in the multivariate parametric domain if MV is a Bspline multivariate, or all between zero and one if MV is a Bezier multivariate. The returned control point has the same type as the control points of MV.

Example:

    CPt = MEVAL( MV1, list( 0.1, 0.25, 0.22, 0.7 ) );

evaluates the four-variate MV1 at the parameter values of (0.1, 0.25, 0.22, 0.7). See also CEVAL, SEVAL, TEVAL.


MFROMMESH

 MultivarType MFROMMESH( MultivarType MV, MumericType Dir, NumericType Index )

Extracts a multivariate out of a multivariate, MV, as the Index's plane of the control mesh of MV in direction Dir.

Example:

 cmesh( s, row, 2 ) ==
         coerce( MFROMMESH( coerce( s, multivar_type ), 1, 2 ), curve_type );

coerces surface s to a multivariate, extract a one dimensional-less multivariate (a curve) from the second direction (first direction is direction zero), at index 2 and compare the result for equality to the curve extracted using cmesh from s.


MFROMMV

 MultivarType MFROMMV( MultivarType MV, NumericType Dir, NumericType Param )

Extracts a multivariate of one lower dimension from multivariate MV by extracting an iso-variate of MV in direction Dir at parameter value Param.

Example:

    MVFirst = MFROMMV( MV, 0, FirstParam );

extract a multivariate for one less dimension than MV as the constant first parameter of MV at parameter value FirstParam. See also STRIVAR, CSURFACE.


MMERGE

 MultivarType MMERGE( MultivarType MV1, MultivarType MV2, NumericType Dir )

Merges MV1 and MV2 together into one multivariate along the direction Dir. The first direction starts from zero.

Example:

    MVFirst = MMERGE( M1, M2, 2 );

Merges M1 and M2 along the third direction. See also SMERGE,


MOFFSET

 CurveType MOFFSET( CurveType Crv, NumericType OffsetDistance,
                    NumericType AngularError )

Computes an offset of OffsetDistance with globally bounded error (controlled by AngularError). The smaller AngularError is, the better the approximation to the offset. The bounded error is achieved by adaptive refinement of the Crv. The offset is computed via matching of the tangent fields of the given curve Crv and an arc spanning the same angular domain. Further, AngularError measures the angular deviation allowed between the two tangent fields.

Example:

    OffCrv1 = MOFFSET( Crv, -0.4, 10 );
    OffCrv2 = MOFFSET( Crv, -0.4, 5 );

computes an offset approximation to Crv with OffsetDistance of -0.4 and AngularError of 10 and 5 degrees, respectively. See also OFFSET, AOFFSET, LOFFSET, and FFMATCH.


MOMENT

 PointType MOMENT( CurveType Crv, 0 );

 or

 VectorType MOMENT( CurveType Crv, 1 );

Approximates the zero and first moment of curve Crv.

Example:

    a = circle( vector( 0, 0, 0 ), 1 );
    a = cregion( a, 0, 1 );
    p = moment( a, 0 );
    v = moment( a, 1 );
    view(list(a, p, v), on);

    a = cregion( a, 0, 1 ) * rz( 45 );
    p = moment( a, 0 );
    v = moment( a, 1 );
    view(list(a, p, v), on);

computes and displays the zero and first moment of a quarter of a circle in two orientations.


MRAISE

 MultivarType MRAISE( MultivarType TV,
                      ConstantType Direction,
                      NumericType NewOrder )

Raises Srf to the specified NewOrder in the specified Direction.

Example:

    MV2 = MRAISE( MRAISE( MV2, 0, 4 ), 1, 4 );

raises multivariate MV1 to a cubic in the first and second directions. See also TRAISE, SRAISE, and CRAISE.


MRCHCUBE

 PolygonType MRCHCUBE( ListType VolumeSpec,
                       PointType CubeDim,
                       NumericType SkipFactor,
                       NumericType IsoVal )

Applies (a variation of) the marching cubes algorithm (see W. E.Lorensen and H. E.Cline. "Marching Cubes: A High Resolution 3D Surface Construction Algorithm." Computer Graphics (SIGGRAPH '87 Proceedings), Vol. 21, No. 4, pp 163-169, July 1987.) to the given volumetric data set or trivariate. VolumeSpec can be a list of three or five objects as follows:
3 a triplet of the form
(TrivarType TV, NumericType Axis, NumericType TVNormal)
5 a 5-tuple of the form
(StringType FileName, NumericType DataType, NumericType Width,
NumericType Height, NumericType Depth )
In the first case, the trivariate TV is iso surface contoured at level IsoVal along the prescribed Axis (Note a trivariate need not be a scalar function, while Marching Cubes assumes a scalar function). If TVNormals is not zero, much more accurate normals are derived using the trivariate function which is also slower. Otherwise, first order differencing on the cubes is employed for normal estimation.

In the second case, the volume file prescribed by FileName is loaded and iso surface contoured. The file is assumed to hold Width * Height * Depth (Width first, Depth order last) scalar numeric values of type DataType:
1 Regular ascii (separated by while spaces)
2 Two bytes short integer.
3 Four bytes long integer.
4 One byte (char) integer.
5 Four bytes float.
6 Eight bytes double.
Beware of the little vs big Endian problem! We assume here you read in the volume in the same machine type this file was writeen with.

CubeDim allows the user to prescribe the real cell size (not necessarily cubical. SkipFactor allow the skipping ofdata in large data sets. SkipFactor = 1 skips nothing. SkipFactor = 2, skips every other scalar value, reducing in half all dimensions, etc. Last but not least, IsoVal sets the iso surface level.

See also COVERISO, TVLOAD, and TMORPH.

Example:

    IsoSrf = MRCHCUBE( list( ThreeCyls, 1, TRUE ), point( 1, 1, 1 ), 1, 0.12 );

Iso surface contour the X axis of trivariate ThreeCyls and use the trivariate to get better normal's estimations. Cell size is unit cube like, no skipping of data and iso surface level is 0.12.


MREFINE

 MultivarType MREFINE( MultivarType TV, ConstantType Direction,
                       NumericType Replace, ListType KnotList )

Provides the ability to Replace a knot vector of MV or refine it in the specified direction Direction. KnotList is a list of knots to refine MV at. All knots should be contained in the parametric domain of MV in Direction. If the knot vector is replaced, the length of KnotList should be identical to the length of the original knot vector of MV in Direction. If MV is a Bezier multivariate, it is automatically promoted to be a Bspline multivariate.

Example:

    MV = MREFINE( MREFINE( MREFINE( MV,
                                    0, FALSE, list( 0.333, 0.667 ) ),
                           1, FALSE, list( 0.333, 0.667 ) ),
                  2, FALSE, list( 0.333, 0.667 ) );

refines MV in the first three directions by adding two more knots at 0.333 and 0.667. See also CREFINE, SREFINE, and TREFINE.


MREGION

 MultivarType MREGION( MultivarType MV, ConstantType Direction,
                       NumericType MinParam, NumericType MaxParam )

Extracts a region of MV between MinParam and MaxParam in the specified Direction. Both MinParam and MaxParam should be contained in the parametric domain of MV in Direction.

Example:

    MV1r1 = TREGION( MV1, 3, 0.1, 0.2 );
    MV1r2 = TREGION( MV1, 3, 0.4, 0.6 );
    MV1r3 = TREGION( MV1, 3, 0.99, 1.0 );

extracts three regions of MV1 along the 4th (directions are counted from zero) direction. See also CREGION, SREGION, and TREGION.


MREPARAM

 MultivarType MREPARAM( MultivarType MV, ConstantType Direction,
                        NumericType MinParam, NumericType MaxParam )

Reparametrize MV over a new domain from MinParam to MaxParam, in the prescribed Direction. This operation does not affect the geometry of the multivariate and only affine transforms its knot vectors. A Bezier multivariate will automatically be promoted into a Bspline surface by this function.

Example:

    MV = MREPARAM( MREPARAM( MV, 0, 0.1, 1.9 ),
                   1, 0.1, 0.9 );

Ensures that the multivariate MV is defined over [0.1, 0.9] in the first two directions. See also CREPARAM, SREPARAM, and TREPARAM.


MREVERSE

 MultivarType MREVERSE( MultivarType MV, NumericType Dir1, NumericType Dir2 )

Reverses MV by flipping the given two parametric directions, Dir1 and Dir2, (starting to count directions from zero).

Example:

  RevMV = MREVERSE( MV, 2, 4 );

Reverses MV by flipping the third and the fifth direction of MV. See also SREVERSE.


MZERO

 ListType MZERO( ListType MVs, NumericType SubdivTol, NumericType NumerTol )

Computes the simultaneous zeros of several scalar multivariate functions, in MVs. SubdivTol specifies the subdivision tolerance in the parametric domain of the multivariates whereas NumerTol prescribes the tolerance of the numerical improvment stage. A numerical improvment stage is applied if |NumerTol| < SubdivTol. If NumerTol is negative, and numeric improvement stage is indeed applied, all points that fail to improve to the requested accuracy are purged away.

Returned is a list of control points, each designates one location in the parameter space of the multivariates.

The number of multivariates cannot exceed the dimension of the multivariates. That is if the MVs are trivariates than at most three of them may be provided. If less are provided, then the dimension of the solution space is larger than zero and a finite cloud of points sampled from that solution space will be returned.

Example:

  ZeroMVs = MZERO( list( MV1, MV2, MV3 ), 0.01, -1e-6 );

See also CONTOUR.


MPROMOTE

 PromMV = MPROMOTE( MultivarType MV, ListType AddDir );
 
 or
 
 PromMV = MPROMOTE( MultivarType MV, ListType NewDimStartAxis );

Promotes the multivariate MV to a higher dimension. In the first form (a list of one numeric value) the multivariate will be promoted to have one more dimension (i.e. a bivariate would become a trivariate). The new added axis would be AddDir.

The second form (a list of two numeric values) allows the original multivariate to be placed at axes from StartAxis and have a new dimensional NewDim.

Example:

 ms = coerce( srf, multivar_type );
 coerce( mfrommv( MPROMOTE( ms, list( 0 ) ), 0, 0.5 ), surface_type ) == srf;

Coerce a surface to a multivariate, promote it to a trivariate-multivariate, extract an iso-surface bivariate-multivariate along the new introduced axis from the trivariate-multivariate and compare to the original surface. Should be equal!


NIL

 ListType NIL()

Creates an empty list so data can be accumulated in it. See CINFLECT or CZEROS for examples. See also LIST and SNOC.


OFFSET

 PolygonType OFFSET( PolygonType Poly, NumericType OffsetDistance,
                     NumericType Tolerance, NumericType BezInterp )

 or

 CurveType OFFSET( CurveType Crv, NumericType OffsetDistance,
                   NumericType Tolerance, NumericType BezInterp )

 or

 SurfaceType OFFSET( SurfaceType Srf, NumericType OffsetDistance,
                     NumericType Tolerance, NumericType BezInterp )

 or

 TrimSrfType OFFSET( TrimSrfType TrimSrf, NumericType OffsetDistance,
                     NumericType Tolerance, NumericType BezInterp )

Offsets Poly, Crv, Srf or a TrimSrf, by translating all the (control) points in the direction of the normal of the poly/curve or of the (trimmed) surface by an OffsetDistance amount. For a Poly object, result is an offset of the original polygon/line in the XY plane and is exact. Hence, Tolerance and BezInterp parameters are ignored. Result is a mitter joint based offset. Otherwise, each control point has a node parameter value associated with it, which is used to compute the normal. The returned curve or surface only approximates the real offset. If the resulting approximation does not satisfy the accuracy required by Tolerance, Crv or Srf or TrimSrf is subdivided and an offset approximation fit is computed to the two halfs. For curves, one can request a Bezier interpolation scheme in the offset approximation by setting BezInterp. The BezInterp is not supported yet for (trimmed) surfaces. Negative OffsetDistance denotes offset in the reversed direction of the normal.

Example:

    OffCrv = OFFSET( Crv, -0.4, 0.1, off );

offsets Crv by the amount of -0.4 in the reversed normal direction, Tolerance of 0.1 and no Bezier interpolation. See also AOFFSET and LOFFSET.


ORTHOTOMC

 CurveType ORTHOTOMC( CurveType Crv, PointType Pt, NumericType K )

 or,

 SurfaceType ORTHOTOMC( SurfaceType Srf, PointType Pt, NumericType K )

Computes the K-orthotomic of freeform curves and surfaces. See Fundamentals of Computer Aided Geometric Design, by J. Hoschek and and D. Lasser.

Example:

    pt = point( 0, 0.35, 0 );
    crv = cbezier( list( ctlpt( E2, -0.8, -0.6 ),
                         ctlpt( E2, -0.3, -0.2 ),
                         ctlpt( E2,  0.0,  0.0 ),
                         ctlpt( E2,  0.8, -0.6 ) ) );
    Orth = ORTHOTOMC( crv, pt, 2 );
    interact( list( Orth, crv, pt ) * tx( 0.5 ) ) );

computes the orthotomic of a cubic Bezier curve that has an inflection point. Note inflection points are reduced to cusps in the orthotomic result.


PCIRCLE

 CurveType PCIRCLE( VectorType Center, NumericType Radius )

Same as CIRCLE but approximates the circle as a polynomial curve. See CIRCLE.


PDECIMATE

 PolygonType PDECIMATE( PolygonType Obj, NumericType DecimType,
                        NumericType Threshold )

Given a polygonal model, Obj, decimate and merge polygons, effectively reducing the size of the data subject to a maximal deviation distance as controlled via Threshold and DecimType. DecimType can be either TRUE when Threshold has a continuous zero to one control over the output size or FALSE when Threshold prescribes the exact number of polygons desired.

Example:

    gcross = cbspline( 3,
                       list( ctlpt( E3, 0.3, 0.0, 0.0 ),
                             ctlpt( E3, 0.1, 0.0, 0.1 ),
                             ctlpt( E3, 0.1, 0.0, 0.4 ),
                             ctlpt( E3, 0.5, 0.0, 0.5 ),
                             ctlpt( E3, 0.6, 0.0, 0.8 ) ),
                       list( KV_OPEN ) );
    resolution = 30;
    glass = surfprev( gcross );
    
    pglass = gpolygon( glass, false );
    
    dglass = PDECIMATE( pglass, false, 0.5 );

creates a surface of a glass, approximate it with polygons and then decimates the latter.


PDOMAIN

 ListType PDOMAIN( FreeformType Freeform )

Returns the parametric domain of the given Freeform. See also MESHSIZE, FFCTLPTS, FFKNTVEC, FFMESH, FFMSIZE, FFPTTYPE, FFORDER.

Example:

 circ_domain = PDOMAIN( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );


PLANE

 PointType PLANE( NumericType A, NumericType B, NumericType C, NumericType D )

Creates a plane type object, using the four provided NumericType coefficients. See also VECTOR, POINT.


PLN3PTS

 PlaneType PLN3PTS( PointType Pt1, PointType Pt2, PointType Pt3 )

Computes a plane out of three points.

Example:

 Pl1 = PLN3PTS( point( 0, 0, 0 ), point( 0, 1, 0 ), point( 1, 0, 0 ) );


PMORPH

 PlaneType PMORPH( PolyType Pl1, PolyType Pl2, NumericType Blend )

Creates a new polygonal object which is a metamorph of the two given polygonal objects that share the same topology. That is Pl1 and Pl2 must share the same number of polygons and the i'th polygon in Pl1 must equal in its number of vertices to the i'th polygon of Pl2. Very useful if a sequence that "morphs" one polygonal model to another is to be created.

Example:

 Pl1 = con2( vector( 0.0, -0.5, -0.5 ), vector( 0.0, 0.0, 1.0 ), 0.4, 0.1, 3 );
 Pl2 = con2( vector( 0.0, 0.5, 0.0 ), vector( 0.0, 0.0, 1.0 ), 0.1, 0.4, 3 );
 Pl = PMORPH( Pl1, Pl2, 0.5 );

creates a cylinder out of two truncated cones, using PMORPH. See also CMORPH and SMORPH.


POINT

 PointType POINT( NumericType X, NumericType Y, NumericType Z )

Creates a point type object, using the three provided NumericType scalars. See also VECTOR, PLANE.


POLY

 PolygonType POLY( ListType VrtxList, NumericType IsPolyline )

Creates a single polygon/polyline (and therefore open) object, defined by the vertices in VrtxList (see LIST). All elements in VrtxList must be one of PointType, VectorType, CtlPtType, or PolygonType types. If IsPolyline, a polyline is created, otherwise a polygon.

Example:

    V1  = vector( 0.0, 0.0, 0.0 );
    V2  = vector( 0.3, 0.0, 0.0 );
    V3  = vector( 0.3, 0.0, 0.1 );
    V4  = vector( 0.2, 0.0, 0.1 );
    V5  = vector( 0.2, 0.0, 0.5 );
    V6  = vector( 0.3, 0.0, 0.5 );
    V7  = vector( 0.3, 0.0, 0.6 );
    V8  = vector( 0.0, 0.0, 0.6 );
    V9  = vector( 0.0, 0.0, 0.5 );
    V10 = vector( 0.1, 0.0, 0.5 );
    V11 = vector( 0.1, 0.0, 0.1 );
    V12 = vector( 0.0, 0.0, 0.1 );
    I = POLY( list( V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12 ),
              FALSE );

constructs an object with a single polygon in the shape of the letter I.


PPINTER

 ListType PPINTER( PolyType Pl1, PolyType Pl2 )

Compute the intersection of two individual polygons in R3, Pl1 and Pl2. Similar results can also be obtained via Boolean operations.

Example:

    Pl1 = poly( list( point( -1, -1, 0 ),
                      point( -1,  1, 0 ),
                      point(  1,  1, 0 ),
                      point(  1, -1, 0 ) ), false );
    Pl2 = Pl1 * rx( 70 ) * tx( 0.5 );

    Inter1 = PPINTER( Pl1, Pl2 );

    iritstate( "intercrv", true );
    Inter2 = Pl1 * Pl2;

Computes the intersection edge of two polygons in two different ways. Note, however, that while PPINTER considers only the first polygon in a polygonal object, the Boolean operations considers them all.


PRISA

 ListType PRISA( SurfaceType Srfs, NumericType SamplesPerCurve,
                 NumericType Epsilon, ConstantType Dir, VectorType Space,
                 NumericType CrossSecs )
 
 or
 
 ListType PRISA( TrimSrfType TrimSrfs, NumericType SamplesPerCurve,
                 NumericType Epsilon, ConstantType Dir, VectorType Space,
                 NumericType CrossSecs )

Computes a layout (prisa) of the given surface(s) Srfs or {TrimSrfs}, and returns a list of (trimmed) surface objects representing the layout. The surface is approximated to within Epsilon in direction Dir into a set of ruled surfaces and then developable surfaces that are laid out flat onto the XY plane. If Epsilon is negative, the piecewise ruled surface approximation in 3-space is returned. SamplesPerCurve controls the piecewise linear approximation of the boundary of the ruled/developable surfaces. Space is a vector whose X component controls the space between the different surfaces' layout, and whose Y component controls the space between different layout pieces. If CrossSecs is not zero, the 3D cross sections, approximated as planar, of each laid out region are also provided.

Example:

 cross = cbspline( 3,
                   list( ctlpt( E3, 0.7, 0.0, 0. ),
                         ctlpt( E3, 0.7, 0.0, 0.06 ),
                         ctlpt( E3, 0.1, 0.0, 0.1 ),
                         ctlpt( E3, 0.1, 0.0, 0.6 ),
                         ctlpt( E3, 0.6, 0.0, 0.6 ),
                         ctlpt( E3, 0.8, 0.0, 0.8 ),
                         ctlpt( E3, 0.8, 0.0, 1.4 ),
                         ctlpt( E3, 0.6, 0.0, 1.6 ) ),
                   list( KV_OPEN ) );
 wglass = surfrev( cross );
 wgl_ruled = PRISA( wglass, 6, -0.1, COL, vector( 0, 0.25, 0.0 ), false );
 wgl_prisa = PRISA( wglass, 6, 0.1, COL, vector( 0, 0.25, 0.0 ), true );

Computes a layout of a wine glass in wgl_prisa and a three-dimensional ruled surface approximation of wglass in wgl_ruled.


PT3BARY

 VectorType PT3BARY( PointType Pt1, PointType Pt2, PointType Pt3,
                     PointType InteriorPt )

Computes the barycentric coordinates of InterPt with respect to the triangle defined by Pt1, Pt2, Pt3. Returned is a vector of three coefficents, which are the weights of the three points of the triangle. InteriorPt is assumed to be in the triangle.

Example:

 Coeffs = PT3BARY( point( 0, 0, 0 ),
                   point( 1, 0, 0 ),
                   point( 0, 1, 0 ),
                   point( 0.25, 0.25, 0.0 ) );


PTHMSPR

 ListType PTHMSPR( NumericType Size )

Computes a fairly uniform distribution of points on a hemisphere. Size hints on the distance between adjacent placed points.

Example:

 Pts = PTHMSPR( 0.1 );


PTLNPLN

 VectorType PTLNPLN( PointType LineOrig, VectorType LineRay, PlaneType Plane )

Computes the point of intersection of given line LineOrig, LineRay with plane Plane.

Example:

 InterPt = PtLnPln( point( 1, 0, 1 ), vector( 1, 1, 1 ), Plane( 0, 0, 1, 0 ) );


PTPTLN

 VectorType PTPTLN( PointType Point, PointType LineOrig, VectorType LineRay )

Computes the point on line LineOrig, LineRay that is closest to point Point. See also DSTPTLN

Example:

 ClosestPt = PTPTLN( point( 0, 0, 0 ), point( 1, 1, 0 ), vector( 1, 1, 1 ) );



PTS2PLLN

 ListType PTS2PLLN( ListType Points, NumericType MaxMatchDist )

Matches the given cloud of points into a list of polylines. MaxMatchDist is used as the maximal distance between two adjacent points to connect between.

Example:

    Pts = nil();
    for ( i = 0, 1, 100,
        t = random( 0, 2 * Pi ):
        snoc( point( cos( t ), sin( t ), 0 ), Pts ) );
    Pll = PTS2PLLN( Pts, 0.1 );

Connects the 100 random points on the unit circle into a polyline approximating an (almost) complete circle.


PTSLNLN

 ListType PTSLNLN( PointType Line1Orig, VectorType Line1Ray,
                   PointType Line2Orig, VectorType Line2Ray )

Computes the closest two points on the two lines defined by point LineiOrig and ray LineiRay. See also DSTLNLN. Returned is a list object with the two points.

Example:

 ClosestPts = PtsLnLn( point( 1, 0, 0 ), vector( 0, 1, 0 ),
                       point( 0, 1, 0 ), vector( 1, 0, 0 ) );


QUADRIC

 ListType QUADRIC( ListType ABCDEFGHIJ ) )

Constructs a quadric parametric surface whose coefficients are the ten coefficients in the list ABCDEFGHIJ:
     A x^2 + B y^2 + C z^2 + D xy + E xz + F yz + G x + H y + I z + J = 0.


Example:

   Sph   = quadric( list( 1,  1 , 1 , 0,  0,  0,  0,  0,  0, -1 ) );
   Hyp1s = quadric( list( 1,  1, -1,  0,  0,  0,  0,  0,  0, -1 ) );
   Hyp2s = quadric( list( 1, -1, -1,  0,  0,  0,  0,  0,  0, -1 ) );

constructs three quadric surfaces, a portion of the sphere, a portion of a hyperboloid of one sheet and a portion of a hyperboloid of two sheets.

Because the parametrization of the quadric is predetermined, one might need to use SREGION and SMOEBIUS to extract subregions and/or reparametrize the surface.


RAYTRAP

 ListType RAYTRAP( ListType Crvs,
                   NumericType SubdivTol, NumericType NumerTol )

Computes locations on the given planar curves that would bounce rays from one curve to the next, in an infinite cycle. Such traps are denotes ray traps. The ray-traps are computed for the given list of Crvs, in the given order. The ray-trap problem is posed as a set of n multivariate algebraic constraints with n variables, given n curves are prescribed in Crvs. The simultaneous solution of these constraints is computed using the MZERO function. See MZERO for the meaning of the SubdivTol and NumerTol tolerance.

Example:

    Crv1 = pcircle( vector( -0.75, -0.75, 0 ), 0.5 );
    Crv2 = Crv1 * sc( 1.5 ) * tx( 2 );
    Crv3 = Crv1 * sc( 0.5 ) * tx( 0.2 ) * ty( 0.6 );

    Tris = RayTrapTris( list( Crv1, Crv2, Crv3 ), 0.1, -1e-6 );

Computes the ray traps between three circles.


RFLCTLN

 ListType RFLCTLN( SurfaceType Srf, VectorType ViewDir,
                   ListType LinesSprs, NumericType Euclidean )

Computes reflection lines/ovals to the given surface Srf as seen from view direction ViewDir. The resulting piecewise linear curves are in Euclidean space if Euclidean is TRUE and in Srf parameter space, otherwise.

The reflection/ovals themselves are defined via LinesSprs. For reflection lines, LinesSprs, consists of

 list( LineDir, list( LinePos1, LinePos2, ... , LinePosN ) );

defining n parallel lines with direction LineDir through point LinePos1 to LinePosN.

For reflection ovals, LinesSprs, consists of

 list( SprCntr, list( Rad1, Rad2, ... , RadN ) );

defining n co-spherical spheres, all located at SprCntr with radii of Rad1 to RadN.

Example:

    resolution = 20;
    RefLns = RflctLn( Srf,
                      vector( 0, 1, 2 ),
                      list( vector( 0, 0, 1 ),
                            list( point( -3.0, 2, 0 ),
                                  point( -1.5, 2, 0 ),
                                  point(  0.0, 2, 0 ),
                                  point(  1.5, 2, 0 ),
                                  point(  3.0, 2, 0 ) ) ),
                      true );
    RefOvals = RflctLn( Srf,
                        vector( 1, 1, 0 ),
                        list( point( 0, 2, 0 ),
                              list( 5, 25, 45, 65, 85 ) ),
                        true );

Computes the reflection lines of surface Srf from viewing direction ( 0, 1, 2 ) having five reflected lines and computes five reflection ovals from viewing direction ( 0, 1, 2 ). See also ReflectLns attributes in the display devices.


RRINTER

 ListType RRINTER( CurveType Srf1Crv1, CurveType Srf1Crv2,
                   CurveType Srf2Crv1, CurveType Srf2Crv2,
                   NumericType Tolerance, NumericType ZeroSetFunc )

Computes the intersection curves of the given two ruled surfaces, defined as

        SrfiCrv1 * v + SrfiCrv2 * (1 - v)", i = 1, 2, v in [0,1].

     SrfiCrv1 * v~ +~ SrfiCrv2 * (1 - v),~~ i = 1, 2,~~v in [0,1].
   The ruled ruled intersection (RRI) problem is tranformed into a zero set
 finding on another function.  If ZeroSetFunc is true, the function
 whose zero set provides the RRIsolution is returned.  Otherwise, if
 ZeroSetFunc is false, the RRI solution itself is returned.  The zero
 set is computed via numerical zero set finding methods and Tolerance
 controls the fineness of the approximated solution.  If Tolerance is
 negative, is absolute value is emplyed as Tolerance but the
 intersection curves are computed as if the two ruled surfaces are infinite
 (i.e. v is unbounded).



Example:

    c1 = cbezier( list( ctlpt( E3, -1.0,  -1.0, -1.0 ),
                        ctlpt( E3, -0.5,   8.0, -1.0 ),
                        ctlpt( E3,  0.0, -15.0, -1.0 ),
                        ctlpt( E3,  0.5,   8.0, -1.0 ),
                        ctlpt( E3,  1.0,  -1.0, -1.0 ) ) );
    c2 = c1 * sc( 0.7 ) * tz( 1.7 );
    r1 = ruledSrf( c1, c2 );
    
    c1 = pcircle( vector( 0, 0, 0 ), 0.3 ) * tz( 2 );
    c2 = c1 * sc( 0.5 ) * tz( -3 );
    r2 = ruledSrf( c1, c2 ) * ry( 90 );
    
    c = RRINTER( cMesh( r1, row, 0 ),
                 cMesh( r1, row, 1 ),
                 cMesh( r2, row, 0 ),
                 cMesh( r2, row, 1 ),
                 25, false );
    
    interact( list( r1, r2, nth( c, 1 ) ) );


RULEDSRF

 SurfaceType RULEDSRF( CurveType Crv1, CurveType Crv2 )

 or

 PolygonType RULEDSRF( PolygonType Poly1, PolygonType Poly22 )

Constructs a ruled surface between the two curves Crv1 and Crv2 or two polylines Poly1 and Poly2. The curves do not have to have the same order or type, and will be promoted to their least common denominator. The polys must have the same number of points and both must be either polygons or polylines.

Example:

    c1 = cbspline( 3,
                 list( ctlpt(E3, 1.7, 0.0 , 0  ),
                       ctlpt(E3, 0.7, 0.7 , 0  ),
                       ctlpt(E3, 1.7, 0.3 , 0  ),
                       ctlpt(E3, 1.5, 0.8 , 0  ),
                       ctlpt(E3, 1.6, 1.0 , 0  ) ),
            list( KV_OPEN ) );
    c2 = cbspline( 3,
                 list( ctlpt(E3, 0.7, 0.0 , 0  ),
                       ctlpt(E3,-0.7, 0.2 , 0  ),
                       ctlpt(E3, 0.7, 0.5 , 0  ),
                       ctlpt(E3,-0.7, 0.7 , 0  ),
                       ctlpt(E3, 0.7, 1.0 , 0  ) ) ,
            list( KV_OPEN ) );
    
    srf1 = RULEDSRF( c1, c2 );
    interact( list( c1, c2, srf1 ), on );
    
    c2a = ffmatch( c1, c2, 50, 100, 2, false, 1 );
    srf2 = RULEDSRF( c1, c2a );
    interact( list( c1, c2, srf2 ), on );

Constructs a planar ruled surface between two curves, c1 and c2. The naive construction causes self intersection, but by employing FFMATCH the self intersection can be resloved.

See also FFMATCH.


RULEDTV

 TrivarType RULEDTV( SurfaceType Srf1, SurfaceType Srf2 )

Constructs a ruled trivariate between the two surfaces Srf1 and Srf2. The surfaces do not have to have the same order or type, and will be promoted to their least common denominator.

Example:

    s1 = boolone( pcircle( vector( 0, 0, 0 ), 1 ) );
    s2 = boolone( pcircle( vector( 0, 0, 1 ), 0.5 ) );

    tv = RULEDTV( s1, s2 );

Constructs a truncated cone-volume as a ruled trivariate between two surfaces, s1 and s2.

See also EXTRUDE, TFROMSRFS.


SACCESS

 ListType SACCESS( SurfaceType AccessSrf,
                   AnyType OrientFieldSrf,
                   SurfaceType CheckSrf,
                   AnyType AccessLimitDir,
                   NumericType SubdivTol,
                   NumericType NumericTol )

Computes the domain on AccessSrf surface that is accessible from the orientation that is optionally prescribed by OrientFieldSrf, without gouging into CheckSrf surface. If OrientFieldSrf is not a surface, the normal field of AccessSrf is employed. The AccessSrf and OrientFieldSrf must share a (u, v) domain, whereas CheckSrf can present a different (s, t) domain.

If AccessLimitDir is indeed a vector, the access is limited for direction V such that inner product of V and AccessLimitDir is positive.

The accuracy of the computation is governed by a two stages' solution, a subdivision stage with tolerance SubdivTol followed by a numerical improvement stage with NumericTol accuracy. The second, numeric, stage is invoked only if NumericTol < SubdivTol.

The returned results is a set of point on the boundary of the accessible region. The points are in E4 space as (u, v, s, t) 4-tuples.

Example:

    c = cregion( pcircle( vector( 0, 0, 0 ), 1 ), 1, 3 ) * ry( 90 );
    pSphere = surfPRev( c ) * sc( 0.3 ) * tz( 1 );

    Pln = ruledSrf( ctlpt( E3, -1, -1, 0 ) + ctlpt( E3, -1,  1, 0 ),
                    ctlpt( E3,  1, -1, 0 ) + ctlpt( E3,  1,  1, 0 ) );

    Pts = SACCESS( Pln, 0, pSphere, 0, 0.1, 1e-5 );

    sPts = nil();
    sPtsErr = nil();
    for ( i = 1, 1, sizeof( Pts ),
        Pt = nth( Pts, i ):
        Err = getAttr( Pt, "Error"):
        if ( Err > 1e-5,
             snoc( seval( Pln, coord( Pt, 1 ), coord( Pt, 2 ) ), sPtsErr ),
             snoc( seval( Pln, coord( Pt, 1 ), coord( Pt, 2 ) ), sPts ) ) );
    color( sPts, green );
    color( sPtsErr, red );

    interact( list( pSphere, Pln, sPts, sPtsErr ) );

compute the access domain of plane Pln along the normal, Z, direction while preventing from gouging into check surface pSphere.


SBEZIER

 SurfaceType SBEZIER( ListType CtlMesh )

Creates a Bezier surface using the provided control mesh. CtlMesh is a list of rows, each of which is a list of control points. All control points must be of type (E1-E9, P1-P9), or regular PointType defining the surface's control polygon. Surface's point type will be of a space which is the union of the spaces of all points.

Example:

   Srf = SBEZIER( list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
                               ctlpt( E3, 0.0, 1.0, 0.0 ),
                               ctlpt( E3, 0.0, 2.0, 1.0 ) ),
                         list( ctlpt( E3, 1.0, 0.0, 0.0 ),
                               ctlpt( E3, 1.0, 1.0, 2.0 ),
                               ctlpt( E3, 1.0, 2.0, 0.0 ) ),
                         list( ctlpt( E3, 2.0, 0.0, 2.0 ),
                               ctlpt( E3, 2.0, 1.0, 0.0 ),
                               ctlpt( E3, 2.0, 2.0, 2.0 ) ),
                         list( ctlpt( E3, 3.0, 0.0, 0.0 ),
                               ctlpt( E3, 3.0, 1.0, 2.0 ),
                               ctlpt( E3, 3.0, 2.0, 0.0 ) ),
                         list( ctlpt( E3, 4.0, 0.0, 1.0 ),
                               ctlpt( E3, 4.0, 1.0, 0.0 ),
                               ctlpt( E3, 4.0, 2.0, 1.0 ) ) ) );

See also CBEZIER, SBSPLINE and SPOWER.


SBISECTOR

 SurfaceType SBISECTOR( SurfaceType Srf, PointType Pt )

Computes the bisector surface of a given surface a a point. See also CBISECTOR.

Example:

    s = ruledSrf( ctlpt( E3, -1.0, -1.0, 0.0 ) + ctlpt( E3,  1.0, -1.0, 0.0 ),
                  ctlpt( E3, -1.0,  1.0, 0.0 ) + ctlpt( E3,  1.0,  1.0, 0.0 ) );
    
    pt = point( 0.0, 0.0, 1.0 );
    
    bisect = SBISECTOR( s, pt );

    interact( list( s, pt, bisect ) );

computes the bisector surface of a plane and a point.


SBSPLINE

 SurfaceType SBSPLINE( NumericType UOrder, NumericType VOrder,
                       ListType CtlMesh, ListType KnotVectors )

Creates a Bspline surface from the provided UOrder and VOrder orders, the control mesh CtlMesh, and the two knot vectors KnotVectors. CtlMesh is a list of rows, each of which is a list of control points. All control points must be of point type (E1-E9, P1-P9), or regular PointType defining the surface's control mesh. Surface's point type will be of a space which is the union of the spaces of all points. KnotVectors is a list of two knot vectors. Each knot vector is a list of NumericType knots of length #CtlPtList plus the Order. If, however, the length of the knot vector is equal to #CtlPtList + Order + Order - 1} the curve is assumed periodic. The knot vector may also be a list of a single constant KV_OPEN or KV_FLOAT or KV_PERIODIC, in which a uniform knot vector with the appropriate length and with open, floating or periodic end condition will be constructed automatically.

Example:

    Mesh = list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
                        ctlpt( E3, 0.0, 1.0, 0.0 ),
                        ctlpt( E3, 0.0, 2.0, 1.0 ) ),
                  list( ctlpt( E3, 1.0, 0.0, 0.0 ),
                        ctlpt( E3, 1.0, 1.0, 2.0 ),
                        ctlpt( E3, 1.0, 2.0, 0.0 ) ),
                  list( ctlpt( E3, 2.0, 0.0, 2.0 ),
                        ctlpt( E3, 2.0, 1.0, 0.0 ),
                        ctlpt( E3, 2.0, 2.0, 2.0 ) ),
                  list( ctlpt( E3, 3.0, 0.0, 0.0 ),
                        ctlpt( E3, 3.0, 1.0, 2.0 ),
                        ctlpt( E3, 3.0, 2.0, 0.0 ) ),
                  list( ctlpt( E3, 4.0, 0.0, 1.0 ),
                        ctlpt( E3, 4.0, 1.0, 0.0 ),
                        ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
    Srf = SBSPLINE( 3, 3, Mesh, list( list( KV_OPEN ),
                                      list( 3, 3, 3, 4, 5, 6, 6, 6 ) ) );

constructs a bi-quadratic Bspline surface with its first knot vector having uniform knot spacing with open end conditions.

See also CBSPLINE, SBEZIER and SPOWER.


SCRVTR

 SurfaceType SCRVTR( SurfaceType Srf, ConstType PtType, ConstType Dir )

Symbolically computes the extreme curvature bound on Srf. If Dir is either ROW or COL, then the normal curvature square of Srf in Dir is computed symbolically and returned. Otherwise, a upper bound on the sum of the squares of the two principal curvatures is symbolically computed and returned.

Returned value is a surface that can be evaluated to the curvature bound, given a UV location. The returned surface value is a scalar field of point type P1 (scalar rational). However, if PtType is one of E1, P1, E3, P3 the returned surface is coerced to this given type. If the types are one of E3, P3, then the Y and Z axes are set to be equivalent to the U and V parametric domains.

   This function computes the square of the normal curvature scalar
 field for surfaces as (in the U parametric direction, same for V),
                     2  
                    d S
              < n , --- >
                      2
    u               du
   k (u, v) = ------------
    n         
                 dS   ds
               < -- , -- >
                 du   du

 and computes the sum of the squares of the principal curvatures as,

  2    2  ( g11 l22 + g22 l11 - 2 g12 l12 )^2 - 2 |G| |L|
 k  + k = -----------------------------------------------
  1    2                   |G|^2 ||n||^2

 See also CCRVTR.



Example:

 cross = cbspline( 3,
                   list( ctlpt( E2,  0.0,  0.0 ),
                         ctlpt( E2,  0.8,  0.0 ),
                         ctlpt( E2,  0.8,  0.2 ),
                         ctlpt( E2,  0.07, 1.4 ),
                         ctlpt( E2, -0.07, 1.4 ),
                         ctlpt( E2, -0.8,  0.2 ),
                         ctlpt( E2, -0.8,  0.0 ),
                         ctlpt( E2,  0.0,  0.0 ) ),
                   list( KV_OPEN ) );
 cross = coerce( cross, e3 );
 s = sFromCrvs( list( cross,
                      cross * trans( vector( 0.5, 0, 1 ) ),
                      cross * trans( vector( 0, 0, 2 ) ) ), 3, KV_OPEN );
 view( list( s, axes ), on );
 
 UCrvtrZXY = scrvtr( s, E3, row );
 VCrvtrZXY = scrvtr( s, E3, col );
 UCrvtrXYZ = UCrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 0.001 ) );
 VCrvtrXYZ = VCrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 10 ) );
 color( UCrvtrXYZ, red );
 color( VCrvtrXYZ, magenta );
 
 view( list( UCrvtrXYZ, VCrvtrXYZ ), off );
 
 CrvtrZXY = scrvtr( s, E3, off );
 CrvtrXYZ = CrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 0.001 ) );
 color( CrvtrXYZ, green );
 
 view( CrvtrXYZ, off );

Computes the sqaure of the normal curvature in the U and V direction, flips its scalar value from X to Z using rotations and scale the fields to reasonable values and display them. Then, display a total bound on the normal curvature as well.

Due to the large degree of the resulting fields be warned that rational surfaces will compute into large degree curvature bound fields. See also IRITSTATE("InterpProd", FALSE); for faster symbolic computation.


SDERIVE

 SurfaceType SDERIVE( SurfaceType Srf, NumericType Dir )

Returns a vector field surface representing the differentiated surface in the given direction (ROW or COL). Evaluation of the returned surface at a given parameter value will return a vector tangent to Srf in Dir at that parameter value.

 DuSrf = SDERIVE( Srf, ROW );
 DvSrf = SDERIVE( Srf, COL );
 Normal = coerce( seval( DuSrf, 0.5, 0.5 ), VECTOR_TYPE ) ^
          coerce( seval( DvSrf, 0.5, 0.5 ), VECTOR_TYPE );

computes the two partial derivatives of the surface Srf and computes its normal as their cross product, at the parametric location (0.5, 0.5). See also CDERIVE, TDERIVE, and MDERIVE.


SDIVIDE

 SurfaceType SDIVIDE( SurfaceType Srf, ConstantType Direction,
                                                          NumericType Param )

 or

 TrimSrfType SDIVIDE( TrimSrfType Srf, ConstantType Direction,
                                                          NumericType Param )

Subdivides a (possibly trimmed) surface into two at the specified parameter value Param in the specified Direction (ROW or COL). Srf can be either a Bspline surface in which Param must be contained in the parametric domain of the surface, or a Bezier surface in which Param} can be arbitrary, extrapolating if not in the range of zero to one.

It returns a list of upto two sub-surfaces. The individual surfaces may be extracted from the list using the NTH command. If Srf is a trimmed surface, it can be the case that one of the two subdivided surfaces is completely trimmed out, and hence only one surface will be returned.

Example:

    SrfLst = SDIVIDE( Srf, ROW, 0.5 );
    Srf1 = nth( SrfLst, 1 );
    Srf2 = nth( SrfLst, 2 );

Subdivides Srf at the parameter value of 0.5 in the ROW direction. See also CDIVIDE, TDIVIDE, and MDIVIDE


SEDITPT

 SurfaceType SEDITPT( SurfaceType Srf, CtlPtType CPt, NumericType UIndex,
                                                      NumericType VIndex )

Provides a simple mechanism to manually modify a single control point number UIndex and VIndex (base count is 0) in the control mesh of Srf by substituting CtlPt instead. CtlPt must have the same point type as the control points of Srf. Original surface Srf is not modified.

Example:

    CPt = ctlpt( E3, 1, 2, 3 );
    NewSrf = SEDITPT( Srf, CPt, 0, 0 );

Constructs a NewSrf with the first control point of Srf being CPt.


SEVAL

 CtlPtType SEVAL( SurfaceType Srf, NumericType UParam, NumericType VParam )

 or

 CtlPtType SEVAL( TrimSrfType Srf, NumericType UParam, NumericType VParam )

Evaluates the provided (possibly trimmed) surface Srf at the given UParam and VParam parameters. Both UParam and VParam should be contained in the surface parametric domain if Srf is a Bspline surface, or between zero and one if Srf is a Bezier surface. The returned control point has the same type as the control points of Srf.

Example:

    CPt = SEVAL( Srf, 0.25, 0.22 );

Evaluates Srf at the parameter values of (0.25, 0.22). See also CEVAL, MEVAL, TEVAL.


SFOCAL

 SurfaceType SFOCAL( SurfaceType Srf, NumericType Dir )

Evaluates the focal surface field of surface Srf using the normal curvature in the isoparametric direction as given by Dir (either ROW or COL). Note this function is not using the principal curvatures as is generaly the case for focal surfaces.

Example:

    gcross = cbspline( 3,
                       list( ctlpt( E3, 0.3, 0.0, 0.0 ),
                             ctlpt( E3, 0.1, 0.0, 0.1 ),
                             ctlpt( E3, 0.1, 0.0, 0.4 ),
                             ctlpt( E3, 0.5, 0.0, 0.5 ),
                             ctlpt( E3, 0.6, 0.0, 0.8 ) ),
                       list( KV_OPEN ) );
    glass = surfprev( gcross );
    color( glass, red );
    
    gfocal = SFOCAL(glass, col);

Evaluates the focal surface using the COL isoparametric direction's normal curvature of the glass surface.


SFROMCRVS

 SurfaceType SFROMCRVS( ListType CrvList,
                        NumericType OtherOrder,
                        NumericType OtherEndCond )

Constructs a surface by substituting the curves in CrvList as rows in a control mesh of a surface. Curves in CrvList are made compatible by promoting Bezier curves to Bsplines if necessary, and raising degree and refining as required before substituting the control polygons of the curves as rows in the mesh. The other direction order is set by OtherOrder, which cannot be larger than the number of curves. If Bspline (OtherOrder smaller than number of curves), end conditions are set via OtherEndCond and can be one of KV_OPEN, KV_FLOAT and KV_PERIODIC.

The surface interpolates the first and last curves only, if A Bezier or open end conditions are selected and no curve is interpolated otherwise.

Example:

    Crv1 = cbspline( 3,
                     list( ctlpt( E3, 0.0, 0.0, 0.0 ),
                           ctlpt( E3, 1.0, 0.0, 0.0 ),
                           ctlpt( E3, 1.0, 1.0, 0.0 ) ),
                     list( KV_OPEN ) );
    Crv2 = Crv1 * trans( vector( 0.0, 0.0, 1.0 ) );
    Crv3 = Crv2 * trans( vector( 0.0, 1.0, 0.0 ) );
    Srf = SFROMCRVS( list( Crv1, Crv2, Crv3 ), 3, KV_OPEN );


SGAUSS

 SurfaceType SGAUSS( SurfaceType Srf )

Evaluates the Gaussian curvature field of surface Srf.

Example:

    Srf1 = hermite( cbezier( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
                                   ctlpt( E3, 0.5, 0.2, 0.0 ),
                                   ctlpt( E3, 1.0, 0.0, 0.0 ) ) ),
                    cbezier( list( ctlpt( E3, 0.0, 1.0, 0.0 ),
                                   ctlpt( E3, 0.5, 0.8, 0.0 ),
                                   ctlpt( E3, 1.0, 1.0, 0.5 ) ) ),
                    cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
                                   ctlpt( E3, 0.0, 2.0, 0.0 ),
                                   ctlpt( E3, 0.0, 2.0, 0.0 ) ) ),
                    cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
                                   ctlpt( E3, 0.0, 2.0, 0.0 ),
                                   ctlpt( E3, 0.0, 2.0, 0.0 ) ) ) );

    SGauss = SGAUSS( Srf1 );

Evaluates the Gaussian curvaure of Srf1.


SILHOUETTE

 SurfaceType SILHOUETTE( SurfaceType Srf, VectorType ViewDir, NumericType Euc )

Computes the silhouette edges of the given Srf from the prescribed viewing direction ViewDir. The end result is a piecewise linear approximation of the exact silhouette, and its accuracy is controlled via the RESOLUTION variable. If Euc is TRUE, the silhouette curves are returned on the surface, in Euclidean space. Otherwise, the silhouette curves are returned in the parametric space of Srf.

Example:

 Resolution = 10;
 Sils = SILHOUETTE( glass, vector( 1, -2, 1 ), true );

Computes the silhouette curves of surface glass as viewed from viewing direction (1, -2, 1), and returns the silhouette curves in the Euclidean space. See also ISOCLINE.


SINTERP

 SurfaceType SINTERP( ListType PtList, NumericType UOrder, NumericType VOrder,
                      NumericType USize, NumericType VSize,
                      ConstantType Param)

Computes a Bspline polynomial surface that interpolates or approximates the rectangular grid or scattered set of points in PtList. The Bspline surface will have orders UOrder and VOrder and mesh of size USize by VSize control points. If the data is on a grid, the knots will be spaced according to Param which can be one of PARAM_UNIFORM, PARAM_CHORD, PARAM_CENTRIP or PARAM_NEILFOL. Currently only PARAM_UNIFORM is supported. For scattered point set, the Param parameter is ignored. PtList is a list of list of points for girdded data where all lists should carry the same amount of points in them, defining a rectangular grid. For scattered data, PtList is a linear list of points. All points in PtList must be of type (E1-E9, P1-P9) control point, or regular PointType. If USize and VSize are equal to the number of points in the grid data set of PtList, the resulting surface will interpolate the data set. Otherwise, if USize or VSize is less than the number of points in the grid of PtList, the point data set will be least square approximated. In no time can USize or VSize be larger that the number of points in PtList or lower than UOrder and VOrder, respectively. If USize or VSize are zero, the grid size is used, forcing an interpolation of the data set. If PtList contains a linear list of points, these points are treated as scattered. Each scattered point is assumed to be holding the parameteric location to interpolate at as its first two coefficients. The other coefficients are the interpolation values. In other words, to interpolated scattered data of type E3, E5 control points in a linear list must be provided in (u, v, x, y, z) format. Scattered data is interpolated over a unit square (0 to 1) parameteric domain in both u and v.

All interior knots will be distinct preserving maximal continuity. The resulting Bspline surface will have open end conditions.

Example:

    pl = nil();
    pll = nil();
    for ( x = -5, 1, 5,
          pl = nil():
          for ( y = -5, 1, 5,
                snoc( point( x, y, sin( x * Pi / 2 ) * cos( y * Pi / 2 ) ),
                      pl )
          ):
          snoc( pl, pll ) );

    s1 = sinterp( pll, 3, 3, 8, 8, PARAM_UNIFORM );
    s2 = sinterp( pll, 3, 3, 11, 11, PARAM_UNIFORM );

Samples an explicit surface sin(x) * cos(y) at a grid of 11 by 11 points, least square fit with a grid of size of 8 by 8 surface s1, and interpolate surface s2 using this data set. See also CINTERP and LINTERP.


SKEL2DINT

 ListType SKEL2DINT( CurveType Crv1 | PointType Pt1 | CtlPtType Pt1,
                     CurveType Crv2 | PointType Pt2 | CtlPtType Pt1,
                     CurveType Crv3 | PointType Pt3 | CtlPtType Pt1,
                     NumericType OutExtent, NumericType Epsilon,
                     NumericType FineNess )

Computes locations in the plane of points that are equadistant from the three given entities. Entities can be points or control points or curves, all in the XY plane. The equadistant points are computed as the mutual intersection of the bisectors of the entities. Infinite bisectors (such as the bisector of two points) are extended up to OutExtent. Epsilon controls the tolerances while FineNess controls the subdivision fineness in the bisector intersection computations.

Exanple:

    Crv1 = pcircle( vector( -0.5,  0.7, 0.0 ), 0.3 );
    Crv2 = pcircle( vector( -0.4, -0.6, 0.0 ), 0.5 );
    Crv3 = pcircle( vector(  0.3,  0.2, 0.0 ), 0.4 );

    EquaPt = SKEL2DINT( Crv1, Crv2, Crv3, 100, 0.1, 150 ):

Computes the eight points that are equadistant to three circles.


SMEANSQR

 SurfaceType SMEANSQR( SurfaceType Srf )

Evaluates the square of the mean curvature field of surface Srf.

Example:

    Srf1 = hermite( cbezier( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
                                   ctlpt( E3, 0.5, 0.2, 0.0 ),
                                   ctlpt( E3, 1.0, 0.0, 0.0 ) ) ),
                    cbezier( list( ctlpt( E3, 0.0, 1.0, 0.0 ),
                                   ctlpt( E3, 0.5, 0.8, 0.0 ),
                                   ctlpt( E3, 1.0, 1.0, 0.5 ) ) ),
                    cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
                                   ctlpt( E3, 0.0, 2.0, 0.0 ),
                                   ctlpt( E3, 0.0, 2.0, 0.0 ) ) ),
                    cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
                                   ctlpt( E3, 0.0, 2.0, 0.0 ),
                                   ctlpt( E3, 0.0, 2.0, 0.0 ) ) ) );

    SMean = SMEANSQR( Srf1 );

Evaluates the square of the mean curvaure of Srf1.


SMERGE

 SurfaceType SMERGE( SurfaceType Srf1, SurfaceType Srf2,
                     NumericType Dir, NumericType SameEdge )

Merges two surfaces along the requested direction (ROW or COL). If SameEdge is non-zero (ON or TRUE), then the common edge is assumed to be identical and copied only once. Otherwise (OFF or FALSE), a ruled surface is constructed between the two surfaces along the (not) common edge.

Example:

 MergedSrf = SMERGE( Srf1, Srf2, ROW, TRUE );

See also MMERGE.


SMESH

 SurfaceType SMESH( TrivarType TV, MumericType Dir, NumericType Index )

Extracts a surface out of a trivariate, TV, as the Index's plane of the control mesh of TV in direction Dir. Dir can be one of COL, ROW, DEPTH.

Example:

 tv = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
                                 ctlpt( E3, 0.2, 0.1, 2.4 ) ),
                           list( ctlpt( E3, 0.3, 2.2, 0.2 ),
                                 ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
                     list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
                                 ctlpt( E3, 2.2, 0.7, 2.3 ) ),
                           list( ctlpt( E3, 2.3, 2.6, 0.5 ),
                                 ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );
 s0 = SMESH( tv, col, 0 );
 s1 = SMESH( tv, col, 1 );

extracts the two (first and last) planes in direction col out of trivariate tv.

See also STRIVAR, CMESH, MFROMMESH.


SMOEBIUS

 CurveType SMOEBIUS( CurveType Crv, NumericType Ratio, NumericType Dir )

Rebalance the weights of a rational surface using the Moebius transformation. The shape of the surface remains identical while the speed is modified in the direction Dir. Ratio controls the ratio between the last and the first weight of the first row/column. If Ratio = 0, the first and last weights are made equal.

See also CMOEBIUS.


SMOOTHNRML

 ListType SMOOTHNRML( ListType Obj, NumericType MaxAngle )

 or

 PolygonType SMOOTHNRML( PolygonType Obj, NumericType MaxAngle )

Given a (list of) polygonal object(s), Obj, compute normals to the vertices by averaging the normals of the polygons that share the vertices. Only vertices were the deviation between polygons' normals and the averaged normal is less than MaxAngle are updated. Useful for polygonal data sets that have no vertex normals.

Example:

    A = box( vector( -1, -1, -1 ), 2, 2, 2 );
    B = SMOOTHNRML( A, 90 );

computes average normals to a cuve resulted in smooth shaded display of a cube.


SMORPH

 SurfaceType SMORPH( SurfaceType Srf1, SurfaceType Srf2, NumericType Blend )

Creates a new surface which is a convex blend of the two given surfaces. The two given surfaces must be compatible (see FFCOMPAT) before this blend is invoked. Very useful if a sequence that "morphs" one surface to another is to be created.

Example:

 for ( i = 0.0, 1.0, 11.0,
        Msrf = SMORPH( Srf1, Srf2, i / 11.0 ):
        color( Msrf, white ):
        attrib( Msrf, "rgb", "255,255,255" ):
        attrib( Msrf, "reflect", "0.7" ):
        save( "morp1-" + i, Msrf )
 );

creates a sequence of 12 surfaces, morphed from Srf1 to Srf2 and saves them in the files "morph-0.dat" to "morph-11.dat". See also PMORPH, CMORPH and TMORPH.


SNORMAL

 VectorType SNORMAL( SurfaceType Srf, NumericType UParam, NumericType VParam )

 or

 VectorType SNORMAL( TrimSrfType Srf, NumericType UParam, NumericType VParam )

Computes the normal vector to (possibly trimmed) surface Srf at the parameter values UParam and VParam. The returned vector has a unit length.

Example:

    Normal = SNORMAL( Srf, 0.5, 0.5 );

computes the normal to Srf at the parameter values (0.5, 0.5). See also SNRMLSRF.


SNRMLSRF

 SurfaceType SNRMLSRF( SurfaceType Srf )

Symbolically computes a vector field surface representing the non-normalized normals of the given surface. That is the normal surface, evaluated at (u, v), provides a vector in the direction of the normal of the original surface at (u, v). The normal surface is computed as the symbolic cross product of the two surfaces representing the partial derivatives of the original surface.

Example:

 NrmlSrf = SNRMLSRF( Srf );


SPARABOLC

 ListType SPARABOLC( SurfaceType Srf, NumericType Euclidean )

Computes the parabolic edges of a freeform surface, Srf, as the zero set of the Gaussian curvature. A scalar field with the sign of the Gauss curvature is computed and its zero is derived. If Euclidean is false, the list of (piecewise linear) parabolic curves is returned in the parametric space of Srf. Otherwise, if Euclidean is true, the parabolic curves are mapped onto Srf.

Example:

 pl = nil();
 pll = nil();
 for ( x = -3, 1, 3,
       pl = nil():
       for ( y = -3, 1, 3,
           snoc( point( x, y, sin( x * Pi / 2 ) * cos( y * Pi / 2 ) ),
                 pl ) ):
     snoc( pl, pll ) );
 EggBase = sinterp( pll, 4, 4, 0, 0, PARAM_UNIFORM );

 Resolution = 15;
 Parab = SPARABOLC( EggBase, true );

constructs a surface in the shape of eggs' carton base and then derive its parabolic edges in the Euclidean space.


SPHERE

 PolygonType SPHERE( VectorType Center, NumericType Radius )

Creates a SPHERE geometric object, defined by Center as the center of the SPHERE, and with Radius as the radius of the SPHERE. See RESOLUTION for accuracy of SPHERE approximation as a polygonal model. See IRITSTATE's "PrimRatSrfs" and "PrimRatSrfs" state variables.


SPOWER

 SurfaceType SPOWER( ListType CtlMesh )

Creates a polynomial/rational surface out of the provided control mesh. The created surface is employing the monomial power basis. CtlMesh is a list of rows, each of which is a list of control points. All control points must be of type (E1-E9, P1-P9), or regular PointType defining the surface's control polygon. Surface's point type will be of a space which is the union of the spaces of all points.

Example:

 s = SPOWER( list( list( ctlpt( E3, 1, 0, 1 ),
                         ctlpt( E3, 0, 1, 1 ) ),
                   list( ctlpt( E3, 0, 0, 1 ),
                         ctlpt( E3, 0, 0, 1 ) ) ) );
 s == coerce( coerce( s, bezier_type ), power_type );

constructs a bilinear power basis surface, coerce it to a bezier form, coerce the bezier form back to power basis and then compare the result for equality.

See also CBEZIER, SBSPLINE and SPOWER.


SRAISE

 SurfaceType SRAISE( SurfaceType Srf, ConstantType Direction,
                                                      NumericType NewOrder )

Raises Srf to the specified NewOrder in the specified Direction.

Example:

    Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.0 ),
                                   ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
                    cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
                                   ctlpt( E3,  0.5,  0.5, 0.0 ) ) ) );
    Srf = SRAISE( SRAISE( Srf, ROW, 3 ), COL, 3 );

constructs a bilinear flat ruled surface and raises both its directions to be a bi-quadratic surface. See also TRAISE, MRAISE, and CRAISE.


SREFINE

 SurfaceType SREFINE( SurfaceType Srf, ConstantType Direction,
                      NumericType Replace, ListType KnotList )

Provides the ability to Replace a knot vector of Srf or refine it in the specified direction Direction (ROW or COL). KnotList is a list of knots to refine Srf at. All knots should be contained in the parametric domain of Srf in Direction. If the knot vector is replaced, the length of KnotList should be identical to the length of the original knot vector of Srf in Direction. If Srf is a Bezier surface, it is automatically promoted to be a Bspline surface.

Example:

    Srf = SREFINE( SREFINE( Srf,
                            ROW, FALSE, list( 0.333, 0.667 ) ),
                   COL, FALSE, list( 0.333, 0.667 ) );

refines Srf in both directions by adding two more knots at 0.333 and 0.667. See also CREFINE, TREFINE, and MREFINE.


SREGION

 SurfaceType SREGION( SurfaceType Srf, ConstantType Direction,
                                  NumericType MinParam, NumericType MaxParam )

Extracts a region of Srf between MinParam and MaxParam in the specified Direction. Both MinParam and MaxParam should be contained in the parametric domain of Srf in Direction, except for Bezier surfaces when MinParam and MaxParam can be arbitrary.

Example:

    Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.5 ),
                                   ctlpt( E3,  0.0,  0.5, 0.0 ),
                                   ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
                    cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
                                   ctlpt( E3,  0.0,  0.0, 0.0 ),
                                   ctlpt( E3,  0.5,  0.5, 0.5 ) ) ) );
    SubSrf = SREGION( Srf, ROW, 0.3, 0.6 );

extracts the region of Srf from the parameter value 0.3 to the parameter value 0.6 along the ROW direction. the COLumn direction is extracted as a whole. See also CREGION, TREGION, and MREGION.


SREPARAM

 SurfaceType SREPARAM( SurfaceType Srf, ConstantType Direction,
                                  NumericType MinParam, NumericType MaxParam )
 or

 TrimSrfType SREPARAM( TrimSrfType Srf, ConstantType Direction,
                                  NumericType MinParam, NumericType MaxParam )

Reparametrize Srf over a new domain from MinParam to MaxParam, in the prescribed Direction. This operation does not affect the geometry of the (trimmed) surface and only affine transforms its knot vectors. A Bezier (trimmed) surface will automatically be promoted into a Bspline surface by this function.

Example:

    srf = sbspline( 2, 4,
                     list( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
                                 ctlpt( E2, 0.0, 1.0 ),
                                 ctlpt( E3, 0.0, 2.0, 1.0 ) ),
                           list( ctlpt( E2, 1.0, 0.0 ),
                                 ctlpt( E3, 1.0, 1.0, 2.0 ),
                                 ctlpt( E2, 1.0, 2.0 ) ),
                           list( ctlpt( E3, 2.0, 0.0, 2.0 ),
                                 ctlpt( E2, 2.0, 1.0 ),
                                 ctlpt( E3, 2.0, 2.0, 2.0 ) ),
                           list( ctlpt( E2, 3.0, 0.0 ),
                                 ctlpt( E3, 3.0, 1.0, 2.0 ),
                                 ctlpt( E2, 3.0, 2.0 ) ),
                           list( ctlpt( E3, 4.0, 0.0, 1.0 ),
                                 ctlpt( E2, 4.0, 1.0 ),
                                 ctlpt( E3, 4.0, 2.0, 1.0 ) ) ),
                     list( list( KV_OPEN ),
                           list( KV_OPEN ) ) );
    
    srf = sreparam( sreparam( srf, ROW, 0, 1 ), COL, 0, 1 );

Ensures that the (trimmed) Bspline surface is defined over the unit size parametric domain. See also CREPARAM, TREPARAM, and MREPARAM.


SREVERSE

 SurfaceType SREVERSE( SurfaceType Srf )

Reverses Srf by flipping the U and V parametric directions. Note the the unary minus (i.e -Srf) also reverses the surface by reversing the U parametric direction.

  RevSrf = SREVERSE( Srf );

See also MREVERSE.


SRINTER

 PointType SRINTER( SurfaceType Srf, PointType RayOrigin,
                    VectorType RayDirection )

Computes the first intersection, if any, of the prescribed ray originating from RayOrigin in direction RayDirection with surface Srf. Returns the intersection point in the parametric space of Srf with the U and V coordinates as the X and Y coefficients of the returned value. The intersection is computed between the ray and a polygonal approximation of the surface Srf as set via the RESOLUTION variable.

Example:

    RayOrigin = point( 2, 0.1, 0.3 );
    RayDir = vector( -4, 0, 0 );

    RayLine = coerce( RayOrigin, E3 ) + coerce( RayOrigin + RayDir, E3 );
    color( RayLine, magenta );
    attrib( RayLine, "dwidth", 2 );

    resolution = 5;
    InterPt = SRINTER( glass, RayOrigin, RayDir );
    InterPtE3 = seval( glass, coord( InterPt, 0 ), coord( InterPt, 1 ) );
    color( InterPtE3, cyan );
    attrib( InterPtE3, "dwidth", 3 );
    view( list( InterPtE3, RayLine, glass, axes ), 1 );

    resolution = 80;
    InterPt = SRINTER( glass, RayOrigin, RayDir );
    InterPtE3 = seval( glass, coord( InterPt, 0 ), coord( InterPt, 1 ) );
    color( InterPtE3, cyan );
    attrib( InterPtE3, "dwidth", 3 );
    view( list( InterPtE3, RayLine, glass, axes ), 1 );

A complete example of constructing a ray and intersecting it against a surface of a glass at two different resolution, resulting in two different accuracies. See also RESOLUTION.


SSINTER

 ListType SSINTER( SurfaceType Srf1, SurfaceType Srf2,
                   NumericType Euclidean, NumericType Epsilon,
                   NumericType Alignment )

Computes the intersection curve of two surfaces, Srf1 and Srf2, upto Epsilon accuracy. Returned data is in Euclidean space if Euclidean is true, and is in the parametric space otherwise. Returned is a list of two lists (for the two surfaces) of n curves each where n is the number of intersection curves. If Alignment is true, the surfaces are rotated to that one bbox of one surface is axes aligned, increasing the probability of detecting disjoint cases.

Example:

    s1 = sphereSrf( 0.35 ) * trans( vector( 0.0, 0.1, 0.2 ) );
    s2 = coneSrf( 1, 0.5 );
 
    Inter = nth( SSINTER( s1, s2, true, 0.1, false ), 1 );

Computes the Euclidean intersection curves of a cone and a sphere, in general positions. The Euclidean curves on the first surface are extracted while purging the Euclidean curves on the second surface.


STANGENT

 VectorType STANGENT( SurfaceType Srf, ConstantType Direction,
                      NumericType UParam, NumericType VParam )

 or

 VectorType STANGENT( TrimSrfType Srf, ConstantType Direction,
                      NumericType UParam, NumericType VParam )

Computes the tangent vector to (possibly trimmed) surface Srf at the parameter values UParam and VParam in Direction. The returned vector has a unit length.

Example:

    Tang = STANGENT( Srf, ROW, 0.5, 0.6 );

computes the tangent to Srf in the ROW direction at the parameter values (0.5, 0.6).


STRIMSRF

 SurfaceType STRIMSRF( TrimSrfType TSrf )

Extracts the surface of a trimmed surface TSrf.

Example:

    Srf = STRIMSRF( TrimSrf ); 

extracts the surface of TrimSrf.


STRIVAR

 SurfaceType STRIVAR( TrivarType TV, ConstantType Direction,
                                                          NumericType Param ) )

Extracts an iso surface from a trivariate function TV in the specified Direction (ROW or COL or DEPTH) at the specified parameter value Param. Param must be contained in the parametric domain of TV in Direction direction. The returned surface is in the trivariate TV.

Example:

    TV1 = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
                                     ctlpt( E3, 0.2, 0.1, 2.4 ) ),
                               list( ctlpt( E3, 0.3, 2.2, 0.2 ),
                                     ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
                         list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
                                     ctlpt( E3, 2.2, 0.7, 2.3 ) ),
                               list( ctlpt( E3, 2.3, 2.6, 0.5 ),
                                     ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );
    Srf = STRIVAR( TV1, col, 0.4 ); 

extracts an iso surface of TV1, in the col direction at parameter value 0.4. See also SMESH, CSURFACE, MFROMMV.


SURFPREV

 SurfaceType SURFPREV( CurveType Object )

Same as SURFREV but approximates the surface of revolution as a polynomial surface. Object must be a polynomial curve. See SURFREV.


SURFREV

 PolygonType SURFREV( PolygonType Object )

 or
 
 SurfaceType SURFREV( CurveType Object )

Creates a surface of revolution by rotating the first polygon/curve of the given Object, around the Z axis. Use the linear transformation functions to position a surface of revolution in a different orientation.

Example:

    VTailAntn = SURFREV( ctlpt( E3, 0.001, 0.0, 1.0 ) +
                         ctlpt( E3, 0.01,  0.0, 1.0 ) +
                         ctlpt( E3, 0.01,  0.0, 0.8 ) +
                         ctlpt( E3, 0.03,  0.0, 0.7 ) +
                         ctlpt( E3, 0.03,  0.0, 0.3 ) +
                         ctlpt( E3, 0.001, 0.0, 0.0 ) );

constructs a piecewise linear Bspline curve in the XZ plane and uses it to construct a surface of revolution by rotating it around the Z axis. See also SURFPREV, SURFREVAXS, SURFREV2, SURFREVAX2.


SURFREVAXS

 PolygonType SURFREVAXS( PolygonType Object, VectorType Axis )

 or
 
 SurfaceType SURFREVAXS( CurveType Object, VectorType Axis )

Creates a surface of revolution by rotating the first polygon/curve of the given Object, around the Axis axis. Use the linear transformation functions to position a surface of revolution in a different location.

Example:

    Glass = SURFREVAXS( GCross, vector( 1, 0, 1 ) );

Constructs a surface of revolution by rotating GCross around the a axis of (1, 0, 1). See also SURFPREV, SURFREV, SURFREV2, SURFREVAX2.


SURFREV2

 PolygonType SURFREV2( PolygonType Object,
                       NumericType StartAngle,
                       NumericType EndAngle )

 or
 
 SurfaceType SURFREV2( CurveType Object,
                       NumericType StartAngle,
                       NumericType EndAngle )

Creates a surface of revolution by rotating the first polygon/curve of the given Object, around the Z axis. The rotation does not form a complete circle and is from StartAngle to EndAngle only, in degrees, starting from the X axis toward the Y axis, in the XY plane. Use the linear transformation functions to position a surface of revolution in a different orientation.

Example:

    Glass = SURFREV2( GCross, 45, 180 );

Constructs a surface of revolution by rotating it around the Z axis from 45 degrees to 180 degrees. See also SURFPREV, SURFREVAXS, SURFREV, SURFREVAX2.


SURFREVAX2

 PolygonType SURFREVAX2( PolygonType Object,
                         NumericType StartAngle,
                         NumericType EndAngle,
                         VectorType Axis )

 or
 
 SurfaceType SURFREVAX2( CurveType Object,
                         NumericType StartAngle,
                         NumericType EndAngle,
                         VectorType Axis )

Creates a surface of revolution by rotating the first polygon/curve of the given Object, around the Axis axis. The rotation does not form a complete circle and is from StartAngle to EndAngle only, in degrees, starting from the X axis toward the Y axis, in the XY plane. Use the linear transformation functions to position a surface of revolution in a different location.

Example:

    T4 = SURFREVAX2( PolyCross, 90, 360, vector( 1, 0, 1 ) );

Constructs a polygonal surface of revolution by rotating PolygonType PolyCross around the axis (1, 0, 1), from 45 degrees to 180 degrees. See also SURFPREV, SURFREVAXS, SURFREV2, SURFREV.


SVISIBLE

 ListType SVISIBLE( SurfaceType Srf,
                    NumericType Resolution,
                    NumericType ConeSize )

Computes a decomposition of a freeform surface Srf into regions each visible with a cone visibility of ConeSize degrees from one direction. In other words all point in one region have angular deviation of their surface normal of less than ConeSize degrees from the set viewing direction. Resolution controls the accuracy of the computation; the higher this value is, more exact the result. 20 is a good starting value. Each returned region is a trimmed surface that has a "ViewDir" attribute that contains the viewing direction of this region.

Example:

    c1 = cbezier( list( ctlpt( E3, 1.0, 0.0,  0.5 ),
                        ctlpt( E3, 1.1, 0.0,  0.0 ),
                        ctlpt( E3, 1.0, 0.0, -0.5 ) ) );
    Simp = sregion( surfPRev( c1 ), col, 0.0, 1.0 ) * rz( 45 ) * rx( 90 );
    Decomp = SVISIBLE( Simp, 20, 30 * pi / 180 );
    
    SimDecomp = nil();
    Mod = 5;
    for ( i = 1, 1, sizeof( Decomp ),
        o = nth( Decomp, i ):
        v = getattr( o, "ViewDir" ):
        l = ( ctlpt( E3, 0, 0, 0 ) + coerce( v, e3 ) ) * sc( 1.5 ):
        j = floor( ( i - 1 ) / Mod ):
        snoc( list( o, Simp, l, axes )
                    * view_mat * tx( ( i - 1 - j * Mod ) * 2 - 4 )
                               * ty( -j * 2 ),
              SimDecomp ) );

    view( SimDecomp, on );

decomposes a given surface Simp into regions of 30 degrees at most, goes over the decomposed regions and order them five in a row.


SWEEPSRF

 SurfaceType SWEEPSRF( CurveType CrossSection, CurveType Axis,
                     CurveType FrameCrv | VectorType FrameVec | ConstType OFF )

Constructs a generalized cylinder surface. This function sweeps a specified cross-section CrossSection along the provided Axis. By default, when frame specification is OFF, the orientation of the cross section is computed using the Axis curve tangent and normal. However, unlike the Frenet frame, attempt is made to minimize the normal change, as can happen along inflection points in Axis. If a VectorType FrameVec is provided as a frame orientation setting, it is used to fix the binormal direction to this value. In other words, the orientation frame has a fixed binormal. If a CurveType FrameCrv is specified as a frame orientation setting, this vector field curve is evaluated at each placement of the cross-section to yield the needed binormal.

The resulting sweep is only an approximation of the real sweep. The resulting sweep surface will not be exact, in general. Refinement of the axis curve at the proper location, where accuracy is important, should improve the accuracy of the output. The parametric domains of FrameCrv do not have to match the parametric domain of Axis, and its parametric domain is automatically made compatible by this function.

Example:

    Cross = arc( vector( 0.2, 0.0, 0.0 ),
                 vector( 0.2, 0.2, 0.0 ),
                 vector( 0.0, 0.2, 0.0 ) ) +
            arc( vector( 0.0, 0.4, 0.0 ),
                 vector( 0.1, 0.4, 0.0 ),
                 vector( 0.1, 0.5, 0.0 ) ) +
            arc( vector( 0.8, 0.5, 0.0 ),
                 vector( 0.8, 0.3, 0.0 ),
                 vector( 1.0, 0.3, 0.0 ) ) +
            arc( vector( 1.0, 0.1, 0.0 ),
                 vector( 0.9, 0.1, 0.0 ),
                 vector( 0.9, 0.0, 0.0 ) ) +
            ctlpt( E2, 0.2, 0.0 );
    Axis = arc( vector( -1.0, 0.0, 0.0 ),
                vector(  0.0, 0.0, 0.1 ),
                vector(  1.0, 0.0, 0.0 ) );
    Axis = crefine( Axis, FALSE, list( 0.25, 0.5, 0.75 ) );
    Srf1 = SWEEPSRF( Cross, Axis, OFF );
    Srf2 = SWEEPSRF( Cross, Axis, vector( 0.0, 1.0, 1.0 ) );
    Srf3 = SWEEPSRF( Cross, Axis,
                     cbezier( list( ctlpt( E3,  1.0, 0.0, 0.0 ),
                                    ctlpt( E3,  0.0, 1.0, 0.0 ),
                                    ctlpt( E3, -1.0, 0.0, 0.0 ) ) ) );

constructs a rounded rectangle cross-section and sweeps it along an arc, while orienting it several ways. The axis curve Axis is manually refined to better approximate the requested shape.

See also SWPSCLSRF for sweep with scale.


SWPSCLSRF

 SurfaceType SWPSCLSRF( CurveType CrossSection, CurveType Axis,
                        NumericType Scale | CurveType ScaleCrv,
                        CurveType FrameCrv | VectorType FrameVec
                                                          | ConstType OFF,
                        NumericType ScaleRefine )

Constructs a generalized cylinder surface. This function sweeps a specified cross-section CrossSection along the provided Axis. The cross-section may be scaled by a constant value Scale, or scaled along the Axis parametric direction via a scaling curve ScaleCrv. By default, when frame specification is OFF, the orientation of the cross section is computed using the Axis curve tangent and normal. However, unlike the Frenet frame, attempt is made to minimize the normal change, as can happen along inflection points in Axis. If a VectorType FrameVec is provided as a frame orientation setting, it is used to fix the binormal direction to this value. In other words, the orientation frame has a fixed binormal. If a CurveType FrameCrv is specified as a frame orientation setting, this vector field curve is evaluated at each placement of the cross-section to yield the needed binormal. ScaleRefine is an integer value to define possible refinement of the Axis to reflect the information in ScalingCrv. Value of zero will force no refinement while value of n > 0 will insert n times the number of control points in ScaleCrv into Axis, better emulating the scaling requested. The resulting sweep is only an approximation of the real sweep. The scaling and axis placement will not be exact, in general. Manual refinement (in addition to ScaleRefine) of the axis curve at the proper location, where accuracy is important, should improve the accuracy of the output. The parametric domains of ScaleCrv and FrameCrv do not have to match the parametric domain of Axis, and their domains are made compatible by this function.

Example:

    Cross = arc( vector( -0.11, -0.1,  0.0 ),
                 vector( -0.1,  -0.1,  0.0 ),
                 vector( -0.1,  -0.11, 0.0 ) ) +
            arc( vector(  0.1,  -0.11, 0.0 ),
                 vector(  0.1,  -0.1,  0.0 ),
                 vector(  0.11, -0.1,  0.0 ) ) +
            arc( vector(  0.11,  0.1,  0.0 ),
                 vector(  0.1,   0.1,  0.0 ),
                 vector(  0.1,   0.11, 0.0 ) ) +
            arc( vector( -0.1,   0.11, 0.0 ),
                 vector( -0.1,   0.1,  0.0 ),
                 vector( -0.11,  0.1,  0.0 ) ) +
            ctlpt( E2, -0.11, -0.1 );
    scaleCrv = cbspline( 3,
                         list( ctlpt( E2, 0.05, 1.0 ),
                               ctlpt( E2, 0.1,  0.0 ),
                               ctlpt( E2, 0.2,  2.0 ),
                               ctlpt( E2, 0.3,  0.0 ),
                               ctlpt( E2, 0.4,  2.0 ),
                               ctlpt( E2, 0.5,  0.0 ),
                               ctlpt( E2, 0.6,  2.0 ),
                               ctlpt( E2, 0.7,  0.0 ),
                               ctlpt( E2, 0.8,  2.0 ),
                               ctlpt( E2, 0.85, 1.0 ) ),
                         list( KV_OPEN ) );
    Axis = circle( vector( 0, 0, 0 ), 1 );
    Frame = circle( vector( 0, 0, 0 ), 1 )
            * rotx( 90 ) * trans( vector( 1.5, 0.0, 0.0 ) );

    Srf1 = SWPSCLSRF( Cross, Axis, scaleCrv, off, 0 );
    Srf2 = SWPSCLSRF( Cross, Axis, scaleCrv, off, 2 );
    Srf3 = SWPSCLSRF( Cross, Axis, 1.0, Frame, 0 );

constructs a rounded rectangle cross-section and sweeps it along a circle, while scaling and orienting in several ways. The axis curve Axis is automatically refined in Srf2 to better approximate the requested scaling.

See also SWEEPSRF for sweep with no scale.


SWUNGASUM

 SurfaceType SWUNGASUM( CurveType Crv1, CurveType Crv2 )

Given two curves, compute a swung surface that equal:

                       S(r, t) = (x1(r) x2(t), x1(r) y2(t), y1(r))




Example:

 circ = circle( vector( 0.0, 0.0, 0.0 ), 1.5 ) * ry( 90 );
 arc1 = arc( vector( 0.0, 1.0, 0.0 ),
             vector( 0.0, 0.0, 0.0 ),
             vector( 1.0, 0.0, 0.0 ) );
 as1 = SWUNGASUM( circ * ry( -90 ), arc1 );

 arc1 = cregion( circle( vector( 0.0, 0.0, 0.0 ), 1.5 ), 0, 2 ) * rz( 90 );
 c2 = coerce( cbspline( 3,
                        list( ctlpt( E2,  1.0,  0.0 ),
                              ctlpt( E2,  0.2,  0.2 ),
                              ctlpt( E2,  0.0,  1.0 ),
                              ctlpt( E2, -0.2,  0.2 ),
                              ctlpt( E2, -1.0,  0.0 ),
                              ctlpt( E2, -0.2, -0.2 ),
                              ctlpt( E2,  0.0, -1.0 ),
                              ctlpt( E2,  0.2, -0.2 ) ),
                        list( KV_PERIODIC ) ),
              KV_OPEN );
 as2 = SWUNGASUM( arc1, c2 );

Creates two algebraic sum surfaces, one in the shape of a cylinder as a sum of a line and a circle and one circular sweep like.


SYMBCPROD

 CurveType SYMBCPROD( CurveType Crv1, CurveType Crv2 )

 or

 SurfaceType SYMBCPROD( SurfaceType Srf1, SurfaceType Srf2 )

 or

 MultivarType SYMBCPROD( MultivarType MV1, MultivarType MV2 )

Computes the symbolic cross product of the given two curves/surfaces/multivariates as a curve, surface or multivariate.

Example:

 NrmlSrf = SYMBCPROD( sderive( Srf, ROW ), sderive( Srf, COL ) )

computes a normal surface as the cross product of the surface two partial derivatives (see SNRMLSRF).


SYMBDIFF

 CurveType SYMBDIFF( CurveType Crv1, CurveType Crv2 )

 or

 SurfaceType SYMBDIFF( SurfaceType Srf1, SurfaceType Srf2 )

 or

 MultivarType SYMBDIFF( MultivarType MV1, MultivarType MV2 )

Computes the symbolic difference of the given two curves/surfaces/multivariates as a curve, surface or multivariate. The difference is computed coordinate-wise.

Example:

 DiffCrv = SYMBDIFF( Crv1, Crv2 )
 DistSqrCrv = symbdprod( DiffCrv, DiffCrv )


SYMBDPROD

 CurveType SYMBDPROD( CurveType Crv1, CurveType Crv2 )

 or

 SurfaceType SYMBDPROD( SurfaceType Srf1, SurfaceType Srf2 )

 or

 MultivarType SYMBDPROD( MultivarType MV1, MultivarType MV2 )

Computes the symbolic dot (inner) product of the given two curves/surfaces/multivariates as a scalar curve/surface/multivariate.

Example:

 DiffCrv = symbdiff( Crv1, Crv2 )
 DistSqrCrv = SYMBDPROD( DiffCrv, DiffCrv )

Computes a scalar curve that at parameter t is equal to the distance square between Crv1 at t and Crv2.


SYMBIPROD

 NumericType SYMBIPROD( CurveType Crv, NumericType Order1, NumericType Order2 )

 or

 NumericType SYMBIPROD( NumericType Dummy, NumericType Idx1, NumericType Idx2 )

Computes the inner product of two Bspline basis functions. The first form defines the function space to be the same sa the function space of Crv of order Order1 (first basis function) by Order2 (second basis function in the inner product that is defined as,
     _
    |
    | Bi,o1(t) Bj,o2(t) dt.
    |
   -


The second form prescribes the indices of the two basis functions, i and j. The first form returns zero in case of an error. The second form returns the result of the inner product.

Example:

    SYMBIPROD( Crv = pcircle( vector( 0, 0, 0 ), 1 ), 4, 4 );
    for ( i = 0, 1, nth( ffmsize( Crv ), 1 ) - 1,
        for ( j = 0, 1, nth( ffmsize( Crv ), 1 ) - 2,
            printf( "%3.3f ", list( SYMBIPROD( 0, i, j ) ) ) ):
        printf( "\n", nil() ) );

Prints all possible inner products of the Bspline function space of pcircle, of cubics vs. cubics.


SYMBPROD

 CurveType SYMBPROD( CurveType Crv1, CurveType Crv2 )

 or

 SurfaceType SYMBPROD( SurfaceType Srf1, SurfaceType Srf2 )

 or

 MultivarType SYMBPROD( MultivarType MV1, MultivarType MV2 )

Computes the symbolic product of the given two curves/surfaces/multivariates as a curve, surface or multivariate. The product is computed coordinate-wise.

Example:

 ProdSrf = SYMBPROD( Srf1, Srf2 )


SYMBSUM

 CurveType SYMBSUM( CurveType Crv1, CurveType Crv2 )

 or

 SurfaceType SYMBSUM( SurfaceType Srf1, SurfaceType Srf2 )

 or

 MultivarType SYMBSUM( MultivarType MV1, MultivarType MV2 )

Computes the symbolic sum of the given two curves/surfaces/multivariates as a curve, surface or multivariate. The sum is computed coordinate-wise.

Example:

 SumCrv = SYMBSUM( Crv1, Crv2 )


TBEZIER

 TrivarType TBEZIER( ListType CtlMesh )

Creates a Bezier trivariate using the provided control mesh. CtlMesh is a list of planes, each of which is a list of rows, each of which is a list of control points. All control points must be of type (E1-E9, P1-P9), or regular PointType defining the trivariate's control mesh. Surface's point type will be of a space which is the union of the spaces of all points.

Example:

   TV = TBEZIER( list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
                                   ctlpt( E3, 0.2, 0.5, 1.1 ),
                                   ctlpt( E3, 0.3, 0.1, 2.2 ) ),
                             list( ctlpt( E3, 0.4, 1.3, 0.5 ),
                                   ctlpt( E3, 0.5, 1.7, 1.7 ),
                                   ctlpt( E3, 0.6, 1.3, 2.9 ) ),
                             list( ctlpt( E3, 0.7, 2.4, 0.5 ),
                                   ctlpt( E3, 0.8, 2.6, 1.4 ),
                                   ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
                       list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
                                   ctlpt( E3, 1.3, 0.2, 1.7 ),
                                   ctlpt( E3, 1.5, 0.3, 2.9 ) ),
                             list( ctlpt( E3, 1.7, 1.2, 0.0 ),
                                   ctlpt( E3, 1.9, 1.4, 1.2 ),
                                   ctlpt( E3, 1.2, 1.6, 2.4 ) ),
                             list( ctlpt( E3, 1.4, 2.3, 0.9 ),
                                   ctlpt( E3, 1.6, 2.5, 1.7 ),
                                   ctlpt( E3, 1.8, 2.7, 2.5 ) ) ) ) );

creats a trivariate Bezier which is linear in the first direction, and quadratic in the second and third.


TBSPLINE

 TrivarType TBSPLINE( NumericType UOrder,
                      NumericType VOrder,
                      NumericType WOrder,
                      ListType CtlMesh,
                      ListType KnotVectors )

Creates a Bspline trivariate with the provided UOrder, VOrder and WOrder orders, the control mesh CtlMesh, and the three knot vectors in KnotVectors. CtlMesh is a list of planes, each of which is a list of rows, each of which is a list of control points. All control points must be of point type (E1-E9, P1-P9), or regular PointType defining the trivariate's control mesh. Trivariate's point type will be of a space which is the union of the spaces of all points. KnotVectors is a list of three knot vectors. Each knot vector is a list of NumericType knots of length #CtlPtList plus the Order. If, however, the length of the knot vector is equal to #CtlPtList + Order + Order - 1} the curve is assumed periodic. The knot vector may also be a list of a single constant KV_OPEN or KV_FLOAT or KV_PERIODIC, in which a uniform knot vector with the appropriate length and with open, floating or periodic end condition will be constructed automatically.

Example:

   TV = TBSPLINE( 2, 2, 2,
                  list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
                                    ctlpt( E3, 0.2, 0.5, 1.1 ),
                                    ctlpt( E3, 0.3, 0.1, 2.2 ) ),
                              list( ctlpt( E3, 0.4, 1.3, 0.5 ),
                                    ctlpt( E3, 0.5, 1.7, 1.7 ),
                                    ctlpt( E3, 0.6, 1.3, 2.9 ) ),
                              list( ctlpt( E3, 0.7, 2.4, 0.5 ),
                                    ctlpt( E3, 0.8, 2.6, 1.4 ),
                                    ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
                        list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
                                    ctlpt( E3, 1.3, 0.2, 1.7 ),
                                    ctlpt( E3, 1.5, 0.3, 2.9 ) ),
                              list( ctlpt( E3, 1.7, 1.2, 0.0 ),
                                    ctlpt( E3, 1.9, 1.4, 1.2 ),
                                    ctlpt( E3, 1.2, 1.6, 2.4 ) ),
                              list( ctlpt( E3, 1.4, 2.3, 0.9 ),
                                    ctlpt( E3, 1.6, 2.5, 1.7 ),
                                    ctlpt( E3, 1.8, 2.7, 2.5 ) ) ) ),
                  list( list( KV_OPEN ),
                        list( KV_OPEN ),
                        list( KV_OPEN ) ) );

constructs a trilinear Bspline trivariate with open end conditions. TCRVTR


TCRVTR

 AnyType TCRVTR( TrivarType TV, PointType Pos, NumericType ComputeWhat )

Compute differential curvature properties of an isosurface of the given trivariate TV at the given (parameteric) location Pos. Following the value of ComputeWhat, the result equals,
-1 Initialization (a must prelude)
0 Conclusion (a must postlude)
1 Returns a vector hold the gradient
2 Returns a list of three vectors
equal to the Hessian of this location
3 Returns a list of two scalar values
(Principal curvatures) and two vectors
(Principal directions).


Every evaluation must start with an invokation with ComputeWhat equal -1 and terminates with ComputeWhat 0. In both cases, 1 is return in case of success.

Example:

 TCRVTR( TV, point( 0, 0, 0 ), -1 ); # Prelude
 Grad1 = TCRVTR( TV, point( 0, 0, 0 ),  1 );
 Grad2 = TCRVTR( TV, point( 0, 0, 1 ),  1 );
 Grad3 = TCRVTR( TV, point( 0, 1, 0 ),  1 );
 Grad4 = TCRVTR( TV, point( 1, 0, 0 ),  1 );
 TCRVTR( TV, point( 0, 0, 0 ), 0 ); #Postlude


TDERIVE

 TrivarType TDERIVE( TrivarType TV, NumericType Dir )

Returns a vector field trivariate representing the differentiated trivariate in the given direction (ROW, COL, or DEPTH). Evaluation of the returned trivariate at a given parameter value will return a vector representing the partial derivative of TV in Dir at that parameter value.

 TV = tbezier( list( list( list( ctlpt( E1, 0.1 ),
                                 ctlpt( E1, 0.2 ) ),
                           list( ctlpt( E1, 0.3 ),
                                 ctlpt( E1, 0.4 ) ) ),
                     list( list( ctlpt( E1, 2.4 ),
                                 ctlpt( E1, 2.2 ) ),
                           list( ctlpt( E1, 2.3 ),
                                 ctlpt( E1, 2.1 ) ) ) ) );

 DuTV = TDERIVE( TV, ROW );
 DvTV = TDERIVE( TV, COL );
 DwTV = TDERIVE( TV, DEPTH );

computes the gradiate of a scalar trivariate field, by computing its partials with respect to u, v, and w. See also CDERIVE, SDERIVE, and MDERIVE.


TDIVIDE

 TrivarType TDIVIDE( TrivarType TV, ConstantType Direction,
                                                          NumericType Param )

Subdivides a trivariate into two at the specified parameter value Param in the specified Direction (ROW, COL, or DEPTH). TV can be either a Bspline trivariate in which Param must be conatined in the parametric domain of the trivariate, or a Bezier trivariate in which Param must be in the range of zero to one.

It returns a list of the two sub-trivariates. The individual trivariates may be extracted from the list using the NTH command.

Example:

    TvDiv = TDIVIDE( Tv2, depth, 0.3 );
    Tv2a = nth( TvDiv, 1 ) * tx( -2.2 );
    Tv2b = nth( TvDiv, 2 ) * tx( 2.0 );

subdivides Tv2 at the parameter value of 0.3 in the DEPTH direction, See also CDIVIDE, SDIVIDE, and MDIVIDE


TEDITPT

 TrivarType TEDITPT( TrivarType TV, CtlPtType CPt, NumericType UIndex,
                                                   NumericType VIndex )
                                                   NumericType WIndex )

Provides a simple mechanism to manually modify a single control point number UIndex, VIndex and WIndex (base count is 0) in the control mesh of Srf by substituting CtlPt instead. CtlPt must have the same point type as the control points of Srf. Original surface Srf is not modified.

Example:

    CPt = ctlpt( E3, 1, 2, 3 );
    NewTV = TEDITPT( TV, CPt, 0, 0, 0 );

Constructs a NewTV with the first control point of TV being CPt.


TEVAL

 CtlPtType TEVAL( TrivarType TV,
                  NumericType UParam,
                  NumericType VParam,
                  NumericType WParam )

Evaluates the provided trivariate TV at the given UParam, VParam and WParam values. UParam, VParam, WParam must be contained in the surface parametric domain if TV is a Bspline trivariate, or between zero and one if TV is a Bezier trivariate. The returned control point has the same type as the control points of TV.

Example:

    CPt = TEVAL( TV1, 0.25, 0.22, 0.7 );

evaluates TV at the parameter values of (0.25, 0.22, 0.7). See also CEVAL, SEVAL, MEVAL.


TEXTGEOM

 AnyType TEXTGEOM( StringType Str, VectorType Spacing, NumericType Scaling )

Creates a displayable geometry that represents the text in Str, with Spacing space between individual characters. Each character is scaled by Scaling where scaling of one generates a close to a unit size character.

Example:

    a = TEXTGEOM("Text", vector( 0.12, 0, 0 ), 0.1 );
    b = TEXTGEOM("IRIT", vector( 0, -0.12, 0 ), 0.1 );

Creates an horizontal Text and a vertical top to bottom IRIT, both as geometrical objects.


TFROMSRFS

 TrivarType TFROMSRFS( ListType SrfList, NumericType OtherOrder )

Constructs a trivariate by substituting the surfaces in SrfList as planes in a control mesh of a trivariate. Surfaces in SrfList are made compatible by promoting Bezier surfaces to Bsplines if necessary, and raising degree and refining as required before substituting the control meshes of the surfaces as planes in the mesh of the trivariate. The other, third, direction order is set by OtherOrder, which cannot be larger than the number of surfaces.

The trivariate interpolates the first and last surfaces only.

Example:

    s1 = sbezier( list( list( ctlpt( E3, -0.5, -0.5, 0 ),
                              ctlpt( E3, -0.5,  0.5, 0 ) ),
                        list( ctlpt( E3,  0.5, -0.5, 0 ),
                              ctlpt( E3,  0.5,  0.5, 0 ) ) ) ) * sc( 0.3 );
    Srfs = list( s1 * sc( 2.0 ),
                 s1 * sx( 1.4 ) * ry( 45 ) * tz( 1.0 ),
                 s1 * ry( 90 ) * trans( vector( 1.0, 0.0, 1.1 ) ),
                 s1 * sx( 1.4 ) * ry( 135 ) * trans( vector( 2.0, 0.0, 1.0 ) ),
                 s1 * sc( 2.0 ) * ry( 180 ) * trans( vector( 2.0, 0.0, 0.0 ) ) );
    color( Srfs, red );

    ts = tfromsrfs( Srfs, 3 );
    color( ts, green );
    view( list( Srfs, ts ), on );

Constructs a trivariate from five planar surfaces and display both the trivariate and the five planar surfaces, in different colors.

See also EXTRUDE, RULEDTV.


TINTERP

 TrivarType TINTERP( TrivarType TV,
                 NumericType ULength, NumericType VLength, NumericType Length,
                 NumericType UOrder, NumericType VOrder, NumericType WOrder );

Given a trivariate data structure, computes a fitted trivariate in the prescribed function space (i.e. U/V/WLength and U/V/WOrder) that interpolates the given trivariate, TV, at the node parameter values. If U/V/WOrder are zero, the respective order is taken for TV. If U/V/WLength are zero, the respective length is taken for TV.

Example:

     tv = tbspline( 3, 3, 2,
                    list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
                                      ctlpt( E3, 0.2, 0.5, 1.1 ),
                                      ctlpt( E3, 0.3, 0.1, 2.2 ) ),
                                list( ctlpt( E3, 0.4, 1.3, 0.5 ),
                                      ctlpt( E3, 0.5, 1.7, 1.7 ),
                                      ctlpt( E3, 0.6, 1.3, 2.9 ) ),
                                list( ctlpt( E3, 0.7, 2.4, 0.5 ),
                                      ctlpt( E3, 0.8, 2.6, 1.4 ),
                                      ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
                          list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
                                      ctlpt( E3, 1.3, 0.2, 1.7 ),
                                      ctlpt( E3, 1.5, 0.3, 2.9 ) ),
                                list( ctlpt( E3, 1.7, 1.2, 0.0 ),
                                      ctlpt( E3, 1.9, 1.4, 1.2 ),
                                      ctlpt( E3, 1.2, 1.6, 2.4 ) ),
                                list( ctlpt( E3, 1.4, 2.3, 0.9 ),
                                      ctlpt( E3, 1.6, 2.5, 1.7 ),
                                      ctlpt( E3, 1.8, 2.7, 2.5 ) ) ),
                          list( list( ctlpt( E3, 2.8, 0.1, 0.4 ),
                                      ctlpt( E3, 2.6, 0.7, 1.3 ),
                                      ctlpt( E3, 2.4, 0.2, 2.2 ) ),
                                list( ctlpt( E3, 2.2, 1.1, 0.4 ),
                                      ctlpt( E3, 2.9, 1.2, 1.5 ),
                                      ctlpt( E3, 2.7, 1.3, 2.6 ) ),
                                list( ctlpt( E3, 2.5, 2.9, 0.7 ),
                                      ctlpt( E3, 2.3, 2.8, 1.7 ),
                                      ctlpt( E3, 2.1, 2.7, 2.7 ) ) ) ),
                    list( list( KV_OPEN ),
                          list( KV_OPEN ),
                          list( KV_OPEN ) ) );
    tvi = TINTERP( tv, 0, 0, 0, 0, 0, 0 );

creates a quadratic by quaratic by linear trivariate tvi that interpolates the control points of tv at the node parameter values.


TMORPH

 TrivarType TMORPH( TrivarType TV1, SurfaceType TV2, NumericType Blend )

Creates a new trivariate which is a convex blend of the two given trivariates. The two given trivariates must be compatible (see FFCOMPAT) before this blend is invoked. Very useful if a sequence that "morphs" one trivariate to another is to be created and in combination of MRCHCUBE.

Example:

    Size = 0.05;
    for ( i = 0, step, 1.0,
        Tv = TMORPH( Tv1, Tv2, i ):
        view( mrchcube( list( Tv, 1, off ),
                        point( Size, Size, Size ), 1, IsoVal ), on ) );

creates a sequence of 1/step trivariates, morphed from Tv1 to Tv2 and displays an extracted iso surface at level IsoVal. See also MRCHCUBE, PMORPH, CMORPH and SMORPH.


TORUS

 PolygonType TORUS( VectorType Center, VectorType Normal,
                    NumericType MRadius, NumericType mRadius )

Creates a TORUS geometric object, defined by Center as the center of the TORUS, Normal as the normal to the main plane of the TORUS, MRadius and mRadius as the major and minor radii of the TORUS. See RESOLUTION for the accuracy of the TORUS approximation as a polygonal model. See IRITSTATE's "PrimRatSrfs" and "PrimRatSrfs" state variables.

Example:

    T = TORUS( vector( 0.0, 0.0, 0.0), vector( 0.0, 0.0, 1.0), 0.5, 0.2 );

constructs a torus with major plane as the XY plane, major radius of 0.5, and minor radius of 0.2.


TRAISE

 TrivarType TRAISE( TrivarType TV, ConstantType Direction,
                      NumericType NewOrder )

Raise TV to the specified NewOrder in the specified Direction.

Example:

    tv1r = TRAISE( traise( traise( tv1, row, 4 ), col, 4 ), depth, 4 );

ensures that the trivariate is a tricubic. See also MRAISE, SRAISE, and CRAISE.


TREFINE

 TrivarType TREFINE( TrivarType TV, ConstantType Direction,
                     NumericType Replace, ListType KnotList )

Provides the ability to Replace a knot vector of TV or refine it in the specified direction Direction (ROW, COL, or DEPTH). KnotList is a list of knots to refine TV at. All knots should be contained in the parametric domain of TV in Direction. If the knot vector is replaced, the length of KnotList should be identical to the length of the original knot vector of TV in Direction. If TV is a Bezier trivariate, it is automatically promoted to be a Bspline trivariate.

Example:

    TV = TREFINE( TREFINE( TREFINE( TV,
                                    ROW, FALSE, list( 0.333, 0.667 ) ),
                           COL, FALSE, list( 0.333, 0.667 ) ),
                  DEPTH, FALSE, list( 0.333, 0.667 ) );

refines TV in all directions by adding two more knots at 0.333 and 0.667. See also CREFINE, SREFINE, and MREFINE.


TREGION

 TrivarType TREGION( TrivarType TV, ConstantType Direction,
                     NumericType MinParam, NumericType MaxParam )

Extracts a region of TV between MinParam and MaxParam in the specified Direction. Both MinParam and MaxParam should be contained in the parametric domain of TV in Direction.

Example:

    Tv1 = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
                                     ctlpt( E3, 0.2, 0.1, 2.4 ) ),
                               list( ctlpt( E3, 0.3, 2.2, 0.2 ),
                                     ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
                         list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
                                     ctlpt( E3, 2.2, 0.7, 2.3 ) ),
                               list( ctlpt( E3, 2.3, 2.6, 0.5 ),
                                     ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );

    Tv1r1 = TREGION( Tv1, row, 0.1, 0.2 );
    Tv1r2 = TREGION( Tv1, row, 0.4, 0.6 );
    Tv1r3 = TREGION( Tv1, row, 0.99, 1.0 );

extracts three regions of Tv1 along the ROW direction. See also CREGION, SREGION, and MREGION.


TREPARAM

 TrivarType TREPARAM( TrivarType TV, ConstantType Direction,
                      NumericType MinParam, NumericType MaxParam )

Reparametrize TV over a new domain from MinParam to MaxParam, in the prescribed Direction. This operation does not affect the geometry of the trivariate and only affine transforms its knot vectors. A Bezier trivariate will automatically be promoted into a Bspline surface by this function.

Example:

    Tv = TREPARAM( TREPARAM( TREPARAM( tv, row, 0, 1 ),
                             col, 0, 1 ),
                   depth, 0, 1 );

Ensures that the trivariate is defined over the unit size parametric cube. See also CREPARAM, SREPARAM, and MREPARAM.


TRIANGL

 PolygonType TRIANGL( PolygonType Model, NumericType Regular ) 

Converts Model into a new model with exactly the same shape that holds only triangles. If Regular is not zero, the object is regularized as well. Example:

    final2 = triangl( final, false ); 


TRIMSRF

 TrimSrfType TRIMSRF( SurfaceType Srf,
                      CurveType TrimCrv,
                      NumericType HasUpperLevel )
 
 or
 
 TrimSrfType TRIMSRF( SurfaceType Srf,
                      ListType TrimCrvs,
                      NumericType HasUpperLevel )

Creates a trimmed surface from the provided surface Srf and the trimming curve TrimCrv or curves TrimCrvs. If HasUpperLevel is FALSE, an additional trimming curve is automatically being added that contains the entire parametric domain of Srf. No validity test is performed on the trimming curves which are assumed two dimensional curves contained in the parametric domain of Srf.

Example:

    spts = list( list( ctlpt( E3, 0.1, 0.0, 1.0 ),
                       ctlpt( E3, 0.3, 1.0, 0.0 ),
                       ctlpt( E3, 0.0, 2.0, 1.0 ) ),
                 list( ctlpt( E3, 1.1, 0.0, 0.0 ),
                       ctlpt( E3, 1.3, 1.5, 2.0 ),
                       ctlpt( E3, 1.0, 2.1, 0.0 ) ),
                 list( ctlpt( E3, 2.1, 0.0, 2.0 ),
                       ctlpt( E3, 2.3, 1.0, 0.0 ),
                       ctlpt( E3, 2.0, 2.0, 2.0 ) ),
                 list( ctlpt( E3, 3.1, 0.0, 0.0 ),
                       ctlpt( E3, 3.3, 1.5, 2.0 ),
                       ctlpt( E3, 3.0, 2.1, 0.0 ) ),
                 list( ctlpt( E3, 4.1, 0.0, 1.0 ),
                       ctlpt( E3, 4.3, 1.0, 0.0 ),
                       ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
    sb = sbspline( 3, 3, spts, list( list( KV_OPEN ), list( KV_OPEN ) ) );
    
    TCrv1 = cbspline( 2,
                      list( ctlpt( E2, 0.3, 0.3 ),
                            ctlpt( E2, 0.7, 0.3 ),
                            ctlpt( E2, 0.7, 0.7 ),
                            ctlpt( E2, 0.3, 0.7 ),
                            ctlpt( E2, 0.3, 0.3 ) ),
                      list( KV_OPEN ) );
    TCrv2 = circle( vector( 0.5, 0.5, 0.0 ), 0.25 );
    TCrv3 = cbspline( 3,
                      list( ctlpt( E2, 0.3, 0.3 ),
                            ctlpt( E2, 0.7, 0.3 ),
                            ctlpt( E2, 0.7, 0.7 ),
                            ctlpt( E2, 0.3, 0.7 ) ),
                      list( KV_PERIODIC ) );
    
    TSrf1 = TRIMSRF( sb, TCrv1, false );
    TSrf2 = TRIMSRF( sb, TCrv1, true );
    TSrf3 = TRIMSRF( sb, list( TCrv1, TcRv2 * ty( 1 ), TCrv3 * ty( 2 ) ),
                     false );

constructs three trimmed surfaces. Tsrf1 contains the outer boundary and excludes what is inside TCrv1, TSrf2 contains only the domain inside TCrv1. TCrv3 has three holes corresponds to the three trimming curves. See also TRMSRFS.


TRMSRFS

 TrimSrfType TRMSRFS( SurfaceType Srf, CurveType Cntrs )
 
 or
 
 TrimSrfType TRMSRFS( SurfaceType Srf, PolyType Cntrs )
 
 or
 
 TrimSrfType TRMSRFS( SurfaceType Srf, ListType Cntrs )

Creates a set of trimmed surfaces from the provided surface Srf and the set of contours Cntrs in Srf's parametric domain.

The contours in Cntrs can be either polylines, curves, or list of such entities. The contours in Cntrs must be either closed or start and end on the boundary of the parametric domain of Srf. Further, these contours must be (self) intersection free.

The returned result is a (list of) trimmed surfaces, each defines one sub-regions that results from Cntrs's trimming.

Example:

    tsrfs = TRMSRFS( srf,
                     list( poly( list( point( 0.0, 0.2, 0.0 ),
                                       point( 1.0, 0.5, 0.0 ) ), true ),
                           cbezier( list( ctlpt( E2, 0.0, 2.5 ),
                                          ctlpt( E2, 0.5, 2.5 ),
                                          ctlpt( E2, 0.5, 3.0 ) ) ) ) );
    interact( list( nth( tsrfs, 1 ) * tz( -0.2 ),
                    nth( tsrfs, 2 ) * tz(  0.0 ),
                    nth( tsrfs, 3 ) * tz(  0.2 ) ) );

constructs trimmed surfaces using two contours. One contour is a polyline with two points, and the other is a quadratic Bezier curve. See also TRIMSRF.


TSBEZIER

 SurfaceType TSBEZIER( NumericType Order, ListType CtlMesh )

Creates a triangular Bezier surface of order Order using the provided control mesh. CtlMesh is a list of control points of size (Order + 1) * Order / 2. All control points must be of type (E1-E9, P1-P9), or regular PointType defining the surface's control polygon. Surface's point type will be of a space which is the union of the spaces of all points.

Example:

    b = TSBEZIER( 3,
                  list( ctlpt( E3, 0.0,  0.0,  0.4 ),
                        ctlpt( E3, 0.3,  0.0,  0.3 ),
                        ctlpt( E3, 0.7,  0.0,  0.8 ),
     
                        ctlpt( E3, 0.2,  0.4,  1.0 ),
                        ctlpt( E3, 0.4,  0.5,  1.0 ),
     
                        ctlpt( E3, 0.5,  1.0,  0.7 ) ) );

See also TSGREGORY and TSBSPLINE.


TSBSPLINE

 TriSrfType TSBSPLINE( NumericType Order, NumericType Length,
                       ListType CtlMesh, ListType KnotVector )

Creates a Bspline surface from the provided Order and Length, the control mesh CtlMesh, and the knot vector KnotVector. CtlMesh is a list of control points of size (Length + 1) * Length / 2. All control points must be of point type (E1-E9, P1-P9), or regular PointType defining the surface's control mesh. Surface's point type will be of a space which is the union of the spaces of all points. KnotVector is a list of NumericType knots of length Length plus the Order. The knot vector may also be a list of a single constant KV_OPEN or KV_FLOAT, in which a uniform knot vector with the appropriate length and with open or floating end condition will be constructed automatically.

Not fully supported at this time. See also TSBEZIER and TSGREGORY.


TSDERIVE

 TriSrfType TSDERIVE( TriSrfType Srf, NumericType Dir )

Returns a vector field surface representing the differentiated triangular surface in the given direction (ROW, COL, or DEPTH). Evaluation of the returned surface at a given parameter value will return a vector tangent to Srf in Dir at that parameter value.

 DuSrf = TSDERIVE( Srf, ROW );
 DvSrf = TSDERIVE( Srf, COL );
 Normal = coerce( tseval( DuSrf, 0.5, 0.25, 0.25 ), VECTOR_TYPE ) ^
          coerce( tseval( DvSrf, 0.5, 0.25, 0.25 ), VECTOR_TYPE );

computes two partial derivatives of the surface Srf and computes its normal as their cross product, at the parametric location (0.5, 0.25, 0.25).

See also TSNORMAL


TSEVAL

 CtlPtType TSEVAL( TriSrfType Srf,
                   NumericType UParam, NumericType VParam, NumericType WParam )

Evaluates the provided triangulae surface Srf at the given UParam, VParam, WParam parameters. UParam, VParam, and WParam must all be non negative and must sum to one for a Bezier triangular surface or to the maximum domain, if Bspline surface.

Example:

    CPt = TSEVAL( Srf, u, v, 1.0 - u - v );

Evaluates Srf at the parameter values prescribed by u and v.


TSGREGORY

 SurfaceType TSGREGORY( NumericType Order, ListType CtlMesh )

Creates a triangular Gregory surface of order Order using the provided control mesh. CtlMesh is a list of control points of size (Order + 1) * Order / 2 + 3. All control points must be of type (E1-E9, P1-P9), or regular PointType defining the surface's control polygon. Surface's point type will be of a space which is the union of the spaces of all points.

Example:

    Srf = tsgregory( 5,
        list( ctlpt( E3, 2, -1, 0 ),
              ctlpt( E3, 2.3, -1, 0.25 ),
              ctlpt( E3, 2.6, -1, 0.25 ),
              ctlpt( E3, 2.8, -1, 0.13 ),
              ctlpt( E3, 3, -1, 0 ),
              ctlpt( E3, 2.25, -0.7, 0.25 ),
              ctlpt( E3, 2.5, -0.7, -0.25 ),
              ctlpt( E3, 2.6, -0.7, -0.15 ),
              ctlpt( E3, 2.75, -0.7, 0.25 ),
              ctlpt( E3, 2.4, -0.4, 0.25 ),
              ctlpt( E3, 2.5, -0.4, 0 ),
              ctlpt( E3, 2.6, -0.4, -0.25 ),
              ctlpt( E3, 2.45, -0.2, 0.12 ),
              ctlpt( E3, 2.55, -0.2, -0.12 ),
              ctlpt( E3, 2.5, 0, 0 ),
              ctlpt( E3, 2.5, -0.7, -0.25 ),
              ctlpt( E3, 2.6, -0.7, -0.15 ),
              ctlpt( E3, 2.5, -0.4, 0 ) ) );

Not fully supported at this time. See also TSBEZIER and TSBSPLINE.


TSNORMAL

 VectorType TSNORMAL( TriSrfType Srf,
                      NumericType UParam, NumericType VParam, NumericType WParam)

Computes the normal vector to a triangular surface Srf at the parameter values UParam, VParam, WParam. The returned vector has a unit length.

UParam, VParam, and WParam must all be non negative and must sum to one for a Bezier triangular surface or to the maximum domain, if Bspline surface.

Example:

    Normal = TSNORMAL( Srf, 0.5, 0.5, 0.0 );

computes the normal to Srf at the parameter values (0.5, 0.5, 0.0).


TVLOAD

 TrivarType TVLOAD( StringType FileName,
                    NumericType DataType,
                    VectorType VolSize,
                    VectorType Orders )

Loads a volumetric data set from file FileName in as a trivariate of orders Orders. DataType can be one of:
1 Regular ascii (separated by while spaces).
2 Two bytes short integer.
3 Four bytes long integer.
4 One byte (char) integer.
5 Four bytes float.
6 Eight bytes double.
Beware of the little vs big Endian problem! We assume here you read in the volume in the same machine type this file was writeen with.

VolSize provides the dimensions of the volume, with width first and depth last. Uniform open end condition knot vector are constructed to all three axes.

Example:

    Tv = TVLOAD( "3dhead", 1, vector( 32, 32, 13 ), vector( 3, 3, 3 ) );

loads the data set "3dhead" of size (32, 32, 13) as a triquadratic function. Data set is assumed to contain ascii numeric values.

See also MRCHCUBE.


TVZRJACOB

 PolyType TVZRJACOB( TrivarType TV,
                     NumericType Euclidean,
                     NumericType SkipRate,
                     NumericType Fineness )

Computes the zero set of the Jacobian of the given trivariate, TV. This zero set is the implicit boundary of the trivariate and, for example, equals the envelop of the sweep of a bivariate surface in space (See example below). The zero set is returned as a polygonal data set approximation with Fineness tolerance. If Euclidean, the resulting polygons are in Euclidean space. Otherwise, the polygons are returned in the trivariate's parametric domain. Finally, SkipRate provides a mechanism to skip to every SkipRate row, column and plane while a SkipRate of skips nothing.

Example:

    Tv = tfromsrfs( list( Srf,
                           Srf * tx( 3 ) * ty( 3 ),
                           Srf * tx( 6 ) ), 3 );
    Tv1ZeroJacobian = TVZRJACOB( Tv, 1, 1, 0 );

a trivariate TV is constructed as a sweep of surface Srf along a quadratic Bezier curve with (0, 0), (3, 3), (6, 0) as control points, and then the zero set of the Jacobian is derived to yeild the envelop of this motion of Srf.


ZCOLLIDE

 NumericType ZCOLLIDE( GeometricTreeType Obj1,
                       GeometricTreeType Obj2,
                       NumericType Fineness,
                       NumericType NumOfIters );

Given two objects, Obj1 and Obj2, where Obj1 is assumed to be above (in the Z direction) Obj2, this function computes the amount that Obj1 could be moved down, the -Z direction, until it collides with Obj2. The collision detection is considered using a polygonal approximation that has Fineness resolution (see RESOLUTION variable). The computation cost is linear in NumOfIters with quadratic accuracy convergance. Values of ten for both Fineness and NumOfIters are reasonable selections. While Obj1 is considered in its exact form, in Obj2, only the bbox of the shape is considered.

Example:

    view( chair, 1 );
    for ( x = 0, 1, 5,
        b = box( vector( x / 10, 0, 2 ), 0.1, 0.1, 0.1 ):
        view( b * tz( ZCOLLIDE( chair, b, 10, 10 ) ), 0 ) );

places and draws six different cubes on top of the object called chair.


Object transformation functions

All the routines in this section construct a 4 by 4 homogeneous transformation matrix representing the required transform. These matrices may be concatenated to achieve more complex transforms using the matrix multiplication operator *. For example, the expression

    m = trans( vector( -1, 0, 0 ) ) * rotx( 45 ) * trans( vector( 1, 0, 0 ) );

constructs a transform to rotate an object around the X = 1 line, 45 degrees. A matrix representing the inverse transformation can be computed as:

    InvM = m ^ -1

See also overloading of the - operator.


HOMOMAT

 MatrixType HOMOMAT( ListType MatData )

Creates an arbitrary homogeneous transformation matrix by manually providing its 16 coefficients. Example:

 step = 10;
 for ( a = 1, 1, 720 / step,
       view_mat = save_mat *
                  HOMOMAT( list( list( 1, 0, 0, 0 ),
                                 list( 0, 1, 0, 0 ),
                                 list( 0, 0, 1, -a * step / 500 ),
                                 list( 0, 0, 0, 1 ) ) ):
       view( list( view_mat, axes ), on )
 );

looping and viewing through a sequence of perspective transforms, created using the HOMOMAT constructor.


MATPOSDIR

 MatrixType MATPOSDIR( PointType Pos, VectorType Dir, VectorType UpDir )

Creates a viewing transformation matrix of a viewer at Pos, looking at direction Dir and upper view of UpDir.

Example:

 step = 10;
 for ( a = 1, 1, 720 / step,
       view_mat = MATPOSDIR( point( 0.5, 0.1, 0.5 ),
                             vector( 0.0, 1.0, 0.0 ),
                             vector( cos( a * step * Pi / 360 ), 0,
                                     sin( a * step * Pi / 360 ) ) ):
       view( list( view_mat, axes ), on )
 );

Looping and viewing through a sequence of transforms, created using the MATPOSDIR constructor.


ROTVEC

 MatrixType ROTVEC( VectorType Vec, NumericType Angle )

Creates a rotation around the vector Vec matrix with Angle degrees.


ROTX

 MatrixType ROTX( NumericType Angle )

Creates a rotation around the X transformation matrix with Angle degrees.


ROTY

 MatrixType ROTY( NumericType Angle )

Creates a rotation around te Y transformation matrix with Angle degrees.


ROTZ

 MatrixType ROTZ( NumericType Angle )

Creates a rotation around the Z transformation matrix with Angle degrees.


ROTZ2V

 MatrixType ROTZ2V( VectorType Dir )

Creates a rotation matrix that takes Z axis into Dir. Length of Dir is ignored.


ROTZ2V2

 MatrixType ROTZ2V2( VectorType Dir, VectorType Dir2 )

Creates a rotation matrix that takes Z axis into Dir, while the X axis is aligned with Dir2. The lengths of Dir and Dir2 are ignored.


SCALE

 MatrixType SCALE( VectorType ScaleFactors )

Creates a scaling by the ScaleFactors transformation matrix.


TRANS

 MatrixType TRANS( VectorType TransFactors )

Creates a translation by the TransFactors transformation matrix.


General purpose functions


ADWIDTH

 ADWIDTH( GeometricType Object, NumericType DWidth )

Sets the width of the object. This display width is used in pixels in display devices for width of line drawing, if supported by the display device. See also ATTRIB, COLOR, and AWIDTH.

This function is equivament to using,

ATTRIB( Object, "dwidth", Width );


ANIMEVAL

 ANIMEVAL( NumericType Time, AnyType Object )

Evaluates the animation curves in Object at time Time. The transformations for time Time are saved at the respective sub objects of Object as "animation_mat" matrices.

For example,

    mov_x = cbezier( list( ctlpt( E1, 0.0 ), ctlpt( E1, 1.0 ) ) );
    attrib( axes, "animation", list( mov_x ) );
    ANIMEVAL( 0.5, axes );

and axes will have a matrix in attribute "animation_mat" of translation in x of 1/2.


ATTRIB

 ATTRIB( AnyType Object, StringType Name, AnyType Value )

Provides a mechanism to add an attribute of any type to an Object, with name Name and value Value. This ATTRIB function is tuned and optimized toward numeric values or strings as Value although any other object type can be saved as attribue.

These attributes may be used to pass information to other programs about this object, and are saved with the objects in data files. Attributes placed on a list object or even a whole hierarchy of objects will be propagated into all items in the list or hierarchy. The exception to this propagation are few. The "animation" attribute that is not propagated and is kept in the internal nodes, forming an hierachy of animation commands for all the objects contained in the list/hierarchy. The "invisible" attribute is saved at all levels of the hierarchy, used to denote a complete sub tree that is invisible (yet can serve as a source instances can point at).

For example,

    ATTRIB(Glass, "rgb", "255,0,0");
    ATTRIB(Glass, "refract", "1.4");
        .
        .
        .
    RmAttr(Glass, "rgb");   # Removes "rgb" attribute.

sets the RGB color and refraction index of the Glass object and later removes the RGB attribute.

Attribute names are case insensitive. Spaces are allowed in the Value string, as well as the double quote itself, although the latter must be escaped:

    ATTRIB(Glass, "text", "Say "this is me"");

See also RMATTR for removal of attributes, GETATTR to get an attribute, ATTRPROP for setting attributes on all subtrees of parts, as well as AWIDTH, ADWIDTH, and COLOR.


ATTRPROP

 ATTRPROP( AnyType Object, StringType Name, AnyType Value )

Same as ATTRIB but propagates the attributes to all sub-parts of the object.

Example:

    Glass1 = list( Base, Handle, Wine );
    Glass2 = list( Base, Handle, Wine );
    attrib( Glass1, "texture", "marble1.gif" );
    ATTRPROP( Glass2, "texture", "marble1.gif" );

In Glass1, only Glass1 will be set with "texture" while in Glass2, the "texture" attribute will propagate to the sub-parts of Glass2, namely to Base, Handle, Wine.


AWIDTH

 AWIDTH( GeometricType Object, NumericType Width )

Sets the width of the object to one of those specified below. This width is used in real object side dimensions in tools such as scan converters and rendering tools for rendering lines and curves, as well as postscript. See also ATTRIB, COLOR, and ADWIDTH.

This function is equivament to using,

ATTRIB( Object, "width", Width );


CHDIR

 CHDIR( StringType NewDir )

Sets the current working directory to be NewDir.


CLNTCLOSE

 CLNTCLOSE( NumericType Handler, NumericType Kill )

Closes a communication channel to a client. Handler contains the index of the communication channel opened via CLNTEXEC. If Kill, the client is send an exit request for it to die. Otherwise, the communication is closed and the client is running stand alone. See also VIEWOBJ, VIEWSET, CLNTREAD, CLNTWRITE, and CLNTEXEC.

Example:

   h2 = clntexec( "nuldrvs -s-" );
       .
       .
       .

   CLNTCLOSE( h2,TRUE );

closes the connection to the nuldrvs client, opened via CLNTEXEC.


CLNTWRITE

 CLNTWRITE( NumericType Handler, AnyType Object )

Writes one object Object to a communication channel of a client. Handler contains the index of the communication channel opened via CLNTEXEC. If Handler equals -1, the regular display device (forked via, for example, VIEWOBJ command) is used. if Handler equals CLIENTS_ALL, a broadcast of Object to all clients is performed. See also VIEWOBJ, VIEWSET, CLNTREAD, CLNTCLOSE, and CLNTEXEC.

Example:

   h2 = clntexec( "nuldrvs -s-" );
       .
       .

   CLNTWRITE( h2, Model );
       .
       .

   clntclose( h2,TRUE );

writes the object named Model to client through communication channel h2.


COLOR

 COLOR( GeometricType Object, NumericType Color )

Sets the color of the object to one of those specified below. Note that an object has a default color (see IRIT.CFG file) according to its origin - loaded with the LOAD command, PRIMITIVE, or BOOLEAN operation result. The system internally supports colors (although you may have a B&W system) and the colors recognized are: BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, and WHITE.

See the ATTRIB command for more fine control of colors using the RGB attribute. See also AWIDTH and AWIDTH.

This function is equivament to using,

ATTRIB( Object, "color", Width );


COMMENT

 COMMENT

Two types of comments are allowed:

1. One-line comment: starts anywhere in a line at the '#' character, up to the end of the line.

2. Block comment: starts at the COMMENT keyword followed by a unique character (anything but white space), up to the second occurrence of that character. This is a fast way to comment out large blocks.

Example:

    COMMENT 
      This is a comment
    


ERROR

 ERROR( StringType Message);

Breaks the execution and returns to IRIT main loop, after printing Message to the screen. May be useful in user defined function to break execution in cases of fatal errors.


EXEC

 EXEC( StringType Command );

Executes string Command in the IRIT interepreter, indirectly.

Example:

    Univariate2Bezier = function( Polynom, Deg ): x: f:
    return = nil():
    f = 1:
    for ( x = 0, 0.05 / Deg, 1,
        EXEC( "f = " + Polynom ):
        snoc( ctlpt( E1, f ), return ) ):
    return = coerce( cinterp( return, Deg + 1, Deg + 1, PARAM_UNIFORM, FALSE ),
                     bezier_type );

defines a function that converts univariate expressions into explicit, E1, Bezier curves. For example "Univariate2Bezier( "3 * x verb-^- 2 - 2 * x + 5", 3 );" would return a cubic Bezier curve representing "3 * x verb-^- 2 - 2 * x + 5".


EXIT

 EXIT()

Exits from the solid modeler. NO warning is given!


FOR

 FOR( NumericType Start, NumericType Increment, NumericType End, AnyType Body )

Executes the Body (see below), while the FOR loop conditions hold. Start, Increment, End are evaluated first, and the loop is executed while <= End if Increment > 0, or while >= End 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, separated by COLONs, including nesting FOR loops to an arbitrary level.

Example:

 step = 10;
 rotstepx = rotx(step);
 FOR ( a = 1, 1, 360 / step,
     view_mat = rotstepx * view_mat:
     view( list( view_mat, axes ), ON )
 );

Displays axes with a view direction that is rotated 10 degrees at a time around the X axis.


HELP

 HELP( StringType Subject )

Provides help on the specified Subject.

Example:

    HELP("");

will list all IRIT help subjects.


FREE

 FREE( GeometricType Object )

Because of the usually huge size of geometric objects, this procedure may be used to free them. Reassigning a value (even of different type) to a variable automatically releases the old variable's allocated space as well.


FUNCTION

 FuncName = FUNCTION(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
     FuncBody;

Defines a function named FuncName with N parameters and M local variables (N, M >= 0). Here is a (simple) example of a function with no local variables and a single parameter that computes the square of a number:

 sqr = FUNCTION(x):
    return = x * x;

Functions can be defined with optional parameters and optional local variables. A function's body may contain an arbitrary set of expressions including for/while loops, (user) function calls, or even recursive function calls, all separated by colons. The returned value of the function is the value of an automatically defined local variable named return. The return variable is a regular local variable within the scope of the function and can be used as any other variable.

If a variable's name is found in neither the local variable list nor the parameter list, it is searched in the global variable list (outside the scope of the function). Binding of names of variables is static as in the C programming language.

Because binding of variables is performed in execution time, there is a somewhat less restrictive type checking of parameters of functions that are invoked within a user's defined function.

A function can invoke itself, i.e., it can be recursive. However, since a function should be defined when it is called, a dummy function should be defined before the recursive one is defined:

 factorial = function(x):return = x; # Dummy function.
 factorial = function(x):
     if (x <= 1, return = 1, return = x * factorial(x - 1));

Overloading is valid inside a function as it is outside. For example, for

 add = FUNCTION(x, y):
    return = x + y;

the following function calls are all valid:

 add(1, 2);
 add(vector(1,2,3), point(1,2,3));
 add(box(vector(-3, -2, -1), 6, 4, 2), box(vector(-4, -3, -2), 2, 2, 4));

Finally, here is a more interesting example that computes an approximation of the length of a curve, using the sqr function defined above:

 distptpt = FUNCTION(pt1, pt2):
     return = sqrt(sqr(coord(pt1, 1) - coord(pt2, 1)) +
                   sqr(coord(pt1, 2) - coord(pt2, 2)) +
                   sqr(coord(pt1, 3) - coord(pt2, 3)));

 crvlength = FUNCTION(crv, n):pd:t:t1:t2:dt:pt1:pt2:i:
     return = 0.0:
     pd = pdomain(crv):
     t1 = nth(pd, 1):
     t2 = nth(pd, 2):
     dt = (t2 - t1) / n:
     pt1 = coerce(ceval(crv, t1), e3):
     for (i = 1, 1, n,
          pt2 = coerce(ceval(crv, t1 + dt * i), e3):
          return = return + distptpt(pt1, pt2):
          pt1 = pt2);

Try, for example:

 crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 30) / 2;
 crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 100) / 2;
 crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 300) / 2;

See PROCEDURE and IRITSTATE's "DebugFunc" for more.


IF

 IF( NumericType Cond, AnyType TrueBody { , AnyType FalseBody } )

Executes TrueBody (group of regular commands, separated by COLONs - see FOR loop) if the Cond holds, i.e., it is a numeric value other than zero, or optionally, if it exists, executes FalseBody if the Cond does not hold, i.e., it evaluates to a numeric value equal to zero.

Examples:

    IF ( machine == IBMOS2, resolution = 5, resolution = 10 );
    IF ( a > b, max = a, max = b );

sets the resolution to be 10, unless running on an IBMOS2 system, in which case the RESOLUTION variable will be set to 5 in the first statement, and set max to the maximum of a and b in the second statement.


INCLUDE

 INCLUDE( StringType FileName )

Executes the script file FileName. Nesting of include file is allowed up to 10 levels deep. If an error occurs, all open files in all nested files are closed and data are waited for at the top level (standard input). Files are searched for inclusion in the current directory. If not found, and the inclusion is from a different file at some directory, that directory is searched as well. Finally, if all the above fails, the directories specified via IRIT_INCLUDE environment variable are also searched.

A script file can contain any command the solid modeler supports.

Example:

    INCLUDE( "/tmp/general.irt" );

includes the file "/tmp/general.irt". Any inclusion inside general.irt will search for the included file in the current directory, then in /tmp, and then in the directories specified via IRIT_INCLUDE.


INTERACT

 INTERACT( GeometryTreeType Object )

A user-defined function (see iritinit.irt) that does the following, in order:

Clear the display device.

Display the given Object.

Pause for a keystroke.

This user-defined function in version 4.0 of IRIT is an emulation of the INTERACT function that used to exist in previous versions.

Example:

 INTERACT( list( view_mat, Axes, Obj ) );

displays and interacts with the object Obj and the predefined object Axes. VIEW_MAT will be used to set the starting transformation.

See VIEW and VIEWOBJ for more.


IQUERY

 IQUERY( NumericType QueryType )

A low level query tool of current state of the IRIT internal tables. According to the values of QueryType the following is printed to stdout:

QueryType Printed content
1 All the known functions/user defined function/constant
and parameters/returned values (if any).
2 All the knwon keywords

LIST

 ListType LIST( AnyType Elem1, AnyType Elem2, ... )

Constructs an object as a list of several other objects. Only a reference is made to the Elements, so modifying Elem1 after being included in the list will affect Elem1 in that list next time list is used!

Each inclusion of an object in a list increases its internal used reference. The object is freed iff in used reference is zero. As a result, attempt to delete a variable (using FREE) which is referenced in a list removes the variable, but the object itself is freed only when the list is freed.


LOAD

 AnyType LOAD( StringType FileName )

Loads an object from the given FileName. The object may be any object defined in the system, including lists, in which the structure is recovered and reconstructed as well (internal objects are inserted into the global system object list if they have names). If no file type is provided, ".dat" is assumed.

This command can also be used to load binary files. Ascii regular data files are usually loaded in much more time then binary files due the the parsing required. Binary data files can be loaded directly like ascii files in IRIT, but can only be inspected through IRIT tools such as dat2irit. A binary data file must have a ".bdt" (Binary DaTa) type in its name.

Under unix, compressed files can be loaded if the given file name has a postfix of ".Z". The unix system's "zcat" will be invoked via a pipe for that purpose.


LOGFILE

 LOGFILE( NumericType Set )

 or

 LOGFILE( StringType FileName )

If Set is non zero (see TRUE/FALSE and ON/OFF), then everything printed in the input window, will go to the log file specified in the IRIT.CFG configuration file. This file will be created the first time logfile is turned ON. If a string FileName is provided, it will be used as a log file name from now on. It also closes the current log file. A "LOGFILE( on );" must be issued after a log file name change.

Example:

    LOGFILE( "Data1" );    
    LOGFILE( on );    
    printf( "Resolution = %lf\n", list( resolution ) );
    LOGFILE( off );    

to print the current resolution level into file Data1.


MSLEEP

 MSLEEP( NumericType MilliSeconds )

Causes the solid modeller to sleep for the prescribed time in milliseconds.

Example:

 for ( i = 1, 1, sizeof( crvs ),
     c = nth( crvs, i ):
     color( c, yellow ):
     msleep(20):
     viewobj( c )
 );

Displays an animation sequence and sleeps for 20 milliseconds between iterations.


NREF

 AnyType NREF( ListType ListObject, NumericType Index )

Returns a reference to the Index (base count 1) element of the list ListObject. The reference points to the original object and hence can be used to modify (add attributes for example) to objects in lists. Assignment of this reference to a new object would result in a copy of the object. In contrast a FREE of a reference to an object would have an undefined result.

Example:

    Lst = list( a, b, c );
    attrib( NREF( Lst, 2 ), "NewAttr", on );

add a new attribute to the second element of Lst. See also NTH.


NRMLCONE

 ListType NRMLCONE( SurfaceType Srf )

Computes cone that bounds all normal of surface Srf. Returned is a list of two objects, the axis vector of the cone and the opening radius, in radians.

Example:

    NCone = NRMLCONE( Srf );
    Cn = Cone( vector( 0, 0, 0 ), normalize( nth( NCone, 1 ) ),
               nth( NCone, 2 ), 0 ) * tz( 1.0 ) * sc( 0.75 );

Computes a normals' cone for surface Srf and build a real cone following these limits.


NTH

 AnyType NTH( ListType ListObject, NumericType Index )

Returns the Index (base count 1) element of the list ListObject.

Example:

    Lst = list( a, list( b, c ), d );
    Lst2 = NTH( Lst, 2 );

and now Lst2 is equal to 'list( b, c )'. See also NREF.


PAUSE

 PAUSE( NumericType Flush )

Waits for a keystroke. Nice to have if a temporary stop in a middle of an included file (see INCLUDE) is required. If Flush is TRUE, then the input is first flushed to guarantee that the actual stop will occur.


PRINTF

 PRINTF( StringType CtrlStr, ListType Data )

A formatted printing routine, following the concepts of the C programming language's printf routine. CtrlStr is a string object for which the following special '%' commands are supported:
%d, %i, %u Prints the numeric object as an integer or unsigned integer.
%o, %x, %X Prints the numeric object as an octal or hexadecimal integer.
%e, %f, %g, Prints the numeric object in several formats of
%E, %F floating point numbers.
%s Prints the string object as a string.
%pe, %pf, %pg Prints the three coordinates of the point object.
%ve, %vf, %vg Prints the three coordinates of the vector object.
%Pe, %Pf, %Pg, Prints the four coordinates of the plane object.
%De, %Df, %Dg, Prints the given object in IRIT's data file format.


All the '%' commands can include any modifier that is valid in the C programming language printf routine, including l (long), prefix character(s), size, etc. The point, vector, plane, and object commands can also be modified in a similar way, to set the format of the numeric data printed.

Also supported are the newline and tab using the backslash escape character:

* PRINTF("\tThis is the char "\%"\n", nil());

Backslashes should be escaped themselves as can be seen in the above example. Here are few more examples:

* PRINTF("this is a string "%s" and this is an integer %8d.\n",
*       list("STRING", 1987));
* PRINTF("this is a vector [%8.5lvf]\n", list(vector(1,2,3)));
* IritState("DumpLevel", 9);
* PRINTF("this is a object %8.6lDf...\n", list(axes));
* PRINTF("this is a object %10.8lDg...\n", list(axes));

This implementation of PRINTF is somewhat different than the C programming language's version, because the backslash always escapes the next character during the processing stage of IRIT's parser. That is, the string

*        '\tThis is the char "\%"\n'

is actually parsed by the IRIT's parser into

*        'tThis is the char "%"n'

because this is the way the IRIT parser processes strings. The latter string is the one that PRINTF actually see.


PROCEDURE

 ProcName = PROCEDURE(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
     ProcBody;

A procedure is a function that does not return a value, and therefore the return variable (see FUNCTION) should not be used. A procedure is identical to a function in every other way. See FUNCTION for more.


RESET

 RESET()

Clear all variables and initialize the environment to the starting state. User defined function are kept intact, though.


RMATTR

 RMATTR( AnyType Object, StringType Name )

Removes attribute named Name from object Object. This function will have no affect on Object if Object have no attribute named Name.

See also ATTRIB.


SAVE

 SAVE( StringType FileName, AnyType Object )

Saves the provided Object in the specified file name FileName. No extension type is needed (ignored if specified), and ".dat" is supplied by default. Object can be any object type, including list, in which structure is saved recursively. See also LOAD. If a display device is actively running at the time SAVE is invoked, its transformation matrix will be saved with the same name but with extension type of ".mat" instead of ".dat".

This command can also be used to save binary files. Ascii regular data files are usually loaded in much more time then binary files due the the parsing required. Binary data files can be loaded directly like ascii files in IRIT, but must be inspected through IRIT tools such as dat2irit. A binary data file must have a ".bdt" (Binary DaTa) type in its name.

Under unix, files will be saved compressed if the given file name has a postfix of ".Z". The unix system's "compress" will be invoked via a pipe for that purpose.

Example:

 SAVE( "Obj1.bdt.Z", Obj1 );

Saves Obj1 in the file Obj1.bdt.Z as compressed binary file.


SETNAME

 SETNAME( ListType ListObj, NumericType Index, StringType NewName )

Sets the name of a sub object of index Index in list object ListObj to a new name NewName. Index of first element is zero.

Example:

    A = list( 1, 2, 3 );
    SETNAME( A, 0, "First" );

sets the name of the first element in object A to be "First".

While it is not a good idea to modify names of objects in the top level global space, one can use this function to do exactly that; To rename the object "Axes" to "XYZ", do:

    SETNAME( list( Axes ), 0, "XYZ" );

See also GETNAME.


SNOC

 SNOC( AnyType Object, ListType ListObject )

Similar to the lisp cons operator but puts the new Object in the end of the list ListObject instead of the beginning, in place.

Example:

    Lst = list( axes );
    SNOC( Srf, Lst );

and now Lst is equal to the list 'list( axes, Srf )'.


SYSTEM

 SYSTEM( StringType Command )

Executes a system command Command. For example,

    SYSTEM( "ls -l" );


TIME

 TIME( NumericType Reset )

Returns the time in seconds from the last time TIME was called with Reset TRUE. This time is CPU time if such support is available from the system (times function), and is real time otherwise (time function). The time is automatically reset at the beginning of the execution of this program.

Example:

    Dummy = TIME( TRUE );
      .
      .
      .
    TIME( FALSE );

prints the time in seconds between the above two time function calls.


VARLIST

 VARLIST()

List all the currently defined objects in the system.


VECTOR

 VectorType VECTOR( NumericType X, NumericType Y, NumericType Z )

Creates a vector type object, using the three provided NumericType scalars. See also PLANE, POINT.


VIEW

 VIEW( GeometricTreeType Object, NumericType ClearWindow )

Displays the (geometric) object(s) as given in Object.

If ClearWindow is non-zero (see TRUE/FALSE and ON/OFF) the window is first cleared (before drawing the objects).

Example:

    VIEW( Axes, FALSE );

displays the predefined object Axes in the viewing window on top of what is drawn already.

In version 4.0, this function is emulated (see iritinit.irt) using the VIEWOBJ function. In order to use the current viewing matrix, VIEW_MAT should be provided as an additional parameter. For example,

    VIEW( list( view_mat, Obj ), TRUE );

However, since VIEW is a user defined function, the following will not use VIEW_MAT as one would expect:

    VIEW( view_mat, TRUE );

because VIEW_MAT will be renamed inside the VIEW user defined function to a local (to the user defined function) variable.

In iritinit.irt one can find several other useful VIEW related functions:
VIEWCLEAR Clears all data displayed on the display device.
VIEWREMOVE Removes the object specified by name from display.
VIEWDISC Disconnects from display device (which is still running)
while allowing IRIT to connect to a new device.
VIEWEXIT Forces the display device to exit.
VIEWSAVE Request sdisplay device to save transformation matrix.
BEEP An emulation of the BEEP command of versions prior to 4.0.
VIEWSTATE Allows to change the state of the display device.


For the above VIEW related functions, only VIEWREMOVE, VIEWSAVE, and VIEWSTATE require a parameter, which is the file name and view state respectively. The view state can be one of several commands. See the display device section for more.

Examples:

    VIEWCLEAR();
    VIEW( axes, off );
    VIEWSTATE( "LngrVecs" );
    VIEWSTATE( "DrawSolid" );
    VIEWSAVE( "matrix1" );
    VIEWREMOVE( "axes" );
    VIEWDISC();


VIEWOBJ

 VIEWOBJ( GeometricTreeType Object )

Displays the (geometric) object(s) as given in Object. Object may be any GeometricType or a list of other GeometricTypes nested to an arbitrary level.

Unlike IRIT versions prior to 4.0, VIEW_MAT is not explicitly used as the transformation matrix. In order to display with a VIEW_MAT view, VIEW_MAT should be listed as an argument (in that exact name) to VIEWOBJ. Same is true for the perspective matrix PRSP_MAT.

Example:

    VIEWOBJ( list( view_mat, Axes ) );

displays the predefined object Axes in the viewing window using the viewing matrix VIEW_MAT.


VIEWSET

 VIEWSET( NumericType DispHandle )

Sets the current display device to be DispHandle. DispHandle is returned by the CLNTEXEC command. The use of the reserved constant of CLIENTS_ALL would broadcast the viewing commands to all objects.

Example:

    h1 = clntexec( DispDeviceName );
    h2 = clntexec( DispDeviceName );

    clntwrite( h1, sphere( vector( 0, 0, 0 ), 1 ) );
    clntwrite( h2, axes );

    pause();

    VIEWSET( h1 );
    viewclear();
    viewobj( list( sphere( vector( 0, 0, 0 ), 1 ), axes ) );

    VIEWSET( h2 );
    viewclear();
    viewobj( list( sphere( vector( 0, 0, 0 ), 1 ), axes ) );

    pause();

    VIEWSET( CLIENTS_ALL );

    viewobj( axes );

    pause();

    viewexit();

opens two display devices, and display a unit sphere to the first and the axes object to the second. After a pause, displays both objects on both display devices, pause and exit from both.

See also VIEWOBJ, CLNTEXEC, CLNTCLOSE, CLNTREAD, CLNTWRITE.


WHILE

 WHILE( NumericType Cond, AnyType Body )

Executes the Body (see below), while the WHILE loop conditions Cond is evaluated into a non zero value. Cond is being evaluated before each iteration.

The body may consist of any number of regular commands, separated by COLONs, including nesting loops to an arbitrary level.

Example:

 deg = 0;
 rotstepx = rotx( 10 );
 WHILE ( deg < 360,
     deg = deg + 10:
     view_mat = rotstepx * view_mat:
     view( list( view_mat, axes ), ON )
 );

Displays axes with a view direction that is rotated 10 degrees at a time around the X axis.


System variables

System variables are predefined objects in the system. Any time IRIT is executed, these variable are automatically defined and set to values which are sometimes machine dependent. These are regular objects in any other sense, including the ability to delete or overwrite them. One can modify, delete, or introduce other objects using the IRITINIT.IRT file.


AXES

Predefined polyline object (PolylineType) that describes the XYZ axes.


DRAWCTLPT

Predefined Boolean variable (NumericType) that controls whether curves' control polygons and surfaces' control meshes are drawn (TRUE) or not (FALSE). Default is FALSE.


FLAT4PLY

Predefined Boolean object (NumericType) that controls the way almost flat surface patches are converted to polygons: four polygons (TRUE) or only two polygons (FALSE). Default value is FALSE.


MACHINE

Predefined numeric object (NumericType) holding the machine type as one of the following constants: MSDOS, SGI, HP, SUN, APOLLO, UNIX, IBMOS2, IBMNT, and AMIGA.


POLY_APPROX_OPT

A variable controlling the algorithm to convert surfaces to polygons. This two digit number controls the method that is used to subdivide a surface into polygons. The first digit (units) can be one of:
0 Uniform sampling in a fixed grid.
1 An alternated U and V subdivision direction. Once U is
subdivided and then V is subdivided.
2 A min max subdivision direction. In other words, the
direction that minimizes the maximal error is selected.


The second digit (tenths) can be one of:
0 A fixed sized regular grid. The side of the grid is set
via the RESOLUTION variable.
1 This mode is not for general use.
2 Maximal distance between the surface and its polygonal
approximation is bounded by bilinear surface fit.
Maximal distance allowed is set via POLY_APPROX_TOL.
Recommended choice for optimal polygonization.
3 This mode is not for general use.



POLY_APPROX_UV

A Boolean predefined variable. If TRUE, UV values of surface polygonal approximation are placed on attribute lists of vertices.


POLY_APPROX_TOL

A numeric predefined tolerance control on the distance between the surface and its polygonal approximation in POLY_APPROX_OPT settings.


PRSP_MAT

Predefined matrix object (MatrixType) to hold the perspective matrix used/set by VIEW and/or INTERACT commands. See also VIEW_MAT.


RESOLUTION

Predefined numeric object (NumericType) that sets the accuracy of the polygonal primitive geometric objects and the approximation of curves and surfaces. Holds the number of divisions a circle is divided into (with minimum value of 4). If, for example, RESOLUTION is set to 6, then a generated CONE will effectively be a six-sided pyramid. Also controls the fineness of freeform curves and surfaces when they are approximated as piecewise linear polylines, and the fineness of freeform surfaces when they are approximated as polygons.


VIEW_MAT

Predefined matrix object (MatrixType) to hold the viewing matrix used/set by VIEW and/or INTERACT commands. See also PRSP_MAT.


System constants

The following constants are used by the various functions of the system to signal certain conditions. Internally, they are represented numerically, although, in general, their exact value is unimportant and may be changed in future versions. In the rare circumstance that you need to know their values, simply type the constant as an expression.

Example:

    MAGENTA;


AMIGA

A constant designating an AMIGA system, in the MACHINE variable.


APOLLO

A constant designating an APOLLO system, in the MACHINE variable.


BEZIER_TYPE

A constant defining a Bezier freeform geometry.


BLACK

A constant defining a BLACK color.


BLUE

A constant defining a BLUE color.


BSPLINE_TYPE

A constant defining a Bspline freeform geometry.


CLIENTS_ALL

A constant defining a request to address (broadcast) all clients.


COL

A constant defining the COLumn or U direction of a surface or a trivariate mesh.


CTLPT_TYPE

A constant defining an object of type control point.


CURVE_TYPE

A constant defining an object of type curve.


CYAN

A constant defining a CYAN color.


DEPTH

A constant defining the DEPTH direction of a trivariate mesh. See TBEZIER, TBSPLINE.


E1

A constant defining an E1 (X only coordinate) control point type.


E2

A constant defining an E2 (X and Y coordinates) control point type.


E3

A constant defining an E3 (X, Y and Z coordinates) control point type.


E4

A constant defining an E4 control point type.


E5

A constant defining an E5 control point type.


E6

A constant defining an E6 control point type.


E7

A constant defining an E7 control point type.


E8

A constant defining an E8 control point type.


E9

A constant defining an E9 control point type.


FALSE

A zero constant. May be used as Boolean operand.


GEOM_CONST

Designates a constant shape.


GEOM_LINEAR

Designates a shape of a (piecewise) linear curve.


GEOM_CIRCULAR

Designates a shape of a circle/arc.


GEOM_PLANAR

Designates a planar shape.


GEOM_SPHERICAL

Designates a spherical shape.


GEOM_SRF_OF_REV

Designates a shape that is (a portion of) a surface of revolution..


GEOM_EXTRUSION

Designates a shape that is an extrusion surface.


GEOM_RULED_SRF

Designates a shape that is a ruled surface.


GEOM_DEVELOP_SRF

Designates a shape that is a ruled surface.


GEOM_SWEEP

Designates a shape that is a sweep surface.


GREEN

A constant defining a GREEN color.


HP

A constant designating an HP system, in the MACHINE variable.


IBMOS2

A constant designating an IBM system running under OS2, in the MACHINE variable.


IBMNT

A constant designating an IBM system running under Windows NT, in the MACHINE variable.


KV_FLOAT

A constant defining a floating end condition uniformly spaced knot vector.


KV_OPEN

A constant defining an open end condition uniformly spaced knot vector.


KV_PERIODIC

A constant defining a periodic end condition with uniformly spaced knot vector.


LIST_TYPE

A constant defining an object of type list.


MAGENTA

A constant defining a MAGENTA color.


MATRIX_TYPE

A constant defining an object of type matrix.


MSDOS

A constant designating an MSDOS system, in the MACHINE variable.


MULTIVAR_TYPE

A constant defining an object of type multivariate function.


NUMERIC_TYPE

A constant defining an object of type numeric.


OFF

Synonym of FALSE.


ON

Synonym for TRUE.


P1

A constant defining a P1 (W and WX coordinates, in that order) rational control point type.


P2

A constant defining a P2 (W, WX, and WY coordinates, in that order) rational control point type.


P3

A constant defining a P3 (W, WX, WY, and WZ coordinates, in that order) rational control point type.


P4

A constant defining a P4 rational control point type.


P5

A constant defining a P5 rational control point type.


P6

A constant defining a P6 rational control point type.


P7

A constant defining a P7 rational control point type.


P8

A constant defining a P8 rational control point type.


P9

A constant defining a P9 rational control point type.


PARAM_CENTRIP

A constant defining a centripetal length parametrization.


PARAM_CHORD

A constant defining a chord length parametrization.


PARAM_NIELFOL

A constant defining a Neilson-Foley parametrization.


PARAM_UNIFORM

A constant defining an uniform parametrization.


PI

The constant of 3.141592...


PLANE_TYPE

A constant defining an object of type plane.


POINT_TYPE

A constant defining an object of type point.


POLY_TYPE

A constant defining an object of type poly.


POWER_TYPE

A constant defining a Power basis freeform geometry.


RED

A constant defining a RED color.


ROW

A constant defining the ROW or V direction of a surface or a trivariate mesh.


SGI

A constant designating an SGI system, in the MACHINE variable.


STRING_TYPE

A constant defining an object of type string.


SURFACE_TYPE

A constant defining an object of type surface.


SUN

A constant designating a SUN system, in the MACHINE variable.


TRIMSRF_TYPE

A constant defining an object of type trimmed surface.


TRISRF_TYPE

A constant defining an object of type triangular surface.


TRIVAR_TYPE

A constant defining an object of type trivariate function.


TRUE

A non zero constant. May be used as Boolean operand.


UNDEF_TYPE

A constant defining an object of no type (yet).


UNIX

A constant designating a generic UNIX system, in the MACHINE variable.


VECTOR_TYPE

A constant defining an object of type vector.


WHITE

A constant defining a WHITE color.


YELLOW

A constant defining a YELLOW color.


Animation

The animation tool adds the capability of animating objects using forward kinematics, exploiting animation curves. Each object has different attributes, that prescribe its motion, scale, and visibility as a function of time. Every attribute has a name, which designates it's role. For instance an attribute animation curve named MOV_X describes a translation motion along the X axis.


How to create animation curves in IRIT

Let OBJ be an object in IRIT to animate.

Animation curves are either scalar (E1/P1) curves or three dimensional (E3/P3) curves with one of the following name prefixes:
MOV_X, MOV_Y, MOV_Z Translation along one axis
MOV_XYZ Arbitrary translation along all three axes
ROT_X, ROT_Y, ROT_Z Rotating around a single axis (degrees)
SCL_X, SCL_Y, SCL_Z Scale along a single axis
SCL Global scale
VISIBLE Visibility


The visibility curve is a scalar curve that enables the display of the object if the visibility curve is positive at time t and disables the display (hide) the object if the visibility curve is negative at time t. A positive visibility value between zero and one also hints on the opacity of the object, if supported, one being fully opaque.

The animation curves are all attached as an attribute named "animation" to the object OBJ.

Example:

    mov_x = cbezier( ctlpt( E1, 0.0 ),
                     ctlpt( E1, 1.0 ) );
    scl   = cbezier( ctlpt( E1, 1.0 ),
                     ctlpt( E1, 0.1 ) );
    rot_y = cbezier( ctlpt( E1, 0.0 ),
                     ctlpt( E1, 0.0 ) );
                     ctlpt( E1, 360.0 ) );
    attrib(OBJ, "animation", list( mov_x, scl, rot_y ) );

To animate OBJ between time zero and one (Bezier curves are always between zero and one), by moving it a unit size in the X direction, scaling it to %10 of its original size and rotating it at increasing angular speed from zero to 360 degrees.

OBJ can now be save into a file or displayed via one of the regular viewing commands in IRIT (i.e. VIEWOBJ).

Animation is not always between zero and one. To that end, one can apply the CREPARAM function to modify the parametric domain of the animation curve. The convention is that if the time is below the starting value of the parametric domain, the starting value of the curve is used. Similarly if the time is beyond the end of the parameter domain of the animation curve, the end value of the animation curve is used.

Example:

    CREPARAM( mov_x, 3.0, 5.0 );

to set the time of the motion in the x axis to be from t = 3 to t = 5. for t < 3, mov_x(3) is used, and for t > 5, mov_x(5) is employed.

the animation curves are regular objects in the IRIT system. Hence, only one object named mov_x or scl can exist at one time. If you create a new object named mov_x, the old one is overwritten! To preserve old animation curves you can detach the old ones by executing 'free(mov_x)' that removes the object named mov_x from IRIT's object list but not from its previous used locations within other list objects, if any. A different way to it call this animation curves mov_x1, mov_x2 etc. as only the prefix of the name is verified.

For example:

    mov_x = cbezier( list( ctlpt( E1, 0.0 ),
                           ctlpt( E1, 1.0 ) ) );
    attrib(obj1, "animation", list( mov_x ) );
    free(mov_x);

    mov_x1 = cbezier( list( ctlpt( E1, 2.0 ),
                            ctlpt( E1, 3.0 ) ) );
    mov_x2 = cbezier( list( ctlpt( E1, 2.0 ),
                            ctlpt( E1, 3.0 ) ) );
    attrib(obj2, "animation", list( mov_x1, mov_x2 ) );
    free(mov_x);

notice the way we have two animation curves translating obj2 in x. This is somewhat artificial but might make more sense if other transformations would appear in between.

One can evaluate an object with animation curves at a certain time, only to find the proper expected transformation matrix at that time on the object as an "animation_mat" attribute. The following example defines a user defined TransformAnim function that creates an transformed object out of object that was evaluated with ANIMEVAL. Then, a simple loop (slowly) animate the scene...

 TransformAnim = function( Obj ):
    return = 0;
 TransformAnim = function( Obj ): m: i:
    if ( thisobj( "Obj" ) == list_type,
        return = nil():
        for ( i = 1, 1, sizeof( Obj ),
            snoc( TransformAnim( nth( Obj, i ) ), return ) ),
        return = Obj * tx( 0 ) ):
    m = getattr( Obj, "animation_mat" ):
    if ( thisobj( "m" ) == matrix_type,
        return = return * m );

 for ( t = 0, 0.1, 1,
     ANIMEVAL( t, Object ):
     view( TransformAnim( Object ), 1 ) );


A more complete animation example

  a = box( vector( 0, 0, 0 ), 1, 1, 1 );
  b = box( vector( 0, 0, 0 ), 1, 1, 1 );
  c = box( vector( 0, 0, 0 ), 1, 1, 1 );
  d = sphere( vector( 0, 0, 0), 0.7 );
  
  pt0   =  ctlpt( e1,  0.0 );
  pt1   =  ctlpt( e1,  1.0 );
  pt2   =  ctlpt( e1,  2.0 );
  pt6   =  ctlpt( e1,  6.0 );
  pt360 =  ctlpt( e1,  360.0 );
  
  pt10 = ctlpt( e1, -4.0 );
  pt11 = ctlpt( e1,  1.0 );
  pt12 = ctlpt( e1,  4.0 );
  pt13 = ctlpt( e1, -1.0 );
  
  visible = creparam( cbezier( list( pt10,  pt11 ) ), 0.0, 5.0 );
  mov_x   = creparam( cbezier( list( pt0, pt6, pt2 ) ), 0.0, 1.2 );
  mov_y   = mov_x;
  mov_z   = mov_x;
  rot_x   = creparam( cbspline( 2,
                                list( pt0, pt360, pt0 ),
                                list( KV_OPEN ) ),
                      1.2, 2.5 ); 
  rot_y   = rot_x;
  rot_z   = rot_x;
  scl     = creparam( cbezier( list( pt1, pt2, pt1, pt2, pt1 ) ),
                      2.5, 4.0 );
  scl_x   = scl;
  scl_y   = scl;
  scl_z   = scl;
  mov_xyz = creparam( circle( vector( 0, 0, 0 ), 2.0 ), 4.0, 5.0 );
  
  attrib( d, "animation", list( mov_xyz, visible ) );
  free( visible );
  
  visible = creparam( cbezier( list( pt12,  pt13 ) ), 0.0, 5.0 );
  
  attrib( a, "animation", list( rot_x, mov_x, scl, scl_x, visible ) );
  attrib( b, "animation", list( rot_y, mov_y, scl, scl_y, visible ) );
  attrib( c, "animation", list( rot_z, mov_z, scl, scl_z, visible ) );
  
  color( a, red );
  color( b, green );
  color( c, blue );
  color( d, cyan );
  
  demo = list( a, b, c, d );
  
  interact( demo );
  viewanim( 0, 5, 0.01 );

In this example, we create four objects, three cubes and one sphere. Animation curves to translate the three cubes along the three axes for the time period of t = 0 to t = 1.2 are created. Rotation curves to rotate the three cubes along the three axes are then created for time period of t = 1.2 to t = 2.5. Finally, for the time period of t = 2.5 to t = 4.0. the cubes are (not only) unifomly scaled. For the time period of t = 4 to t = 5, the cubes become invisible and the sphere, that becomes visible, is rotated along a circle of radius 2.


Another complete animation example

This example demonstrates the ability to put "animation" attributes on internal nodes of a hierarchy, affecting the entire set of objects in the hierachy. Herein, we present an robotic arm with three edges and two joints.

    BoxLength = 2;
    BoxWidth = 2;
    BoxHeight = 10;
    
    LowerBox = box( vector( -BoxLength / 2, -BoxWidth / 2, 0 ),
                    BoxLength, BoxWidth, BoxHeight);
    MiddleBox = box( vector( -BoxLength / 2, -BoxWidth / 2, 0 ),
                     BoxLength, BoxWidth, BoxHeight);
    UpperBox = box( vector( -BoxLength / 2, -BoxWidth / 2, 0 ),
                    BoxLength, BoxWidth, BoxHeight);
    Cn1 = cone( vector( 0, 0, 0 ), vector( 0, BoxHeight / 3, 0 ), 1 );
    
    color( LowerBox, magenta );
    color( MiddleBox, yellow );
    color( UpperBox, cyan );
    color( Cn1, green );
    
    rot_x1 = creparam( cbspline( 3,
                                 list( ctlpt( E1,  0 ),
                                       ctlpt( E1,  -200 ),
                                       ctlpt( E1,  200 ),
                                              ctlpt( E1,  0 ) ),
                                 list( KV_OPEN ) ),
                       0, 3 );
    rot_x2 = creparam( cbspline( 4,
                                 list( ctlpt( E1,  0 ),
                                       ctlpt( E1,  400 ),
                                       ctlpt( E1,  -400 ),
                                              ctlpt( E1,  0 ) ),
                                 list( KV_OPEN ) ),
                       0, 3 );
    rot_y = creparam( cbspline( 2,
                                list( ctlpt( E1,  0 ),
                                      ctlpt( E1,  100 ),
                                      ctlpt( E1, -100 ),
                                      ctlpt( E1,  0 ) ),
                                list( KV_OPEN ) ),
                      0, 3 );
    rot_z = creparam( cbspline( 2,
                                list( ctlpt( E1,  0 ),
                                      ctlpt( E1,  1440 ) ),
                                list( KV_OPEN ) ),
                      0, 3 );
    Translate = trans( vector( 0, 0, BoxHeight ) );
    
    attrib( Cn1, "animation", list( rot_z, Translate ) );
    
    Upr = list( Cn1, UpperBox );
    attrib( Upr, "animation", list( rot_y, Translate ) );
    
    Mid = list( Upr, MiddleBox );
    attrib( Mid, "animation", list( rot_x2, Translate ) );
    
    rbt_hand = list( Mid, LowerBox );
    attrib( rbt_hand, "animation", list( rot_x1 ) );
    
    view( rbt_hand, 1 );

In this example, we create four objects, three cubes and one cone, simulating a robotic hand with three edges an a gripper (the cone). The animation is define hierarchically, making it very easy to model the robot.


Display devices

The following display device drivers are available,
Device Name Invocation Environment
xgldrvs xgldrvs -s- SGI 4D GL regular driver.
xogldrvs xogldrvs -s- SGI 4D Open GL/Motif driver.
xgladap xgladap -s- SGI 4D GL adaptive isocurve
experimental driver.
x11drvs x11drvs -s- X11 driver.
xmtdrvs xmtdrvs -s- X11 Motif driver.
xglmdrvs xglmdrvs -s- SGI 4D GL and X11/Motif driver.
wntdrvs wntdrvs -s- IBM PC Windows NT driver.
wntgdrvs wntgdrvs -s- IBM PC Windows NT Open GL driver.
os2drvs os2drvs -s- IBM PC OS2 2.x/3.x driver.
amidrvs amidrvs -s- AmigaDOS 2.04+ driver.
nuldrvs nuldrvs -s- [-d] [-D] A device to print the
object stream to stdout.


All display devices are clients communicating with the server (IRIT) using IPC (inter process communication). On Unix and Window NT sockets are used. A Windows NT client can talk to a server (IRIT) on a unix host if hooked to the same netwrok. On OS2 pipes are used, and both the client and server must run on the same machine. On AmigaDOS exec messages are used, and both the client and server must run on the same machine.

While all display devices support object(s) transformations via a transformation control window, many of the display devices allow one to click and drag on the viewing window to rotate (Left Button) and to translate (Right Button). This mode exploits the two degrees of freedom of the mouse to provide intuitive dual axis rotation and translation. Most display devices supports two levels of fineness. A rough display is used while in the middle of a transformation operation (i.e. the mouse button is down/dragged) while a fine object display is employed when the display is idle (mouse button is up). See also option '-E'.

The server (IRIT) will automatically start a client display device if the IRIT_DISPLAY environment variable is set to the name and options of the display device to run. For example:

    setenv IRIT_DISPLAY xgldrvs -s-

The display device must be in a directory that is in the path environment variable. Most display devices require the '-s-' flags to run in a non-standalone mode, or a client-server mode. Most drivers can also be used to display data in a standalone mode (i.e., no server). For example:

    xgldrvs -s solid1.dat irit.mat

Effectively, all the display devices are also data display programs Therefore some functionality is not always as expected. For example, the quit button will always force the display device to quit, even if poped up from IRIT, but will not cause IRIT to quit as might logically expected. In fact, the next time IRIT will try to communicate with the display device, it will find the broken connection and will start up a new display device.

Most display devices recognize attributes found on objects. The following attributes are usually recognized (depending on the device capability.):



COLOR: Selects the drawn color of the object to be one of the 8/16 predefined colors in the IRIT system: white, red, green, blue, yellow, cyan, magenta, black.

RGB: Overwrites (if supported) the COLOR attribute (if given) and sets the color of the object to the exact prescribed RGB set.

DWIDTH: Sets the width in pixels of the drawn object, when drawn as a wireframe.

ReflectLns: Allows the display of reflection lines off a freeform surface. The "ReflectLns" attribute is a list object of two subobjects, a vector and a list of points. The vector is the reflection lines' direction (all reflection lines are parallel) and the list of points is a list of points on the different reflection lines. For example,

    attrib( S, "RflctLines",
            list( vector( 0, 0, 1 ),
                  list( point( -1.6, 2, 0 ),
                        point( -0.8, 2, 0 ),
                        point(  0.0, 2, 0 ),
                        point(  0.8, 2, 0 ),
                        point(  1.6, 2, 0 ) ) ) );        

defines five reflection lines to be reflected off surface S, all in the direction of (0, 0, 1) and on the plane Y = 2. See also RFLCTLN command.

All display devices recognize all the command line flags and all the configuration options in a configuration file, as described below. The display devices will make attemps to honor the requests, to the best of their ability. For example, only gl and Open GL devices can render shaded models, and so only they will honor a DrawSolid configuration options.


Command Line Options

 ???drvs [-s] [-u] [-n] [-N] [-i] [-c] [-C] [-m] [-a] [-g x1,x2,y1,y2]
         [-G x1,x2,y1,y2] [-I #IsoLines] [-F PolygonOpti FineNess] [-R]
         [-f PolylineOpti SampTol] [-E RelLowRes] [-p] [-l LineWidth]
         [-r] [-A Shader] [-B] [-2] [-d] [-D] [-L NormalLen] [-4]
         [-k SketchType Sil Shd] [-b BackGround] [-S LgtSrcPos] [-e PickDist]
         [-O PickObjType] [-Z ZMin ZMax] [-M] [-W WireSetup] [-P]
         [-x ExecAnimCmd] [-X Min,Max,Dt{,flags}] [-w InitWidget] [-z] DFiles



-s: Runs the driver in a Standalone mode. Otherwise, the driver will attempt to communicate with the IRIT server.

-u: Forces a Unit matrix. That is, input data are not transformed at all.

-n: Draws normals of vertices.

-N: Draws normals of polygons.

-i: Draws internal edges (created by IRIT) - default is not to display them, and this option will force displaying them as well.

-c: Sets depth cueing on. Drawings that are closer to the viewer will be drawn in more intense color.

-C: Cache the piecewise linear geometry so curves and surface can be redisplay faster. Purging it will free memory, on the other hand.

-m: Provides some more information on the data file(s) parsed.

-a: Sets the support of antialiased lines.

-g x1,x2,y1,y2: Prescribes the position and location of the transformation window by prescribing the domain of the window in screen space pixels.

-G x1,x2,y1,y2: Prescribes the position and location of the viewing window by prescribing the domain of the window in screen space pixels.

-I #IsoLines: Specifies number of isolines per surface, per direction. A specification of zero isolines is possible only on the command line and it denotes the obvious.

-F PolyOpti FineNess: Controls the method used to approximate surfaces into polygons. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-R: Use optimized polygonal strips instead of lists of polygons, if possible. This feasibility depends on the support of the underlaying hardware/graphics libraries.

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-E RelLowRes: Sets the relative fineness of curves and surface while the input device is active, such as in a drag operation.

-p: Sets the width of drawn points.

-l LineWidth: Sets the linewidth, in pixels. Default is one pixel wide.

-r: Rendered mode. Draws object as solid.

-A Shader: Shader can be one of 0 (None), 1 (Background), 2 (Flat), 3 (Gouraud), or 4 (Phong).

-B: Back face culling of polygons.

-2: Double buffering. Prevents screen flicker on the expense of possibly less colors.

-d: Debug objects. Prints to stderr all objects read from communcation port with the server IRIT.

-D: Debug input. Prints to stderr all characters read from communcation port with the server IRIT. Lowest level of communication.

-L NormalLen: Sets the length of the drawn normals in thousandths of a unit.

-4: Forces four polygons per almost flat region in the surface to polygon conversion. Otherwise two polygons only.

-k SketchType Sil Shd: Sets the strokes type (one of 1 (isoparametric curves), 2 (lines of curvature), 3 (silhoutees)), and the silhouette and shader powers (between zero and one), in interactive line art strokes (See -W).

-b BackGround: Sets the background color as three RGB integers in the range of 0 to 255.

-S LgtSrcPos: Sets the lighting via the light source position.

-e PickDist: Sets the distance thenear and far Z clipping planes.

-O PickObjType: A binary mask that controls which object can be picked: bit 0 - not used, bit 1 - poly, bit 2 - numeric, bit 3 - point, bit 4 - vector, bit 5 - Plane, bit 6 - matrix, bit 7 - curve, bit 8 - surface, bit 9 - string, bit 10 - list object, bit 11 - ctl pt, bit 12 - trimmed srf, bit 13 - trivariate, bit 14 - instance, bit 15 - triangular srf, bit 16 - model, bit 17 - multivariate.

-Z ZMin ZMax: Sets the near and far Z clipping planes.

-M: Draw control mesh/polygon of curves and surfaces, as well.

-W WireSetup: Controls the line drawing of the freeforms where WireSetup is a mask that controls: bit 0: Draws curves and surfaces using a set of isocurves (see -I and -f), bit 1: Draw boundary curves of surfaces, bit 2: draw silhouette curves of surfaces, bit 3: draw polygonal representation that is silhouette based (view dependent, bit 4: draw surfaces in sketch style line art (see -k). bit 5: draw surfaces' reflection lines (surface also must have a "ReflectLns" attribute - see attributes above).

-P: Draws curves and surfaces using a set of polygons (see -F).

-x ExecAnimCmd: Command to execute as a subprocess every iteration of display of an animation sequence. This command can for example save the display into an image file, saving the animation sequence. One parameter is passed, which is an running index starting from one.

-X Min,Max,Dt{,flags}: Executes an animation sequence between Min time to Max time is steps of Dt. If an 's' flag is specified the animation is saved as idividual data files, one per frame, for high quality rendering. If 'x' flag is given, the display device exists once the animation is complete.

-w InitWidget: Sets the widgets that are displayed initially (as an or'ed mask): 1 - Environment widget, 2 - Animation widget, 4 - Curves widget, 8 - surfaces widget, 16 - Shading widget, 32 - Pick objects widget, 64 - Object transforms widget.

-z: Prints version number and current defaults.


Configuration Options

The configuration file is read before the command line options are processed. Therefore, all options in this section can be overriden by the appropriate command line option, if any.



TransPrefPos: Preferred location (Xmin, YMin, Xmax, Ymax) of the transformation window.

ViewPrefPos: Preferred location (Xmin, YMin, Xmax, Ymax) of the viewing window.

BackGround: Background color. Same as '-b'.

Internal: Draws internal edges. Same as '-i'.

LightSrcPos: Sets the location of the (first) light source as a rational four coefficient location. W of zero sets the light source at infinity.

ExecAnimCmd: Executes a command each step of animation. Same as '-x'.

ExecAnimation: Executes an animation sequence on startup. Same as '-X'.

DrawVNormal: Draws normals of vertices. Same as '-n'.

DrawPNormal: Draws normals of polygons. Same as '-n'.

MoreVerbose: Provides some more information on the data file(s) parsed. Same as '-m'.

UnitMatrix: Forces a Unit matrix. That is, input data are not transformed at all. Same as '-u'.

DrawSolid: Requests a shaded surface rendering, as opposed to isocurve surface representation.

BFaceCull: Requests the removal of back facing polygons, for better visibility.

DoubleBuffer: Requests drawing using a double buffer, if any.

DebugObjects: Debug objects. Prints to stderr all objects read from the communcation port with the server IRIT. Same as '-d'.

DebugEchoInput: Debug input. Prints to stderr all characters read from the communcation port with the server IRIT. Lowest level of communications.

DepthCue: Set depth cueing on. Drawings that are closer to the viewer will be drawn in more intense color. Same as '-c'.

CacheGeom: Normally piecewise linear approximation of freefroms is cached. By setting this option to FALSE, no such auxiliary data is being saved, reducing the memory overhead. Same as '-C'.

FourPerFlat: Forces four polygons per almost flat region in the surface to polygon conversion. Otherwise two polygons only. Same as '-4'.

AntiAlias: Request the drawing of anti aliased lines.

DrawSurfaceMesh: Draws control mesh/polygon of curves and surfaces, as well. Same as '-M'.

DrawSurfacePoly: Draws curves and surfaces (surfaces are drawn using a set of isocurves, see -I, or polygons, see -f). Same as '-P'.

StandAlone: Runs the driver in a Stand alone mode. Otherwise, the driver will attempt to communicate with the IRIT server. Same as '-s'.

NumOfIsolines: Specifies number of isolines per surface, per direction. Same as '-I'.

SamplesPerCurve: Specifies the samples per (iso)curve. See '-f'.

LineWidth: Sets the linewidth, in pixels. Default is one pixel wide. Same as '-l'

AdapIsoDir: Selects the direction of the adaptive isoline rendering.

PolygonOpti: Controls the method used to subdivide a surface into polygons that approximate it. Same as '-F'.

PolylineOpti: Controls the method used to subdivide a curve into polylines that approximate it. Same as '-f'.

ShadingModel: One of 1 (Flat), 2 (Gouraud), or 3 (Phong). Same as '-A'.

TransMode: Selects between object space transformations and screen space transformation.

ViewMode: Selects between perspective and orthographic views.

NormalLength: Sets the length of the drawn normals in thousandths of a unit. Same as '-L'.

ZClipMin: Sets the minimal clipping plane in Z. Same as '-Z'.

ZClipMax: Sets the maximal clipping plane in Z. Same as '-Z'.

FineNess: Controls the fineness of the surface to polygon subdivision. See '-F'.


Interactive mode setup

Commands that affect the status of the display device can also be sent via the communication port with the IRIT server. The following commands are recognized as string objects with object name of "COMMAND_":
ANIMATE TMin TMax Dt Animates current scene from TMin to TMax in Dt
steps.
BEEP Makes some sound.
CLEAR Clears the display area. All objects are deleted.
DCLEAR Delayed clear. Same as CLEAR but delayed until next
object is sent from the server. Useful for animation.
DISCONNECT Closes connection with the server, but does not quit.
EXIT Closes connection with the server and quits.
GETOBJ NAME Requests the object named NAME that is returned
in the output channel to the server.
HIGHLIGHT1 NAME Color the object named NAME with highlight1 color.
HIGHLIGHT2 NAME Color the object named NAME with highlight2 color.
MSAVE NAME Save the current matrix in a file named NAME.
PICKCRSR Requests to interactively sample mouse/cursor events
for mouse-up, mouse-down, and mouse-move-while-down.
PICKDONE Stop interactive pick reports to server. Stops all
PICKCRSR, PICKNAME and PICKOBJ modes.
PICKNAME Requests to interactively pick an object by name that
is returned in the output channel to the server.
PICKOBJ Requests to interactively pick an object that is
returned in the output channel to the server.
MSAVE NAME Saves the transformation matrix file by the name
NAME.
REMOVE NAME Request the removal of object named NAME from
display.
STATE COMMAND Changes the state of the display device. See below.
UNHIGHLIGHT Unhighlight all highlighted objects.
The following commands are valid for the STATE COMMAND above,
MoreSense: More sensitive mouse control.
LessSense: Less sensitive mouse control.
ScrnObject: Toggle screen/object transformation mode.
PerspOrtho: Toggles perspective/orthographic trans. mode.
DepthCue: Toggles depth cueing drawing.
CacheGeom: Cache the created piecewise linear geometry.
DrawSolid: Toggles isocurve/shaded solid drawing.
ShadingMdl: Toggles shading model for solid solid drawing.
BFaceCull: Cull back facing polygons.
DblBuffer: Toggles single/double buffer mode.
AntiAlias: Toggles anti aliased lines.
DrawIntrnl: Toggles drawing of internal lines.
DrawVNrml: Toggles drawing of normals of vertices.
DrawPNrml: Toggles drawing of normals of polygons.
DSrfMesh: Toggles drawing of control meshes/polygons.
DSrfPoly: Toggles drawing of curves/surfaces as polygons.
DPolygons: Toggles drawing of polygonal objects as polygons.
4PerFlat: Toggles 2/4 polygons per flat surface regions.
MoreIso: Doubles the number of isolines in a surface.
LessIso: Halves the number of isolines in a surface.
FinrAprx: Doubles the number of samples per curve.
CrsrAprx: Halves the number of samples per curve.
LngrVecs: Doubles the length of displayed normal vectors.
ShrtrVecs: Halves the length of displayed normal vectors.
WiderLns: Doubles the width of the drawn lines.
NarrwLns: Halves the width of the drawn lines.
WiderPts: Doubles the width of the cross of drawn points.
NarrwPts: Halves the width of the cross of drawn points.
FinrAdapIso: Doubles the number of adaptive isocurves.
CrsrAdapIso: Halves the number of adaptive isocurves.
FinerRld: Doubles number of ruled surfaces in adaptive isocurves.
CrsrRld: Halves number of ruled surfaces in adaptive isocurves.
RuledSrfApx: Toggles ruled surface approx. in adaptive isocurves.
AdapIsoDir: Toggles the row/col direction of adaptive isocurves.
Front: Selects a front view.
Side: Selects a side view.
Top: Selects a top view.
Isometry: Selects an isometric view.
Clear: Clears the viewing area.


Obviously not all state options are valid for all drivers. The IRIT server defines in iritinit.irt several user-defined functions that exercise some of the above state commands, such as VIEWSTATE and VIEWSAVE.

In addition to state modification via communication with the IRIT server, modes can be interactively modified on most of the display devices using a pop-up menu that is activated using the right button in the transformation window}. This pop up menu is somewhat different in different drivers, but its entries closely follow the entries of the above state command table.


Animation Mode

All the display drivers are now able to animate objects with animation curves' attributes on them. For more on the way animation curves can be created see the Animation Section of this manual

Once a scene with animation curves' attributes is being loaded into a display device, one can enter "animation" mode using the "Animation" button available in all display devices. The user is then prompt (either graphically or in a textual based interface) for the starting time, termination time and step size of the animation. The parameter space of the animation curve is serving as the time domain. The default staring and terminating times are set as the minimal and maximal parametric domain values of all animation curves. An object at time t below the minimal parametric value will be placed at the starting value of the animation curve. Similarly, an object at time t above the maximal parametric value will be placed at the termination value of the animation curve. The user can also set a bouncing back and forth mode, the number of repetitions, and if desired, request the saving of all the different scenes in the animation as seperate files so a high quality animation can be created.

String object can be viewed as text of selected PS font (See -N). The string position is set via a "StrPos" vector attribute (default to the origin), and "StrScale" real attribute to control the string height in world unit (default to 0.1). Text will always be in a plane parallel to the XY plane.


Specific Comments



The x11drvs supports the following X Defaults (searched at ~/.Xdefaults):

        #ifndef COLOR
        irit*MaxColors:                    1
        irit*Trans*BackGround:             Black
        irit*Trans*BorderColor:            White
        irit*Trans*TextColor:              White
        irit*Trans*SubWin*BackGround:      Black
        irit*Trans*SubWin*BorderColor:     White
        irit*Trans*CursorColor:            White
        irit*View*BackGround:              Black
        irit*View*BorderColor:             White
        irit*View*CursorColor:             White
        #else
        irit*MaxColors:                    15
        irit*Trans*BackGround:             NavyBlue
        irit*Trans*BorderColor:            Red
        irit*Trans*TextColor:              Yellow
        irit*Trans*SubWin*BackGround:      DarkGreen
        irit*Trans*SubWin*BorderColor:     Magenta
        irit*Trans*CursorColor:            Green
        irit*View*BackGround:              NavyBlue
        irit*View*BorderColor:             Red
        irit*View*CursorColor:             Red
        #endif
        irit*Trans*BorderWidth:            3
        irit*Trans*Geometry:               =150x500+510+0
        irit*View*BorderWidth:             3
        irit*View*Geometry:                =500x500+0+0



The Motif-based display drivers contain three types of gadgets which can be operated in the following manner. Scales: can be dragged or clicked outside button for single (mouse's middle button) or continuous (mouse's left button) action. Pushbuttons: activated by clicking the mouse's left button. The control panel: allowes rotation, translation of the objects in three axes, determine perspective ratio, viewing object from top, side, front or isometrically, determining scale factor and clipping settings, and operate the matrix stack.

The environment window toggles between screen or object transformation, depth cue on or off, orthographic or perspective projection, wireframe or solid display, single or double buffering, showing or hiding normals, including or excluding the surface;s mesh and curve;s control polygon, surface drawing using isolines or polygons, and four or two polygons per flat patch. Same display devices allow for the inclusion or exclusion of internal edges, and enable or disable of antialiased lines. Scales in the X11/Motif based devices set normals length, lines width, control sensitivity, the number of islolines and samples, etc.

The locations of windows as set via [-g] and [-G] and/or via the configuration file overwrites in x11drvs the Geometry X11 defaults. To use the Geometry X11 default use '-G " "' and '-g " "' or set the string to empty size in the configuration file.

In os2drvs, only -G is used to specify the dimensions of the parent window that holds both the viewing and the transformation window.

In os2drvs, the following key strokes are available as short cuts:
Key Function
^x Quit
^s Save
^f Front View
^d Side View
^t Top View
^i Isometric VIew
^p Perspetive/Orthographic
^n View Internal Edges
^v View Vertices' Normals
^g View Polygons' Normals
^b Backface Culling
^c Depth Cue
^m View Control Mesh/Poly



Examples

 xglmdrvs -z

prints all the options and their current values.

 xglmdrvs -B -i -l 3 solid1.dat

displays the model of solid1.dat using back face culling ('-B'), with internal edges ('-i'), and line width of 3.

 xglmdrvs -r -A flat wiggle.dat

displays the model of wiggle.dat shaded ('-r') using flat shading ('-A').

 xglmdrvs -I 40 -u -b 255 255 255 wiggle.dat

displays the model of wiggle.dat using isolines' density of 40 ('-I'), using unit matrix to begin with ('-u'), and a white background ('-b').

 xglmdrvs -X 0,2,0.1,sx -r anim.dat

executes the animation in anim.dat, from time 0 to time 2 in steps of 0.1. The animation is saved in one frame per file (flag 's' in '-X') and the display device exists once the animation has terminated (flag 'x' in '-X')). The animation will be shaded ('-r').


Utilities - General Usage

The IRIT solid modeler is accompanied by quite a few utilities. They can be subdivided into two major groups. The first includes auxiliary tools such as illustrt and poly3d-h. The second includes filters such as irit2ray and irit2ps.

All these tools operate on input files, and most of the time produce data files. In all utilities that read files, the dash ('-') can be used to read stdin.

Example:

 poly3d-h solid1.dat | irit2ps - > solid1.ps

All the utilities have command line options. If an option is set by a '-x' then '-x-' resets the option. The command line options overwrite the settings in config files, and the reset option is useful for cases where the option is set by default, in the configuration file.

All utilities can read a sequence of data files. However, the last transformation matrices found (VIEW_MAT and PRSP_MAT) are actually used.

Example:

 poly3d-h solid1.dat | x11drvs solid1.dat - solid1.mat 

x11drvs will display the original solid1.dat file with its hidden version, as computed by poly3d-h, all with the solid1.mat, ignoring all other matrices in the data stream.

Under unix, compressed files with a postfix ".Z" will be automatically uncompressed on read and write. The following is legal under unix,

 poly3d-h solid1.dat.Z | x11drvs solid1.dat.Z - solid1.mat

where solid1.dat.Z was saved from within IRIT using the command

 save( "solid1.dat.Z", solid1 );

or similar. The unix system's "compress" and "zcat" are used for the purpose of (un)compressing the data via pipes. See also SAVE and LOAD.


Poly3d-h - Hidden Line Removing Program


Introduction

poly3d-h is a program to remove hidden lines from a given polygonal model. Freeform objects are preprocessed into polygons with controlled fineness.

The program performs 4 passes over the input:

1. Preprocesses and maps all polygons in a scene, and sorts them.

2. Generates edges out of the polygonal model and sorts them (preprocessing for the scan line algorithm) into buckets.

3. Intersects edges, and splits edges with non-homogeneous visibility (the scan line algorithm).

4. Applies a visibility test of each edge.

This program can handle CONVEX polygons only. From IRIT one can ensure that a model consists of convex polygons only using the CONVEX command:

  CnvxObj = convex( Obj );

just before saving it into a file. Surfaces are always decomposed into triangles.

poly3d-h output is in the form of polylines. It is a regular IRIT data file that can be viewed using any of the display devices, for example.


Command Line Options

 poly3d-h [-b] [-m] [-i] [-e #Edges] [-H] [-4] [-W Width]
        [-F PolyOpti FineNess] [-q] [-o OutName] [-t AnimTime]
        [-c] [-z] DFiles > OutFile



-b: BackFacing - if an object is closed (such as most models created by IRIT), back facing polygons can be deleted, therefore speeding up the process by at least a factor of two.

-m: More - provides some more information on the data file(s) parsed.

-i: Internal edges (created by IRIT) - default is not to display them, and this option will force displaying them as well.

-e n: Number of edges to use from each given polygon (default all). Handy as '-e 1 -4' for freeform data.

-H: Dumps both visible lines and hidden lines as separated objects. Hidden lines will be dumped using a different (dimmer) color and (a narrower) line width.

-4: Forces four polygons per almost flat region in the surface to polygon conversion. Otherwise two polygons only.

-W Width: Selects a default width for visible lines in inches.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-q: Quiet mode. No printing aside from fatal errors. Disables -m.

-o OutName: Name of output file. Default is stdout.

-t AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-z: Prints version number and current defaults.

-c: Clips data to screen (default). If disabled ('-c-'), data outside the view screen ([-1, 1] in x and y) are also processed.

Some of the options may be turned on in poly3d-h.cfg. They can be then turned off in the command line as '-?-'.


Configuration

The program can be configured using a configuration file named poly3d-h.cfg. This is a plain ASCII file you can edit directly and set the parameters according to the comments there. 'poly3d-h -z' will display the current configuration as read from the configuration file.

The configuration file is searched in the directory specified by the IRIT_PATH environment variable. For example, 'setenv IRIT_PATH /u/gershon/irit/bin/'. If the IRIT_PATH variable is not set, the current directory is searched.


Usage

As this program is not interactive, usage is quite simple, and the only control available is using the command line options.


If a certain surface should be polygonized into a finer/caurser set of polygons than the rest of the scene, one can set a "resolution" attribute which specifies the relative FineNess resolution of this specific surface. Further, "u_resolution" and "v_resolution" might be similarly used to set relative resolution for the u or v direction only. The "crv_resolution" attribute controls the relative fineness of curves as polylines. The "num_of_isolines" attribute controls the relative number of isoparametric curves.

See also IHidden.


Poly3d-r - A Simple Data Rendering Program

Retired. Sources can be found in the contrib directory, but this program is no longer supported. See irender program instead.


Illustrt - Simple line illustration filter


Introduction

illustrt is a filter that processes IRIT data files and dumps out modified IRIT data files. illustrt can be used to make simple nice illustrations of data. The features of illustrt include depth sorting, hidden line clipping at intersection points, and vertex enhancements. illustrt is designed to closely interact with irit2ps, although it is not neceessary to use irit2ps on illustrt output.


Command Line Options

   illustrt [-I #UIso[:#VIso[:#WIso]]] [-f PolyOpti SampTol] [-s] [-M] [-P]
            [-p] [-O] [-l MaxLnLen] [-a] [-t TrimInter] [-o OutName]
            [-Z InterSameZ] [-m] [-T AnimTime] [-z] DFiles



-I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per surface/trivariate, per direction. If #VIso is not specified, #UIso is used for #VIso as well and so no.

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-s: sorts the data in Z depth order that emulates hidden line removal once the data are drawn.

-M: Dumps the control mesh/polygon as well.

-P: Dumps the curve/surface as isocurves.

-p: Dumps vertices of polygons/lines as points.

-O: Handle polygonal objects as possibly open. This will generate two identical edges for an edge shared by two adjacent polygons. Can be useful for open or isolated polygons.

-l MaxLnLen: breaks long lines into shorter ones with maximal length of MaxLnLen. This option is necessary to achieve good depth depending line width in the '-d' option of irit2ps.

-a: takes into account the angle between the two (poly)lines that intersect when computing how much to trim. See also -t.

-t TrimInter: Each time two (poly)line segments intersect in the projection plane, the (poly)line that is farther away from the viewer is clipped TrimInter amount from both sides. See also -a.

-o OutName: Name of output file. Default is stdout.

-Z InterSameZ: The maximal Z depth difference of intersection curves to be be considered invalid.

-m: More talkative mode. Prints processing information.

-T AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-z: Prints version number and current defaults.


Usage

illustrt is a simple line illustration tool. It process geometry such as polylines and surfaces and dumps geometry with attributes that will make nice line illustrations. illustrt is geared mainly toward its use with irit2ps to create postscript illustrations. Here is a simple example:

 illustrt -s -l 0.1 solid1.dat | irit2ps -W 0.05 -d 0.2 0.6 -u - > solid.ps

make sure all segments piped into irit2ps are shorter than 0.1 and sort them in order to make sure hidden surface removal is correctly applied. Irit2ps is invoked with depth cueing activated, and a default width of 0.05.

illustrt dumps out regular IRIT data files, so output can be handled like any other data set. illustrt does the following processing to the input data set:



Converts surfaces to isocurves ('-I' flag) and isocurves and curves to polylines ('-S' flag), and converts polygons to polylines. Polygonal objects are considered closed and even though each edge is shared by two polygons, only a single one is generated.

Finds the intersection location in the projection plane of all segments in the input data set and trims away the far segment at both sides of the intersection point by an amount controlled by the '-t' and '-a' flags.

Breaks polylines and long lines into short segments, as specified via the '-l' flag, so that width depth cueing can be applied more accurately (see irit2ps's '-d' flag) as well as the Z sorting.

Generates vertices of polygons in the input data set as points in output data controlled via the '-p' flag. set.

Applies a Z sort to the output data, if '-s', so drawing in order of the data will produce a properly hidden surface removal drawing.

Here is a more complex example. Make sure tubular is properly set via "attrib(solid1, "tubular", 0.7);" and invoke:

 illustrt -s -p -l 0.1 -t 0.05 solid1.dat |
     irit2ps -W 0.05 -d 0.2 0.6 -p h 0.05 -u - > solid.ps

makes sure all segments piped into irit2ps are shorter than 0.1, generates points for the vertices, sorts the data in order to make sure hidden surface removal is correctly applied, and trims the far edge by 0.05 at an intersection point. Irit2ps is invoked with depth cueing activated and a default width of 0.05, points are drawn as hollowed circles of default size 0.05, and lines are drawn tubular.

Objects in the input stream that have an attribute by the name of "IllustrtNoProcess" are passed to the output unmodified. Objects in the input stream that have an attribute by the name of "SpeedWave" will have a linear segments added that emulate fast motion with the following attributes,

 "Randomness,DirX,DirY,DirZ,Len,Dist,LenRandom,DistRandom,Width".

Objects in the input stream that have an attribute by the name of "HeatWave" will have a spiral curves added that emulate a heat wave in the +Z axis with the following attributes,

 "Randomness,Len,Dist,LenRandom,DistRandom,Width".

Examples:

 attrib(Axis, "IllustrtNoProcess", "");
 attrib(Obj, "SpeedWave", "0.0005,1,0,0,5,3,3,2,0.05");
 attrib(Obj, "HeatWave", "0.015,0.1,0.03,0.06,0.03,0.002");


Aisoshad - Simple line illustration filter


Introduction

Aisoshad is a filter that processes IRIT data files of freeform shapes and dumps out modified IRIT data files in the form of short univariate strokes. Aisoshad can be used to make simple yet nice line art illustrations of geometry that is based solely on isoparametric curves.

Aisoshad employs a simple shader to determine the density of the isoparametric strokes as well as the thickness etc. Output of aisoshad cat be piped into the irit2ps postscript postprocessor.


Command Line Options

   aisoshad [-o OutName] [-m] [-i] [-F PolyOpti FineNess]
            [-f PolyOpti SampTol] [-r RndrMdl] [-c CosPwr] [-s SdrPwr]
            [-l Lx Ly Lz] [-R Random] [-d AdapDir] [-t SrfZTrans]
            [-M MinSubdiv] [-D AdapDist] [-w AdapIsoWidth] [-S WidthScale]
            [-W] [-u] [-Z ZbufSize] [-b] [-z] DFiles



-o OutName: Name of output file. Default is stdout.

-m: More talkative mode. Prints processing information.

-i: Solve symbolic products using interpolations. Faster but the generated output is not as compact as possible.

-I #IsoLines: Specifies number of isolines per surface, per direction.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. Default is 0 and 20.0 (no optimal sampling with fineness of 20.0 (real number)).

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-r: Selects the rendering model of the shader as follows:

1. Cosine shader, diffuse only, light source regular.

2. Cosine shader, diffuse only, light source as two lights from opposite directioons.

3. Cosine shader, have specular term, light source regular.

4. Cosine shader, have specular term, light source as two lights.

5. Shader emphasizing the silhouette areas of the model.

6. Shader estimating distance decay from a point light source.

-c CosPower: Controls the cosine shader's power.

-s SdrPower: Controls the shader's relative influence.

-l Lx Ly Lz: Sets the light source position/direction.

-R Random: Controls the levels of randomness that the isoparametric curves are perturbed. Low levels of randomness would leave visible artifacts while too high levels would disturb the shading.

-d AdapDir: Sets the isoparametric directions of the strokes. Either 0, 1, or 2 for U direction, V direction or both U and V directions, respectively.

-t SrfZTrans: Amount to translate the created line strokes in Z, in order to prevent Z fighting with the rendered object itself.

-M MinSubdiv: Sets the minimal number of subdivision to enforce during the isoparametric strokes construction. This flag should be rarely used and typically MinSubdiv should be low and close to one.

-D AdapDist: Sets the distance between adjacent isocurves. The smaller AdapDist is the denser the coverage of the strokes would be.

-w AdapIsoWidth: Sets the default width attribute of the generated strokes.

-S WidthScale: Controls the relative variance of the width of the strokes in variable width strokes.

-W: If set, enables variable width strokes.

-u: If set, maps the strokes to screen space. Otherwise, strokes are mapped back to object space.

-Z ZbufSize: ZbufSize sets the size of the (square) Z buffer to set.

-b: If set, generates binary irit data file that holds the strokes. Otherwise, irit text file will be created.

-z: Print version number and current defaults.


Usage

aisoshad is a simple line art illustration tool that generates strokes that follows the isoparametric curves. It processes freeform geometry such as surfaces and dumps geometry with attributes that makes nice line illustrations. aisoshad is geared mainly toward its use with irit2ps to create postscript illustrations. Here is a simple example:

 aisoshad -Z -500 -F 0 50 -s 10 -c 1 -D 0.3 -r 5 wglass.dat view.mat |
 irit2ps -W 0.05 -d 0.2 0.6 -u - > wglass1.ps

that creates line art illustrations of a wine glass wglass.dat with hidden strokes removal via a Z-buffer of size 500 that will be displayed on screen, polygonal fineness of 50 for the surface of the glass, shader power of 10 and cosine power of 1, isoparametric curves maximal distance of 0.3, and shader number 5 that emphasizes silhouettes. The output of the shader is piped tp irit2ps filter to postscript that sets the width of the strokes to be a function of depth.

Here is another example:

 aisoshad -Z 700 -R 4 -F 0 50 -l 1 1 1 -D 0.02 -r 2 wglass.dat view.mat
 irit2ps -W 0.005 -d 0.2 0.6 -u - > wglass2.ps

that creates line art illustrations of a wine glass wglass.dat with hidden strokes removal via a Z-buffer of size 700 that is allocated off line in core memory, polygonal fineness of 50 for the surface of the glass, a light source at (1, 1, 1), isoparametric curves maximal distance of 0.02, and a cosine shader number 2. The output of the shader is piped tp irit2ps filter to postscript that sets the width of the strokes to be a function of depth.

Transparent objects, or objects with "transp" attribute would generate strokes as regular surfaces but would not participate in the hidden strokes removal. An "AdapIsoDir" attribute that is found on some surface object would override the global isoparametric direction's setup of strokes as is set via the 'd' option.

See also the illustrt, izebra, lineshad, and irit2ps tools.


IZebra - Simple zebra style, parallel curve based rendering


Introduction

Izebra is a filter that processes IRIT data files into 2D stripes, zebra style, illustration that give the user an illusive depth cues. The output is also an IRIT data files in the form of freeform curves. Izebra can be used to make simple yet nice art illustrations of geometry that is based on a specific style that is inspired by the artist Victor Vasarely.

Izebra employs a Z buffer to determine the density and warping of the stripes. Output of izebra cat be piped into the irit2ps postscript postprocessor.


Command Line Options

    IZebra [-o OutName] [-m] [-O ImgOper] [-F PolyOpti FineNess] [-u]
           [-I NumIters] [-Z ZbufSize] [-B CbcBspSize] [-D DataSrf]
           [-A StripeAngle] [-b] [-s Stripes] [-S ZScale] [-d ZInitDepth]
           [-z] DFiles



-o OutName: Name of output file. Default is stdout.

-m: More talkative mode. Prints processing information.

-O ImgOper: By default, the Z buffer is employed directly. However, once the Z buffer is fully evaluated and before we begin the stripes processing, one can apply a filter to the Z map of the Z buffer. The filter can be a first order Roberts derivative if "-O 1", a second order laplacian if "-O 2", an inverted depth if "-O 3".

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. Default is 0 and 20.0 (no optimal sampling with fineness of 20.0 (real number)).

-u: Forces a Unit matrix. That is, input data are not transformed at all.

-I NumIters: Puts a bound on the number of iterations in the numerical processing stage.

-Z ZbufSize: ZbufSize sets the size of the (square) Z buffer to set.

-B CbcBspSize: Sets the mesh size of the constructed uniform cubic Bspline grid, if no data surface is specified by '-D'.

-D DataSrf: If specified, provides the name of the uniform cubic Bspline to load and warp. Overrides the '-B' option.

-A StripeAngle: Sets the angle of the stripes with respect to the horizontal line, in degrees.

-b: If set, generates binary irit data file that holds the stripes. Otherwise, irit text file will be created.

-s Stripes: If set, prescribes the number of strips to extract as iso parametric curves of the warped Bspline surface. Otherwise, the warped Bspline surface itself is dumped out.

-S ZScale: A relative factor to control the affect of the depth on the warping amount. Should be around one.

-d ZInitDepth: By default, the Z buffer is initialized to depth of zero which amounts to no warping of the Bspline surface. Here is a proper way to prescribed a different background depth (which will cause warping in the surface).

-z: Print version number and current defaults.


Usage

Izebra is a simple stripes art illustration tool that generates stripes that follows a warped Bspline surface as its isoparametric curves. It processes the given geometry, such as surfaces, into a Z map of a Z buffer and warps a Bspline surface that is placed over it, with a wapring amount that is a function of the locally detected depth. IZebra dumps out stripes geometry that makes nice illusive illustrations. IZebra is geared mainly toward its use with irit2ps to create postscript illustrations. Here is a simple example:

 izebra -m -Z 500 -B 150 -I 10 -F 0 100 -A 140 -S 0.35 pawn.dat |
 irit2ps -f 0 300 -u -B -0.45 -0.75 0.65 0.75 -W 0.004 -I 0:250 - > pawn.ps

that creates stripes illustrations of a pawn chess piece, with the aid of a Z-buffer of size 500 by 500, a uniform cubic Bspline surface with mesh size of 150 by 150, polygonal fineness of 100 for the surface of the pawn, rotation of stripes of 140 degrees and Z scale factor of 0.35. 10 Iterations will be conducted during the numerical processing of the data. The output of izebra is piped tp irit2ps filter to postscript that extracts 250 isoparametric curves out of the dumped warped surface and sets the width of the strokes to be 0.004.

Here is another example:

 izebra -m -Z 500 -B 200 -I 10 -F 0 100 -A -90 -S 0.4 teapot.dat |
 irit2ps -f 0 200 -u -B -0.55 -0.35 0.55 0.35 -W 0.007 -I 0:150 - > teapot.ps

that creates stripes illustrations of the Utah Teapot, with the aid of a Z-buffer of size 500 by 500, a uniform cubic Bspline surface with mesh size of 200 by 200, polygonal fineness of 100 for the surface of the pawn, rotation of stripes of -90 degrees and Z scale factor of 0.4. 10 Iterations will be conducted during the numerical processing of the data. The output of izebra is piped tp irit2ps filter to postscript that extracts 150 isoparametric curves out of the dumped warped surface and sets the width of the strokes to be 0.007.

See also the illustrt, aisoshad, lineshad, and irit2ps tools.


LineShad - Simple line illustration filter


Introduction

Lineshad is a filter that processes IRIT data files of freeform shapes and dumps out modified IRIT data files in the form of short univariate strokes. Lineshad can be used to make simple yet nice line art illustrations of geometry that is based on arbitrary stroked curves on the surfaces.

Lineshad employs a simple shader to determine the density of the isoparametric strokes as well as the thickness etc. Output of lineshad cat be piped into the irit2ps postscript postprocessor.


Command Line Options

   lineshad [-o OutName] [-m] [-F PolyOpti FineNess] [-R RelStepSize]
            [-f PolyOpti SampTol] [-r RndrMdl] [-c CosPwr] [-s SdrPwr]
            [-i Intensity] [-l Lx Ly Lz] [-v Vx Vy Vz] [-w Width]
            [-d Density] [-t SrfZTrans] [-S WidthScale] [-T Texture]
            [-Z ZbufSize] [-b] [-z] DFiles



-o OutName: Name of output file. Default is stdout.

-m: More talkative mode. Prints processing information.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. Default is 0 and 20.0 (no optimal sampling with fineness of 20.0 (real number)).

-R RelStepSize: Relative control (default to 1.0) on the step size taken during the numerical marching on the surfaces in the different strokes' patterns.

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-r: Selects the rendering model of the shader as follows:

1. Dumps only the uniform point distribution.

2. Cosine shader, diffuse only, light source regular.

3. Cosine shader, diffuse only, light source as two lights from opposite directioons.

4. Cosine shader, have specular term, light source regular.

5. Cosine shader, have specular term, light source as two lights.

6. Shader emphasizing the silhouette areas of the model.

7. Shader estimating distance decay from a point light source.

-c CosPower: Controls the cosine shader's power.

-s SdrPower: Controls the shader's relative influence. -i Intensity: Controls the global density of the constructed line art. The larger Intensity is, the denser the drawing becomes.

-l Lx Ly Lz: Sets the light source position/direction.

-v Vx Vy Vz: Sets the viewing direction. Typically the Z axis.

-w Width: Sets the width of the generated strokes.

-d Density: Relative control (default to 1.0) of the density of the uniform point distribution from which the strokes are developed from.

-t SrfZTrans: Amount to translate the created line strokes in Z, in order to prevent Z fighting with the rendered object itself.

-S WidthScale: Controls the relative variance of the width of the strokes in variable width strokes.

-T Textures: Selects the pattern of the strokes. Texture can be one of:

1. "isoparam[,{0,1,2}w]": Isoparametric curves will be created in a similar way to the aisoshad tool. Following the "isoparam" string, one can optionally specify the isoparametric direction as 0, 1 or 2 for U, V, or both, and a second 'w' character for optional variable width. This option extract exact isoparametric curves from the given surface.

2. "wood[,Dx,Dy,Dz]": A strokes' style following layers of wood will be used. Optionally a direction normal to the layers can be specified, with a default being the Z axis.

3. "vood[,Ry,Rz]": A variation on the wood texture, this time with a layered orientation set via two rotation angles around Y and Z.

4. "isomarch[,{0,1,2}]": Similar to "isparam" but numerically march on the surface in the isoparametric direction. Again 0, 1, or 2 stands for U, V, or both isoparametric directions.

5. "silhouette[,{t,n,tn}]": Extract strokes emphasizing the silhoeutte areas from the given viewing direction. Strokes can be extracted in the direction of the surface normal near the silhouette area if option ",n" is given, tangent along the surface if ",t", or both if ",tn".

6. "iTexture": Employ a raster image as a texture image on the surface with the gradient of the image serving as the direction of strokes. The name of the image itself (must be in urt rle format) is extected in a "iTexture" attribute on the specific object.

7. "curvature[,{0,1,2}]": Develope strokes along lines of curvatures. Strokes are developed along the minimal curvature if ",0", the maximal curvature if ",1" and both if ",2".

8. "CurveStroke": An XY curve object is expected as a "CurveStroke" attribute on the same object and serves as a specification of motion in the parametric space of the surface for each given point.

-Z ZbufSize: ZbufSize sets the size of the (square) Z buffer to set.

-b: If set, generates binary irit data file that holds the strokes. Otherwise, irit text file will be created.

-z: Print version number and current defaults.


Usage

lineshad is a simple line art illustration tool that generates strokes that follows the isoparametric curves. It processes freeform geometry such as surfaces and dumps geometry with attributes that makes nice line illustrations. lineshad is geared mainly toward its use with irit2ps to create postscript illustrations. Here is a simple example:

 lineshad -Z -500 -F 0 50 -T "isoparam" -d 0.5 -c 10 -r 2 wglass.dat view.mat |
 irit2ps -W 0.002 -u - > wglass3.ps

that creates line art illustrations of a wine glass wglass.dat with hidden strokes removal via a Z-buffer of size 500 that will be displayed on screen, polygonal fineness of 50 for the surface of the glass, shader that employes isoparametric curves, relative density of distribution of 0.5, cosine power of 10 of the cosine shader number 2.

Here is another example:

 lineshad -Z -500 -F 0 50 -T "wood,1,1,1" -d 6 -c 10 -r 2 wglass.dat view.mat |
 irit2ps -W 0.002 -u - > wglass4.ps

that creates line art illustrations of a wine glass wglass.dat with hidden strokes removal via a Z-buffer of size 500 that is allocated off line in core memory, polygonal fineness of 50 for the surface of the glass, a light source at (1, 1, 1) for the wood strokes' style, relative point distribution of 6, and a cosine power of 10 for the cosine shader number 2.

Transparent objects, or objects with "transp" attribute would generate strokes as regular surfaces but would not participate in the hidden strokes removal. A string "itexture" attribute is expected if "itexture" strokes' style is used. A curve object as "CurveStroke" attribute is expected if "CurveStroke" is employed. One can override the strokes' style as is set via the '-T' command line option by setting an "lTexture" string attribute with the prefered strokes' style of this object. One can modify the relative density of some specific object by placing a real number attribute named "PtsDensity" on the object.

See also the illustrt, izebra, aisoshad, and irit2ps tools.


ihidden - Hidden Curve Removing Program


Introduction

ihidden is a program to remove hidden curves from a given surface model. Only freeform objects are processed in ihidden.

The program performs 3 passes over the input:

1. Preprocesses and extract the different curves in a scene, boundary curves, silhouette curves, isoparametric curves and discontinuity curves.

2. Solve for all the intersections of the different curves in the parametric space, and split there the curves into curve segments.

3. Applies a visibility test of each segment of curve.

This program can handle non self interesecting surfaces only. Further, surfaces that intersects other surfaces and are not properly trimmed into a model are likely to result in the wrong answer as well.

The output of ihidden is in the form of curves. It is a regular IRIT data file that can be viewed using any of the display devices, for example.


Command Line Options

 ihidden [-q] [-H] [-I #UIso[:#VIso[:#WIso]]] [-s Stage] [-b]
         [-o OutName] [-C CCTTol] [-S RSITol] [-Z ZBufSz] [-t AnimTime]
         [-z] DFiles



-q: Quiet - provides no information on the progress if TRUE.

-H: Dumps both visible lines and hidden curves as separated objects. Hidden curves will be dumped using a narrower line width.

-I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per surface/trivariate, per direction. If #VIso is not specified, #UIso is used for #VIso as well and so no.

-s: Specifies the step to stop this process at, where step 3, as described above, will complete the entire hidden curve removal process and is the default.

-b: If set, generates binary irit data file that holds the strokes. Otherwise, irit text file will be created.

-o OutName: Name of output file. Default is stdout.

-C CCTTol: Tolerance of the curve curve intersection (CCI) process.

-S RSITol: Tolerance of the surface fineness in the ray surface intersection (RSI) and visibility testing process as well as in the silhouette extraction.

-Z ZBufSz: Size of the Z buffer in the visibility testing process.

-c: Clips data to screen (default). If disabled ('-c-'), data outside the view screen ([-1, 1] in x and y) are also processed.

-t AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-z: Prints version number and current defaults.

Some of the options may be turned on in ihidden.cfg. They can be then turned off in the command line as '-?-'.


Configuration

The program can be configured using a configuration file named ihidden.cfg. This is a plain ASCII file you can edit directly and set the parameters according to the comments there. 'ihidden -z' will display the current configuration as read from the configuration file.

The configuration file is searched in the directory specified by the IRIT_PATH environment variable. For example, 'setenv IRIT_PATH /u/gershon/irit/bin/'. If the IRIT_PATH variable is not set, the current directory is searched.


Usage

As this program is not interactive, usage is quite simple, and the only control available is using the command line options.


If a certain surface should contain more or less isoparametric curves, a relative change could be applied to some specific object via the "num_of_isolines" attribute. If a "transp" attribute is found on some object, it will generate all the curves but will not affect the visibility (i.e. be fully transparent).

See also Poly3d-h.


Irender - Simple Scan Line Renderer


Introduction

irender is a program to render IRIT scenes into images. It is a software based Z buffer that is able to create images in few formats. Several of its features includes parametric and volumetric texture mapping, shadow computations, transparency and antialiasing.

Freeform objects are preprocessed into polygons with controlled fineness.


Command Line Options

  irender [-z] [-v] [-s XSize YSize] [-a Ambient] [-b R G B] [-B]
          [-F PolyOpti FineNess] [-f PolyOpti SampTol]
          [-M Flat/Gouraud/Phong/None] [-P WMin [WMax]] [-S] [-T] [-t AnimTime]
          [-A FilterName] [-Z] [-n] [-i rle/ppm{3,6}] files



-z: Prints version number and current defaults.

-v: Verbose mode. Prints informative messages as it progresses.

-s XSize YSize: Sets the size of the output image, in pixels. Default to 512x512.

-a Ambient: Sets the ambient lighting fraction. Between zero (no ambient lighting) and one. Default to 0.2.

-b R G B: Sets the background color. Each of thre R,G,B colors is an integer value between zero and 255. Default to black.

-B : Apply back face culling. Somewhat faster, but only correct for closed objects. Default is no back face culling.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. Default is 0 and 20.0 (no optimal sampling with fineness of 20.0 (real number)).

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-M Flat/Gouraud/Phong/None: Selects the shader to be used. Default to Phong if has normals of vertices, Flat if no normals are found. The None options exactly paints the objects with the given color, applying no shader.

-P WMin [WMax]: Width of rendered polyline, in pixels. If only WMin is specified, all polylines are set to have WMin width. Otherwise, if WMax is prescribed as well, polylines' width is set to be proportional to their depth with WMax is the width of closest polyline and WMin the farest polyline. Polylines and curves will be ignored without the setting of this option.

-S: Enable shadow computation. No shadows will be rendered without -S.

-T: Enable transparency computation. No transparent object will be processed without -T.

-t AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-A FilterName: Selects an antialiasing filter. FilterName can be one of 'none', 'box', 'triangle', 'quadratic', 'cubic', 'catrom', 'mitchell', 'gaussian', 'sinc, and 'bessel'. Default is 'none'.

-Z: Output will be in the form of Z depth instead of a color image. Output will be 32 bits depth instead of RGBA.

-n: Reverses the normals of vertices and planes, globally.

-i rle/ppm{3,6}: Selects output image type. Currently the Utah Raster Toolkit's (URT) rle format is being supported as well as the PPM format. PPM can be either P6 or P3 style.

Some of the options may be turned on in irender.cfg. They can be then turned off in the command line as '-?-'.


Configuration

The program can be configured using a configuration file named irender.cfg. This is a plain ASCII file you can edit directly and set the parameters according to the comments there. 'irender -z' will display the current configuration as read from the configuration file.

The configuration file is searched in the directory specified by the IRIT_PATH environment variable. For example, 'setenv IRIT_PATH /u/gershon/irit/bin/'. If the IRIT_PATH variable is not set, the current directory is searched.


Usage

As this program is not interactive, usage is quite simple, and the only control available is using the command line options.



Advanced Usage

One can specify several attributes that affect the way the scene is rendered. The attributes can be generated within IRIT. See also the ATTRIB IRIT command.

Surface color is controlled in two levels. If the object has an RGB attribute, it is used. Otherwise, a color as set via the IRIT COLOR command is used.

If a certain surface should be finer/caurser than the rest of the scene, one can set a "resolution" attribute which specifies the relative FineNess resolution of this specific surface. Further, "u_resolution" and "v_resolution" might be similarly used to set relative resolution for the u or v direction only. The "crv_resolution" attribute controls the relative fineness of curves as polylines. The "num_of_isolines" attribute controls the relative number of isoparametric curves.

Example:

 attrib( Ball, "rgb", "255,0,0" );
 color( Sphere, white );

The cosine exponent of the phong shader can be set for a specific object via the SRF_COSINE attribute.

Example:

 attrib( Ball, "srf_cosine", 16 );

An object can be drawn transparent instead of opaque, if it has a "transp" attribute. A transparent value of one denotes a completely transparent object, while a value of zero means a completely opaque object. Transparent object will be rendered as such if and only if the '-T' command line option is set.

Example:

 attrib( final, "transp", 0.5 );

Several types of texture mapping are supported. Parametric texture may be attached to a parametric surface where the prescribed image is mapped onto the rectangular parametric domain of the surface.

The parametric texture may be applied with the following options:
'D' x y z Vector that will be rotated to Z along with the
texture coordinates. Applies to 'T' 1, 2 or 3.
Default to the Z axis.
'O' x y z a point that texture Origin will be translated
to. Applies to 'T' 1, 2 or 3. Default to origin.
'S' Su Sv Scales the coordinated in u and v. Scale
factors of 1.0 would cover the entire surface
once. Default to scale factors of 1.0.
'A' a Angle of rotation in degrees of texture map with
respect to main axis. Applies to 'T' 1, 2 or 3.
Default to no rotations.
'T' TextureType with 0 denotes regular parametric texture,
1 denotes spherical coordinates,
2 denotes spherical bijective coordinates,
3 denotes cylinderical coordinates,
4 denotes planar coordinates.


Regular parametric texture employs the inherit surface parametrization of the freeform surface and can only be used on parametric surfaces.

Spherical, cylinderical, and planar coordinate transformations are useable for all types of geometry from polygons to freeform surfaces and is fairly straight forward with the origin as set by 'O' being the center of the mapping while the direction set by 'D' controls the north pole of the sphere, the axis of the cylinder, and the normal of the plane. Finally, the angle set by 'A' rotates the texture around this 'D' prescribed axis.

The spherical bijective mapping is more complex. An identical object to the textured object should be found as an "PTextureBijectObj" that contains the identical topology of the original object. The original object must be Genus zero non convex, while the attribute object must be Genus zero convex object with the origin as set via 'O', inside this convex object. It is likely that both the original one and its attribute object will be polygonal object. Both objects must contain triangles only.

A bijective mapping is conducted then from every point on the original non convex object to the convex attribute object and from there through spherical mapping to the texture map.

Example:

 attrib( Srf1,        "ptexture", "checker.ppm, S 1 1, A 45" );
 attrib( Srf2,        "ptexture", "checker.ppm, S 1 3, T 1, O 1 1 1, D 0 0 1" );
 attrib( Srf3Triangs, "ptexture", "checker.ppm, S 1 2, T 1, O 1 1 1, D 0 0 1" );
 attrib( Srf3Triangs, "PTextureBijectObj", Srf3ConvexTriangles );

Srf1 is to be parametrically textured map using spherical mapping, Srf2 is to be parametrically textured map using cylinderical mapping and Srf3Triangs is to be parametrically textured map using spherical bijective mapping and Srf3ConvexTriangles as the convex topologically equivalent object.

The program will automatically detected a ppm file from an rle according to the file's name. Note that regular parametric texture may be applied to parametric surfaces only, whereas the spherical, cylinderical and planar parametric textures may be used on all type of geometry.

A second type of texture mapping can be applied to all geometric objects. Herein, a procedural texture mapping is employed. The currently supported textures are

camouf Camouflage style
checker Checker style
chocolate Chocolate chips style
contour Parallel plane contouring
curvature Gaussian/Mean etc. curvature
marble Marble style
ncontour Constant normal angle to major axis
orange Bump mapping orange style
wood Wood style
punky Colorful punky style
A second parameter that must be provided for procedural textures is the scaling factor of the texture, which can be either one parameter of uniform scaling or a vector of three coefficients for scaling in x, y, and z. For contour style, the scale denotes the spacing of the contouring planes in X, Y and Z. For ncontour style, the scale also denotes the spacing of the adjacent constant normal contours. Related attributes are "texture_color" and "texture_width" that supports the color and the width of the textured strokes.

Example:

 attrib( Obj1, "texture", "marble, 2" );
 attrib( Obj2, "texture", "wood, 1 0.5 2.5" );

which sets Obj1 to have a marble procedural texture with a uniform scaling factor of 2 and a wood texture for Obj2 with scaling factors of (1, 0.5, 2.5) in x, y, and z.

In addition, the appearance of each procedural texture can be controlled by optional parameters which are different for each texture. Each texture parameter is recognized by a letter, to enter a parameter, add to the attribute string the paramter letter followed by the value or values. Each parameter should be seperated by a comma.

Example:

 attrib( Obj1, "texture", "wood, 2, b 0.3, o 5 5 5" );

Which sets Obj1 to have a wood procedural texture with a scaling factor of 2, a Brightness level of 0.3, and the Origin point at (5,5,5).

The optional parameters are:

checker:
'z' x y z a vector that the Z axis will be rotated to.
'o' x y z a point that the Origin will be translated to.
'b' x the brightness of the checker color scaling,
should be between 0 and 1.
'CP' f To force a 2D checker plane orthogonal to the
vector that is specified via the 'z' option.
'C1' r g b A second optional color for the checker board.
'C2' r g b A third optional color for the checker board,
used in the second layer of the checker volume.
'C3' r g b A fourth optional color for the checker board,
used in the second layer of the checker volume.


chocolate:
'W' w the 'width' of chocolate piece (zero to half).
'd' x the 'depth' of the bumps on the bump-mapping.


contour:
'W' w the 'width' of contour.
'C' r g b the color of the contour in RGB betweeo zero
and one ("C 1 1 1" fully is white).


curvature:

The curvature texture has no optional parameter, but the first scale parameter has a special meaning. A scale of
0 Paints convex regions in red, concave in
green, and saddle-like in yellow.
>0 Paints the Gaussian curvature in convex regions
in red to magenta, in concave regions in yellow
to green, and in saddle-like in cyan to blue.
<0 Paints the Mean curvature in positive mean
curvature regions in yellow to green and in
negative Mean curvature in red to magenta.
If this first scale parameter is non zero its absolute value is used to modify the blending speeds between the different color.

marble:
'z' x y z a vector that the Z axis will be rotated to.
'o' x y z a point that the Origin will be translated to.
't' f s the scale of the turbulence noise, and the
factor to multiply that noise.
'f' x the 'frequency' of the marble layers.


ncontour:
'W' w the 'width' of contour.
'C' r g b the color of the contour in RGB betweeo zero
and one ("C 1 1 1" fully is white).


orange:
'd' x the 'depth' of the bumps on the bump-mapping.


wood:
'z' x y z a vector that the Z axis will be rotated to.
'o' x y z a point that the Origin will be translated to.
'b' x the brightness of the wood color scaling,
should be between 0 and 1.
'c' f s the scale of the noise in the wood center axis
and the factor to multiply that noise.
'w' n f the number of angles to sample noise when creating
distortion in the circle shape of the wood
cylinders, and the factor to multiply that noise.
'f' x the 'frequency' of the wood cylinders.
'r' f s the scale of the wood-fibers noise, and the
factor to multiply that noise.


punky:
'b' x the brightness/saturation of the punky color.


More Example:

 attrib( Obj1, "texture", "marble, 2, t 3.0 12.0, f 7.0" );
 attrib( Obj2, "texture", "contour, 1 0.5 2.5, W 0.004, C 1 1 0" );

which sets Obj1 to have a marble procedural texture with a uniform scaling factor of 2, and new turbulance and frequency factors. Also sets a contouring texture for Obj2 with scaling factors of (1, 0.5, 2.5) in x, y, and z, in yellow color and width 0.004.

In addition, a scalar surface spanning the same parameteric domain as an original surface may be used as texture mapping function. Herein, the scalar function texture is evaluated at each UV parameter value and is mapped through a color scale to yield the output color. This type of texture is useful for stress maps or analysis maps on top of freeform surfaces. Several related attributes are supported: "stexture_scale" which prescribes the color scale image (only its first column is employed), and "stexture_bound" that sets the domain that will be clipped to the min max values. Funally, "stexture_func" can hold the functions "sqrt" or "abs" to be applied to the evaluated surface value.

Example:

 attrib( Srf, "stexture", scrvtr( Srf, P1, off ) );
 attrib( Srf, "stexture_scale", "color_scale.ppm" );
 attrib( Srf, "stexture_func", "sqrt" );
 attrib( Srf, "stexture_bound", "0.0 100.0" );

where scrvtr computes a scalar field to Srf that represents the sum of the squares of the principle curvatures. The evaluated scalar texture surface's value is piped through a sqrt function. The first column of the image of color_scale.ppm is used to set the coloring scale for curvature bounds values between 0.0 and 100.0.

Both "stexture_scale" and "stexture_bound" are optional. The default color scale maps the min/max values from blue to red through green. The default scalar surface texture bound is computed as the extreme values of the "stexture" surface.

While the program has a default for lighting which is two light sources at opposite directions at (1, 1, 1) and (-1, -1, -1), one can overwrite this default. A POINT_TYPE object with LIGHT_SOURCE attribute denotes a light source. If irender detects one or more light sources in the input stream, the default light sources are not created. Two types of light sources may be prescribed, a parallel at infinity or a point at finite distance light source, distinguished by a TYPE attribute of either POINT_POS or POINT_INFTY. A point light source can be colored, when an RGB attribute will set its color. A point light source will cast shadows if and only if it has SHADOW attribute (one needs to apply the '-S' command line option as well for rendering shadows). Finally, one can construct two mirrored light sources at opposite directions if TWOLIGHT attribute is added to the light source object.

Example:

    Light1 = point( 0, 0, 10 );
    attrib( Light1, "light_source", on );
    attrib( Light1, "shadow", on );
    attrib( Light1, "rgb", "255,0,0" );
    attrib( Light1, "type", "point_pos" );

    Light2 = point( 1, 1, 1 );
    attrib( Light2, "light_source", on );
    attrib( Light2, "twolight", on );
    attrib( Light2, "type", "point_infty" );

constructs two lights sources with Light1 with red color positioned at (0, 0, 10) and casting shadows, while Light2 will create two mirrored white parallel lights sources in the direction of (1, 1, 1) and (-1, -1, -1), as is irender's default.


3DS2Irit - AutoCad 3DS Data To IRIT file filter

Converts '.3ds' data files to '.dat' IRIT data files.


Command Line Options

   3ds2Irit [-m] [-c ClrScale] [-o OutName] [-b] [-z] 3DSFile



-m: More information flag.

-c ClrScale: Scaling the color values (intensity control).

-o OutName: Name of output file. By default the output goes to stdout.

-b: If set, generates binary irit data file that holds the strokes. Otherwise, irit text file will be created.

-z: Print version number and current defaults.


Usage

3ds2irit converts Autocad's 3DS data files into IRIT data files. The current version provides only partial support, mainly due to luck of documentation examples on the dxf format and the convoluted way freeform surfaces are saved.

Example:

    3ds2irit file.3ds > file.dat


Dat2Bin - Data To Binary Data file filter


Command Line Options

   dat2bin [-t] [-z] DFiles



-t: Dumps data to stdout as text instead of binary. -z: Print version number and current defaults.


Usage

It may be sometimes desired to convert .dat data files into a binary form, for example, for fast loading of files with large geometry. Binary files can be somewhat larger, are unreadable in editors but are much faster to load in. A binary file must have a '.bdt' file type.

Example:

   dat2bin b58polys.dat > b58polys.bdt
   dat2bin -t b58polys.bdt | more

to convert a text file b58polys.dat into a binary file b58polys.bdt and to view the content of the binary file by converting it back to text. At this time data through pipes must be in text. That is, the following is illegal:

   dat2bin b58polys.dat | xglmdrvs -

It should be remembered that the binary format is not documented and it might change in the future. Moreover, it is machine dependent and can very well may be unreadible between different platforms.


Dat2Irit - Data To IRIT file filter

Converts '.dat' and '.bdt' data files to '.irt' IRIT scripts.


Command Line Options

   dat2irit [-z] DFiles



-z: Print version number and current defaults.


Usage

It may be sometimes desired to convert .dat data files into a form that can be fed back to IRIT - a '.irt' file. This filter does exactly that.

Example:

   dat2irit b58.dat > b58-new.irt


Dxf2Irit - DXF (Autocad) To IRIT filter

Converts Autocad's, DXF data files into IRIT data files.


Command Line Options

   dxf2irit [-m] [-f] [-o OutName] [-z] DXFFile



-m: Provides some more information on the data file(s) parsed.

-f: Coerce floating end conditions to constructed freeform surfaces. Default is open end conditions.

-o OutName: Name of output file. By default the output goes to stdout.

-z: Prints version number and current defaults.


Usage

dxf2irit converts Autocad's DXF data files into IRIT data files. The current version provides only partial support for the conversion of freeform surfaces, mainly due to luck of documentation examples on the dxf format and the convoluted way freeform surfaces are saved.

Example:

 dxf2irit file.dxf > file.dat


IGS2Irit - IGES Data To IRIT file filter

Converts '.igs' data files to '.dat' IRIT data files.


Command Line Options

   IGS2Irit [-m] [-M] [-c] [-a] [-o OutName] [-b] [-z] IGSFile



-m: More information flag.

-M: Even more information flag - dumps all parsed entities.

-c: Clip trimmed surfaces to the minimal domain as prescribed by the trimming curves.

-a: Dump all. Without this flag setting, only top level objects, that are referenced by no other object, will be dumped out.

-o OutName: Name of output file. By default the output goes to stdout.

-b: If set, generates binary irit data file that holds the strokes. Otherwise, irit text file will be created.

-z: Print version number and current defaults.


Usage

igs2irit converts IGES data files into IRIT data files.

Example:

    igs2irit file.igs > file.dat


Irit2Dxf - IRIT To DXF (Autocad) filter

Converts IRIT data files into Autocad's, DXF data files.


Command Line Options

    irit2dxf [-s Scale] [-t Tx Ty Tz] [-i] [-f] [-F PolyOpti FineNess]
             [-4] [-o OutName] [-T] [-a AnimTime] [-z] DFiles



-s Scale: Global scaling factor of the converted geometry.

-t Tx Ty Tz: a Vector of size three of translation factors along the X, Y, and Z axes.

-i: Show internal edges as well.

-f: Dumps freeforms as converted polygonal geometry.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-4: Forces four polygons per almost flat region in the surface to polygon conversion. Otherwise two polygons only.

-o OutName: Name of output file. By default the output goes to stdout.

-T: Talkative mode. Prints processing information.

-a AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-z: Prints version number and current defaults.


Usage

irit2dxf converts IRIT data files into Autocad's DXF data files. The current version provides only partial support for the direct conversion of freeform surfaces, mainly due to luck of documentation examples on the dxf format and the convoluted way freeform surfaces are saved. Nonetheless, Freeform surfaces can be converted into polygons using the '-f' flag.

Example:

 irit2dxf -z -t 1 2 3 -F 0 20 -4 -o file.dxf file.dat


Irit2Hgl - IRIT To HPGL filter

Converts IRIT geometry into the HL Graphics Language used by HP's plotters.


Command Line Options

  irit2hgl [-t XTrans YTrans] [-I #UIso[:#VIso[:#WIso]]]
       [-f PolyOpti SampTol] [-F PolyOpti FineNess] [-M] [-G] [-T]
       [-a AnimTime] [-i] [-o OutName] [-z] DFiles



-t XTrans YTrans: X and Y translation. of the image. Default is (0, 0).

-I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per surface/trivariate, per direction. If #VIso is not specified, #UIso is used for #VIso as well and so no.

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-F PolygonOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4. This enforces the dump of freefrom geometry as polygons.

-M: Dumps the control mesh/polygon as well.

-G: Dumps the freeform geometry.

-T: Talkative mode. Prints processing information.

-a AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-i: Internal edges (created by IRIT) - default is not to display them, and this option will force displaying them as well.

-o OutName: Name of output file. By default the name of the first data file from DFiles list is used. See below on the output files.

-z: Prints version number and current defaults.


Usage

Irit2Hgl converts freeform surfaces and polygons into polylines in a format that can be used by HPGL.

Example:

 irit2Hgl -M -f 0 16 saddle.dat > saddle.hgl

However, one can overwrite the viewing matrix by appending a new matrix in the end of the command line, created by the display devices:

 x11drvs b58.dat
 irit2Hgl -M -f 0 16 b58.dat irit.mat > saddle.hgl

where irit.mat is the viewing matrix created by x11drvs.


Irit2IGS - IRIT To IGES filter

Converts IRIT data files into IGS data files.


Command Line Options

     Irit2igs [-m] [-o OutName] [-t AnimTime] [-u] [-z] IritFile



-m: More information flag.

-o OutName: Name of output file. By default the output goes to stdout.

-t AnimTime: If has animation data, time of dump.

-u: Force a unit transfor,ation matrix.

-z: Prints version number and current defaults.


Usage

Irit2IGS converts IRIT data files into IGES data files.

Example:

    Irit2IGS -u -o file.igs file.dat


Irit2Iv - IRIT To SGI's Inventor filter

IV is the format used by the Inventor modeling/rendering package from SGI.


Command Line Options

  irit2iv [-l] [-4] [-P] [-F PolyOpti FineNess] [-f PolyOpti SampTol]
                                              [-T] [-t AnimTime] [-z] DFiles



-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although, most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free form shape (saddle like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough.

-4: Four - Generates four polygons per flat patch. Default is 2.

-P: Polygonize freeform shapes. Default is to leave freeform curves and surfaces as is.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-T: Talkative mode. Prints processing information.

-t AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-z: Prints version number and current defaults.


Usage

Irit2Iv converts freeform surfaces and polygons into polygons and saved in iv Inventor's ascii file format.

Example:

 irit2iv solid1.dat > solid1.iv

Surfaces are converted to polygons with fineness control:

 irit2iv -F 0 16 - view.mat < saddle.dat > saddle.iv

Note the use of '-' for stdin.


Irit2Nff - IRIT To NFF filter


Command Line Options

  irit2nff [-l] [-4] [-c] [-F PolyOpti FineNess] [-o OutName] [-T]
                                           [-t AnimTime] [-g] [-z] DFiles



-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although, most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free-form shape (saddle-like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough.

-4: Four - Generates four polygons per flat patch. Default is 2.

-c: Output files should be filtered by cpp. When set, the usually huge geometry file is separated from the main nff file that contains the surface properties and view parameters. By default all data, including the geometry, are saved into a single file with type extension '.nff'. Use of '-c' will pull out all the geometry into a file with the same name but a '.geom' extension, which will be included using the '#include' command. The '.nff' file should, in that case, be preprocessed using cpp before being piped into the nff renderer.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-o OutName: Name of output file. By default the name of the first data file from the DFiles list is used. See below on the output files.

-T: Talkative mode. Prints processing information.

-t AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-g: Generates the geometry file only. See below.

-z: Prints version number and current defaults.


Usage

Irit2Nff converts freeform surfaces into polygons in a format that can be used by an NFF renderer. Usually, one file is created with '.nff' type extension. Since the number of polygons can be extremely large, a '-c' option is provided, which separates the geometry from the surface properties and view specification, but requires preprocessing by cpp. The geometry is isolated in a file with extension '.geom' and included (via '#include') in the main '.nff' file. The latter holds the surface properties for all the geometry as well as the viewing specification. This allows for the changing of shading or the viewing properties while editing small ('.nff') files.

If '-g' is specified, only the '.geom' file is created, preserving the current '.nff' file. The '-g' flag can be specified only with '-c'.

In practice, it may be useful to create a low resolution approximation of the model, change viewing/shading parameters in the '.nff' file until a good view and/or surface quality is found, and then run Irit2Nff once more to create a high resolution approximation of the geometry using '-g'.

Example:

 irit2nff -c -l -F 0 8 b58.dat

creates b58.nff and b58.geom with low resolution (FineNess of 5).

Once done with parameter setting, a fine approximation of the model can be created with:

 irit2nff -c -l -g -F 0 64 b58.dat

which will only recreate b58.geom (because of the -g option).

One can overwrite the viewing matrix by appending a new matrix in the end of the command line, created by a display device:

 xgldrvs b58.dat
 irit2nff -l -F 0 32 b58.dat irit.mat

where irit.mat is the viewing matrix created by xgldrvs.


Advanced Usage

One can specify surface qualities for individual surfaces of a model. Several such attributes are supported by Irit2Nff and can be set within IRIT. See also the ATTRIB IRIT command.

If a certain surface should be finer/caurser than the rest of the scene, one can set a "resolution" attribute which specifies the relative FineNess resolution of this specific surface. Further, "u_resolution" and "v_resolution" might be similarly used to set relative resolution for the u or v direction only. The "crv_resolution" attribute controls the relative fineness of curves as polylines. The "num_of_isolines" attribute controls the relative number of isoparametric curves.

Example:

 attrib( srf1, "resolution", 2 );

will force srf1 to have twice the default resolution, as set via the '-f' flag.

Almost flat patches are converted to polygons. The rectangle can be converted into two polygons (by subdividing along one of its diagonals) or into four by introducing a new point at the center of the patch. This behavior is controlled by the '-4' flag, but can be overwritten for individual surfaces by setting a "twoperflat" or a "fourperflat" attribute.

NFF specific properties are controlled via the following attributes: "kd", "ks", "shine", "trans", "index". Refer to the NFF manual for detail.

Example:

 attrib( srf1, "kd", 0.3 );
 attrib( srf1, "shine", 30 );

Surface color is controlled in two levels. If the object has an RGB attribute, it is used. Otherwise, a color, as set via the IRIT COLOR command, is used if set.

Example:

 attrib( tankBody, "rgb", "244,164,96" );


Irit2Off - IRIT To IGES filter

Converts IRIT data files into IGS data files.


Command Line Options

     Irit2Off [-l] [-4] [-F PolyOpti FineNess] [-E VrtxEps] [-o OutName]
                                                           [-m] [-z] DFiles



-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although, most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free form shape (saddle like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough.

-4: Four - Generates four polygons per flat patch. Default is 2.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-E VrtxEps: Epsilon to consider two vertices same.

-o OutName: Name of output file. By default the output goes to stdout.

-m: More information flag.

-z: Prints version number and current defaults.


Usage

Irit2Off converts IRIT data files into Geom View OFF data files.

Example:

    Irit2Off -m -o file.off file.dat


Irit2Plg - IRIT To PLG (REND386) filter

PLG is the format used by the rend386 real time renderer for the IBM PC.


Command Line Options

  irit2plg [-l] [-4] [-F PolyOpti FineNess] [-T] [-z] DFiles



-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although, most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free form shape (saddle like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough.

-4: Four - Generates four polygons per flat patch. Default is 2.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-T: Talkative mode. Prints processing information.

-z: Prints version number and current defaults.


Usage

Irit2Plg converts freeform surfaces and polygons into polygons in a format that can be used by the REND386 renderer.

Example:

 irit2plg solid1.dat > solid1.plg

Surfaces are converted to polygons with fineness control:

 irit2plg -F 0 16 - view.mat < saddle.dat > saddle.plg

Note the use of '-' for stdin.


Irit2pov - IRIT To POVRAY raytracer filter


Command Line Options

  irit2pov [-l] [-4] [-C] [-F PolyOpti FineNess] [-f PolyOpti SampTol]
           [-o OutName] [-g] [-p Zmin Zmax] [-P] [-M] [-T] [-t AnimTime]
           [-I #UIso[:#VIso[:#WIso]]] [-s ObjSeq#] [-i Includes] [-z] DFiles



-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free-form shape (saddle-like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough.

-4: Four - Generates four polygons per flat patch. Default is 2.

-C: Construct biCubic Bezier patches whenever possible as POVRAY support this type of surface. Polynomial Bezier surfaces of orders up to and including bicubic (order 4, degree 3) are degree raised to bicubic. Piecewise polynomials Bspline surfaces are split into Bezier patches. Higher order surfaces and rational surfaces are always converted into polygons.

-F PolygonOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4, -C, and -l.

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-o OutName: Name of output file. By default the name of the first data file from the DFiles list is used. See below on the output files.

-g: Generates the geometry file only. See below.

-p Zmin Zmax: Sets the ratios between the depth cue and the width of the dumped polylines. See also -P. Closer lines will be drawn wider.

-P: Forces dumping polygons as polylines with thickness controlled by -p.

-M: If -P (see -P and -p) then converts the control mesh/polygon to polylines which are represented as a sequence of truncated cones.

-T: Talkative mode. Prints processing information.

-t AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per surface/trivariate, per direction. If #VIso or #WIso is not specified, #UIso is used for #VIso etc.

-s ObjSeq#: Sets object sequence number if no object name. Default 1.

-i Includes: Expands the comma's seperated list of povray include file names into povray include commands at the beginning of the created povray output file.

-z: Prints version number and current defaults.


Usage

Irit2pov converts freeform surfaces into polygons in a format that can be used by the POVRAY ray tracing program. Two files are created, one with a '.geom' extension and one with '.pov'. Since the number of polygons can be extremely large, the geometry is isolated in the '.geom' file and is included (via '#include') in the main '.pov' file. The latter holds the surface properties for all the geometry as well as viewing and POVRAY specific commands. This allows for the changing of the shading or the viewing properties while editing small ('.pov') files.

If '-g' is specified, only the '.geom' file is created, preserving the current, possibly manually modified, '.pov' file.

In practice, it may be useful to create a low resolution approximation of the model, change the viewing/shading parameters in the '.pov' file until a good view and/or surface quality is found, and then run Irit2pov once more to create a high resolution approximation of the geometry using '-g'.

Example:

 irit2pov -l -F 0 5 b58.dat

creates b58.pov and b58.geom with low resolution (FineNess of 5). At such low resolution it can very well may happen that triangles will have normals "over the edge" since a single polygon may approximate a highly curved surface. One can ray trace this scene using a command similar to:

 POVRAY -Q0 +Ib58

Once done with parameter setting for POVRAY, a fine approximation of the model can be created with:

 irit2pov -l -g -F 0 64 b58.dat

which will only recreate b58.geom (because of the -g option).

Interesting effects can be created using the depth cue support and polyline conversion of irit2pov. For example

 irit2pov -P -p -0.0 0.5 solid1.dat

will dump solid1 as a set of polylines (represented as truncated cones in POVRAY) with varying thickness according to the z depth. Another example is

 irit2pov -P -p -0.1 1.0 saddle.dat

which dumps the isolines extracted from the saddle surface with varying thickness.

Each time a data file is saved in IRIT, it can be saved with the viewing matrix of the last INTERACT by saving the VIEW_MAT object as well. I.e.:

 save( "b58", b58 );

However one can overwrite the viewing matrix by appending a new matrix in the end of the command line, created by the display devices:

 xglmdrvs b58.dat                        // Creates irit.mat
 irit2pov -l -F 0 16 b58.dat irit.mat

where irit.mat is the viewing matrix created by xglmdrvs. The output name, by default, is the last input file name, so you might want to provide an explicit name with the -o flag.


Advanced Usage

One can specify surface qualities for individual surfaces of a model. Several such attributes are supported by Irit2pov and can be set within IRIT. See also the ATTRIB IRIT command.

If a certain surface should be finer/caurser than the rest of the scene, one can set a "resolution" attribute which specifies the relative FineNess resolution of this specific surface. Further, "u_resolution" and "v_resolution" might be similarly used to set relative resolution for the u or v direction only. The "crv_resolution" attribute controls the relative fineness of curves as polylines. The "num_of_isolines" attribute controls the relative number of isoparametric curves.

Example:

 attrib( srf1, "resolution", 2 );

will force srf1 to have twice the default resolution, as set via the '-f' flag.

Almost flat patches are converted to polygons. The rectangle can be converted into two polygons (by subdividing along one of its diagonals) or into four by introducing a new point at the patch center. This behavior is controlled by the '-4' flag, but can be overwritten for individual surfaces bu setting "twoperflat" or "fourperflat".

POVRAY also supports bicubic Bezier patches and the '-C' option of irit2pov supports that. In such a case, the resolution that is requested from POVRAY to polygonize these patches approximately follow the resolution as selected via the '-F' flag of irit2pov. Nevertheless, one can override the requested resolution via the "steps", "u_steps", and "v_steps" attributes to irit2pov data files that are transfered directly to POVRAY's bicubic Bezier patches. The "steps" attributes sets both "u_steps" and "v_steps".

POVRAY specific properties are controlled via the following attributes: "ambient", "diffuse", "brilliance", "phong", "phong_size", "specular", "roughness", "metallic", "reflection", "refraction", "ior", "caustics", "fade_distance", "fade_power", "irid", "crand", "texture", "pigment", "finish", "halo", and "normal. The value of this attributes must be strings as it is copied verbatim. Refer to POVRAY's manual for their exact meaning.

Example:

 attrib( legs, "ambient", "0.1" );
 attrib( pot, "matallic", "" );
 attrib( table, "ior", "1.4" );

Surface color is controlled in two levels. If the object has an RGB attribute, it is used. Otherwise a color as set via the IRIT COLOR command is being used if set.

Example:

 attrib( tankBody, "rgb", "244,164,96" );


Irit2Ps - IRIT To PS filter


Command Line Options

  irit2ps [-l] [-4] [-s Size] [-I #UIso[:#VIso[:#WIso]]] [-F PolyOpti FineNess]
          [-f PolyOpti SampTol] [-M] [-G] [-P] [-W LineWidth]
          [-w WidenLen WidenWidth] [-b R G B] [-B X1 Y1 X2 Y2] [-c] [-C]
          [-T] [-t AnimTime] [-N FontName] [-i] [-o OutName] [-d [Zmin Zmax]]
          [-D [Zmin Zmax]] [-p PtType PtSize] [-u] [-z] DFiles



-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free-form shape (saddle-like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough.

-4: Four - Generates four polygons per flat patch. Default is 2.

-s Size: Controls the size of the postscript output in inches. Default is to fill the entire screen.

-I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per surface/trivariate, per direction. If #VIso or #WIso is not specified, #UIso is used for #VIso etc.

-F PolygonOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-M: Dumps the control mesh/polygon as well.

-G: Dumps the curve/surface (as freeform geometry). Default. See -I, -C, -f for control on polyline approximation.

-P: Dumps the curve/surface (as polygons). See -F, -l, -4 for control on polygonal approximation.

-W #LineWidth: Sets the line drawing width in inches. Default is as thin as possible. This option will overwrite only those objects that do not have a "width" attribute. See also -d. If LineWidth is negative its absolute value is used to scale the current width of the object if has one, or the default width otherwise.

-w WidenLen WidenWidth: If end points of polylines should be made wider, and if so to what width.

-b R G B: Sets a colored background. RGB are three integers prescribing the Red, Green, and Blue coefficients. if no -c (i.e. a gray level drawing) this color is converted to a gray level using RGB to T.V. Y(IQ) channel conversion.

-B X1 Y1 X2 Y2: Clips the drawing area outsize the bounding box from (X1, Y1) to (X2, Y2).

-c: Creates a color postscript file.

-C: Curve mode. Dumps freeform curves and surfaces as cubic Bezier curves. Higher order curves and surfaces and/or rationals are approximated by cubic Bezier curves. This option generates data files that are roughly a third of piecewise linear postscript files (by disabling this feature, -C-), but takes a longer time to compute.

-T: Talkative mode. Prints processing information.

-t AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-N FontName: Sets the font to use when dumping text out of string objects.

-i: Internal edges (created by IRIT) - the default is not to display them, and this option will force displaying them as well.

-o OutName: Name of output file. Default is stdout.

-d [Zmin Zmax]: Sets the ratios between the depth cue and the width of the dumped data. See also -W, -p. Closer lines/points will be drawn wider/larger. Zmin and Zmax are optional. The object's bounding box is otherwise computed and used.

-D [Zmin Zmax]: Same as -d, but depth cue the color or gray scale instead of width. You might need to consider the sorting option of the illustrt tool (-s of illustrt) for proper drawings. Only one of -d and -D can be used.

-p PtType PtSize: Specifies the way points are drawn. PtType can be one of H, F, C for Hollow circle, Full Circle, or Cross. PtSize specifies the size of the point to be drawn, in inches. Vectors will also be drawn as points, but with an additional thin line to the origin. See also -d.

-u: Forces a unit matrix transformation, i.e. no transformation.

-z: Prints version number and current defaults.


Usage

Irit2Ps converts freeform surfaces and polygons into a postscript file.

Example:

 irit2ps solid1.dat > solid1.ps

Surfaces are converted to polygons with fineness control:

 irit2ps -f 0 32 -c -W 0.01 saddle.dat > saddle.ps

creates a postscript file for the saddle model, in color, and with lines 0.01 inch thick.


Advanced Usage

One can specify several attributes that affect the way the postscript file is generated. The attributes can be generated within IRIT. See also the ATTRIB IRIT command.

If a certain object should be thinner or thicker than the rest of the scene, one can set a "width" attribute which specifies the line width in inches of this specific object.

Example:

 attrib( srf1, "width", 0.02 );

will force srf1 to have this width, instead of the default as set via the '-W' flag.

If a (closed) object, a polygon for example, needs to be filled, a "fill" attribute should be set.

Example:

 attrib( poly, "fill", true );

will fill poly.

If an object, a polygon for example, needs to be painted/filled in a gray level instead of black, a "gray" attribute should be set, with a value equal to the gray level desired.

Example:

 attrib( poly, "gray", 0.5 );

will draw/fill poly with %50 gray.

Dotted or dashed line effects can be created using a "dash" attribute which is a direct PostScript dash string. A simple form of this string is "[a b]" in which a is the drawing portion (black) in inches, followed by b inches of white space. See the postScript manual for more about the format of this string. Here is an example for a dotted-dash line.

 attrib( poly, "dash", "[0.006 0.0015 0.001 0.0015] 0" );

Surface color is controlled (for color postscript only - see -c) in two levels. If the object has an RGB attribute, it is used. Otherwise, a color as set via the IRIT COLOR command is used.

Example:

 attrib( Ball, "rgb", "255,0,0" );

An object can be drawn as ``tubes'' instead of full lines. The ratio between the inner and the outer radii of the tube is provided as the TUBULAR attribute:

 attrib( final, "tubular", 0.7 );

The "resolution" attribute controls the relative fineness of polygonal approximation of surfaces, and "u_resolution" and "v_resolution" similarly controls this relative fineness along one parametric direction only. The "crv_resolution" attribute controls the relative fineness of curves as polylines. The "num_of_isolines" attribute controls the relative number of isoparametric curves.

String object can be dumped as text of selected PS font (See -N). The string position is set via a "StrPos" vector attribute (default to the origin), and "StrScale" real attribute to control the string height in world unit (default to 0.1). Text will always be dumped horizontally.

Example:

 Text = "Some text";
 attrib( Text, "StrPos", vector( 1, 2, 3 ) );
 attrib( Text, "StrScale", 0.1 );

Will print the Text "Some text" at location (1, 2, 3). The text height be be 0.1.


Irit2Ray - IRIT To RAYSHADE filter


Command Line Options

  irit2ray [-l] [-4] [-G GridSize] [-F PolyOpti FineNess]
           [-f PolyOpti SampTol] [-o OutName] [-g] [-p Zmin Zmax] [-P]
           [-M] [-T] [-t AnimTime] [-I #UIso[:#VIso[:#WIso]]] [-s ObjSeq#]
           [-z] DFiles



-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free-form shape (saddle-like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough.

-4: Four - Generates four polygons per flat patch. Default is 2.

-G GridSize: Usually objects are grouped as lists of polygons. This flags will coerce the usage of the RAYSHADE grid structure, with GridSize being used as the grid size along the object bounding box's largest dimension.

-F PolygonOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-o OutName: Name of output file. By default the name of the first data file from the DFiles list is used. See below on the output files.

-g: Generates the geometry file only. See below.

-p Zmin Zmax: Sets the ratios between the depth cue and the width of the dumped polylines. See also -P. Closer lines will be drawn wider.

-P: Forces dumping polygons as polylines with thickness controlled by -p.

-M: If -P (see -P and -p) then converts the control mesh/polygon to polylines which are represented as a sequence of truncated cones.

-T: Talkative mode. Prints processing information.

-t AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per surface/trivariate, per direction. If #VIso or #WIso is not specified, #UIso is used for #VIso etc.

-s ObjSeq#: Sets object sequence number if no object name. Default 1.

-z: Prints version number and current defaults.


Usage

Irit2Ray converts freeform surfaces into polygons in a format that can be used by the RAYSHADE ray tracing program. Two files are created, one with a '.geom' extension and one with '.ray'. Since the number of polygons can be extremely large, the geometry is isolated in the '.geom' file and is included (via '#include') in the main '.ray' file. The latter holds the surface properties for all the geometry as well as viewing and RAYSHADE specific commands. This allows for the changing of the shading or the viewing properties while editing small ('.ray') files.

If '-g' is specified, only the '.geom' file is created, preserving the current '.ray' file.

In practice, it may be useful to create a low resolution approximation of the model, change the viewing/shading parameters in the '.ray' file until a good view and/or surface quality is found, and then run Irit2Ray once more to create a high resolution approximation of the geometry using '-g'.

Example:

 irit2ray -l -F 0 5 b58.dat

creates b58.ray and b58.geom with low resolution (FineNess of 5). At such low resolution it can very well may happen that triangles will have normals "over the edge" since a single polygon may approximate a highly curved surface. That will cause RAYSHADE to issue an "Inconsistent triangle normals" warning. This problem will not exist if high fineness is used. One can ray trace this scene using a command similar to:

 RAYSHADE -p -W 256 256 b58.ray > b58.rle

Once done with parameter setting for RAYSHADE, a fine approximation of the model can be created with:

 irit2ray -l -g -F 0 64 b58.dat

which will only recreate b58.geom (because of the -g option).

Interesting effects can be created using the depth cue support and polyline conversion of irit2ray. For example

 irit2ray -G 5 -P -p -0.0 0.5 solid1.dat

will dump solid1 as a set of polylines (represented as truncated cones in RAYSHADE) with varying thickness according to the z depth. Another example is

 irit2ray -G 5 -P -p -0.1 1.0 saddle.dat

which dumps the isolines extracted from the saddle surface with varying thickness.

Each time a data file is saved in IRIT, it can be saved with the viewing matrix of the last INTERACT by saving the VIEW_MAT object as well. I.e.:

 save( "b58", b58 );

However one can overwrite the viewing matrix by appending a new matrix in the end of the command line, created by the display devices:

 os2drvs b58.dat                        // Creates irit.mat
 irit2ray -l -F 0 16 b58.dat irit.mat

where irit.mat is the viewing matrix created by os2drvs. The output name, by default, is the last input file name, so you might want to provide an explicit name with the -o flag.


Advanced Usage

One can specify surface qualities for individual surfaces of a model. Several such attributes are supported by Irit2Ray and can be set within IRIT. See also the ATTRIB IRIT command.

If a certain surface should be finer/caurser than the rest of the scene, one can set a "resolution" attribute which specifies the relative FineNess resolution of this specific surface. Further, "u_resolution" and "v_resolution" might be similarly used to set relative resolution for the u or v direction only. The "crv_resolution" attribute controls the relative fineness of curves as polylines. The "num_of_isolines" attribute controls the relative number of isoparametric curves.

Example:

 attrib( srf1, "resolution", 2 );

will force srf1 to have twice the default resolution, as set via the '-f' flag.

Almost flat patches are converted to polygons. The rectangle can be converted into two polygons (by subdividing along one of its diagonals) or into four by introducing a new point at the patch center. This behavior is controlled by the '-4' flag, but can be overwritten for individual surfaces bu setting "twoperflat" or "fourperflat".

RAYSHADE specific properties are controlled via the following attributes: "specpow", "reflect", "transp", "body", "index", and "texture". The value of this attributes must be strings as it is copied verbatim. Refer to RAYSHADE's manual for their meaning.

Example:

 attrib( legs, "transp", "0.3" );
 attrib( legs, "texture", "wood,2" );
 attrib( table, "texture", "marble" );
 attrib( table, "reflect", "0.5" );

Optional scale can be prescribed to textures. In the above example wooden legs' (that are also transparent...) texture is selected with texture's scaling factor of 2.

Surface color is controlled in two levels. If the object has an RGB attribute, it is used. Otherwise a color as set via the IRIT COLOR command is being used if set.

Example:

 attrib( tankBody, "rgb", "244,164,96" );


Irit2Scn - IRIT To SCENE (RTrace) filter

SCENE is the format used by the RTrace ray tracer. This filter was donated by Antonio Costa (acc@asterix.inescn.pt), the author of RTrace.


Command Line Options

  irit2scn [-l] [-4] [-F PolyOpti FineNess] [-o OutName] [-g] [-T]
           [-t AnimTime] [-z] DFiles



-l: Linear - forces linear (degree two) surfaces to be approximated as a single polygon along their linear direction. Although most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free-form shape (saddle-like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough.

-4: Four - Generates four polygons per flat patch.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-o OutName: Name of output file. By default the name of the first data file from DFiles list is used. See below on the output files.

-g: Generates the geometry file only. See below.

-T: Talkative mode. Prints processing information.

-t AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-z: Prints version number and current defaults.


Usage

Irit2Scn converts freeform surfaces and polygons into polygons in a format that can be used by RTrace. Two files are created, one with a '.geom' extension and one with '.scn'. Since the number of polygons can be extremely large, the geometry is isolated in the '.geom' file and is included (via '#include') in the main '.scn' file. The latter holds the surface properties for all the geometry as well as viewing and RTrace specific commands. This allows for the changing of the shading or the viewing properties while editing small ('.scn') files.

If '-g' is specified, only the '.geom' file is created, preserving the current '.scn' file.

In practice, it may be useful to create a low resolution approximation of the model, change the viewing/shading parameters in the '.scn' file until a good view and/or surface quality is found, and then run Irit2Scn once more to create a high resolution approximation of the geometry using '-g'.

Example:

 irit2scn -l -F 0 8 b58.dat

creates b58.scn and b58.geom with low resolution (FineNess of 5).

One can ray trace this scene after converting the scn file to a sff file, using scn2sff provided with the RTrace package.

Once done with the parameter setting of RTrace, a fine approximation of the model can be created with:

 irit2scn -l -g -F 0 64 b58.dat

which will only recreate b58.geom (because of the -g option).

One can overwrite the viewing matrix by appending a new matrix in the end of the command line, created by the display devices:

 wntdrvs b58.dat
 irit2scn -l -F 0 8 b58.dat irit.mat

where irit.mat is the viewing matrix created by wntdrvs. The output name, by default, is the last input file name, so you might want to provide an explicit name with the -o flag.


Advanced Usage

One can specify surface qualities for individual surfaces of a model. Several such attributes are supported by Irit2Scn and can be set within IRIT. See also the ATTRIB IRIT command.

If a certain surface should be finer/caurser than the rest of the scene, one can set a "resolution" attribute which specifies the relative FineNess resolution of this specific surface. Further, "u_resolution" and "v_resolution" might be similarly used to set relative resolution for the u or v direction only. The "crv_resolution" attribute controls the relative fineness of curves as polylines. The "num_of_isolines" attribute controls the relative number of isoparametric curves.

Example:

 attrib( srf1, "resolution", 2 );

will force srf1 to have twice the default resolution, as set via the '-f' flag.

Almost flat patches are converted to polygons. The patch can be converted into two polygons (by subdividing along one of its diagonals) or into four by introducing a new point at the patch center. This behavior is controlled by the '-4' flag, but can be overwritten for individual surfaces bu setting "twoperflat" or "fourperflat".

RTrace specific properties are controlled via the following attributes: "SCNrefraction", "SCNtexture", "SCNsurface. Refer to the RTrace manual for their meaning.

Example:

 attrib( srf1, "SCNrefraction", 0.3 );

Surface color is controlled in two levels. If the object has an RGB attribute, it is used. Otherwise a color as set via IRIT COLOR command is used if set.

Example:

 attrib( tankBody, "rgb", "244,164,96" );


Irit2Stl - IRIT To STL filter


Command Line Options

  irit2stl [-l] [-4] [-F PolyOpti FineNess] [-E VrtxEps] [-s] [-S] 
           [-o OutName] [-m] [-u] [-z] DFiles



-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free-form shape (saddle-like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough.

-4: Four - Generates four polygons per flat patch. Default is 2.

-F PolygonOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-E VrtxEps: Tolerance of two adjacent verices to be considered the same. Vertices that are considered the same are collapsed to an identical location.

-s: Dumps each object as a seperated "solid" - "endsolid" brackets.

-S: Dumps each object as a seperated "solid" - "endsolid" brackets in a seperated stl file, with file name appended with numeric index.

-o OutName: Name of output file. By default the output goes to stdout.

-m: More information flag.

-u: Forces a Unit matrix. That is, input data are not transformed at all.

-z: Prints version number and current defaults.


Usage

Irit2Stl converts freeform surfaces and polygons into the STL (Stereolithography) file format. The STL data should be a closed solid in general but so such validity check is being conducted by irit2stl.

Example:

 irit2stl -u solid2.dat > solid2.stl


Irit2Wrl - IRIT To IGES filter

Converts IRIT data files into IGS data files.


Command Line Options

    irit2wrl [-l] [-4] [-u] [-F PolyOpti FineNess] [-f PolyOpti SampTol]
                                                 [-o OutName] [-T] [-z] DFiles



-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although, most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free form shape (saddle like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough.

-4: Four - Generates four polygons per flat patch. Default is 2.

-u: Forces a Unit matrix. That is, input data are not transformed at all.

-F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4.

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-o OutName: Name of output file. By default the output goes to stdout.

-T: More talkative/information flag.

-z: Prints version number and current defaults.


Usage

Irit2Wrl converts IRIT data files into Geom View OFF data files.

Example:

    Irit2Wrl -m -o file.off file.dat


Irit2Xfg - IRIT To XFIG filter


Command Line Options

  irit2xfg [-s Size] [-t XTrans YTrans] [-I #UIso[:#VIso[:#WIso]]]
       [-f PolyOpti SampTol] [-F PolyOpti FineNess] [-M] [-G] [-T]
       [-a AnimTime] [-i] [-o OutName] [-z] DFiles



-s Size: Size in inches of the page. Default is 7 inches.

-t XTrans YTrans: X and Y translation. of the image. Default is (0, 0).

-I #UIso[:#VIso]: Specifies the number of isolines per surface, per direction. If #VIso is not specified, #UIso is used for #VIso as well.

-f PolyOpti SampTol: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. For PolyOpti == 1, an adaptive subdivision that optimizes the samples is employed. For PolyOpti == 2, SampTol (real number) specifies the maximal allowed deviation tolerance of the piecewise linear approximation from the original curve. Default is 0 64 (uniform sampling with 64 samples).

-F PolygonOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4. This enforces the dump of freefrom geometry as polygons.

-M: Dumps the control mesh/polygon as well.

-G: Dumps the freeform geometry.

-T: Talkative mode. Prints processing information.

-a AnimTime: If the data contains animation curves, evaluate and process the scene at time AnimTime.

-i: Internal edges (created by IRIT) - default is not to display them, and this option will force displaying them as well.

-o OutName: Name of output file. By default the name of the first data file from DFiles list is used. See below on the output files.

-z: Prints version number and current defaults.


Usage

Irit2Xfg converts freeform surfaces and polygons into polylines in a format that can be used by XFIG.

Example:

 irit2Xfg -T -f 0 16 saddle.dat > saddle.xfg

However, one can overwrite the viewing matrix by appending a new matrix in the end of the command line, created by the display devices:

 x11drvs b58.dat
 irit2Xfg -T -f 0 16 b58.dat irit.mat > saddle.xfg

where irit.mat is the viewing matrix created by x11drvs.


Obj2irit - Wavefront OBJ format To IRIT data files

Converts Waverfront's OBJ data files into IRIT data files.


Command Line Options

    obj2irit [-m] [-o OutName] [-z] OBJFile



-m: Provides some more information on the data file(s) parsed.

-o OutName: Name of output file. By default the output goes to stdout.

-z: Prints version number and current defaults.


Usage

obj2irit converts Wavefront's OBJ data files into IRIT data files. The current version provides only partial support for the direct conversion of freeform surfaces, mainly due to luck of examples of freeform surfaces in obj format.

Example:

 obj2irit -o file.dat file.obj


Off2irit - Geom View Off format To IRIT data files

Converts Geom View's Off data files into IRIT data files.


Command Line Options

    Off2irit [-o OutName] [-z] OffFile



-o OutName: Name of output file. By default the output goes to stdout.

-z: Prints version number and current defaults.


Usage

Off2irit converts Geom View's Off data files into IRIT data files.

Example:

    Off2irit - < file.off > file.dat


Data File Format

This section describes the data file format used to exchange data between IRIT and its accompanying tools.

 [OBJECT {ATTRS} OBJNAME
     [NUMBER n]

   | [POINT x y z]

   | [VECTOR x y z]

   | [CTLPT POINT_TYPE {w} x y {z}]

   | [STRING "a string"]

   | [MATRIX m00 ... m03
             m10 ... m13
             m20 ... m23
             m30 ... m33]

     ;A polyline should be drawn from first point to last. Nothing is drawn
     ;from last to first (in a closed polyline, last point is equal to first).
   | [POLYLINE {ATTRS} #PTS                   ;#PTS = number of points.
         [{ATTRS} x y z]
         [{ATTRS} x y z]
            .
            .
            .
         [{ATTRS} x y z]
     ]
 
     ;Defines a closed planar region. Last point is NOT equal to first,
     ;and a line from last point to first should be drawn when the boundary
     ;of the polygon is drawn.
   | [POLYGON {ATTRS} #PTS
         [{ATTRS} x y z]
         [{ATTRS} x y z]
            .
            .
            .
         [{ATTRS} x y z]
     ]
 
     ;Defines a "cloud" of points.
   | [POINTLIST {ATTRS} #PTS
         [{ATTRS} x y z]
         [{ATTRS} x y z]
            .
            .
            .
         [{ATTRS} x y z]
     ]
 
     ;Defines an instance - a geometry reference (by name, SRF13 below)
     ;and a transformation matrix to apply to this geoemtry
   | [INSTANCE SRF13
             m00 ... m03
             m10 ... m13
             m20 ... m23
             m30 ... m33]

     ;Defines a Bezier curve with #PTS control points. If the curve is
     ;rational, the rational component is introduced first.
   | [CURVE BEZIER {ATTRS} #PTS POINT_TYPE
         [{ATTRS} {w} x y z ...]
         [{ATTRS} {w} x y z ...]
            .
            .
            .
         [{ATTRS} {w} x y z ...]
     ]
 
     ;Defines a Bezier surface with #UPTS * #VPTS control points. If the
     ;surface is rational, the rational component is introduced first.
     ;Points are printed row after row (#UPTS per row), #VPTS rows.
   | [SURFACE BEZIER {ATTRS} #UPTS #VPTS POINT_TYPE
         [{ATTRS} {w} x y z ...]
         [{ATTRS} {w} x y z ...]
            .
            .
            .
         [{ATTRS} {w} x y z ...]
     ]
 
     ;Defines a Bezier triangular surface with (#PTS + 1) * #PTS / 2 control
     ;points, of order ORDER. If the surface is rational, the rational
     ;component is introduced first. Note #PTS holds number of points along
     ;an edge and is exactly equal to ORDER. Points are printed sequentially.
   | [TRISRF BEZIER {ATTRS} #PTS POINT_TYPE
         [{ATTRS} {w} x y z ...]
         [{ATTRS} {w} x y z ...]
            .
            .
            .
         [{ATTRS} {w} x y z ...]
     ]

     ;Defines a Bezier trivariate with #UPTS * #VPTS * #WPTS control
     ;points. If the trivariate is rational, the rational component is
     ;introduced first. Points are printed row after row (#UPTS per row),
     ;#VPTS rows, #WPTS layers (depth).
   | [TRIVAR BEZIER {ATTRS} #UPTS #VPTS #WPTS POINT_TYPE
         [{ATTRS} {w} x y z ...]
         [{ATTRS} {w} x y z ...]
            .
            .
            .
         [{ATTRS} {w} x y z ...]
     ]
 
     ;Defines a Bspline curve of order ORDER with #PTS control points. If the
     ;curve is rational, the rational component is introduced first.
     ;Note length of knot vector is equal to #PTS + ORDER.
     ;If curve is periodic KVP prefix the knot vector that has length of
     ;'Length + Order + Order - 1'.
   | [CURVE BSPLINE {ATTRS} #PTS ORDER POINT_TYPE
         [KV{P} {ATTRS} kv0 kv1 kv2 ...]                    ;Knot vector
         [{ATTRS} {w} x y z ...]
         [{ATTRS} {w} x y z ...]
            .
            .
            .
         [{ATTRS} {w} x y z ...]
     ]
 
     ;Defines a Bspline surface with #UPTS * #VPTS control points, of order
     ;UORDER by VORDER. If the surface is rational, the rational component
     ;is introduced first.
     ;Points are printed row after row (#UPTS per row), #VPTS rows.
     ;If surface is periodic in some direction KVP prefix the knot vector
     ;that has length of 'Length + Order + Order - 1'.
   | [SURFACE BSPLINE {ATTRS} #UPTS #VPTS UORDER VORDER POINT_TYPE
         [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
         [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
         [{ATTRS} {w} x y z ...]
         [{ATTRS} {w} x y z ...]
            .
            .
            .
         [{ATTRS} {w} x y z ...]
     ]

     ;Defines a Bspline triangular surface with (#PTS + 1) * #PTS / 2 control
     ;points, of order ORDER. If the surface is rational, the rational
     ;component is introduced first.
     ;Points are printed sequentially.
   | [TRISRF BSPLINE {ATTRS} #PTS ORDER POINT_TYPE
         [KV {ATTRS} kv0 kv1 kv2 ...]                   ;Knot vector
         [{ATTRS} {w} x y z ...]
         [{ATTRS} {w} x y z ...]
            .
            .
            .
         [{ATTRS} {w} x y z ...]
     ]

     ;Defines a Bspline trivariate with #UPTS * #VPTS * #WPTS control
     ;points. If the trivariate is rational, the rational component is
     ;introduced first. Points are printed row after row (#UPTS per row),
     ;#VPTS rows, #WPTS layers (depth).
     ;If trivariate is periodic in some direction KVP prefix the knot vector
     ;that has length of 'Length + Order + Order - 1'.
   | [TRIVAR BSPLINE {ATTRS} #UPTS #VPTS #WPTS UORDER VORDER WORDER POINT_TYPE
         [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
         [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
         [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;W Knot vector
         [{ATTRS} {w} x y z ...]
         [{ATTRS} {w} x y z ...]
            .
            .
            .
         [{ATTRS} {w} x y z ...]
     ]
 
     ;Defines a trimmed surface. Encapsulates a surface (can be either a
     ;Bspline or a Bezier surface) and prescribes its trimming curves.
     ;There can be an arbitrary number of trimming curves (either Bezier
     ; or Bspline). Each trimming curve contains an arbitrary number of
     ;trimming curve segments, while each trimming curve segment contains
     ;a parameteric representation optionally followed by a Euclidean
     ;representation of the trimming curve segment.
   | [TRIMSRF
         [SURFACE ...
         ]
         [TRIMCRV
             [TRIMCRVSEG
                 [CURVE ...
                 ]
             ]
                .
                .
                .
             [TRIMCRVSEG
                 [CURVE ...
                 ]
             ]
         ]
             .
             .
             .
         [TRIMCRV
             [TRIMCRVSEG
                 [CURVE ...
                 ]
             ]
                .
                .
                .
             [TRIMCRVSEG
                 [CURVE ...
                 ]
             ]
         ]
     ]
 ]

 POINT_TYPE -> E1 | E2 | E3 | E4 | E5 | E6 | E7 | E8 | E9 |
               P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 | P9

 ATTRS -> [ATTRNAME ATTRVALUE]
          | [ATTRNAME]
          | [ATTRNAME ATTRVALUE] ATTRS


Some notes:

* This definition for the text file is designed to minimize the reading time and space. All information can be read without backward or forward referencing.

* An OBJECT must never hold different geometry types or other entities. I.e. CURVEs, SURFACEs, and POLYGONs must all be in different OBJECTs.

* Attributes should be ignored if not needed. The attribute list may have any length and is always terminated by a token that is NOT '['. This simplifies and disambiguates the parsing.

* Comments may appear between '[OBJECT ...]' blocks, or immediately after OBJECT OBJNAME, and only there.

A comment body can be anything not containing the '[' or the ']' tokens (signals start/end of block). Some of the comments in the above definition are illegal and appear there only of the sake of clarity.

* It is preferred that geometric attributes such as NORNALs will be saved in the geometry structure level (POLYGON, CURVE or vertices) while graphical and others such as COLORs will be saved in the OBJECT level.

* Objects may be contained in other objects to an arbitrary level.

Here is an example that exercises most of the data format:

 This is a legal comment in a data file.
 [OBJECT DEMO
     [OBJECT REAL_NUM
         And this is also a legal comment.
         [NUMBER 4]
     ]
 
     [OBJECT A_POINT
         [POINT 1 2 3]
     ]
 
     [OBJECT A_VECTOR
         [VECTOR 1 2 3]
     ]
 
     [OBJECT CTL_POINT
         [CTLPT E3 1 2 3]
     ]
 
     [OBJECT STR_OBJ
         [STRING "string"]
     ]
 
     [OBJECT UNIT_MAT
         [MATRIX
            1 0 0 0
            0 1 0 0
            0 0 1 0
            0 0 0 1
         ]
     ]
 
     [OBJECT [COLOR 4] POLY1OBJ
         [POLYGON [PLANE 1 0 0 0.5] 4
             [-0.5 0.5 0.5]
             [-0.5 -0.5 0.5]
             [-0.5 -0.5 -0.5]
             [-0.5 0.5 -0.5]
         ]
         [POLYGON [PLANE 0 -1 0 0.5] 4
             [0.5 0.5 0.5]
             [-0.5 0.5 0.5]
             [-0.5 0.5 -0.5]
             [0.5 0.5 -0.5]
         ]
     ]
 
     [OBJECT [COLOR 63] ACURVE
         [CURVE BSPLINE 16 4 E2
             [KV 0 0 0 0 1 1 1 2 3 4 5 6 7 8 9 10 11 11 11 11]
             [0.874 0]
             [0.899333 0.0253333]
             [0.924667 0.0506667]
             [0.95 0.076]
             [0.95 0.76]
             [0.304 1.52]
             [0.304 1.9]
             [0.494 2.09]
             [0.722 2.242]
             [0.722 2.318]
             [0.38 2.508]
             [0.418 2.698]
             [0.57 2.812]
             [0.57 3.42]
             [0.19 3.572]
             [0 3.572]
         ]
     ]
 
     [OBJECT [COLOR 2] SOMESRF
         [SURFACE BEZIER 3 3 E3
             [0 0 0]
             [0.05 0.2 0.1]
             [0.1 0.05 0.2]
 
             [0.1 -0.2 0]
             [0.15 0.05 0.1]
             [0.2 -0.1 0.2]
 
             [0.2 0 0]
             [0.25 0.2 0.1]
             [0.3 0.05 0.2]
         ]
     ]
 ]


Bugs and Limitations

Like any program of more than one line, it is far from being perfect. Some limitations, as well as simplifications, are laid out below.

* If the intersection curve of two objects falls exactly on polygon boundaries, for all polygons, the system will scream that the two objects do not intersect at all. Try to move one by EPSILON into the other. I probably should fix this one - it is supposed to be relatively easy.

* Avoid degenerate intersections that result with a point or a line. They will probably cause wrong propagation of the inner and outer part of one object relative to the other. Always extend your object beyond the other object.

* If two objects have no intersection in their boundary, IRIT assumes they are disjoint: a union simply combines them, and the other Boolean operators return a NULL object. One should find a FAST way (3D Jordan theorem) to find the relation between the two (A in B, B in A, A disjoint B) and according to that, make a decision.

* Since the boolean sum implementation constructs ruled surfaces with uniform speed, it might return a somewhat incorrect answer, given non-uniform input curves.

* The parser is out of hand and is difficult to maintain. There are several memory leaks there that one should fix.

* The X11 driver has no menu support (any easy way to have menus using Xlib!?).

* IBM R6000 fails to run the drivers in -s- mode.

* Rayshade complains a lot about degenerate polygons on irit2ray output. To alleviate the problem, change the 'equal' macro in common.h in libcommon of rayshade from EPSILON (1e-5) to 1e-7 or even lower.

* On the motif-based drivers (xmtdrvs etc.) clicking the mouse left and right of the scale's button produces stepped transformations. This step size is constant, and is not proportional to the distance between the mouse's position and the position of the button. The reason for the flaw is incorrect callback information returned from the scale in repeattive mode.

* Binary data files are not documented, nor will they be. They might change in the future and are in fact machine dependend. Hence, one platform might fail to read the other's binary data file.