home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-03-15 | 281.1 KB | 8,993 lines |
- ;This is the source file to create documentation for the IRIT solid modeler.
- ;First character in line specifies the action to take for this line/next block
- ;as follows:
- ; ';' - a comment that is always ignored.
- ; '#' - all lines following this line until next '#' are indented as an array.
- ; Four integers follow specifying indentations, # of elements per
- ; line, whether or not to put an internal vertical separator, and
- ; if entries are row ordered (1) or column ordered (2).
- ; '@' - latex only manual. Latex commands can appear within this line.
- ; '^' - text/hlp only manual. Opposite of '@'.
- ; '!' - plain text and irit docs only manual - keywords/headers.
- ; '&' - plain text only manual - headers.
- ; '$' - terminator for current block.
- ; '*' - prints line in all modes but without any latex filtering on the line.
- ; '%' - copied verbatim to all output types.
- ;
- ; latex commands can appear in regular text limited to a single line as
- ; {\command *}. For plain text the {\command } will be filtered out.
- ; Escaped characters via '\' (i.e. \#) will be left escaped (\#) in the
- ; latex output but unescaped (#) in the plain output.
- ;
- ; IRIT solid modeler (C) Gershon Elber 1991.
- ;
-
- @%
- @% Irit Solid modeler latex manual.
- @%
- @% Authors: Gershon Elber
- @%
- @% Date: Thu April 15, 1993
- @%
- @% Copyright (c) 1991/92/93 Gershon Elber
- @%
- @
- @\documentstyle[11pt]{article}
- @\oddsidemargin -.2in
- @\evensidemargin -.2in
- @\textwidth 6.75in
- @\topmargin 0.0in
- @\textheight 9.5in
- @
- @\newcommand{\eqnref}[1]{(\ref{#1})}
- @\newcommand{\inner}[2]{\left<{#1}, {#2} \right>}
- @
- @\begin{document}
- @
- @\pagestyle{empty}
- @ \rule{0in}{3in}
- @ \begin{center}
- @ {\huge\bf _IRIT_VERSION_ User's Manual}\\
- @ \vspace{3cm}
- @ {\Large A Solid modeling Program}\\
- @ \vspace{2cm}
- @ {\large Copyright (C) 1989, 1990-1995 Gershon Elber}\\
- @ \vspace{1cm}
- @ {\large EMail: gershon@cs.technion.ac.il }\\
- @ \vspace{2cm}
- @ {\large Join {\em IRIT} mailing list: gershon@cs.technion.ac.il }\\
- @ {\large Mailing list: irit-mail@cs.technion.ac.il }\\
- @ {\large Bug reports: irit-bugs@cs.technion.ac.il }\\
- @
- @ \vfill
- @ {\small This manual is for IRIT _IRIT_VERSION_.}
- @ \end{center}
- @\newpage
- @
- @\tableofcontents
- @\newpage
- @
- @\setcounter{page}{1}
- @\markright{{\em {\bf Irit Solid modeler}}\hfil G. Elber}
- @\pagestyle{myheadings}
- @\newpage
- @
- @
- !
- ! IRIT _IRIT_VERSION_ User's Manual
-
- ! A Solid modeling Program
-
- ^ Copyright (C) 1989, 1990-1995 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
-
-
- @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- @
- @\section{Introduction}
- !INTRODUCTION
-
- {\em IRIT} is a solid modeler developed for educational purposes. Although
- small, it is now powerful enough to create quite complex scenes.
-
- {\em 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.
- $
-
- @\section{Copyrights}
- !COPYRIGHTS
-
- BECAUSE {\em 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 {\em 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 {\em 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.
-
- @\smallskip
-
- {\em 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.
-
- {\em IRIT} can be compiled and executed on numerous Unix systems as well
- as OS2, Windows NT 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 {\em IRIT}.
- You are encouraged to share any model you made with it, but the models
- you made with it are {\em 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 {\em not} required.
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Command Line Options and Set Up of {\em IRIT}}
- !SETUP
-
- The {\em IRIT} program reads a file called {\bf 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 {\bf irit.cfg}.
-
- In addition, if it exists, a file by the name of {\bf iritinit.irt} will be
- automatically executed before any other '.irt' file. This file may contain
- any {\em 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 {\bf 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:
- # 14 2 0 1
- path
- Add to path the directory where {\em IRIT}'s binaries are.
- IRIT\_PATH
- Directory with config., help and {\em 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,
-
- @\begin{verbatim}
- set path = ($path /u/gershon/irit/bin)
- setenv IRIT_PATH /u/gershon/irit/bin/
- setenv IRIT_DISPLAY "xgldrvs -s-"
- setenv IRIT_BIN_IPC 1
- @\end{verbatim}
-
- 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 {\em 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.
- # 17 2 0 1
- IRIT\_MALLOC
- If set, apply dynamic memory consistency testing.
-
- Programs will execute much slower in this mode.
- 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.
- #
-
- For example,
-
- @\begin{verbatim}
- setenv IRIT_MALLOC 1
- setenv IRIT_NO_SIGNALS 1
- setenv IRIT_SERVER_HOST irit.cs.technion.ac.il
- @\end{verbatim}
-
- IRIT\_MALLOC is useful for programmers, or when reporting a memory
- fatal error occurrence. 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 ({\em IRIT}/Display device) communication.
-
- IRIT\_SERVER\_HOST and IRIT\_SERVER\_PORT are used in the unix and
- Window NT ports of {\em 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:
-
- @\begin{verbatim}
- IRIT [-t] [-z] [file.irt]
- @\end{verbatim}
-
- # 10 2 1 1
- -t
- Puts {\em 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.
- #
-
- @\subsection{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:
-
- @\begin{verbatim}
- %set IRIT_PATH=c:\irit\bin\
- set IRIT_DISPLAY=os2drvs.exe
- set IRIT_BIN_IPC=1
- @\end{verbatim}
-
- 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.
-
- @\subsection{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.
-
- @\subsection{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.
- # 33 2 0 1
- \#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
-
- #
- $
-
- @\section{First Usage}
- !FIRSTUSAGE
-
- Commands to {\em 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 {\em 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:
- # 18 2 1 1
- 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 and under OS2
- 2.x.
- $
-
- @\section{Data Types}
- !DATATYPES
- These are the Data Types recognized by the solid modeler. They are also
- used to define the calling sequences of the different functions below:
- # 18 2 1 1
- {\bf ConstantType}
- Scalar real type that cannot be modified.
- {\bf NumericType}
- Scalar real type.
- {\bf VectorType}
- 3D real type vector.
- {\bf PointType}
- 3D real type point.
- {\bf CtlPtType}
- Control point of a freeform curve or surface.
- {\bf MatrixType}
- 4 by 4 matrix (homogeneous transformation matrix).
- {\bf PolygonType}
- Object consists of polygons.
- {\bf PolylineType}
- Object consists of polylines.
- {\bf CurveType}
- Object consists of curves.
- {\bf SurfaceType}
- Object consists of surfaces.
- {\bf TrimSrfType}
- Object consists of trimmed surfaces.
- {\bf TrivarType}
- Object consists of trivariate function.
- {\bf GeometricType}
- One of Polygon/lineType, CurveType, SurfaceType,
-
- TrimSrfType, TrivarType.
- {\bf GeometricTreeType}
- A list of GeometricTypes or GeometricTreeTypes.
- {\bf StringType}
- Sequence of chars within double quotes - "A string".
-
- Current implementation is limited to 80 chars.
- {\bf AnyType}
- Any of the above.
- {\bf ListType}
- List of (any of the above type) objects. List
-
- size is dynamically increased, as needed.
- #
- Although points and vectors are not the same, {\em IRIT} does not
- destinguish between them, most of the time. This might change in the future.
- $
-
- @\section{Commands summary}
- !COMMANDS
-
- These are all the commands and operators supported by the {\em IRIT} solid
- modeler:
-
- # 11 6 1 0
- $+$
- $-$
- $*$
- $/$
- \verb+^+
- $=$
- $==$
- $!=$
- $<$
- $>$
- $<=$
- $>=$
- ABS
- ACOS
- ADAPISO
- ARC
- AREA
- ASIN
- ATAN
- ATAN2
- ATTRIB
- AOFFSET
- BOOLONE
- BOOLSUM
- BOX
- BSP2BZR
- BZR2BSP
- CBEZIER
- CBSPLINE
- CCINTER
- CCRVTR
- CDERIVE
- CDIVIDE
- CEDITPT
- CEVAL
- CEVOLUTE
- CEXTREMES
- CHDIR
- CINFLECT
- CINTERP
- CIRCLE
- CIRCPOLY
- CLNTCLOSE
- CLNTEXEC
- CLNTREAD
- CLNTWRITE
- CMESH
- CMORPH
- CMULTIRES
- COERCE
- COLOR
- COMMENT
- CON2
- CONE
- CONVEX
- COORD
- COS
- COMPOSE
- CPOLY
- CRAISE
- CREFINE
- CREGION
- CREPARAM
- CROSSEC
- CRVLNDST
- CRVPTDST
- CSURFACE
- CTANGENT
- CTLPT
- CTRIMSRF
- CYLIN
- CZEROS
- ERROR
- EXIT
- EXP
- EXTRUDE
- FFCOMPAT
- FFEXTREME
- FOR
- FREE
- FUNCTION
- GBOX
- GETLINE
- GPOLYGON
- GPOLYLINE
- HELP
- HOMOMAT
- IF
- INCLUDE
- INTERACT
- IRITSTATE
- LIST
- LN
- LOAD
- LOFFSET
- LOG
- LOGFILE
- MERGEPOLY
- MESHSIZE
- MOMENT
- MSLEEP
- NIL
- NTH
- OFFSET
- PAUSE
- PCIRCLE
- PDOMAIN
- POLY
- PRINTF
- PRISA
- PROCEDURE
- RANDOM
- RMATTR
- ROTX
- ROTY
- ROTZ
- RULEDSRF
- SAVE
- SBEZIER
- SBSPLINE
- SCALE
- SCRVTR
- SDERIVE
- SDIVIDE
- SEDITPT
- SEVAL
- SFROMCRVS
- SIN
- SINTERP
- SIZEOF
- SMERGE
- SMORPH
- SNOC
- SNORMAL
- SNRMLSRF
- SPHERE
- SQRT
- SRAISE
- SREFINE
- SREGION
- SREPARAM
- STANGENT
- STRIMSRF
- STRIVAR
- SURFPREV
- SURFREV
- SWEEPSRF
- SWPSCLSRF
- SYMBCPROD
- SYMBDIFF
- SYMBDPROD
- SYMBPROD
- SYMBSUM
- SYSTEM
- TAN
- TBEZIER
- TBSPLINE
- TDERIVE
- TEVAL
- TIME
- TINTERP
- THISOBJ
- TORUS
- TRANS
- TREFINE
- TREGION
- TRIMSRF
- TSUBDIV
- VARLIST
- VECTOR
- VIEW
- VIEWOBJ
- VOLUME
- #
- $
-
- @\section{Functions and Variables}
- !FUNCTIONS
- @ This section lists all the functions supported by the {\em IRIT} system
- @ according to their classes - mostly, the object type they return.
- @
-
- Functions that return a {\bf NumericType}:
- # 11 5 1 0
- ABS
- ACOS
- AREA
- ASIN
- ATAN
- ATAN2
- COS
- CLNTEXEC
- CPOLY
- EXP
- LN
- LOG
- MESHSIZE
- RANDOM
- SIN
- SIZEOF
- SQRT
- TAN
- THISOBJ
- VOLUME
- #
-
- Functions that return a {\bf GeometricType}:
- # 11 6 1 0
- ADAPISO
- ARC
- AOFFSET
- BOOLONE
- BOOLSUM
- BOX
- BSP2BZR
- BZR2BSP
- CBEZIER
- CBSPLINE
- CCINTER
- CCRVTR
- CDERIVE
- CDIVIDE
- CEDITPT
- CEVAL
- CEVOLUTE
- CEXTREMES
- CINFLECT
- CINTERP
- CIRCLE
- CIRCPOLY
- CLNTREAD
- CMESH
- CMORPH
- CMULTIRES
- COERCE
- COMPOSE
- CON2
- CONE
- CONVEX
- COORD
- CPOLY
- CRAISE
- CREFINE
- CREGION
- CREPARAM
- CROSSEC
- CRVLNDST
- CRVPTDST
- CSURFACE
- CTANGENT
- CTRIMSRF
- CTLPT
- CYLIN
- CZEROS
- EXTRUDE
- FFCOMPAT
- FFEXTREME
- GBOX
- GETLINE
- GPOLYGON
- GPOLYLINE
- LOFFSET
- MERGEPOLY
- MOMENT
- NIL
- OFFSET
- PCIRCLE
- PDOMAIN
- POLY
- PRISA
- PROCEDURE
- RULEDSRF
- SBEZIER
- SBSPLINE
- SCRVTR
- SDERIVE
- SDIVIDE
- SEDITPT
- SEVAL
- SFROMCRVS
- SINTERP
- SMERGE
- SMORPH
- SNORMAL
- SNRMLSRF
- SPHERE
- SRAISE
- SREFINE
- SREGION
- SREPARAM
- STANGENT
- STRIMSRF
- STRIVAR
- SURFPREV
- SURFREV
- SWEEPSRF
- SWPSCLSRF
- SYMBCPROD
- SYMBDIFF
- SYMBDPROD
- SYMBPROD
- SYMBSUM
- TBEZIER
- TBSPLINE
- TDERIVE
- TEVAL
- TINTERP
- TORUS
- TREFINE
- TREGION
- TRIMSRF
- TSUBDIV
- #
-
- Functions that create linear transformation matrices:
- # 11 6 1 0
- HOMOMAT
- ROTX
- ROTY
- ROTZ
- SCALE
- TRANS
- #
-
- Miscellaneous functions:
- # 11 6 1 0
- ATTRIB
- CHDIR
- CLNTCLOSE
- CLNTWRITE
- COLOR
- COMMENT
- ERROR
- EXIT
- FOR
- FREE
- FUNCTION
- HELP
- IF
- INCLUDE
- INTERACT
- IRITSTATE
- LIST
- LOAD
- LOGFILE
- MSLEEP
- NTH
- PAUSE
- PRINTF
- PROCEDURE
- RMATTR
- SAVE
- SNOC
- SYSTEM
- TIME
- VARLIST
- VECTOR
- VIEW
- VIEWOBJ
- #
-
- Variables that are predefined in the system:
- # 18 4 1 0
- AXES
- DRAWCTLPT
- FLAT4PLY
- MACHINE
- POLY\_APPROX\_OPT
- POLY\_APPROX\_UV
- POLY\_APPROX\_TOL
- PRSP\_MAT
- RESOLUTION
- VIEW\_MAT
- #
-
- Constants that are predefined in the system:
- # 13 5 1 0
- AMIGA
- APOLLO
- BLACK
- BLUE
- COL
- CTLPT\_TYPE
- CURVE\_TYPE
- CYAN
- DEPTH
- E1
- E2
- E3
- E4
- E5
- FALSE
- GREEN
- HP
- IBMOS2
- IBMNT
- KV\_FLOAT
- KV\_OPEN
- LIST\_TYPE
- MAGENTA
- MATRIX\_TYPE
- MSDOS
- NUMERIC\_TYPE
- OFF
- ON
- P1
- P2
- P3
- P4
- P5
- PARAM\_CENTRIP
- PARAM\_CHORD
- PARAM\_UNIFORM
- PI
- PLANE\_TYPE
- POINT\_TYPE
- POLY\_TYPE
- RED
- ROW
- SGI
- STRING\_TYPE
- SURFACE\_TYPE
- SUN
- TRIMSRF\_TYPE
- TRIVAR\_TYPE
- TRUE
- UNDEF\_TYPE
- UNIX
- VECTOR\_TYPE
- WHITE
- YELLOW
- #
- $
-
- @\section{Language description}
- !LANGUAGE
- The front end of the {\em 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 (\verb+^+), for
- numeric operators, with the same precedence as in C.
-
- However, unlike the C language, these operators are overloaded,
- @\footnote{In fact the C language does support overloaded operators to some
- @extent: '1 + 2' and '1.0 + 2.0' implies invocation of two different
- @actions.}
- 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:
-
- @\begin{verbatim}
- for ( t = 1.1, 0.1, 1.9,
- cb1 = csurface( sb, COL, t ):
- color( cb1, green ):
- snoc( cb1, cb_all )
- );
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- V = sin( 45 * pi / 180.0 );
- V = V * vector( 1, 2, 3 );
- V = V * rotx( 90 );
- V = V * V;
- @\end{verbatim}
-
- 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.
- $
-
- @\section{Operator overloading}
- @
- @ The basic operators $+$, $-$, $*$, $/$, and \verb+^+ are overloaded.
- @ This section describes what action is taken by each of these operators
- @ depending on its arguments.
- @
- @\subsection{Overloading $+$}
- !+
- The $+$ operator is overloaded above the following domains:
-
- @\begin{verbatim}
- NumericType + NumericType -> NumericType
- 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)
- @\end{verbatim}
-
- 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.
- $
-
- @\subsection{Overloading $-$}
- !-
- The $-$ operator is overloaded above the following domains:
-
- As a binary operator:
-
- @\begin{verbatim}
- NumericType - NumericType -> NumericType
- VectorType - VectorType -> VectorType (Vectoric difference)
- MatrixType - MatrixType -> MatrixType (Matrix difference)
- PolygonType - PolygonType -> PolygonType (Boolean SUBTRACT operation)
- @\end{verbatim}
-
- As a unary operator:
-
- @\begin{verbatim}
- - 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)
- @\end{verbatim}
-
- 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.
- $
-
- @\subsection{Overloading $*$}
- !*
- The $*$ operator is overloaded above the following domains:
-
- @\begin{verbatim}
- NumericType * NumericType -> NumericType
- VectorType * NumericType -> VectorType (Vector scaling)
- 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)
- @\end{verbatim}
-
- 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.
- $
-
- @\subsection{Overloading $/$}
- !/
- The $/$ operator is overloaded above the following domains:
-
- @\begin{verbatim}
- NumericType / NumericType -> NumericType
- PolygonType / PolygonType -> PolygonType (Boolean CUT operation)
- @\end{verbatim}
- $
-
- Note: Boolean CUT of two disjoint objects (no common volume) will result
- with an empty object.
- $
-
- @\subsection{Overloading \^{\ }}
- !^
- The \verb+^+ operator is overloaded above the following domains:
-
- @\begin{verbatim}
- 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)
- @\end{verbatim}
-
- 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.
- $
-
- @\subsection{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 )".
- $
-
- @\subsection{Comparison operators $==$, $!=$, $<$, $>$, $<=$, $>=$}
- &Comparison operators ==, !=, <, >, <=, >=
- The conditional comparison operators can be applied to the following
- domains (o for a comparison operator):
-
- @\begin{verbatim}
- NumericType o NumericType -> NumericType
- StringType o StringType -> NumericType
- PointType o PointType -> NumericType
- VectorType o VectorType -> NumericType
- PlaneType o PlaneType -> NumericType
- @\end{verbatim}
-
- The returned NumericType is non-zero if the condition holds, or zero if
- not.
- For PointTypes, VectorTypes, and PlaneTypes, only $==$ and $!=$ comparisons
- are valid. This is either the same or different.
- For NumericTypes and StringTypes (uses strcmp) all comparisons are valid.
- $
-
- @\subsection{Logical operators $\&\&$, $\|\|$, !}
- &Logical operators &&, ||, !
- Complex logical expressions can be defined using the logical {\em and} ($\&\&$),
- logical {\em or} ($\|\|$) and logical {\em 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 {\em and}
- operator, at least one is true for the {\em or} operator, and the operand is
- false for the {\em not} operator. In all other cases, a false is returned.
- To make sure Logical expressions are readable, the {\em and} and {\em or}
- operators are defined to have the {\em same} priority. Use parentheses to
- disambiguate a logical expression and to make it more readable.
- $
-
- @\subsection{Geometric Boolean Operations}
- &Geometric Boolean Operations
- The {\em 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.
-
- Example:
-
- @\begin{verbatim}
- 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 ) );
- @\end{verbatim}
-
- A complete example to compute the union, intersection and both
- differences of a box and a truncated cone.
- @The result of this example can be seen in Figure~\ref{fig-booleans}
- @with its hidden lines removed.
- @\begin{figure}
- @\vspace{3in}
- @\special{psfile=user_man/booleans.ps hscale=100 vscale=100 hoffset=-40 voffset=-130}
- @\caption{Geometric Boolean operatioms between a box and a truncated cone.
- @ Shown are union (left), intersection (bottom center), box minus
- @ the cone (top center), and cone minus the box (right).}
- @\label{fig-booleans}
- @\end{figure}
-
- There are several flags to control the Boolean operations. See
- IRITSTATE command for the "InterCrv", "Coplanar", and "PolySort"
- states.
- $
-
- @\subsection{Priority of operators}
- &Priority of operators
- The following table lists the priority of the different operators.
- # 19 3 0 1
- 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
- \verb+^+
- power
- priority
- -, !
- unary minus, logical not
- #
- $
-
- @\subsection{Grammar}
- &Grammar
- The grammar of the {\em 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.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Function Description}
- &Function Description
-
- @ The description below defines the parameters and returned values of the
- @ predefined functions in the system, using the notation of functions
- @ in ANSI C. Listed are all the functions in the system, in alphabetic
- @ order, according to their classes.
- @
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{NumericType returning functions}
- &NumericType returning functions
-
- @\subsubsection{ABS}
- !ABS
-
- @\begin{verbatim}
- NumericType ABS( NumericType Operand )
- @\end{verbatim}
-
- Returns the absolute value of the given {\bf Operand}.
- $
-
- @\subsubsection{ACOS}
- !ACOS
-
- @\begin{verbatim}
- NumericType ACOS( NumericType Operand )
- @\end{verbatim}
-
- Returns the arc cosine value (in radians) of the given {\bf Operand}.
- $
-
- @\subsubsection{AREA}
- !AREA
-
- @\begin{verbatim}
- NumericType AREA( PolygonType Object )
- @\end{verbatim}
-
- Returns the area of the given {\bf 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.
- $
-
- @\subsubsection{ASIN}
- !ASIN
-
- @\begin{verbatim}
- NumericType ASIN( NumericType Operand )
- @\end{verbatim}
-
- Returns the arc sine value (in radians) of the given {\bf Operand}.
- $
-
- @\subsubsection{ATAN}
- !ATAN
-
- @\begin{verbatim}
- NumericType ATAN( NumericType Operand )
- @\end{verbatim}
-
- Returns the arc tangent value (in radians) of the given {\bf Operand}.
- $
-
- @\subsubsection{ATAN2}
- !ATAN2
-
- @\begin{verbatim}
- NumericType ATAN2( NumericType Operand1, NumericType Operand2 )
- @\end{verbatim}
-
- Returns the arc tangent value (in radians) of the given ratio:
- {\bf Operand1} / {\bf Operand2}, over the whole circle.
- $
-
- @\subsubsection{COS}
- !COS
-
- @\begin{verbatim}
- NumericType COS( NumericType Operand )
- @\end{verbatim}
-
- Returns the cosine value of the given {\bf Operand} (in radians).
- $
-
- @\subsubsection{CLNTEXEC}
- !CLNTEXEC
-
- @\begin{verbatim}
- NumericType CLNTEXEC( StringType ClientName )
- @\end{verbatim}
-
- Initiate communication channels to a client named {\bf ClientName}.
- {\bf 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 CLNTREAD, CLNTWRITE, and
- CLNTCLOSE. if {\bf 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:
-
- @\begin{verbatim}
- h1 = CLNTEXEC( "" );
- h2 = CLNTEXEC( "nuldrvs -s-" );
- @\end{verbatim}
-
- executes two clients, one is named {\bf 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,
-
- @\begin{verbatim}
- Irit: Startup your program - I am waiting...
-
- setenv IRIT_SERVER_PORT 2182
- @\end{verbatim}
-
- and he/she will need to set the proper environment variable and execute
- their client manually.
- $
-
- @\subsubsection{CPOLY}
- !CPOLY
-
- @\begin{verbatim}
- NumericType CPOLY( PolygonType Object )
- @\end{verbatim}
-
- Returns the number of polygons in the given polygonal {\bf Object}.
- $
-
- @\subsubsection{EXP}
- !EXP
-
- @\begin{verbatim}
- NumericType EXP( NumericType Operand )
- @\end{verbatim}
-
- Returns the natural exponent value of the given {\bf Operand}.
- $
-
- @\subsubsection{LN}
- !LN
-
- @\begin{verbatim}
- NumericType LN( NumericType Operand )
- @\end{verbatim}
-
- Returns the natural logarithm value of the given {\bf Operand}.
- $
-
- @\subsubsection{LOG}
- !LOG
-
- @\begin{verbatim}
- NumericType LOG( NumericType Operand )
- @\end{verbatim}
-
- Returns the base 10 logarithm value of the given {\bf Operand}.
- $
-
- @\subsubsection{MESHSIZE}
- !MESHSIZE
-
- @\begin{verbatim}
- NumericType MESHSIZE( SurfaceType Srf, ConstantType Direction )
- @\end{verbatim}
-
- Returns the size of {\bf Srf}'s mesh in {\bf Direction}, which
- is one of COL or ROW.
-
- Example:
-
- @\begin{verbatim}
- RSize = MESHSIZE( Sphere, ROW );
- CSize = MESHSIZE( Sphere, COL );
- @\end{verbatim}
- $
-
- @\subsubsection{RANDOM}
- !RANDOM
-
- @\begin{verbatim}
- NumericType RANDOM( NumericType Min, NumericType Max )
- @\end{verbatim}
-
- Returns a randomized value between {\bf Min} and {\bf Max}.
- $
-
- @\subsubsection{SIN}
- !SIN
-
- @\begin{verbatim}
- NumericType SIN( NumericType Operand )
- @\end{verbatim}
-
- Returns the sine value of the given {\bf Operand} (in radians).
- $
-
- @\subsubsection{SIZEOF}
- !SIZEOF
-
- @\begin{verbatim}
- NumericType SIZEOF( ListType List | PolyType Poly | CurveType Crv )
- @\end{verbatim}
-
- Returns the length of a list, if {\bf List}, the number of polygons
- if {\bf Poly}, or the length of the control polygon if {\bf Crv}.
- If, however, only one polygon is in {\bf Poly}, it returns the number
- of vertices in that polygon.
-
- Example:
-
- @\begin{verbatim}
- len = SIZEOF( list( 1, 2, 3 ) );
- numPolys = SIZEOF( axes );
- numCtlpt = SIZEOF( circle( vector( 0, 0, 0 ), 1 ) );
- @\end{verbatim}
-
- will assign the value of 3 to the variable {\bf len}, set {\bf numPolys}
- to the number of polylines in the axes object, and set numCtlPt to 9, the
- number of control points in a circle.
- $
-
- @\subsubsection{SQRT}
- !SQRT
-
- @\begin{verbatim}
- NumericType SQRT( NumericType Operand )
- @\end{verbatim}
-
- Returns the square root value of the given {\bf Operand}.
- $
-
- @\subsubsection{TAN}
- !TAN
-
- @\begin{verbatim}
- NumericType TAN( NumericType Operand )
- @\end{verbatim}
-
- Returns the tangent value of the given {\bf Operand} (in radians).
- $
-
- @\subsubsection{THISOBJ}
- !THISOBJ
-
- @\begin{verbatim}
- NumericType THISOBJ( StringType Object )
- @\end{verbatim}
-
- Returns the object type of the given name of an {\bf Object}. This can
- be one of the constants UNDEF\_TYPE, NUMERIC\_TYPE, STRING\_TYPE,
- VECTOR\_TYPE, POINT\_TYPE, CTLPT\_TYPE, MATRIX\_TYPE, POLY\_TYPE,
- CURVE\_TYPE, SURFACE\_TYPE, TRIMSRF\_TYPE, or TRIVAR\_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).
- $
-
- @\subsubsection{VOLUME}
- !VOLUME
-
- @\begin{verbatim}
- NumericType VOLUME( PolygonType Object )
- @\end{verbatim}
-
- Returns the volume of the given {\bf 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).
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{GeometricType returning functions}
-
- &GeometricType returning functions
-
- @\subsubsection{ADAPISO}
- !ADAPISO
-
- @\begin{verbatim}
- CurveType ADAPISO( SurfaceType Srf, NumericType Dir, NumericType Eps,
- NumericType FullIso, NumericType SinglePath )
- @\end{verbatim}
-
- Constructs a {\em coverage} to {\bf Srf} using isocurve in the {\bf Dir} direction,
- so that for any point p on surface {\bf Srf}, there exists a point on one of
- the isocurves that is close to p within {\bf Eps}. If {\bf FullIso}, the
- extracted isocurves span the entire surface domain, otherwise they may
- span only a subset of the domain. If {\bf SinglePath}, an approximation to
- a single path (Hamiltonian path) that visits all isocurves is constructed.
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- Constructs an adaptive isocurve approximation with tolerance of {\bf 0.1} to
- surface {\bf srf} in direction {\bf COL}. Isocurves are allowed to span a
- subset of the surface domain. No single path is needed.
-
- The {\bf SinglePath} option is currently not supported.
- $
-
- @\subsubsection{ARC}
- !ARC
-
- @\begin{verbatim}
- CurveType ARC( VectorType StartPos, VectorType Center, VectorType EndPos )
- @\end{verbatim}
-
- Constructs an arc between the two end points {\bf StartPos} and {\bf EndPos},
- centered at {\bf Center}. Arc will always be less than 180 degrees, so the
- shortest circular path from {\bf StartPos} to {\bf EndPos} is selected. The
- case where {\bf StartPos}, {\bf Center}, and {\bf 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:
-
- @\begin{verbatim}
- Arc1 = ARC( vector( 1.0, 0.0, 0.0 ),
- vector( 1.0, 1.0, 0.0 ),
- vector( 0.0, 1.0, 0.0 ) );
- @\end{verbatim}
-
- constructs a 90 degrees arc, tangent to both the X and Y axes at coordinate 1.
- @See Figure~\ref{fig-arc}.
- @\begin{figure}
- @\vspace{2.4in}
- @\special{psfile=user_man/arc1cnst.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
- @\caption{A 90 degree arc constructed using the ARC constructor.}
- @\label{fig-arc}
- @\end{figure}
- $
-
- @\subsubsection{AOFFSET}
- !AOFFSET
-
- @\begin{verbatim}
- CurveType AOFFSET( CurveType Crv, NumericType OffsetDistance,
- NumericType Epsilon, NumericType TrimLoops )
-
- or
-
- SurfaceType AOFFSET( SurfaceType Srf NumericType OffsetDistance,
- NumericType Epsilon, NumericType TrimLoops )
- @\end{verbatim}
-
- Computes an offset of {\bf OffsetDistance} with globally bounded error
- (controlled by {\bf Epsilon}). The smaller {\bf Epsilon} is, the better
- the approximation to the offset. The bounded error is achieved by adaptive
- refinement of the {\bf Crv}.
- If {\bf TrimLoops} is TRUE or on, the regions of the object that
- self-intersect as a result of the offset operation are trimmed away.
-
- Example:
-
- @\begin{verbatim}
- OffCrv1 = AOFFSET( Crv, -0.4, 0.01, TRUE );
- OffCrv2 = AOFFSET( Crv, -0.4, 0.01, FALSE );
- @\end{verbatim}
-
- computes an adaptive offset to {\bf Crv} with {\bf OffsetDistance} of
- 0.5 and {\bf Epsilon} of 0.03 and trims the self-intersection loops.
- See also OFFSET and LOFFSET.
- @See Figure~\ref{fig-caoffset}.
- @\begin{figure}
- @\vspace{1.6in}
- @\special{psfile=user_man/caoffset.ps hscale=100 vscale=100 hoffset=-60 voffset=-220}
- @\caption{Adaptive offset approximation (thick) of a Bspline curve (thin).
- @ On the left, the self intersections in the offset computed in the
- @ right are eliminated. Both offsets were computedusing AOFFSET.
- @ (See also Figure~\protect\ref{fig-coffset}.)}
- @\label{fig-caoffset}
- @\end{figure}
- $
-
- @\subsubsection{BOOLONE}
- !BOOLONE
-
- @\begin{verbatim}
- SurfaceType BOOLONE( CurveType Crv )
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- Srf = BOOLONE( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
- @\end{verbatim}
-
- Creates a disk surface containing the area enclosed by the unit circle.
- @See Figure~\ref{fig-boolsum-one}.
- @\begin{figure}
- @\vspace{3.5in}
- @\special{psfile=user_man/boolone.ps hscale=70 vscale=70 hoffset=-80 voffset=-90}
- @\special{psfile=user_man/boolsum.ps hscale=70 vscale=70 hoffset=170 voffset=-70}
- @\caption{A boolean sum of a circle creates a disk (left) using BOOLONE and
- @ a general boolean sum of four curves (right).}
- @\label{fig-boolsum-one}
- @\end{figure}
- $
-
- @\subsubsection{BOOLSUM}
- !BOOLSUM
-
- @\begin{verbatim}
- SurfaceType BOOLSUM( CurveType Crv1, CurveType Crv2,
- CurveType Crv3, CurveType Crv4 )
- @\end{verbatim}
-
- 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:
- # 30 2 0 1
- {\bf Crv1} start point,
- to {\bf Crv3} start point.
- {\bf Crv1} end point,
- to {\bf Crv4} start point.
- {\bf Crv2} start point,
- to {\bf Crv3} end point.
- {\bf Crv2} end point,
- to {\bf Crv4} end point.
- #
- where {\bf Crv1} and {\bf Crv2} are the two boundaries in one parametric
- direction, and {\bf Crv3} and {\bf Crv4} are the two boundaries in the other
- parametric direction.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
- $
-
- @\subsubsection{BOX}
- !BOX
-
- @\begin{verbatim}
- PolygonType BOX( VectorType Point,
- NumericType Dx, NumericType Dy, NumericType Dz )
- @\end{verbatim}
-
- Creates a BOX polygonal object, whose boundary is coplanar with the
- $XY$, $XZ$, and $YZ$ planes. The BOX is defined by {\bf Point} as
- base position, and {\bf Dx, Dy, Dz} as BOX dimensions. Negative dimensions
- are allowed.
-
- Example:
-
- @\begin{verbatim}
- B = BOX( vector( 0, 0, 0 ), 1, 1, 1);
- @\end{verbatim}
-
- creates a unit cube from 0 to 1 in all axes.
- $
-
- @\subsubsection{BZR2BSP}
- !BZR2BSP
-
- @\begin{verbatim}
- CurveType BZR2BSP( CurveType Crv )
-
- or
-
- SurfaceType BZR2BSP( SurfaceType Srf )
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- BspSrf = BZR2BSP( BzrSrf );
- @\end{verbatim}
- $
-
- @\subsubsection{BSP2BZR}
- !BSP2BZR
-
- @\begin{verbatim}
- CurveType | ListType BSP2BZR( CurveType Crv )
-
- or
-
- SurfaceType | ListType BSP2BZR( SurfaceType Srf )
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- BzrCirc = BSP2BZR( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
- @\end{verbatim}
-
- would subdivide the unit circle into four 90 degrees Bezier arcs returned
- in a list.
- $
-
- @\subsubsection{CBEZIER}
- !CBEZIER
-
- @\begin{verbatim}
- CurveType CBEZIER( ListType CtlPtList )
- @\end{verbatim}
-
- Creates a Bezier curve out of the provided control point list. {\bf CtlPtList}
- is a list of control points, all of which must be of type (E1-E5, P1-P5),
- 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 created curve is the polynomial (or rational),
- @\begin{equation}
- @ C(t) = \sum_{i=0}^k P_i B_i(t),
- @\end{equation}
- @where $P_i$ are the control points {\bf CtlPtList}, and k is the degree of
- @the curve, which is one less than the number of points.
-
- Example:
-
- @\begin{verbatim}
- 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 ) ) );
- @\end{verbatim}
-
- constructs an arc of 90 degrees as a rational quadratic Bezier curve.
- $
-
- @\subsubsection{CBSPLINE}
- !CBSPLINE
-
- @\begin{verbatim}
- CurveType CBSPLINE( NumericType Order, ListType CtlPtList,
- ListType KnotVector )
- @\end{verbatim}
-
- Creates a Bspline curve out of the provided control point list, the
- knot vector, and the specified order. {\bf CtlPtList} is a list of control
- points, all of which must be of type (E1-E5, P1-P5), 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 {\bf KnotVector} must be equal to the number of control
- points in {\bf CtlPtList} plus the {\bf Order}. If, however, the length of
- the knot vector is equal to {\bf \#CtlPtList + Order + Order - 1} the curve
- is assumed {\em periodic.}
- The knot vector list may be specified as either {\bf list( KV\_OPEN )} or
- {\bf list( KV\_FLOAT )} or {\bf list( KV\_PERIODIC )} in which a uniform
- open, uniform floating or uniform periodic knot vector with the appropriate
- length is automatically constructed.
- @
- @The created curve is the piecewise polynomial (or rational),
- @\begin{equation}
- @ C(t) = \sum_{i=0}^k P_i B_{i,\tau}(t),
- @\end{equation}
- @where $P_i$ are the control points {\bf CtlPtList} and k is the degree of
- @the curve, which is one less than the {\bf Order} or number of points.
- @$\tau$ is the knot vector of the curve.
-
- Example:
-
- @\begin{verbatim}
- 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 ) );
- @\end{verbatim}
-
- constructs an arc of 180 degrees in the XZ plane as a rational quadratic
- Bspline curve.
-
- Example:
-
- @\begin{verbatim}
- 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 ) );
- @\end{verbatim}
-
- creates a periodic curve and extracts its four polynomial domains as four
- {\em open} end Bspline curves.
- @See Figure~\ref{fig-cperiodic}.
- @\begin{figure}
- @\vspace{2.5in}
- @\special{psfile=user_man/cperiod.ps hscale=100 vscale=100 hoffset=-40 voffset=-230}
- @\caption{A cubic periodic curve created using KV\_PERIODIC end conditions.}
- @\label{fig-cperiodic}
- @\end{figure}
- $
-
- @\subsubsection{CCINTER}
- !CCINTER
-
- @\begin{verbatim}
- ListType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
- NumericType SelfInter )
-
- or
-
- SurfaceType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
- NumericType SelfInter )
- @\end{verbatim}
-
- Computes the intersection point(s) of {\bf Crv1} and {\bf Crv2} in the
- $XY$ plane. Since this computation involves numeric operations, {\bf Epsilon}
- controls the accuracy of the parametric values of the result.
- It returns a list of PointTypes, each containing the parameter of {\bf Crv1}
- in the X coordinate, and the parameter of {\bf Crv2} in the Y coordinate.
- If, however, {\bf Epsilon} is negative, a scalar field surface representing
- the square of the distance function is returned instead.
- If {\bf SelfInter} is TRUE, {\bf Crv1} and {\bf Crv2} can be the same
- curve, and self-intersection points are searched instead.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- Computes the parameter values of the intersection point of {\bf crv1} and
- {\bf crv2} to a tolerance of 0.0001.
- @See Figure~\ref{fig-cci}.
- @\begin{figure}
- @\vspace{2.5in}
- @\special{psfile=user_man/cci.ps hscale=100 vscale=100 hoffset=-60 voffset=-200}
- @\caption{A intersection point of two freeform curve computed using CCINTER.}
- @\label{fig-cci}
- @\end{figure}
- $
-
- @\subsubsection{CCRVTR}
- !CCRVTR
-
- @\begin{verbatim}
- NumericType CCRVTR( CurveType Crv, NumericType Epsilon )
-
- or
-
- CurveType CCRVTR( CurveType Crv, NumericType Epsilon )
- @\end{verbatim}
-
- Computes the extreme curvature points on {\bf 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, {\bf Epsilon} is used to set
- the needed accuracy. It returns the parameter value(s) of the location(s)
- with extreme curvature along the {\bf Crv}.
- If, however, {\bf 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,
- @\begin{equation}
- @ \kappa(t) = \frac{x'(t) y''(t) - x''(t) y'(t)}
- @ {\left( (x'(t))^2 + (y'(t))^2\ \right)^{\frac{3}{2}}},
- @\end{equation}
- @ and computes kN for three dimensional curves as the following vector field,
- @\begin{equation}
- @ \kappa(t) N(t) = \kappa(t) B(t) \times T(t) =
- @ \frac{C' \times C''}{\| C' \| ^ 3} \times \frac{C'}{\| C' \|} =
- @ \frac{(C' \times C'') \times C'}{\| C' \| ^ 4}.
- @\end{equation}
- ^ 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:
-
- @\begin{verbatim}
- 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 ) );
- @\end{verbatim}
-
- finds the extreme curvature points in {\bf Crv} and displays them all
- with the curve.
- @See Figure~\ref{fig-ccrvtr}.
- @\begin{figure}
- @\vspace{2.3in}
- @\special{psfile=user_man/ccrvtr.ps hscale=100 vscale=100 hoffset=-40 voffset=-220}
- @\caption{Extreme curvature locations on a freeform curve computed using CCRVTR.}
- @\label{fig-ccrvtr}
- @\end{figure}
- $
-
- @\subsubsection{CDERIVE}
- !CDERIVE
-
- @\begin{verbatim}
- CurveType CDERIVE( CurveType Curve )
- @\end{verbatim}
-
- Returns a vector field curve representing the differentiated curve,
- also known as the Hodograph curve.
-
- Example:
-
- @\begin{verbatim}
- Circ = circle( vector( 0.0, 0.0, 0.0 ), 1.0 );
- Hodograph = CDERIVE( Circ );
- @\end{verbatim}
- @See Figure~\ref{fig-cderive}.
- @\begin{figure}
- @\vspace{3.5in}
- @\special{psfile=user_man/cderive.ps hscale=100 vscale=100 hoffset=-40 voffset=-210}
- @\caption{The hodograph (thick) of a bspline circle (thin) constructed as four
- @ 90 degrees rational bezier arcs, computed using CDERIVE.}
- @\label{fig-cderive}
- @\end{figure}
- $
-
- @\subsubsection{CDIVIDE}
- !CDIVIDE
-
- @\begin{verbatim}
- ListType CDIVIDE( CurveType Curve, NumericType Param )
- @\end{verbatim}
-
- Subdivides a curve into two sub-curves at the specified parameter value.
- {\bf Curve} can be either a Bspline curve in which {\bf Param} must be
- within the Curve's parametric domain, or a Bezier curve in which {\bf Param}
- must be in the range of zero to one.
-
- It returns a list of the two sub-curves. The individual curves may be
- extracted from the list using the NTH command.
-
- Example:
-
- @\begin{verbatim}
- CrvLst = CDIVIDE( Crv, 1.3 );
- Crv1 = nth( CrvLst, 1 );
- Crv2 = nth( CrvLst, 2 );
- @\end{verbatim}
-
- subdivides the curve {\bf Crv} at the parameter value of 0.5.
- @See Figure~\ref{fig-cdivide}.
- @\begin{figure}
- @\vspace{2.7in}
- @\special{psfile=user_man/cdivide.ps hscale=80 vscale=80 hoffset=30 voffset=-140}
- @\caption{A Bspline curve is subdivided into two distinct regions using CDIVIDE.}
- @\label{fig-cdivide}
- @\end{figure}
- $
-
- @\subsubsection{CEDITPT}
- !CEDITPT
-
- @\begin{verbatim}
- CurveType CEDITPT( CurveType Curve, CtlPtType CtlPt, NumericType Index )
- @\end{verbatim}
-
- Provides a simple mechanism to manually modify a single control point number
- {\bf Index} (base count is 0) in {\bf Curve}, by substituting {\bf CtlPt}
- instead. {\bf CtlPt} must have the same point type as the control points of
- the {\bf Curve}. Original curve {\bf Curve} is not modified.
-
- Example:
-
- @\begin{verbatim}
- CPt = ctlpt( E3, 1, 2, 3 );
- NewCrv = CEDITPT( Curve, CPt, 1 );
- @\end{verbatim}
-
- constructs a {\bf NewCrv} with the second control point of {\bf Curve} being
- {\bf CPt}.
- $
-
- @\subsubsection{CEVAL}
- !CEVAL
-
- @\begin{verbatim}
- CtlPtType CEVAL( CurveType Curve, NumericType Param )
- @\end{verbatim}
-
- Evaluates the provided {\bf Curve} at the given {\bf Param} value.
- {\bf Param} should be in the curve's parametric domain if {\bf Curve} is
- a Bspline curve, or between zero and one if {\bf Curve} is a Bezier curve.
- The returned control point has the same point type as the control points
- of the {\bf Curve}.
-
- Example:
-
- @\begin{verbatim}
- CPt = CEVAL( Crv, 0.25 );
- @\end{verbatim}
-
- evaluates {\bf Crv} at the parameter value of 0.25.
- $
-
- @\subsubsection{CEVOLUTE}
- !CEVOLUTE
-
- @\begin{verbatim}
- CurveType CEVOLUTE( CurveType Curve )
- @\end{verbatim}
-
- Computes the evolute of a curve. The evolute is defined as,
- @\begin{equation}
- @ E(t) = C(t) + \frac{N(t)}{\kappa(t)},
- @\end{equation}
- @ 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
- @ $\frac{N(t)}{\kappa(t)}$ where the latter is,
- @
- @\begin{eqnarray}
- @ \frac{N(t)}{\kappa(t)}
- @ & = & \frac{\kappa(t) N(t)}{k^2(t)} \nonumber \\
- @ & = & \frac{(C'(t) \times C''(t)) \times C'(t)}
- @ {\| C'(t) \|^4}
- @ \frac{\|C'(t)\|^6}
- @ {(C'(t) \times C''(t))^2} \nonumber \\
- @ & = & \frac{\left( {(C'(t) \times C''(t)) \times C'(t)} \right)
- @ \| C'(t) \|^2}
- @ {(C'(t) \times C''(t))^2}
- @\end{eqnarray}
- ^
- ^ 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).
-
- The result of this symbolic computation is exact (upto machine precision)
- unlike a similar operation which is only approximated, the OFFSET or the
- AOFFSET.
-
- Example:
-
- @\begin{verbatim}
- 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 = CEVOLUTE( Crv );
- @\end{verbatim}
- @See Figure~\ref{fig-cevolute}.
- @\begin{figure}
- @\vspace{2in}
- @\special{psfile=user_man/cevolute.ps hscale=100 vscale=100 hoffset=-20 voffset=-260}
- @\caption{The evolute (thick) of a freeform curve (thin) can be computed using
- @ CEVOLUTE.}
- @\label{fig-cevolute}
- @\end{figure}
- $
-
- @\subsubsection{CEXTREMES}
- !CEXTREMES
-
- @\begin{verbatim}
- ListType CEXTREMES( CurveType Crv, NumericType Epsilon, NumericType Axis )
- @\end{verbatim}
-
- Computes the extreme set of the given {\bf Crv} in the given axis (1 for X,
- 2 for Y, 3 for Z). Since this computation is numeric, an {\bf 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:
-
- @\begin{verbatim}
- extremes = CEXTREMES( Crv, 0.0001, 1 );
- @\end{verbatim}
-
- Computes the extreme set of curve {\bf crv}, in the {\bf X} axis, with
- error tolerance of {\bf 0.0001}. See also CZERO.
- @See Figure~\ref{fig-cextreme}.
- @\begin{figure}
- @\vspace{2in}
- @\special{psfile=user_man/cextreme.ps hscale=100 vscale=100 hoffset=-40 voffset=-330}
- @\caption{The X local extremums of a freeform curve are isolated using CEXTREMES.}
- @\label{fig-cextreme}
- @\end{figure}
- $
-
- @\subsubsection{CINFLECT}
- !CINFLECT
-
- @\begin{verbatim}
- ListType CINFLECT( CurveType Crv, NumericType Epsilon )
-
- or
-
- CurveType CINFLECT( CurveType Crv, NumericType Epsilon )
- @\end{verbatim}
-
- Computes the inflection points of {\bf Crv} in the $XY$ plane.
- Since this computation is numeric, an {\bf 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, {\bf 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,
- @\begin{equation}
- @ \sigma(t) = x'(t) y''(t) - x''(t) y'(t).
- @\end{equation}
- ^ The sign of curvature scalar field is equal to
- ^
- ^ s(t) = x' y'' - x'' y'
- ^
- Example:
-
- @\begin{verbatim}
- 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);
- @\end{verbatim}
-
- Computes the set of inflection points of curve {\bf crv} with error
- tolerance of {\bf 0.001}. This set is then scanned in a loop and
- evaluated to the curve's locations which are then displayed with the {\bf crv}.
- See also CZEROS, CEXTREMES, and CCRVTR.
- @See Figure~\ref{fig-cinflect}.
- @\begin{figure}
- @\vspace{1.2in}
- @\special{psfile=user_man/cinflect.ps hscale=100 vscale=100 hoffset=-40 voffset=-310}
- @\caption{The Inflection points of a freeform curve can be isolated using CINFLECT.}
- @\label{fig-cinflect}
- @\end{figure}
- $
-
- @\subsubsection{CINTERP}
- !CINTERP
-
- @\begin{verbatim}
- CurveType CINTERP( ListType PtList, NumericType Order, NumericType Size,
- ConstantType Param)
- @\end{verbatim}
-
- Computes a Bspline polynomial curve that interpolates or approximates
- the list of points in {\bf PtList}. The Bspline curve will have order
- {\bf Order} and {\bf Size} control points. The knots will be spaced
- according to {\bf Param} which can be one of PARAM\_UNIFORM,
- PARAM\_CHORD or PARAM\_CENTRIP. The former prescribes a uniform knot
- sequence and the latters specify knot spacing according to the chord
- length and a square root of the chord length.
- All points in {\bf PtList} must be of type (E1-E5, P1-P5) control point,
- or regular PointType. If {\bf Size} is equal to the number of points in
- {\bf PtList} the resulting curve will {\em interpolate} the data set.
- Otherwise, if {\bf Size} is less than the number of points in {\bf PtList}
- the point data set will be least square approximated. In no time can {\bf Size}
- be larger that the number of points in {\bf PtList} or lower than {\bf Order}.
- {\bf Size} of zero forces interpolation by setting {\bf Size} to the
- data set size.
- All interior knots will be distinct preserving maximal continuity.
- The resulting Bspline curve will have open end conditions.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- 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.
- @See Figure~\ref{fig-cinterp}.
- @\begin{figure}
- @\vspace{2.6in}
- @\special{psfile=user_man/cinterp.ps hscale=100 vscale=100 hoffset=-40 voffset=-150}
- @\caption{A Helix is sampled at 100 locations is least square fit using CINTERP
- @ by a quadratic Bspline curve and 21 control points.}
- @\label{fig-cinterp}
- @\end{figure}
- $
-
- @\subsubsection{CIRCLE}
- !CIRCLE
-
- @\begin{verbatim}
- CurveType CIRCLE( VectorType Center, NumericType Radius )
- @\end{verbatim}
-
- Constructs a circle at the specified {\bf Center} with the specified
- {\bf 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.
- $
-
- @\subsubsection{CIRCPOLY}
- !CIRCPOLY
-
- @\begin{verbatim}
- PolygonType CIRCPOLY( VectorType Normal, VectorType Trans, NumericType Radius )
- @\end{verbatim}
-
- Defines a circular polygon in a plane perpendicular to {\bf Normal} that
- contains the {\bf Trans} point. Constructed polygon is centered at
- {\bf Trans}. RESOLUTION vertices will be defined with {\bf Radius} from
- distance from {\bf 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.
- $
-
- @\subsubsection{CLNTREAD}
- !CLNTREAD
-
- @\begin{verbatim}
- AnyType CLNTREAD( NumericType Handler, NumericType Block )
- @\end{verbatim}
-
- Reads one object from a communication channel of a client.
- {\bf 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 {\bf 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)". See also CLNTWRITE, CLNTCLOSE,
- and CLNTEXEC.
-
- Example:
-
- @\begin{verbatim}
- h2 = clntexec( "xmtdrvs -s-" );
- .
- .
-
- Model = CLNTREAD( h2 );
- .
- .
-
- clntclose( h2,TRUE );
- @\end{verbatim}
-
- reads one object from client through communication channel h2 and save it
- in variable Model.
- $
-
- @\subsubsection{CMORPH}
- !CMORPH
-
- @\begin{verbatim}
- CurveType CMORPH( CurveType Crv1, CurveType Crv2,
- NumericType Method, NumericType Blend )
-
- or
-
- ListType CMORPH( CurveType Crv1, CurveType Crv2,
- NumericType Method, NumericType Blend )
- @\end{verbatim}
-
- Creates a new curve which is a {\em 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 {\bf Method},
-
- # 3 2 0 1
- 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 {\bf Method} 1, {\bf Blend} is a number between zero ({\bf Crv1})
- and one ({\bf Crv2}) defining the similarity to {\bf Crv1} and {\bf Crv2},
- respectively. A single curve is returned.
-
- In {\bf Method}s 2 to 5, {\bf Blend} is a step size for the
- metamorphosis operation and a whole list describing the entire
- metamorphosis operation is returned.
-
- Examples:
-
- @\begin{verbatim}
- crv1 = cbezier( list( ctlpt( E2, 0.3, 0.0 ),
- ctlpt( E2, 0.0, 0.5 ),
- ctlpt( E2, -0.2, 0.0 ) ) );
- crv1a = crv1 * trans( vector( -0.4, 0.0, 0.0 ) );
- crv1b = crv1a * scale( vector( -1.0, 1.0, 1.0 ) );
-
- 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 )
- );
- @\end{verbatim}
-
- creates two metamorphosis animation sequences, one that is based on
- a convex blend and one that is based on corner/edge cutting scheme.
- See alost SMORPH.
- @See Figure~\ref{fig-cmorph}.
- @\begin{figure}
- @\begin{picture}(0,200)
- @ \put(110, 0){\large (a)}
- @ \put(320, 0){\large (b)}
- @\end{picture}
- @\special{psfile=user_man/cmorph.ps hscale=100 vscale=100 hoffset=-50 voffset=-260}
- @\caption{A morphing sequence using convex blend (a) and edge cutting (b).}
- @\label{fig-cmorph}
- @\end{figure}
- $
-
- @\subsubsection{CMULTIRES}
- !CMULTIRES
-
- @\begin{verbatim}
- ListType CMULTIRES( CurveType Crv, NumericType Discont )
- @\end{verbatim}
-
- Computes a multiresolution decomposition of curve {\bf Crv} using least
- squares approximation. The resulting list of curves describes an hierarchy
- of curves in linear subspaces of the space {\bf Crv} was in that can be
- sum algebraically to form {\bf Crv}. Each of the curves in the hierarchy
- is a least squares approximation of {\bf Crv} in the subspace it is defined
- in. {\bf Discont} is a boolean flat that controls the way tangent
- discontinuities are computed throughout the decomposition.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- Computes a multiresolution decomposition to curve {\bf CrossSec} as
- {\bf MRCrv} and display all the decomposition levels by summing them all
- up. The use of {\bf 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.
- @See Figure~\ref{fig-cmultres}.
- @\begin{figure}
- @\vspace{1.2in}
- @\special{psfile=user_man/cmultres.ps hscale=100 vscale=100 hoffset=-50 voffset=-280}
- @\caption{A multiresolution decomposition of a curve of an animal using
- @ list squares. Original curve is shown on the left.}
- @\label{fig-cmultres}
- @\end{figure}
- $
-
- @\subsubsection{CMESH}
- !CMESH
-
- @\begin{verbatim}
- CurveType CMESH( SurfaceType Srf, ConstantType Direction, NumericType Index )
- @\end{verbatim}
-
- Returns a single ROW or COLumn as specified by the {\bf Direction} and
- {\bf Index} (base count is 0) of the control mesh of surface {\bf Srf}.
-
- The returned curve will have the same knot vector as {\bf Srf} in the
- appropriate direction. See also CSURFACE.
-
- This curve is {\em not} necessarily in the surface {\bf Srf}.
- @It is equal to,
- @\begin{equation}
- @ C(t) = \sum_{i=0}^m P_{ij} B_i(t),
- @\end{equation}
- @and similar for the other parametric direction.
-
- Example:
-
- @\begin{verbatim}
- Crv = CMESH( Srf, COL, 0 );
- @\end{verbatim}
-
- extracts the first column of surface {\bf Srf} as a curve. See also
- CSURFACE.
- $
-
- @\subsubsection{COERCE}
- !COERCE
-
- @\begin{verbatim}
- AnyType COERCE( AnyType Object, ConstantType NewType )
- @\end{verbatim}
-
- Provides a coercion mechanism between different objects or object types.
- PointType, VectorType, PlaneType, CtlPtType can be all coerced to each
- other by using the {\bf NewType} of POINT\_TYPE, VECTOR\_TYPE, PLANE\_TYPE,
- or one of E1-E5, P1-P5 (CtlPtType). Similarly, CurveType, SurfaceType,
- TrimSrfType, and TrivarType 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.
- 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).
-
- Example:
-
- @\begin{verbatim}
- CrvE2 = COERCE( Crv, E2 );
- @\end{verbatim}
-
- coerce {\bf Crv} to a new curve that will have an E2 CtlPtType control
- points. Coerction of a projective curve (P1-P5) to a Euclidean curve
- (E1-E5) does not preseve the shape of the curve.
- $
-
- @\subsubsection{COMPOSE}
- !COMPOSE
-
- @\begin{verbatim}
- CurveType COMPOSE( CurveType Crv1, CurveType Crv2 )
-
- or
-
- CurveType COMPOSE( SurfaceType Srf, CurveType Crv )
- @\end{verbatim}
-
- Symbolically compute the composition curve {\bf Crv1(Crv2(t))} or
- {\bf Srf(Crv(t))}. In {\bf Crv1(Crv2(t)}, {\bf Crv1} can be any curve
- while {\bf Crv2} must be a one-dimensional curve that is either E1 or
- P1. In {\bf Srf(Crv(t))}, {\bf Srf} can be any surface, while {\bf Crv}
- must be a two-dimensional curve, that is either E2 or P2. Both {\bf Crv2}
- in the curve's composition, and {\bf Crv} is the surface's composition
- must be contained in the curve or surface parametric domain.
-
- Example:
-
- @\begin{verbatim}
- 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 = coerce( circle( vector( 0.0, 0.0, 1.0 ), 0.4 ), p2 ) *
- trans( vector( 0.5, 0.5, 0.0 ) );
- comp_crv = COMPOSE( srf, crv );
- @\end{verbatim}
-
- compose a circle {\bf Crv} to be on the surface {\bf Srf}.
- @See Figure~\ref{fig-compose}.
- @\begin{figure}
- @\vspace{2.5in}
- @\special{psfile=user_man/compose.ps hscale=100 vscale=100 hoffset=-10 voffset=-210}
- @\caption{A circle in the parametric space of the freefrom surface is composed
- @ to create a closed loop curve on the surface using COMPOSE.}
- @\label{fig-compose}
- @\end{figure}
- $
-
- @\subsubsection{CON2}
- !CON2
-
- @\begin{verbatim}
- PolygonType CON2( VectorType Center, VectorType Direction,
- NumericType Radius1, NumericType Radius2 )
- @\end{verbatim}
-
- Creates a truncated CONE geometric object, defined by {\bf Center} as the
- center of the main base of the CONE, {\bf Direction} as both the CONE's axis
- and the length of CONE, and the two radii {\bf Radius1/2} of the two bases of
- the CONE.
-
- 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.
-
- Example:
-
- @\begin{verbatim}
- Cone2 = CON2( vector( 0, 0, -1 ), vector( 0, 0, 4 ), 2, 1 );
- @\end{verbatim}
-
- 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.
- @See Figure~\ref{fig-cones}.
- @\begin{figure}
- @\vspace{2.7in}
- @\special{psfile=user_man/cones.ps hscale=100 vscale=100 hoffset=0 voffset=-220}
- @\caption{A cone (left) can be constructed using the CONE constructor and
- @ a truncated cone (right) using the constructor CONE2.}
- @\label{fig-cones}
- @\end{figure}
- $
-
- @\subsubsection{CONE}
- !CONE
-
- @\begin{verbatim}
- PolygonType CONE( VectorType Center, VectorType Direction,
- NumericType Radius )
- @\end{verbatim}
-
- Creates a CONE geometric object, defined by {\bf Center} as the center of
- the base of the CONE, {\bf Direction} as the CONE's axis and height, and
- {\bf Radius} as the radius of the base of the CONE.
- See RESOLUTION for accuracy of the CONE approximation as a polygonal model.
-
- Example:
-
- @\begin{verbatim}
- Cone1 = CONE( vector( 0, 0, 0 ), vector( 1, 1, 1 ), 1 );
- @\end{verbatim}
-
- constructs a cone based in an $XY$ parallel plane, centered at the origin
- with radius 1 and with tilted apex at ( 1, 1, 1 ).
-
- See also CON2.
- @See Figure~\ref{fig-cones}.
- $
-
- @\subsubsection{CONVEX}
- !CONVEX
-
- @\begin{verbatim}
- PolygonType CONVEX( PolygonType Object )
-
- or
-
- ListType CONVEX( ListType Object )
- @\end{verbatim}
-
- Converts non-convex polygons in {\bf 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.
-
- @\begin{verbatim}
- CnvxObj = CONVEX( Obj );
- save( "data", CnvxObj );
- @\end{verbatim}
-
- converts non-convex polygons into convex ones, so that the data file can be
- used by external tools requiring convex polygons.
- $
-
- @\subsubsection{COORD}
- !COORD
-
- @\begin{verbatim}
- AnyType COORD( AnyType Object, NumericType Index )
- @\end{verbatim}
-
- Extracts an element from a given {\bf Object}, at index {\bf Index}. From
- a PointType, VectorType, PlaneType, CtlPtType and MatrixType, a NumericType
- is returned with {\bf Index} 0 for the X axis, 1 for the Y axis etc.
- {\bf Index} 0 denotes the weight of CtlPtType. For a PolygonType that
- contains more than one polygon, the {\bf Index}th polygon is returned. For
- a PolygonType that contains a single Polygon, the {\bf Index}th vertex is
- returned. For a CurveType or a SurfaceType, the {\bf Index}th CtlPtType is
- returned. For a ListType, COORD behaves like NTH and returns the {\bf Index}th
- object in the list.
-
- Example:
-
- @\begin{verbatim}
- 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 ) );
- @\end{verbatim}
-
- constructs a vector/ctlpt/plane and reconstructs it by extracting the
- constructed scalar components of the objects using COORD.
-
- See also COERCE.
- $
-
- @\subsubsection{CRAISE}
- !CRAISE
-
- @\begin{verbatim}
- CurveType CRAISE( CurveType Curve, NumericType NewOrder )
- @\end{verbatim}
-
- Raise {\bf Curve} to the {\bf NewOrder} Order specified.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- raises the 90 degrees corner Bezier curve {\bf Crv} to be a quartic.
- @See Figure~\ref{fig-craise}.
- @\begin{figure}
- @\vspace{2.5in}
- @\special{psfile=user_man/craise.ps hscale=70 vscale=70 hoffset=30 voffset=-220}
- @\caption{Raises a 90 degrees corner quadratic Bezier curve to a quintic
- @ using CRAISE. The control polygons are also shown.}
- @\label{fig-craise}
- @\end{figure}
- $
-
- @\subsubsection{CREFINE}
- !CREFINE
-
- @\begin{verbatim}
- CurveType CREFINE( CurveType Curve, NumericType Replace, ListType KnotList )
- @\end{verbatim}
-
- Provides the ability to {\bf Replace} a knot vector of {\bf Curve}, or refine
- it. {\bf KnotList} is a list of knots to refine {\bf Curve} at. All knots
- should be contained in the parametric domain of the {\bf Curve}. If the knot
- vector is replaced, the length of {\bf KnotList} should be identical to the
- length of the original knot vector of the {\bf Curve}. If {\bf Curve} is a
- Bezier curve, it is automatically promoted to be a Bspline curve.
-
- Example:
-
- @\begin{verbatim}
- Crv2 = CREFINE( Crv, FALSE, list( 0.25, 0.5, 0.75 ) );
- @\end{verbatim}
-
- refines {\bf Crv} and adds three new knots at 0.25, 0.5, and 0.75.
- @See Figure~\ref{fig-crefine}.
- @\begin{figure}
- @\vspace{2.5in}
- @\special{psfile=user_man/crefine.ps hscale=70 vscale=70 hoffset=30 voffset=-230}
- @\caption{Refines a 90 degrees corner quadratic Bezier curve at three interior
- @ knots (result is a Bspline curve) using CREFINE.
- @ The control polygons are also shown.}
- @\label{fig-crefine}
- @\end{figure}
- $
-
- @\subsubsection{CREGION}
- !CREGION
-
- @\begin{verbatim}
- CurveType CREGION( CurveType Curve, NumericType MinParam,
- NumericType MaxParam )
- @\end{verbatim}
-
- Extracts a region from {\bf Curve} between {\bf MinParam} and {\bf MaxParam}.
- Both {\bf MinParam} and {\bf MaxParam} should be contained in the
- parametric domain of the {\bf Curve}.
-
- Example:
-
- @\begin{verbatim}
- SubCrv = CREGION( Crv, 0.3, 0.6 );
- @\end{verbatim}
-
- extracts the region from {\bf Crv} from the parameter value 0.3 to the
- parameter value 0.6.
- @See Figure~\ref{fig-cregion}.
- @\begin{figure}
- @\vspace{2.5in}
- @\special{psfile=user_man/cregion.ps hscale=70 vscale=70 hoffset=30 voffset=-230}
- @\caption{Extracts a sub region from a curve using CREGION.}
- @\label{fig-cregion}
- @\end{figure}
- $
-
- @\subsubsection{CREPARAM}
- !CREPARAM
-
- @\begin{verbatim}
- CurveType CREPARAM( CurveType Curve, NumericType MinParam,
- NumericType MaxParam )
- @\end{verbatim}
-
- Reparametrize {\bf Curve} over a new domain from {\bf MinParam} to {\bf 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:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- Sets the domain of the given two curves to be from zero to ten. The
- Bezier curve arc1 is promoted to a Bspline curve.
- $
-
- @\subsubsection{CROSSEC}
- !CROSSEC
-
- @\begin{verbatim}
- PolygonType CROSSEC( PolygonType Object )
- @\end{verbatim}
-
- ; Invoke interactive mode to edit/create a polygon in the plane Z = 0. The
- ; polygon must be in the domain [0..1] in X,Y. The first polygon of the given
- ; Object is copied to begin with. If the given {\bf Operand} is NOT a geometric
- ; object, but FALSE (numeric 0.0), a new polygon is created. Returns an (open)
- ; object with this one polygon only and inside side of $+Z$. Note that if the
- ; given polygon (first polygon of Object) is not on the $XY$ plane, it is transformed
- ; to it before editing, and transformed back after.
- This feature is NOT implemented.
- $
-
- @\subsubsection{CRVLNDST}
- !CRVLNDST
-
- @\begin{verbatim}
- 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 )
- @\end{verbatim}
-
- Computes the closest (if {\bf IsMinDist} is TRUE, farthest if FALSE) point
- on {\bf Curve} to the line specified by {\bf PtOnLine} and {\bf LnDir} as a
- point on the line and a line direction.
- Since this operation is partially numeric, {\bf Epsilon} is used to set
- the needed accuracy. It returns the parameter value of the location on
- {\bf Crv} closest to the line.
- If, however, {\bf Epsilon} is negative, -{\bf 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:
-
- @\begin{verbatim}
- Param = CRVLNDST( Crv, linePt, lineVec, TRUE, 0.001 );
- @\end{verbatim}
-
- finds the closest point on {\bf Crv} to the line defined by {\bf linePt}
- and {\bf lineVec}.
- @See Figure~\ref{fig-crvlndst}.
- @\begin{figure}
- @\vspace{2.2in}
- @\special{psfile=user_man/crvlndst.ps hscale=100 vscale=100 hoffset=-40 voffset=-240}
- @\caption{Computes the locations on the freeform curve with local extreme
- @ distance to the given line, using CRVLNDST.}
- @\label{fig-crvlndst}
- @\end{figure}
- $
-
- @\subsubsection{CRVPTDST}
- !CRVPTDST
-
- @\begin{verbatim}
- NumericType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
- NumericType Epsilon )
-
- or
-
- ListType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
- NumericType Epsilon )
- @\end{verbatim}
-
- Computes the closest (if {\bf IsMinDist} is TRUE, farthest if FALSE) point
- on {\bf Crv} to {\bf Point}.
- Since this operation is partially numeric, {\bf Epsilon} is used to set
- the needed accuracy. It returns the parameter value of the location on
- {\bf Crv} closest to {\bf Point}.
- If, however, {\bf Epsilon} is negative, -{\bf Epsilon} is used instead,
- and all local extrema in the distance function are returned as a list
- (both minima and maxima).
-
- Example:
-
- @\begin{verbatim}
- Param = CRVPTDST( Crv, Pt, FALSE, 0.0001 );
- @\end{verbatim}
-
- finds the farthest point on {\bf Crv} from point {\bf Pt}.
- @See Figure~\ref{fig-crvptdst}.
- @\begin{figure}
- @\vspace{2.2in}
- @\special{psfile=user_man/crvptdst.ps hscale=100 vscale=100 hoffset=-40 voffset=-240}
- @\caption{Computes the locations on the freeform curve with local extreme
- @ distance to the given point, using CRVPTDST.}
- @\label{fig-crvptdst}
- @\end{figure}
- $
-
- @\subsubsection{CSURFACE}
- !CSURFACE
-
- @\begin{verbatim}
- CurveType CSURFACE( SurfaceType Srf, ConstantType Direction,
- NumericType Param )
- @\end{verbatim}
-
- Extract an isoparametric curve out of {\bf Srf} in the specified
- {\bf Direction} (ROW or COL) at the specified parameter value {\bf Param}.
- {\bf Param} must be contained in the parametric domain of {\bf Srf} in
- {\bf Direction} direction.
- The returned curve is {\em in} the surface {\bf Srf}.
- @It is equal to,
- @\begin{equation}
- @ C(t) = S(t, v_0) = \sum_{i=0}^m \sum_{j=0}^n P_{ij} B_i(t) B_j(v_0) =
- @ \sum_{i=0}^m \left( \sum_{j=0}^n P_{ij} B_j(u_0) \right) B_i(t) =
- @ \sum_{i=0}^m Q_i B_i(t),
- @ \label{eqn-crv-from-srf}
- @\end{equation}
- @where $Q_i = \sum_{j=0}^n P_{ij} B_j(u_0)$ are the coefficients of the
- @returned curve, and similar for the other parametric direction $S(u_0, t)$.
- @{\bf param} is $v_0$ is equation~\eqnref{eqn-crv-from-srf}
- @
-
- Example:
-
- @\begin{verbatim}
- Crv = CSURFACE( Srf, COL, 0.45 );
- @\end{verbatim}
-
- extracts an isoparametric curve in the COLumn direction at the parameter
- value of 0.15 from surface {\bf Srf}. See also CMESH, COMPOSE.
- @See Figure~\ref{fig-csurface}.
- @\begin{figure}
- @\vspace{2.5in}
- @\special{psfile=user_man/csurface.ps hscale=100 vscale=100 hoffset=-40 voffset=-180}
- @\caption{Extracts an isoparametric curve from the given surface, using CSURFACE.}
- @\label{fig-csurface}
- @\end{figure}
- $
-
- @\subsubsection{CTANGENT}
- !CTANGENT
-
- @\begin{verbatim}
- VectorType CTANGENT( CurveType Curve, NumericType Param )
- @\end{verbatim}
-
- Computes the tangent vector to {\bf Curve} at the parameter value {\bf Param}.
- The returned vector has a unit length.
-
- Example:
-
- @\begin{verbatim}
- Tang = CTANGENT( Crv, 0.5 );
- @\end{verbatim}
-
- computes the tangent vector to {\bf Crv} at the parameter value of 0.5.
- $
-
- @\subsubsection{CTLPT}
- !CTLPT
-
- @\begin{verbatim}
- CPt = CTLPT( ConstantType PtType, NumericType Coord1, ... )
- @\end{verbatim}
-
- 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 E5 and P1 to P5. The coordinates of the point are specified
- in order, weight is first if rational.
-
- Examples:
-
- @\begin{verbatim}
- CPt1 = CTLPT( E3, 0.0, 0.0, 0.0 );
- CPt2 = CTLPT( P2, 0.707, 0.707, 0.707 );
- @\end{verbatim}
-
- constructs an {\bf 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).
- $
-
- @\subsubsection{CTRIMSRF}
- !CTRIMSRF
-
- @\begin{verbatim}
- ListType CTRIMSRF( TrimSrfType TSrf, NumericType Parametric )
- @\end{verbatim}
-
- Extract the trimming curves of a trimmed surface {\bf TSrf}.
- If {\bf Parametric} is not zero, then the trimming curves are extracted
- as parametric space curves of {\bf TSrf}. Otherwise, the trimming curves
- are evaluated into Euclidean space as curves on surface {\bf TSrf}.
-
- Example:
-
- @\begin{verbatim}
- TrimCrvs = CTRIMSRF( TrimSrf, FALSE );
- @\end{verbatim}
-
- extracts the trimming curves of {\bf TrimSrf} as Euclidean curves on
- {\bf TrimSrf}.
- @See Figure~\ref{fig-ctrimsrf}.
- @\begin{figure}
- @\vspace{3.4in}
- @\special{psfile=user_man/ctrimsrf.ps hscale=100 vscale=100 hoffset=-35 voffset=-170}
- @\caption{Extracts the trimming curves in Euclidean space (middle) and
- @ parametric space (right) of a trimmed surface (left), using CTRIMSRF.}
- @\label{fig-ctrimsrf}
- @\end{figure}
- $
-
- @\subsubsection{CYLIN}
- !CYLIN
-
- @\begin{verbatim}
- PolylineType CYLIN( VectorType Center, VectorType Direction,
- NumericType Radius )
- @\end{verbatim}
-
- Creates a CYLINder geometric object, defined by {\bf Center} as center of
- the base of the CYLINder, {\bf Direction} as the CYLINder's axis and height,
- and {\bf Radius} as the radius of the base of the CYLINder.
- See RESOLUTION for the accuracy of the CYLINder approximation as a
- polygonal model.
-
- Example:
-
- @\begin{verbatim}
- Cylinder1 = CYLIN( vector( 0, 0, 0 ), vector( 1, 0, 0 ), 10 );
- @\end{verbatim}
-
- constructs a cylinder along the $X$ axis from the origin to $X = 10$.
- @See Figure~\ref{fig-cylinder}.
- @\begin{figure}
- @\vspace{1.4in}
- @\special{psfile=user_man/cylinder.ps hscale=100 vscale=100 hoffset=-40 voffset=-180}
- @\caption{A cylinder primitive can be constructor using the CYLIN constructor.}
- @\label{fig-cylinder}
- @\end{figure}
- $
-
- @\subsubsection{CZEROS}
- !CZEROS
-
- @\begin{verbatim}
- ListType CZEROS( CurveType Crv, NumericType Epsilon, NumericType Axis )
- @\end{verbatim}
-
- Computes the zero set of the given {\bf Crv} in the given axis (1 for X,
- 2 for Y, 3 for Z). Since this computation is numeric, an {\bf Epsilon} is
- also required to specify the desired tolerance. It returns a list of
- all the parameter values (NumericType) the curve is zero.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- Computes the {\bf X} zero set of curve {\bf cb} with error tolerance
- of {\bf 0.001}. This set is then scanned in a loop and evaluated to
- the curve's locations, which are then displayed.
- See also CINFLECT.
- @See Figure~\ref{fig-czeros}.
- @\begin{figure}
- @\vspace{3.6in}
- @\special{psfile=user_man/czeros.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
- @\caption{Computes the zero set of a given freeform curve, in the given axis, using
- @ CZEROS.}
- @\label{fig-czeros}
- @\end{figure}
- $
-
- @\subsubsection{EXTRUDE}
- !EXTRUDE
-
- @\begin{verbatim}
- PolygonType EXTRUDE( PolygonType Object, VectorType Dir )
-
- or
-
- SurfaceType EXTRUDE( CurveType Object, VectorType Dir )
- @\end{verbatim}
-
- Creates an extrusion of the given {\bf Object}. If {\bf Object} is a
- PolygonObject, its first polygon is used as the base for the extrusion in
- {\bf Dir} direction, and a closed PolygonObject is constructed. If {\bf Object}
- is a CurveType, an extrusion surface is constructed instead, which is {\em not}
- a closed object (the two bases of the extrusion are excluded, and the curve
- may be open by itself).
-
- Direction {\bf Dir} cannot be coplanar with the polygon plane. The curve
- may be nonplanar.
-
- Example:
-
- @\begin{verbatim}
- 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 ) );
- @\end{verbatim}
-
- constructs a closed cross section {\bf Cross} by duplicating one half of
- it in reverse and merging the two sub-curves. {\bf Cross} is then used as
- the cross-section for the extrusion operation.
- @See Figure~\ref{fig-extrude}.
- @\begin{figure}
- @\vspace{1.5in}
- @\special{psfile=user_man/extrude.ps hscale=100 vscale=100 hoffset=-40 voffset=-310}
- @\caption{An extrusion of a freeform curve using EXTRUDE to create a freeform
- @ surface.}
- @\label{fig-extrude}
- @\end{figure}
- $
-
- @\subsubsection{FFCOMPAT}
- !FFCOMPAT
-
- @\begin{verbatim}
- FFCOMPAT( CurveType Crv1, CurveType Crv2 )
-
- or
-
- FFCOMPAT( SurfaceType Srf1, SurfaceType Srf2 )
- @\end{verbatim}
-
- 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
- {\em in place}.
-
- Example:
-
- @\begin{verbatim}
- FFCOMPAT( Srf1, Srf2 );
- @\end{verbatim}
-
- See also SMORPH.
- $
-
- @\subsubsection{FFEXTREME}
- !FFEXTREME
-
- @\begin{verbatim}
- CtlPtType FFEXTREME( CurveType Crv, NumericType Minimum )
-
- or
-
- CtlPtType FFEXTREME( SurfaceType Srf, NumericType Minimum )
- @\end{verbatim}
-
- Computes a bound on the extreme values a curves {\bf Crv} or surface
- {\bf Srf} can assume. Returned control points provides a bound on the
- minimum (maximum) values that can be assumed if {\bf Minimum} is TRUE
- (FALSE).
-
- Example:
-
- @\begin{verbatim}
- Bound = FFEXTREME( Srf, false );
- @\end{verbatim}
-
- Computes a bound on the maximal values Srf can assume.
- $
-
- @\subsubsection{GBOX}
- !GBOX
-
- @\begin{verbatim}
- PolygonType GBOX( VectorType Point,
- VectorType Dx, VectorType Dy, VectorType Dz )
- @\end{verbatim}
-
- Creates a parallelepiped - Generalized BOX polygonal object, defined by
- {\bf Point} as base position, and {\bf 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 {\bf Dx} = vector(Dx, 0, 0), {\bf Dy} = vector(0, Dy, 0), and
- {\bf Dz} = vector(0, 0, Dz).
-
- {\bf Dx}, {\bf Dy}, {\bf Dz} must all be independent in order to create an
- object with positive volume.
-
- Example:
-
- @\begin{verbatim}
- 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));
- @\end{verbatim}
- @See Figure~\ref{fig-gbox}.
- @\begin{figure}
- @\vspace{2.9in}
- @\special{psfile=user_man/gbox.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
- @\caption{A warped box in a general position can be constructed using the GBOX
- @ constructor.}
- @\label{fig-gbox}
- @\end{figure}
- $
-
- @\subsubsection{GETLINE}
- !GETLINE
-
- @\begin{verbatim}
- AnyType GETLINE( NumericType RequestedType )
- @\end{verbatim}
-
- Provides a method to get input from keyboard within functions and
- or subroutines. {\bf 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:
-
- @\begin{verbatim}
- Pt = GETLINE( point_type );
- @\end{verbatim}
-
- to read one point (three numeric values) from stdin.
- $
-
- @\subsubsection{GPOLYGON}
- !GPOLYGON
-
- @\begin{verbatim}
- PolygonType GPOLYGON( GeometryTreeType Object, NumericType Normals )
- @\end{verbatim}
-
- Approximates all Surface(s)/Trimmed surface(s)/Trivariate(s) in {\bf 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 {\bf Normals} is set, surface normals will be evaluated at the
- vertices. Otherwise flat shading and constant normals across polygons are
- assumed.
-
- Example:
-
- @\begin{verbatim}
- Polys = GPOLYGON( list( Srf1, Srf2, Srf3 ), off );
- @\end{verbatim}
-
- Converts to polygons the three surfaces {\bf Srf1}, {\bf Srf2}, and {\bf Srf3}
- with no normals.
- $
-
- @\subsubsection{GPOLYLINE}
- !GPOLYLINE
-
- @\begin{verbatim}
- PolylineType GPOLYLINE( GeometryTreeType Object, NumericType Optimal )
- @\end{verbatim}
-
- Converts all Curves(s), (Trimmed) Surface(s), and Trivariate(s) {\bf 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 {\bf Optimal} is false, the points are sampled at equally spaced
- interval in the parametric space. If {\bf 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:
-
- @\begin{verbatim}
- Polys = GPOLYLINE( list( Srf1, Srf2, Srf3, list( Crv1, Crv2, Crv3 ) ),
- on );
- @\end{verbatim}
-
- converts to polylines the three surfaces {\bf Srf1}, {\bf Srf2}, and {\bf Srf3}
- and the three curves {\bf Crv1}, {\bf Crv2}, and {\bf Crv3}.
- $
-
- @\subsubsection{LOFFSET}
- !LOFFSET
-
- @\begin{verbatim}
- CurveType LOFFSET( CurveType Crv, NumericType OffsetDistance,
- NumericType NumOfSamples, NumericType NumOfDOF,
- NumericType Order )
- @\end{verbatim}
-
- Approximate an offset of {\bf OffsetDistance} by sampling {\bf NumOfSamples}
- samples along the offset curve and least square fitting them using a Bspline
- curve of order {\bf Order} and {\bf NumOfDOF} control points.
-
- Example:
-
- @\begin{verbatim}
- OffCrv1 = LOFFSET( Crv, -0.4, 100, 10, 4 );
- @\end{verbatim}
- See also OFFSET and AOFFSET.
- $
-
- @\subsubsection{MERGPOLY}
- !MERGEPOLY
-
- @\begin{verbatim}
- PolygonType MERGEPOLY( ListType PolyList )
- @\end{verbatim}
-
- Merges a set of polygonal objects in {\bf PolyList} list to a single polygonal
- object. All elements in {\bf ObjectList} must be of PolygonType type. This
- function performs the same operation as the overloaded {\bf \verb+^+} operator
- would, but might be more convenient to use under some circumstances.
-
- Example:
-
- @\begin{verbatim}
- 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 ) );
- @\end{verbatim}
- @See Figure~\ref{fig-mergpoly}.
- @\begin{figure}
- @\vspace{2.6in}
- @\special{psfile=user_man/mergpoly.ps hscale=100 vscale=100 hoffset=-40 voffset=-220}
- @\caption{Individual polygons can be merged into a complete model using MERGEPOLY.}
- @\label{fig-mergpoly}
- @\end{figure}
- $
-
- @\subsubsection{MOMENT}
- !MOMENT
-
- @\begin{verbatim}
- PointType MOMENT( CurveType Crv, 0 );
-
- or
-
- VectorType MOMENT( CurveType Crv, 1 );
- @\end{verbatim}
-
- Approximates the zero and first moment of curve {\bf Crv}.
-
- Example:
-
- @\begin{verbatim}
- 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);
- @\end{verbatim}
-
- computes and displays the zero and first moment of a quarter of a circle
- in two orientations.
- $
-
- @\subsubsection{NIL}
- !NIL
-
- @\begin{verbatim}
- ListType NIL()
- @\end{verbatim}
-
- Creates an empty list so data can be accumulated in it.
- See CINFLECT or CZEROS for examples. See also LIST and SNOC.
- $
-
- @\subsubsection{OFFSET}
- !OFFSET
-
- @\begin{verbatim}
- CurveType OFFSET( CurveType Crv, NumericType OffsetDistance,
- NumericType Tolerance, NumericType BezInterp )
-
- or
-
- SurfaceType OFFSET( SurfaceType Srf, NumericType OffsetDistance,
- NumericType Tolerance )
- @\end{verbatim}
-
- Offsets {\bf Crv} or {\bf Srf}, by translating all the control points in the
- direction of the normal of the curve or surface by an {\bf OffsetDistance}
- amount. Each control point has a {\em 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 {\bf Tolerance}, {\bf Crv} or {\bf Srf} 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 {\bf BezInter}. Negative {\bf OffsetDistance} denotes offset in
- the reversed direction of the normal.
-
- Example:
-
- @\begin{verbatim}
- OffCrv = OFFSET( Crv, -0.4, 0.1, off );
- @\end{verbatim}
-
- offsets {\bf Crv} by the amount of $-0.4$ in the reversed normal direction,
- {\bf Tolerance} of 0.1 and no Bezier interpolation.
- See also AOFFSET and LOFFSET.
- @See Figure~\ref{fig-coffset}.
- @\begin{figure}
- @\vspace{2.5in}
- @\special{psfile=user_man/coffset.ps hscale=100 vscale=100 hoffset=-40 voffset=-190}
- @\caption{Offset approximation (thick) of a Bspline curve (thin) (See also
- @ Figure~\protect\ref{fig-caoffset}.)}
- @\label{fig-coffset}
- @\end{figure}
- $
-
- @\subsubsection{PCIRCLE}
- !PCIRCLE
-
- @\begin{verbatim}
- CurveType PCIRCLE( VectorType Center, NumericType Radius )
- @\end{verbatim}
-
- Same as CIRCLE but approximates the circle as a {\em polynomial} curve.
- See CIRCLE.
- $
-
- @\subsubsection{PDOMAIN}
- !PDOMAIN
-
- @\begin{verbatim}
- ListType PDOMAIN( CurveType Crv )
-
- or
-
- ListType PDOMAIN( SurfaceType Srf )
-
- or
-
- ListType PDOMAIN( TrimSrfType TrimSrf )
-
- or
-
- ListType PDOMAIN( TrivarType TV )
- @\end{verbatim}
-
- Returns the parametric domain of the curve (TMin, TMax) or of a (trimmed)
- surface (UMin, UMax, VMin, VMax) or of a trivariate function
- (UMin, UMax, VMin, VMax, WMin, WMax) as a list object.
-
- Example:
-
- @\begin{verbatim}
- circ_domain = PDOMAIN( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
- @\end{verbatim}
- $
-
- @\subsubsection{POLY}
- !POLY
-
- @\begin{verbatim}
- PolygonType POLY( ListType VrtxList, NumericType IsPolyline )
- @\end{verbatim}
-
- Creates a single polygon/polyline (and therefore open) object, defined by
- the vertices in {\bf VrtxList} (see LIST). All elements in {\bf VrtxList}
- must be of VectorType type. If {\bf IsPolyline}, a polyline is created,
- otherwise a polygon.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- constructs an object with a single polygon in the shape of the letter I.
- @See Figure~\ref{fig-poly}.
- @\begin{figure}
- @\vspace{1.7in}
- @\special{psfile=user_man/poly.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
- @\caption{Polygons or polylines can be manually constructed using the
- @ POLY constructor.}
- @\label{fig-poly}
- @\end{figure}
- $
-
- @\subsubsection{PRISA}
- !PRISA
-
- @\begin{verbatim}
- ListType PRISA( SurfaceType Srfs, NumericType SamplesPerCurve,
- NumericType Epsilon, ConstantType Dir, VectorType Space )
- @\end{verbatim}
-
- Computes a layout (prisa) of the given surface(s) {\bf Srfs}, and returns
- a list of surface objects representing the layout.
- The surface is approximated to within {\bf Epsilon} in direction {\bf Dir}
- into a set of ruled surfaces and then developable surfaces that are laid out
- flat onto the $XY$ plane. If {\bf Epsilon} is negative, the piecewise ruled
- surface approximation in 3-space is returned.
- {\bf SamplesPerCurve} controls the piecewise linear approximation of the
- boundary of the ruled/developable surfaces. {\bf 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.
-
- Example:
-
- @\begin{verbatim}
- 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 ) );
- wgl_prisa = PRISA( wglass, 6, 0.1, COL, vector( 0, 0.25, 0.0 ) );
- @\end{verbatim}
-
- Computes a layout of a wine glass in {\bf wgl\_prisa} and a three-dimensional
- ruled surface approximation of wglass in {\bf wgl\_ruled}.
- @See Figure~\ref{fig-prisa}.
- @\begin{figure}
- @\vspace{2.4in}
- @\special{psfile=user_man/prisa.ps hscale=100 vscale=100 hoffset=-30 voffset=-210}
- @\caption{The layout (prisa in hebrew...) of a freeform surface can be approximated
- @ using the PRISA function.}
- @\label{fig-prisa}
- @\end{figure}
- $
-
- @\subsubsection{RULEDSRF}
- !RULEDSRF
-
- @\begin{verbatim}
- SurfaceType RULEDSRF( CurveType Crv1, CurveType Crv2 )
- @\end{verbatim}
-
- Constructs a ruled surface between the two curves {\bf Crv1} and {\bf Crv2}.
- The curves do not have to have the same order or type, and will be promoted
- to their least common denominator.
-
- Example:
-
- @\begin{verbatim}
- Circ = circle( vector( 0.0, 0.0, 0.0 ), 0.25 );
- Cyl = RULEDSRF( circ, circ * trans( vector( 0.0, 0.0, 1.0 ) ) );
- @\end{verbatim}
-
- Constructs a cylinder of radius 0.25 along the Z axis from 0 to 1.
- @See Figure~\ref{fig-ruledsrf}.
- @\begin{figure}
- @\vspace{2in}
- @\special{psfile=user_man/ruledsrf.ps hscale=100 vscale=100 hoffset=-40 voffset=-210}
- @\caption{A cylinder can be cunstructed as a RULEDSRF of two different circles.}
- @\label{fig-ruledsrf}
- @\end{figure}
- $
-
- @\subsubsection{SBEZIER}
- !SBEZIER
-
- @\begin{verbatim}
- SurfaceType SBEZIER( ListType CtlMesh )
- @\end{verbatim}
-
- Creates a Bezier surface using the provided control mesh. {\bf CtlMesh} is a
- list of rows, each of which is a list of control points. All control points
- must be of type (E1-E5, P1-P5), 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.
- @
- @The created surface is the piecewise polynomial (or rational) surface,
- @\begin{equation}
- @ S(u, v) = \sum_{i=0}^m \sum_{j=0}^n P_{ij} B_i(u) B_j(v)
- @\end{equation}
- @where $P_{ij}$ are the control points {\bf CtlMesh}. and $m$ and $n$ are the
- @degrees of the surface, which are one less than the number of points in the
- @appropriate direction.
-
- Example:
-
- @\begin{verbatim}
- 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 ) ) ) );
- @\end{verbatim}
- @See Figure~\ref{fig-surface}.
- @\begin{figure}
- @\vspace{1.5in}
- @\special{psfile=user_man/surface.ps hscale=100 vscale=100 hoffset=-70 voffset=-170}
- @\caption{A bezier surface (left) of degree 3 by 5 and a Bspline surface (right)
- @ of degree 3 by 3 (bi-quadratic). Both share the same control mesh.}
- @\label{fig-surface}
- @\end{figure}
- $
-
- @\subsubsection{SBSPLINE}
- !SBSPLINE
-
- @\begin{verbatim}
- SurfaceType SBSPLINE( NumericType UOrder, NumericType VOrder,
- ListType CtlMesh, ListType KnotVectors )
- @\end{verbatim}
-
- Creates a Bspline surface from the provided {\bf UOrder} and {\bf VOrder}
- orders, the control mesh {\bf CtlMesh}, and the two knot vectors {\bf KnotVectors}.
- {\bf CtlMesh} is a list of rows, each of which is a list of control points.
- All control points must be of point type (E1-E5, P1-P5), 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.
- {\bf KnotVectors} is a list of two knot vectors. Each knot vector is a
- list of NumericType knots of length {\bf \#CtlPtList} plus the {\bf Order}.
- If, however, the length of the knot vector is equal to {\bf \#CtlPtList +
- Order + Order - 1} the curve is assumed {\em 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.
- @
- @The created surface is the piecewise polynomial (or rational) surface,
- @\begin{equation}
- @ S(u, v) = \sum_{i=0}^m \sum_{j=0}^n P_{ij} B_{i,\chi}(u) B_{j,\xi}(v)
- @\end{equation}
- @where $P_{ij}$ are the control points {\bf CtlMesh}, and $m$ and $n$ are the
- @degrees of the surface, which are one less than {\bf UOrder} and {\bf VOrder}.
- @$\chi$ and $\xi$ are the two knot vectors of the surface.
-
- Example:
-
- @\begin{verbatim}
- 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 ) ) );
- @\end{verbatim}
-
- constructs a bi-quadratic Bspline surface with its first knot vector
- having uniform knot spacing with open end conditions.
- @See Figure~\ref{fig-surface}.
- $
-
- @\subsubsection{SCRVTR}
- !SCRVTR
-
- @\begin{verbatim}
- SurfaceType SCRVTR( SurfaceType Srf, ConstType PtType, ConstType Dir )
- @\end{verbatim}
-
- Symbolically computes the extreme curvature bound on {\bf Srf}.
- If {\bf Dir} is either ROW or COL, then the normal curvature square
- of {\bf Srf} in {\bf 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 {\bf 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),
- @\begin{equation}
- @ \kappa_n^u(u, v) = \frac{\inner{n}{\frac{\partial^2 S}{\partial u^2}}}
- @ {\inner{\frac{\partial S}{\partial u}}
- @ {\frac{\partial S}{\partial u}}}
- @\end{equation}
- @ and computes $\xi(u, v) = k_1(u, v)^2 + k_2(u, v)^2$ as the scalar field of
- @\begin{equation}
- @ \xi(u, v) = \frac{(g_{11} l_{22} + l_{11} g_{22} - 2 g_{12}
- @ l_{12}) ^ 2 - 2 \left| G \right| \left| L \right|}
- @ {\left| G \right|^2 \| n \|^2},
- @\end{equation}
- @ where $g_{ij}$ and $l_{ij}$ are the coefficients of the first and second
- @ fundamental forms G and L.
- ^ 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:
-
- @\begin{verbatim}
- 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 );
- 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 );
- @\end{verbatim}
-
- 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.
- @See Figure~\ref{fig-scrvtr}.
- @\begin{figure}
- @\vspace{2in}
- @\special{psfile=user_man/scrvtr.ps hscale=100 vscale=100 hoffset=-50 voffset=-170}
- @\caption{From left to right: original surface, normal curvature in the U
- @ direction, normal curvature in the V direction, sum of square of
- @ principle curvatures (different scales).
- @ All computed using SCRVTR.}
- @\label{fig-scrvtr}
- @\end{figure}
- $
-
- @\subsubsection{SDERIVE}
- !SDERIVE
-
- @\begin{verbatim}
- SurfaceType SDERIVE( SurfaceType Srf, NumericType Dir )
- @\end{verbatim}
-
- 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 {\em tangent} to {\bf Srf} in
- {\bf Dir} at that parameter value.
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- computes the two partial derivatives of the surface {\bf Srf} and computes
- its normal as their cross product, at the parametric location (0.5, 0.5).
- $
-
- @\subsubsection{SDIVIDE}
- !SDIVIDE
-
- @\begin{verbatim}
- SurfaceType SDIVIDE( SurfaceType Srf, ConstantType Direction,
- NumericType Param )
- @\end{verbatim}
-
- Subdivides a surface into two at the specified parameter value {\bf Param}
- in the specified {\bf Direction} (ROW or COL). {\bf Srf} can be either a Bspline
- surface in which {\bf Param} must be conatined in the parametric domain of the
- surface, or a Bezier surface in which {\bf Param} must be in the range of zero
- to one.
-
- It returns a list of the two sub-surfaces. The individual surfaces may be
- extracted from the list using the {\bf NTH} command.
-
- Example:
-
- @\begin{verbatim}
- SrfLst = SDIVIDE( Srf, ROW, 0.5 );
- Srf1 = nth( SrfLst, 1 );
- Srf2 = nth( SrfLst, 2 );
- @\end{verbatim}
-
- subdivides {\bf Srf} at the parameter value of 0.5 in the ROW direction.
- @See Figure~\ref{fig-sdivide}.
- @\begin{figure}
- @\vspace{2.9in}
- @\special{psfile=user_man/sdivide.ps hscale=80 vscale=80 hoffset=-20 voffset=-130}
- @\caption{A surface can be subdivided into two distinct regions using SDIVIDE.}
- @\label{fig-sdivide}
- @\end{figure}
- $
-
- @\subsubsection{SEDITPT}
- !SEDITPT
-
- @\begin{verbatim}
- SurfaceType SEDITPT( SurfaceType Srf, CtlPtType CPt, NumericType UIndex,
- NumericType VIndex )
- @\end{verbatim}
-
- Provides a simple mechanism to manually modify a single control point number
- {\bf UIndex} and {\bf VIndex} (base count is 0) in the control mesh of {\bf Srf}
- by substituting {\bf CtlPt} instead. CtlPt must have the same point type as
- the control points of {\bf Srf}. Original surface {\bf Srf} is not modified.
-
- Example:
-
- @\begin{verbatim}
- CPt = ctlpt( E3, 1, 2, 3 );
- NewSrf = SEDITPT( Srf, CPt, 0, 0 );
- @\end{verbatim}
-
- constructs a {\bf NewSrf} with the first control point of {\bf Srf} being
- {\bf CPt}.
- $
-
- @\subsubsection{SEVAL}
- !SEVAL
-
- @\begin{verbatim}
- CtlPtType SEVAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
- @\end{verbatim}
-
- Evaluates the provided surface {\bf Srf} at the given {\bf UParam} and
- {\bf VParam} values. Both {\bf UParam} and {\bf VParam} should be contained
- in the surface parametric domain if {\bf Srf} is a Bspline surface, or
- between zero and one if {\bf Srf} is a Bezier surface. The returned control
- point has the same type as the control points of {\bf Srf}.
-
- Example:
-
- @\begin{verbatim}
- CPt = SEVAL( Srf, 0.25, 0.22 );
- @\end{verbatim}
-
- evaluates {\bf Srf} at the parameter values of (0.25, 0.22).
- $
-
- @\subsubsection{SFROMCRVS}
- !SFROMCRVS
-
- @\begin{verbatim}
- SurfaceType SFROMCRVS( ListType CrvList, NumericType OtherOrder )
- @\end{verbatim}
-
- Constructs a surface by substituting the curves in {\bf CrvList} as rows
- in a control mesh of a surface. Curves in {\bf 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
- {\bf OtherOrder}, which cannot be larger than the number of curves.
-
- The surface interpolates the first and last curves only.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
- @See Figure~\ref{fig-sfromcrvs}.
- @\begin{figure}
- @\vspace{3.2in}
- @\special{psfile=user_man/sfromcrvs.ps hscale=100 vscale=100 hoffset=0 voffset=-85}
- @\caption{A surface can be constructed from a list of curves substituted
- @ as rows into its mesh using SFROMCRVS. The surface does not
- @ necessarily interpolate the curves.}
- @\label{fig-sfromcrvs}
- @\end{figure}
- $
-
- @\subsubsection{SINTERP}
- !SINTERP
-
- @\begin{verbatim}
- SurfaceType SINTERP( ListType PtList, NumericType UOrder, NumericType VOrder,
- NumericType USize, NumericType VSize,
- ConstantType Param)
- @\end{verbatim}
-
- Computes a Bspline polynomial surface that interpolates or approximates
- the rectangular grid of points in {\bf PtList}. The Bspline surface will
- have orders {\bf UOrder} and {\bf VOrder} and mesh of size {\bf USize} by
- {\bf VSize} control points. The knots will be spaced according to
- {\bf Param} which can be one of PARAM\_UNIFORM, PARAM\_CHORD or
- PARAM\_CENTRIP. The former prescribed a uniform knot sequence and the
- latters specified a knot spacing accoridng to the chord length and a square
- root of the chord length. Currently only PARAM\_UNIFORM is supported.
- {\bf PtList} is a list of list of points where all lists should carry the
- same amount of points in them, defining a rectangular grid. All points in
- {\bf PtList} must be of type (E1-E5, P1-P5) control point, or regular
- PointType. If {\bf USize} and {\bf VSize} are equal to the number of points
- in the grid {\bf PtList} the resulting curve will {\em interpolate} the
- data set. Otherwise, if {\bf USize} or {\bf VSize} is less than the number
- of points in {\bf PtList} the point data set will be least square
- approximated. In no time can {\bf USize} or {\bf VSize} be larger that the
- number of points in {\bf PtList} or lower than {\bf UOrder} and {\bf VOrder},
- respectively. If {\bf USize} or {\bf VSize} are zero, the grid size
- is used, forcing an interpolation of the data set.
-
- All interior knots will be distinct preserving maximal continuity.
- The resulting Bspline surface will have open end conditions.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- 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 {\bf s1}, and
- interpolate surface {\bf s2} using this data set.
- @See Figure~\ref{fig-sinterp}.
- @\begin{figure}
- @\vspace{1.6in}
- @\special{psfile=user_man/sinterp.ps hscale=95 vscale=95 hoffset=-30 voffset=-130}
- @\caption{A surface least square fitting a data set with insufficient
- @ degrees of freedom (left) and actually interpolating the data
- @ set (right), all using SINTERP.}
- @\label{fig-sinterp}
- @\end{figure}
- $
-
- @\subsubsection{SMERGE}
- !SMERGE
-
- @\begin{verbatim}
- SurfaceType SMERGE( SurfaceType Srf1, SurfaceType Srf2,
- NumericType Dir, NumericType SameEdge )
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- MergedSrf = SMERGE( Srf1, Srf2, ROW, TRUE );
- @\end{verbatim}
- $
-
- @\subsubsection{SMORPH}
- !SMORPH
-
- @\begin{verbatim}
- SurfaceType SMORPH( SurfaceType Srf1, SurfaceType Srf2, NumericType Blend )
- @\end{verbatim}
-
- Creates a new surface which is a {\em 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:
-
- @\begin{verbatim}
- 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 )
- );
- @\end{verbatim}
-
- creates a sequence of 12 surfaces, morphed from {\bf Srf1} to {\bf Srf2}
- and saves them in the files "morph-0.dat" to "morph-11.dat".
- See also CMORPH.
- @See Figure~\ref{fig-smorph}.
- @\begin{figure}
- @\vspace{1.2in}
- @\special{psfile=user_man/smorph.ps hscale=100 vscale=100 hoffset=-50 voffset=-150}
- @\caption{A morphing sequence between a bottle and a glass. Snapshots computed
- @ using SMORPH.}
- @\label{fig-smorph}
- @\end{figure}
- $
-
- @\subsubsection{SNORMAL}
- !SNORMAL
-
- @\begin{verbatim}
- VectorType SNORMAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
- @\end{verbatim}
-
- Computes the normal vector to {\bf Srf} at the parameter values {\bf UParam}
- and {\bf VParam}. The returned vector has a unit length.
-
- Example:
-
- @\begin{verbatim}
- Normal = SNORMAL( Srf, 0.5, 0.5 );
- @\end{verbatim}
-
- computes the normal to {\bf Srf} at the parameter values (0.5, 0.5).
- See also SNRMLSRF.
- $
-
- @\subsubsection{SNRMLSRF}
- !SNRMLSRF
-
- @\begin{verbatim}
- SurfaceType SNRMLSRF( SurfaceType Srf )
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- NrmlSrf = SNRMLSRF( Srf );
- @\end{verbatim}
- @See Figure~\ref{fig-snrmlsrf}.
- @\begin{figure}
- @\vspace{2.7in}
- @\special{psfile=user_man/snrmlsrf.ps hscale=80 vscale=80 hoffset=10 voffset=-140}
- @\caption{A vector field normal (right) computed for a unit sphere using SNRMLSRF.
- @ The normal field degenerates at the norph and south poles because the
- @ surface is not regular there.}
- @\label{fig-snrmlsrf}
- @\end{figure}
- $
-
- @\subsubsection{SPHERE}
- !SPHERE
-
- @\begin{verbatim}
- PolygonType SPHERE( VectorType Center, NumericType Radius )
- @\end{verbatim}
-
- Creates a SPHERE geometric object, defined by {\bf Center} as the center of
- the SPHERE, and with {\bf Radius} as the radius of the SPHERE.
- See RESOLUTION for accuracy of SPHERE approximation as a polygonal model.
- $
-
- @\subsubsection{SRAISE}
- !SRAISE
-
- @\begin{verbatim}
- SurfaceType SRAISE( SurfaceType Srf, ConstantType Direction,
- NumericType NewOrder )
- @\end{verbatim}
-
- Raises {\bf Srf} to the specified {\bf NewOrder} in the specified
- {\bf Direction}.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- constructs a bilinear flat ruled surface and raises both its directions to be
- a bi-quadratic surface.
- $
-
- @\subsubsection{SREFINE}
- !SREFINE
-
- @\begin{verbatim}
- SurfaceType SREFINE( SurfaceType Srf, ConstantType Direction,
- NumericType Replace, ListType KnotList )
- @\end{verbatim}
-
- Provides the ability to {\bf Replace} a knot vector of {\bf Srf} or refine
- it in the specified direction {\bf Direction} (ROW or COL).
- {\bf KnotList} is a list of knots to refine {\bf Srf} at. All knots should be
- contained in the parametric domain of {\bf Srf} in {\bf Direction}. If the knot
- vector is replaced, the length of {\bf KnotList} should be identical to the
- length of the original knot vector of {\bf Srf} in {\bf Direction}. If {\bf Srf}
- is a Bezier surface, it is automatically promoted to be a Bspline surface.
-
- Example:
-
- @\begin{verbatim}
- Srf = SREFINE( SREFINE( Srf,
- ROW, FALSE, list( 0.333, 0.667 ) ),
- COL, FALSE, list( 0.333, 0.667 ) );
- @\end{verbatim}
-
- refines {\bf Srf} in both directions by adding two more knots at 0.333 and
- 0.667.
- $
-
- @\subsubsection{SREGION}
- !SREGION
-
- @\begin{verbatim}
- SurfaceType SREGION( SurfaceType Srf, ConstantType Direction,
- NumericType MinParam, NumericType MaxParam )
- @\end{verbatim}
-
- Extracts a region of {\bf Srf} between {\bf MinParam} and {\bf MaxParam}
- in the specified {\bf Direction}. Both {\bf MinParam} and {\bf MaxParam}
- should be contained in the parametric domain of {\bf Srf} in {\bf Direction}.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- extracts the region of {\bf 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 Figure~\ref{fig-sregion}.
- @\begin{figure}
- @\vspace{2.2in}
- @\special{psfile=user_man/sregion.ps hscale=100 vscale=100 hoffset=-40 voffset=-190}
- @\caption{A region can be extracted from a freeform surface using SREGION.}
- @\label{fig-sregion}
- @\end{figure}
- $
-
- @\subsubsection{SREPARAM}
- !SREPARAM
-
- @\begin{verbatim}
- SurfaceType SREPARAM( SurfaceType Srf, ConstantType Direction,
- NumericType MinParam, NumericType MaxParam )
- @\end{verbatim}
-
- Reparametrize {\bf Srf} over a new domain from {\bf MinParam} to {\bf MaxParam},
- in the prescribed {\bf Direction}. This operation does not affect the geometry
- of the surface and only affine transforms its knot vectors. A Bezier surface
- will automatically be promoted into a Bspline surface by this function.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- Ensures that the Bspline surface is defined over the unit size parametric
- domain.
- $
-
- @\subsubsection{STANGENT}
- !STANGENT
-
- @\begin{verbatim}
- VectorType STANGENT( SurfaceType Srf, ConstantType Direction,
- NumericType UParam, NumericType VParam )
- @\end{verbatim}
-
- Computes the tangent vector to {\bf Srf} at the parameter values {\bf UParam}
- and {\bf VParam} in {\bf Direction}. The returned vector has a unit length.
-
- Example:
-
- @\begin{verbatim}
- Tang = STANGENT( Srf, ROW, 0.5, 0.6 );
- @\end{verbatim}
-
- computes the tangent to {\bf Srf} in the ROW direction at the parameter
- values (0.5, 0.6).
- $
-
- @\subsubsection{STRIMSRF}
- !STRIMSRF
-
- @\begin{verbatim}
- SurfaceType STRIMSRF( TrimSrfType TSrf )
- @\end{verbatim}
-
- Extracts the surface of a trimmed surface {\bf TSrf}.
-
- Example:
-
- @\begin{verbatim}
- Srf = STRIMSRF( TrimSrf );
- @\end{verbatim}
-
- extracts the surface of {\bf TrimSrf}.
- $
-
- @\subsubsection{STRIVAR}
- !STRIVAR
-
- @\begin{verbatim}
- SurfaceType STRIVAR( TrivarType TV )
- @\end{verbatim}
-
- Extracts an iso surface from a trivariate function {\bf TV}.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- extracts an iso surface of {\bf TV1}, in the {\bf col} direction at
- parameter value 0.4.
- @See Figure~\ref{fig-strivar}.
- @\begin{figure}
- @\vspace{2.5in}
- @\special{psfile=user_man/strivar.ps hscale=100 vscale=100 hoffset=-35 voffset=-170}
- @\caption{Extracts an iso bilinear surface from a trilinear function,
- @ using STRIVAR.}
- @\label{fig-strivar}
- @\end{figure}
- $
-
- @\subsubsection{SURFPREV}
- !SURFPREV
-
- @\begin{verbatim}
- SurfaceType SURFPREV( CurveType Object )
- @\end{verbatim}
-
- Same as SURFREV but approximates the surface of revolution as a
- {\em polynomial} surface. Object must be a polynomial curve.
- See SURFREV.
- $
-
- @\subsubsection{SURFREV}
- !SURFREV
-
- @\begin{verbatim}
- PolygonType SURFREV( PolygonType Object )
-
- or
-
- SurfaceType SURFREV( CurveType Object )
- @\end{verbatim}
-
- Creates a surface of revolution by rotating the first polygon/curve of the
- given {\bf Object}, around the Z axis. Use the linear transformation function
- to position a surface of revolution in a different orientation.
-
- Example:
-
- @\begin{verbatim}
- 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 ) );
- @\end{verbatim}
-
- 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.
- @See Figure~\ref{fig-surfrev}.
- @\begin{figure}
- @\vspace{2.4in}
- @\special{psfile=user_man/surfrev.ps hscale=100 vscale=100 hoffset=-60 voffset=-140}
- @\caption{A surface of revolution, VTailAntn in surfrev documentation, can be
- @ constructed using SURFREV or SURFPREV.}
- @\label{fig-surfrev}
- @\end{figure}
- $
-
- @\subsubsection{SWEEPSRF}
- !SWEEPSRF
-
- @\begin{verbatim}
- SurfaceType SWEEPSRF( CurveType CrossSection, CurveType Axis,
- CurveType FrameCrv | VectorType FrameVec | ConstType OFF )
- @\end{verbatim}
-
- Constructs a generalized cylinder surface. This function sweeps a specified
- cross-section {\bf CrossSection} along the provided {\bf Axis}.
- By default, when frame specification is {\bf OFF}, the orientation
- of the cross section is computed using the {\bf 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 {\bf Axis}.
- If a VectorType {\bf 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 {\bf 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 {\bf FrameCrv} do not have to match the parametric domain of {\bf Axis},
- and its parametric domain is automatically made compatible by this function.
-
- Example:
-
- @\begin{verbatim}
- 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 ) ) ) );
- @\end{verbatim}
-
- constructs a rounded rectangle cross-section and sweeps it along an arc,
- while orienting it several ways. The axis curve {\bf Axis} is manually
- refined to better approximate the requested shape.
-
- See also SWPSCLSRF for sweep with scale.
- @See Figure~\ref{fig-sweepsrf}.
- @\begin{figure}
- @\vspace{1.4in}
- @\special{psfile=user_man/sweepsrf.ps hscale=100 vscale=100 hoffset=-30 voffset=-210}
- @\caption{Three examples of the use of SWEEPSRF (Srf1, Srf2, Srf3 from left to right
- @ in sweepsrf documentation).}
- @\label{fig-sweepsrf}
- @\end{figure}
- $
-
- @\subsubsection{SWPSCLSRF}
- !SWPSCLSRF
-
- @\begin{verbatim}
- SurfaceType SWPSCLSRF( CurveType CrossSection, CurveType Axis,
- NumericType Scale | CurveType ScaleCrv,
- CurveType FrameCrv | VectorType FrameVec
- | ConstType OFF,
- NumericType ScaleRefine )
- @\end{verbatim}
-
- Constructs a generalized cylinder surface. This function sweeps a specified
- cross-section {\bf CrossSection} along the provided {\bf Axis}.
- The cross-section may be scaled by a constant value {\bf Scale}, or scaled
- along the {\bf Axis} parametric direction via a scaling curve {\bf ScaleCrv}.
- By default, when frame specification is {\bf OFF}, the orientation
- of the cross section is computed using the {\bf 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 {\bf Axis}.
- If a VectorType {\bf 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 {\bf 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.
- {\bf ScaleRefine} is an integer value to define possible refinement of the
- {\bf Axis} to reflect the information in {\bf ScalingCrv}. Value of zero will
- force no refinement while value of $n > 0$ will insert $n$ times the
- number of control points in {\bf ScaleCrv} into {\bf 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 {\bf ScaleRefine}) of the axis curve at
- the proper location, where accuracy is important, should improve the accuracy
- of the output. The parametric domains of {\bf ScaleCrv} and {\bf FrameCrv} do
- not have to match the parametric domain of {\bf Axis}, and their domains are
- made compatible by this function.
-
- Example:
-
- @\begin{verbatim}
- Cross = arc( vector( -0.11, -0.01, 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 );
- @\end{verbatim}
-
- constructs a rounded rectangle cross-section and sweeps it along a circle,
- while scaling and orienting in several ways. The axis curve {\bf Axis} is
- automatically refined in {\bf Srf2} to better approximate the requested
- scaling.
-
- See also SWEEPSRF for sweep with no scale.
- @See Figure~\ref{fig-swpsclsrf}.
- @\begin{figure}
- @\vspace{1.2in}
- @\special{psfile=user_man/swpsclsrf.ps hscale=100 vscale=100 hoffset=-35 voffset=-170}
- @\caption{Three examples of the use of SWPSCLSRF (Srf1, Srf2, Srf3 from left to right
- @ in swpsclsrf documentation).}
- @\label{fig-swpsclsrf}
- @\end{figure}
- $
-
- @\subsubsection{SYMBPROD}
- !SYMBPROD
-
- @\begin{verbatim}
- CurveType SYMBPROD( CurveType Crv1, CurveType Crv2 )
-
- or
-
- SurfaceType SYMBPROD( SurfaceType Srf1, SurfaceType Srf2 )
- @\end{verbatim}
-
- Computes the symbolic product of the given two curves or surfaces as
- a curve or surface. The product is computed coordinate-wise.
-
- Example:
-
- @\begin{verbatim}
- ProdSrf = SYMBPROD( Srf1, Srf2 )
- @\end{verbatim}
- $
-
- @\subsubsection{SYMBDPROD}
- !SYMBDPROD
-
- @\begin{verbatim}
- CurveType SYMBDPROD( CurveType Crv1, CurveType Crv2 )
-
- or
-
- SurfaceType SYMBDPROD( SurfaceType Srf1, SurfaceType Srf2 )
- @\end{verbatim}
-
- Computes the symbolic dot (inner) product of the given two curves or surfaces
- as a {\em scalar} curve or surface.
-
- Example:
-
- @\begin{verbatim}
- DiffCrv = symbdiff( Crv1, Crv2 )
- DistSqrCrv = SYMBDPROD( DiffCrv, DiffCrv )
- @\end{verbatim}
-
- Computes a scalar curve that at parameter $t$ is equal to the distance
- square between Crv1 at $t$ and Crv2.
- $
-
- @\subsubsection{SYMBCPROD}
- !SYMBCPROD
-
- @\begin{verbatim}
- CurveType SYMBCPROD( CurveType Crv1, CurveType Crv2 )
-
- or
-
- SurfaceType SYMBCPROD( SurfaceType Srf1, SurfaceType Srf2 )
- @\end{verbatim}
-
- Computes the symbolic cross product of the given two curves or surfaces as
- a curve or surface.
-
- Example:
-
- @\begin{verbatim}
- NrmlSrf = SYMBCPROD( sderive( Srf, ROW ), sderive( Srf, COL ) )
- @\end{verbatim}
-
- computes a normal surface as the cross product of the surface two partial
- derivatives (see SNRMLSRF).
- $
-
- @\subsubsection{SYMBSUM}
- !SYMBSUM
-
- @\begin{verbatim}
- CurveType SYMBSUM( CurveType Crv1, CurveType Crv2 )
-
- or
-
- SurfaceType SYMBSUM( SurfaceType Srf1, SurfaceType Srf2 )
- @\end{verbatim}
-
- Computes the symbolic sum of the given two curves or surfaces as
- a curve or surface. The sum is computed coordinate-wise.
-
- Example:
-
- @\begin{verbatim}
- SumCrv = SYMBSUM( Crv1, Crv2 )
- @\end{verbatim}
- $
-
- @\subsubsection{SYMBDIFF}
- !SYMBDIFF
-
- @\begin{verbatim}
- CurveType SYMBDIFF( CurveType Crv1, CurveType Crv2 )
-
- or
-
- SurfaceType SYMBDIFF( SurfaceType Srf1, SurfaceType Srf2 )
- @\end{verbatim}
-
- Computes the symbolic difference of the given two curves or surfaces as
- a curve or surface. The difference is computed coordinate-wise.
-
- Example:
-
- @\begin{verbatim}
- DiffCrv = SYMBDIFF( Crv1, Crv2 )
- DistSqrCrv = symbdprod( DiffCrv, DiffCrv )
- @\end{verbatim}
- $
-
- @\subsubsection{TBEZIER}
- !TBEZIER
-
- @\begin{verbatim}
- TrivarType TBEZIER( ListType CtlMesh )
- @\end{verbatim}
-
- Creates a Bezier trivariate using the provided control mesh. {\bf 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-E5, P1-P5), 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.
- @
- @The created trivariate is the piecewise polynomial (or rational) function,
- @\begin{equation}
- @ T(u, v, w) = \sum_{i=0}^m \sum_{j=0}^n \sum_{k=0}^l
- @ P_{ijk} B_i(u) B_j(v) B_k(w)
- @\end{equation}
- @where $P_{ijk}$ are the control points {\bf CtlMesh}. and $l$, $m$ and $n$
- @are the degrees of the trivariate, which are one less than the number of
- @points in the appropriate direction.
-
- Example:
-
- @\begin{verbatim}
- 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 ) ) ) ) );
- @\end{verbatim}
-
- creats a trivariate Bezier which is linear in the first direction, and
- quadratic in the second and third.
- @See Figure~\ref{fig-tbezier}.
- @\begin{figure}
- @\vspace{3.2in}
- @\special{psfile=user_man/tbezier.ps hscale=100 vscale=100 hoffset=-60 voffset=-100}
- @\caption{A trivariate Bezier of degree 2 by 3 by 3 (left) and a trilinear
- @ Bspline (right). Both share the same control mesh.}
- @\label{fig-tbezier}
- @\end{figure}
- $
-
- @\subsubsection{TBSPLINE}
- !TBSPLINE
-
- @\begin{verbatim}
- TrivarType TBSPLINE( NumericType UOrder,
- NumericType VOrder,
- NumericType WOrder,
- ListType CtlMesh,
- ListType KnotVectors )
- @\end{verbatim}
-
- Creates a Bspline trivariate with the provided {\bf UOrder}, {\bf VOrder}
- and {\bf WOrder} orders, the control mesh {\bf CtlMesh}, and the three knot
- vectors in {\bf KnotVectors}.
- {\bf 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-E5, P1-P5), 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.
- {\bf KnotVectors} is a list of three knot vectors. Each knot vector is a
- list of NumericType knots of length {\bf \#CtlPtList} plus the {\bf Order}.
- If, however, the length of the knot vector is equal to {\bf \#CtlPtList +
- Order + Order - 1} the curve is assumed {\em 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.
- @
- @The created surface is the piecewise polynomial (or rational) surface,
- @\begin{equation}
- @ T(u, v, w) = \sum_{i=0}^m \sum_{j=0}^n \sum_{k=0}^l P_{ijk}
- @ B_{i,\chi}(u) B_{j,\xi}(v) B_{k,\phi}(w)
- @\end{equation}
- @where $P_{ijk}$ are the control points {\bf CtlMesh}, and $l$, $m$ and $n$
- @are the degrees of the surface, which are one less than {\bf UOrder},
- @{\bf VOrder} and {\bf WOrder} and $\chi$, $\xi$ and $\phi$ are the three
- @knot vectors of the trivariate.
-
- Example:
-
- @\begin{verbatim}
- 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 ) ) );
- @\end{verbatim}
-
- constructs a trilinear Bspline trivariate with open end conditions.
- @See Figure~\ref{fig-tbezier}.
- $
-
- @\subsubsection{TDERIVE}
- !TDERIVE
-
- @\begin{verbatim}
- TrivarType TDERIVE( TrivarType TV, NumericType Dir )
- @\end{verbatim}
-
- 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 {\bf TV} in {\bf Dir} at that
- parameter value.
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- computes the gradiate of a scalar trivariate field, by computing its
- partials with respect to u, v, and w.
- $
-
- @\subsubsection{TDIVIDE}
- !TDIVIDE
-
- @\begin{verbatim}
- TrivarType TDIVIDE( TrivarType TV, ConstantType Direction,
- NumericType Param )
- @\end{verbatim}
-
- Subdivides a trivariate into two at the specified parameter value {\bf Param}
- in the specified {\bf Direction} (ROW, COL, or DEPTH). {\bf TV} can be either
- a Bspline trivairate in which {\bf Param} must be conatined in the parametric
- domain of the trivariate, or a Bezier trivariate in which {\bf 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 {\bf NTH} command.
-
- Example:
-
- @\begin{verbatim}
- TvDiv = TDIVIDE( Tv2, depth, 0.3 );
- Tv2a = nth( TvDiv, 1 ) * tx( -2.2 );
- Tv2b = nth( TvDiv, 2 ) * tx( 2.0 );
- @\end{verbatim}
-
- subdivides {\bf Tv2} at the parameter value of 0.3 in the DEPTH direction,
- @See Figure~\ref{fig-tdivide}.
- @\begin{figure}
- @\vspace{2.6in}
- @\special{psfile=user_man/tdivide.ps hscale=110 vscale=110 hoffset=-60 voffset=-135}
- @\caption{A trivariate can be subdivided into two distinct regions using TDIVIDE.}
- @\label{fig-tdivide}
- @\end{figure}
- $
-
- @\subsubsection{TEVAL}
- !TEVAL
-
- @\begin{verbatim}
- CtlPtType TEVAL( TrivarType TV,
- NumericType UParam,
- NumericType VParam,
- NumericType WParam )
- @\end{verbatim}
-
- Evaluates the provided trivariate {\bf TV} at the given {\bf UParam},
- {\bf VParam} and {\bf WParam} values. {\bf UParam}, {\bf VParam},
- {\bf WParam} must be contained in the surface parametric domain if {\bf TV}
- is a Bspline surface, or between zero and one if {\bf TV} is a Bezier
- trivariate. The returned control point has the same type as the control
- points of {\bf TV}.
-
- Example:
-
- @\begin{verbatim}
- CPt = TEVAL( TV1, 0.25, 0.22, 0.7 );
- @\end{verbatim}
-
- evaluates {\bf TV} at the parameter values of (0.25, 0.22, 0.7).
- $
-
- @\subsubsection{TINTERP}
- !TINTERP
-
- @\begin{verbatim}
- TrivarType TINTERP( TrivarType TV );
- @\end{verbatim}
-
- Given a trivariate data structure, computes a new trivariate in the
- same function space (i.e. same knot sequences and orders) that interpolates
- the given triavriate, {\bf TV}, at the node parameter values.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- creates a quadratic by quaratic by linear trivairatiate {\bf tvi} that
- interpolates the control points of {\bf tv} at the node parameter values.
- $
-
- @\subsubsection{TORUS}
- !TORUS
-
- @\begin{verbatim}
- PolygonType TORUS( VectorType Center, VectorType Normal,
- NumericType MRadius, NumericType mRadius )
- @\end{verbatim}
-
- Creates a TORUS geometric object, defined by {\bf Center} as the center
- of the TORUS, {\bf Normal} as the normal to the main plane of the TORUS,
- {\bf MRadius} and {\bf mRadius} as the major and minor radii of the TORUS.
- See RESOLUTION for the accuracy of the TORUS approximation as a polygonal
- model.
-
- Example:
-
- @\begin{verbatim}
- T = TORUS( vector( 0.0, 0.0, 0.0), vector( 0.0, 0.0, 1.0), 0.5, 0.2 );
- @\end{verbatim}
-
- constructs a torus with major plane as the $XY$ plane, major radius of 0.5,
- and minor radius of 0.2.
- @See Figure~\ref{fig-torus}.
- @\begin{figure}
- @\vspace{2.2in}
- @\special{psfile=user_man/torus.ps hscale=100 vscale=100 hoffset=-40 voffset=-140}
- @\caption{A torus primitive can be constructed using a TORUS constructor...}
- @\label{fig-torus}
- @\end{figure}
- $
-
- @\subsubsection{TREFINE}
- !TREFINE
-
- @\begin{verbatim}
- TrivarType TREFINE( TrivarType TV, ConstantType Direction,
- NumericType Replace, ListType KnotList )
- @\end{verbatim}
-
- Provides the ability to {\bf Replace} a knot vector of {\bf TV} or refine
- it in the specified direction {\bf Direction} (ROW, COL, or DEPTH).
- {\bf KnotList} is a list of knots to refine {\bf TV} at. All knots should be
- contained in the parametric domain of {\bf TV} in {\bf Direction}. If the knot
- vector is replaced, the length of {\bf KnotList} should be identical to the
- length of the original knot vector of {\bf TV} in {\bf Direction}. If {\bf TV}
- is a Bezier trivariate, it is automatically promoted to be a Bspline
- trivariate.
-
- Example:
-
- @\begin{verbatim}
- 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 ) );
- @\end{verbatim}
-
- refines {\bf TV} in all directions by adding two more knots at 0.333 and
- 0.667.
- $
-
- @\subsubsection{TREGION}
- !TREGION
-
- @\begin{verbatim}
- TrivarType TREGION( TrivarType Srf, ConstantType Direction,
- NumericType MinParam, NumericType MaxParam )
- @\end{verbatim}
-
- Extracts a region of {\bf TV} between {\bf MinParam} and {\bf MaxParam}
- in the specified {\bf Direction}. Both {\bf MinParam} and {\bf MaxParam}
- should be contained in the parametric domain of {\bf TV} in {\bf Direction}.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- extracts three regions of {\bf Tv1} along the ROW direction.
- @See Figure~\ref{fig-tregion}.
- @\begin{figure}
- @\vspace{3.3in}
- @\special{psfile=user_man/tregion.ps hscale=100 vscale=100 hoffset=-40 voffset=-110}
- @\caption{A region can be extracted from a freeform trivariate using TREGION.}
- @\label{fig-tregion}
- @\end{figure}
- $
-
- @\subsubsection{TRIMSRF}
- !TRIMSRF
-
- @\begin{verbatim}
- TrimSrfType TRIMSRF( SurfaceType Srf,
- CurveType TrimCrv,
- NumericType UpperLevel )
-
- or
-
- TrimSrfType TRIMSRF( SurfaceType Srf,
- ListType TrimCrvs,
- NumericType UpperLevel )
- @\end{verbatim}
-
- Creates a trimmed surface from the provided surface {\bf Srf} and the
- trimming curve {\bf TrimCrv} or curves {\bf TrimCrvs}. If {\bf UpperLevel},
- an additional trimming curve is automatically being added that contains the
- entire parametric domain of {\bf Srf}. No validity test is performed on the
- trimming curves which are assumed two dimensional curves contained in
- the parametric domain of {\bf Srf}.
-
- Example:
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- constructs three trimmed surfaces. {\bf Tsrf1} contains the out boundary
- and excludes what is inside {\bf TCrv1}, {\bf TSrf2} contains only the
- domain inside {\bf TCrv1}. {\bf TCrv3} has three holes corresponds to the
- three trimming curves.
- @See Figure~\ref{fig-trimsrf}.
- @\begin{figure}
- @\vspace{3.3in}
- @\special{psfile=user_man/trimsrf.ps hscale=100 vscale=100 hoffset=-40 voffset=-140}
- @\caption{Three trimmed surfaces created from the same Bspline surface. In
- @ thin lines is the original surface while in thick lines are the trimmed
- @ surfaces.}
- @\label{fig-trimsrf}
- @\end{figure}
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- @\subsection{Object transformation functions}
- &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
-
- @\begin{verbatim}
- m = trans( vector( -1, 0, 0 ) ) * rotx( 45 ) * trans( vector( 1, 0, 0 ) );
- @\end{verbatim}
-
- constructs a transform to rotate an object around the X = 1 line, 45 degrees.
- A matrix representing the inverse transformation can be computed as:
- @\begin{verbatim}
- InvM = m ^ -1
- @\end{verbatim}
- See also overloading of the - operator.
- $
-
- @\subsubsection{HOMOMAT}
- !HOMOMAT
-
- @\begin{verbatim}
- MatrixType HOMOMAT( ListType MatData )
- @\end{verbatim}
-
- Creates an arbitrary homogeneous transformation matrix by manually providing
- its 16 coefficients.
- Example:
-
- @\begin{verbatim}
- 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, b, axes), on)
- );
- @\end{verbatim}
-
- looping and viewing through a sequence of perspective transforms, created
- using the HOMOMAT constructor.
- $
-
- @\subsubsection{ROTX}
- !ROTX
-
- @\begin{verbatim}
- MatrixType ROTX( NumericType Angle )
- @\end{verbatim}
-
- Creates a rotation around the X transformation matrix with {\bf Angle} degrees.
- $
-
- @\subsubsection{ROTY}
- !ROTY
-
- @\begin{verbatim}
- MatrixType ROTY( NumericType Angle )
- @\end{verbatim}
-
- Creates a rotation around te Y transformation matrix with {\bf Angle} degrees.
- $
-
- @\subsubsection{ROTZ}
- !ROTZ
-
- @\begin{verbatim}
- MatrixType ROTZ( NumericType Angle )
- @\end{verbatim}
-
- Creates a rotation around the Z transformation matrix with {\bf Angle} degrees.
- $
-
- @\subsubsection{SCALE}
- !SCALE
-
- @\begin{verbatim}
- MatrixType SCALE( VectorType ScaleFactors )
- @\end{verbatim}
-
- Creates a scaling by the {\bf ScaleFactors} transformation matrix.
- $
-
- @\subsubsection{TRANS}
- !TRANS
-
- @\begin{verbatim}
- MatrixType TRANS( VectorType TransFactors )
- @\end{verbatim}
-
- Creates a translation by the {\bf TransFactors} transformation matrix.
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{General purpose functions}
- &General purpose functions
-
- @\subsubsection{ATTRIB}
- !ATTRIB
-
- @\begin{verbatim}
- ATTRIB( AnyType Object, StringType Name, AnyType Value )
- @\end{verbatim}
-
- Provides a mechanism to add an attribute of any type to an {\bf Object},
- with name {\bf Name} and value {\bf Value}. This ATTRIB function is tuned
- and optimized toward numeric values or strings as {\bf 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. For example,
-
- @\begin{verbatim}
- ATTRIB(Glass, "rgb", "255,0,0");
- ATTRIB(Glass, "refract", 1.4);
- .
- .
- .
- RMATTR(Glass, "rgb"); # Removes "rgb" attribute.
- @\end{verbatim}
-
- sets the RGB color and refraction index of the {\bf Glass} object and
- later removes the RGB attribute.
-
- Attribute names are case insensitive. Spaces are allowed in the {\bf Value}
- string, as well as the double quote itself, although the latter must be
- escaped:
-
- @\begin{verbatim}
- ATTRIB(Glass, "text", "Say \"this is me\"");
- @\end{verbatim}
-
- See also RMATTR for removal of attributes.
- $
-
- @\subsubsection{CHDIR}
- !CHDIR
-
- @\begin{verbatim}
- CHDIR( StringType NewDir )
- @\end{verbatim}
-
- Sets the current working directory to be {\bf NewDir}.
- $
-
- @\subsubsection{CLNTCLOSE}
- !CLNTCLOSE
-
- @\begin{verbatim}
- CLNTCLOSE( NumericType Handler, NumericType Kill )
- @\end{verbatim}
-
- Closes a communication channel to a client. {\bf Handler} contains the
- index of the communication channel opened via CLNTEXEC. If {\bf 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 CLNTREAD,
- CLNTWRITE, and CLNTEXEC.
-
- Example:
-
- @\begin{verbatim}
- h2 = clntexec( "nuldrvs -s-" );
- .
- .
- .
-
- CLNTCLOSE( h2,TRUE );
- @\end{verbatim}
-
- closes the connection to the nuldrvs client, opened via CLNTEXEC.
- $
-
- @\subsubsection{CLNTWRITE}
- !CLNTWRITE
-
- @\begin{verbatim}
- CLNTWRITE( NumericType Handler, AnyType Object )
- @\end{verbatim}
-
- Writes one object {\bf Object} to a communication channel of a client.
- {\bf Handler} contains the index of the communication channel opened via
- CLNTEXEC. See also CLNTREAD, CLNTCLOSE, and CLNTEXEC.
-
- Example:
-
- @\begin{verbatim}
- h2 = clntexec( "nuldrvs -s-" );
- .
- .
-
- CLNTWRITE( h2, Model );
- .
- .
-
- clntclose( h2,TRUE );
- @\end{verbatim}
-
- writes the object named Model to client through communication channel h2.
- $
-
- @\subsubsection{COLOR}
- !COLOR
-
- @\begin{verbatim}
- COLOR( GeometricType Object, NumericType Color )
- @\end{verbatim}
-
- 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:
- {\bf BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, and WHITE}.
-
- See the ATTRIB command for more fine control of colors using the RGB
- attribute.
- $
-
- @\subsubsection{COMMENT}
- !COMMENT
-
- @\begin{verbatim}
- COMMENT
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- COMMENT $
- This is a comment
- $
- @\end{verbatim}
- $
-
- @\subsubsection{ERROR}
- !ERROR
-
- @\begin{verbatim}
- ERROR( StringType Message);
- @\end{verbatim}
-
- Breaks the execution and returns to IRIT main loop, after printing
- {\bf Message} to the screen. May be useful in user defined function to
- break execution in cases of fatal errors.
- $
-
- @\subsubsection{EXIT}
- !EXIT
-
- @\begin{verbatim}
- EXIT();
- @\end{verbatim}
-
- Exits from the solid modeler. NO warning is given!
- $
-
- @\subsubsection{FOR}
- !FOR
-
- @\begin{verbatim}
- FOR( NumericType Start, NumericType Increment, NumericType End, AnyType Body )
- @\end{verbatim}
-
- Executes the {\bf Body} (see below), while the FOR loop conditions hold.
- {\bf Start, Increment, End} are evaluated first, and the loop is executed
- while {\bf $<=$ End} if {\bf Increment $>$ 0}, or while {\bf $>=$ End} if {\bf Increment $<$ 0}.
- If {\bf 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:
-
- @\begin{verbatim}
- step = 10;
- rotstepx = rotx(step);
- FOR ( a = 1, 1, 360 / step,
- view_mat = rotstepx * view_mat:
- view( list( view_mat, b, axes ), ON )
- );
- @\end{verbatim}
-
- Displays b and axes with a view direction that is rotated 10 degrees at a
- time around the X axis.
- $
-
- @\subsubsection{HELP}
- !HELP
-
- @\begin{verbatim}
- HELP( StringType Subject )
- @\end{verbatim}
-
- Provides help on the specified Subject.
-
- Example:
-
- @\begin{verbatim}
- HELP("");
- @\end{verbatim}
-
- will list all {\em IRIT} help subjects.
- $
-
- @\subsubsection{FREE}
- !FREE
-
- @\begin{verbatim}
- FREE( GeometricType Object )
- @\end{verbatim}
-
- 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.
- $
-
- @\subsubsection{FUNCTION}
- !FUNCTION
-
- @\begin{verbatim}
- FuncName = FUNCTION(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
- FuncBody;
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- sqr = FUNCTION(x):
- return = x * x;
- @\end{verbatim}
-
- Functions can be defined with optional parameters and optional local
- variables. A function's body may contain an arbitrary set of expressions
- including for 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:
-
- @\begin{verbatim}
- factorial = function(x):return = x; # Dummy function.
- factorial = function(x):
- if (x <= 1, return = 1, return = x * factorial(x - 1));
- @\end{verbatim}
-
- Overloading is valid inside a function as it is outside. For example, for
-
- @\begin{verbatim}
- add = FUNCTION(x, y):
- return = x + y;
- @\end{verbatim}
-
- the following function calls are all valid:
-
- @\begin{verbatim}
- 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));
- @\end{verbatim}
-
- Finally, here is a more interesting example that computes an approximation
- of the length of a curve, using the sqr function defined above:
-
- @\begin{verbatim}
- 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);
- @\end{verbatim}
-
- Try, for example:
-
- @\begin{verbatim}
- 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;
- @\end{verbatim}
-
- See PROCEDURE and IRITSTATE's "DebugFunc" for more.
- $
-
- @\subsubsection{IF}
- !IF
-
- @\begin{verbatim}
- IF( NumericType Cond, AnyType TrueBody { , AnyType FalseBody } )
- @\end{verbatim}
-
- Executes {\bf TrueBody} (group of regular commands, separated by COLONs -
- see FOR loop) if the {\bf Cond} holds, i.e., it is a numeric value other than
- zero, or optionally, if it exists, executes {\bf FalseBody} if the {\bf Cond}
- does not hold, i.e., it evaluates to a numeric value equal to zero.
-
- Examples:
-
- @\begin{verbatim}
- IF ( machine == IBMOS2, resolution = 5, resolution = 10 );
- IF ( a > b, max = a, max = b );
- @\end{verbatim}
-
- 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.
- $
-
- @\subsubsection{INCLUDE}
- !INCLUDE
-
- @\begin{verbatim}
- INCLUDE( StringType FileName )
- @\end{verbatim}
-
- Executes the script file {\bf 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).
-
- A script file can contain any command the solid modeler supports.
-
- Example:
-
- @\begin{verbatim}
- INCLUDE( "general.irt" );
- @\end{verbatim}
-
- includes the file "general.irt".
- $
-
- @\subsubsection{IRITSTATE}
- !IRITSTATE
-
- @\begin{verbatim}
- IRITSTATE( StringType State, AnyType Data )
- @\end{verbatim}
-
- Sets a state variable in the {\em IRIT} solid modeller. Current supported
- state variables are,
- # 13 3 1 1
- State Name
- Data Type
- Comments
-
-
-
- InterpProd
- ConstantType
- TRUE for Bspline sym. products via interpolation
-
-
- FALSE for Bspline sym. products via bezier
- DebugFunc
- NumericType
- $>0$ user func. debug information. $>2$ print params
-
-
- on entry, ret. val. on exit. $>4$ global var. list
- 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.
- Coplanar
- NumericType
- If TRUE, Coplanar polygons are handled by Boolean
-
-
- operations.
- PolySort
- NumericType
- Axis of Polygon Intersection sweep in Boolean
-
-
- operations: 0 for X axis, 1 for Y axis, 2 for
-
-
- Z axis.
- EchoSource
- NumericType
- If TRUE, irit scripts are echoed to stdout.
- DumpLevel
- NumericType
- Controls the way variables/expressions ar dumped.
-
-
- Only object names/types if $>=$ 0, Scalars and
-
-
- vectors are dumped if $>=$ 1, Curves and Surfaces
-
-
- are dumped if DumpLvl $>=$ 2, Polygons/lines are
-
-
- dumped if DumpLvl $>=$ 3, and List objects are
-
-
- traversed recursively if DumpLvl $>=$ 4.
- TrimCrvs
- NumericType
- Number of samples the higher order trimmed curves
-
-
- are sampled, in piecewise linear approximation.
-
-
- If zero, computed symbolically as composition.
- #
-
- Example:
-
- @\begin{verbatim}
- IRITSTATE( "DebugFunc", 3 );
- IRITSTATE( "FloatFrmt", "%8.5lg" );
- @\end{verbatim}
-
- To print parameters of user defined functions on entry, and return value on
- exit. Also selects a floating point printf format of "%8.5lg".
- $
-
- @\subsubsection{INTERACT}
- !INTERACT
-
- @\begin{verbatim}
- INTERACT( GeometryTreeType Object )
- @\end{verbatim}
-
- A user-defined function (see iritinit.irt) that does the following,
- in order:
- @\begin{enumerate}
- @\item
- Clear the display device.
- @\item
- Display the given {\bf Object}.
- @\item
- Pause for a keystroke.
- @\end{enumerate}
-
- This user-defined function in version 4.0 of {\em IRIT} is an
- emulation of the INTERACT function that used to exist in previous versions.
-
- Example:
-
- @\begin{verbatim}
- INTERACT( list( view_mat, Axes, Obj ) );
- @\end{verbatim}
-
- displays and interacts with the object {\bf Obj} and the predefined object
- {\bf Axes}. VIEW\_MAT will be used to set the starting transformation.
-
- See VIEW and VIEWOBJ for more.
- $
-
- @\subsubsection{LIST}
- !LIST
-
- @\begin{verbatim}
- ListType LIST( AnyType Elem1, AnyType Elem2, ... )
- @\end{verbatim}
-
- 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 {\bf used}
- reference. The object is freed iff in {\bf 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.
- $
-
- @\subsubsection{LOAD}
- !LOAD
-
- @\begin{verbatim}
- AnyType LOAD( StringType FileName )
- @\end{verbatim}
-
- Loads an object from the given {\bf 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 {\em IRIT}, but can only be inspected through {\bf 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.
- $
-
- @\subsubsection{LOGFILE}
- !LOGFILE
-
- @\begin{verbatim}
- LOGFILE( NumericType Set )
-
- or
-
- LOGFILE( StringType FileName )
- @\end{verbatim}
-
- If {\bf 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 {\bf 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:
-
- @\begin{verbatim}
- LOGFILE( "Data1" );
- LOGFILE( on );
- printf( "Resolution = %lf\\n", list( resolution ) );
- LOGFILE( off );
- @\end{verbatim}
-
- to print the current resolution level into file Data1.
- $
-
- @\subsubsection{MSLEEP}
- !MSLEEP
-
- @\begin{verbatim}
- MSLEEP( NumericType MilliSeconds )
- @\end{verbatim}
-
- Causes the solid modeller to sleep for the prescribed time in milliseconds.
-
- Example:
-
- @\begin{verbatim}
- for ( i = 1, 1, sizeof( crvs ),
- c = nth( crvs, i ):
- color( c, yellow ):
- msleep(20):
- viewobj( c )
- );
- @\end{verbatim}
-
- Displays an animation sequence and sleeps for 20 milliseconds between
- iterations.
- $
-
- @\subsubsection{NTH}
- !NTH
-
- @\begin{verbatim}
- AnyType NTH( ListType ListObject, NumericType Index )
- @\end{verbatim}
-
- Returns the {\bf Index} (base count 1) element of the list {\bf ListObject}.
-
- Example:
-
- @\begin{verbatim}
- Lst = list( a, list( b, c ), d );
- Lst2 = NTH( Lst, 2 );
- @\end{verbatim}
-
- and now {\bf Lst2} is equal to 'list( b, c )'.
- $
-
- @\subsubsection{PAUSE}
- !PAUSE
-
- @\begin{verbatim}
- PAUSE( NumericType Flush )
- @\end{verbatim}
-
- Waits for a keystroke. Nice to have if a temporary stop in a middle of an
- included file (see INCLUDE) is required. If {\bf Flush} is TRUE, then the input
- is first flushed to guarantee that the actual stop will occur.
- $
-
- @\subsubsection{PRINTF}
- !PRINTF
-
- @\begin{verbatim}
- PRINTF( StringType CtrlStr, ListType Data )
- @\end{verbatim}
-
- A formatted printing routine, following the concepts of the C programming
- language's {\em printf} routine. {\bf CtrlStr} is a string object for which
- the following special '\%' commands are supported:
- #15 2 0 1
- \%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:
-
- @\begin{verbatim}
- * PRINTF("\\tThis is the char \"\\%\"\\n", nil());
- @\end{verbatim}
-
- Backslashes should be escaped themselves as can be seen in the above example.
- Here are few more examples:
-
- @\begin{verbatim}
- * 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));
- @\end{verbatim}
-
- This implementation of PRINTF is somewhat different than the C programming
- language's version, because the backslash {\em always} escapes the next
- character during the processing stage of IRIT's parser. That is, the string
-
- @\begin{verbatim}
- * '\\tThis is the char \"\\%\"\\n'
- @\end{verbatim}
-
- is actually parsed by the IRIT's parser into
-
- @\begin{verbatim}
- * '\tThis is the char "\%"\n'
- @\end{verbatim}
-
- because this is the way the IRIT parser processes strings. The latter
- string is the one that PRINTF actually see.
- $
-
- @\subsubsection{PROCEDURE}
- !PROCEDURE
-
- @\begin{verbatim}
- ProcName = PROCEDURE(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
- ProcBody;
- @\end{verbatim}
-
- 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.
- $
-
- @\subsubsection{RMATTR}
- !RMATTR
-
- @\begin{verbatim}
- RMATTR( AnyType Object, StringType Name )
- @\end{verbatim}
-
- Removes attribute named {\bf Name} from object {\bf Object}. This function
- will have no affect on {\bf Object} if {\bf Object} have no attribute named
- {\bf Name}.
-
- See also ATTRIB.
- $
- @\subsubsection{SAVE}
- !SAVE
-
- @\begin{verbatim}
- SAVE( StringType FileName, AnyType Object )
- @\end{verbatim}
-
- Saves the provided {\bf Object} in the specified file name {\bf FileName}.
- No extension type is needed (ignored if specified), and ".dat" is supplied
- by default. {\bf 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 {\em IRIT}, but must be inspected through {\bf 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:
-
- @\begin{verbatim}
- SAVE( "Obj1.bdt.Z", Obj1 );
- @\end{verbatim}
-
- Saves Obj1 in the file Obj1.bdt.Z as compressed binary file.
- $
-
- @\subsubsection{SNOC}
- !SNOC
-
- @\begin{verbatim}
- SNOC( AnyType Object, ListType ListObject )
- @\end{verbatim}
-
- Similar to the lisp cons operator but puts the new {\bf Object} in the
- {\em end} of the list {\bf ListObject} instead of the beginning, in place.
-
- Example:
-
- @\begin{verbatim}
- Lst = list( axes );
- SNOC( Srf, Lst );
- @\end{verbatim}
-
- and now {\bf Lst} is equal to the list 'list( axes, Srf )'.
- $
-
- @\subsubsection{SYSTEM}
- !SYSTEM
-
- @\begin{verbatim}
- SYSTEM( StringType Command )
- @\end{verbatim}
-
- Executes a system command {\bf Command}. For example,
-
- @\begin{verbatim}
- SYSTEM( "ls -l" );
- @\end{verbatim}
- $
-
- @\subsubsection{TIME}
- !TIME
-
- @\begin{verbatim}
- TIME( NumericType Reset )
- @\end{verbatim}
-
- Returns the time in seconds from the last time TIME was called with
- {\bf 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:
-
- @\begin{verbatim}
- Dummy = TIME( TRUE );
- .
- .
- .
- TIME( FALSE );
- @\end{verbatim}
-
- prints the time in seconds between the above two time function calls.
- $
-
- @\subsubsection{VARLIST}
- !VARLIST
-
- @\begin{verbatim}
- VARLIST()
- @\end{verbatim}
-
- List all the currently defined objects in the system.
- $
-
- @\subsubsection{VECTOR}
- !VECTOR
-
- @\begin{verbatim}
- VectorType VECTOR( NumericType X, NumericType Y, NumericType Z )
- @\end{verbatim}
-
- Creates a vector type object, using the three provided NumericType scalars.
- $
-
- @\subsubsection{VIEW}
- !VIEW
-
- @\begin{verbatim}
- VIEW( GeometricTreeType Object, NumericType ClearWindow )
- @\end{verbatim}
-
- Displays the (geometric) object(s) as given in {\bf Object}.
-
- If {\bf ClearWindow} is non-zero (see TRUE/FALSE and ON/OFF) the window is
- first cleared (before drawing the objects).
-
- Example:
-
- @\begin{verbatim}
- VIEW( Axes, FALSE );
- @\end{verbatim}
-
- displays the predefined object {\bf 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,
-
- @\begin{verbatim}
- VIEW( list( view_mat, Obj ), TRUE );
- @\end{verbatim}
-
- However, since VIEW is a user defined function, the following will not
- use VIEW\_MAT as one would expect:
-
- @\begin{verbatim}
- VIEW( view_mat, TRUE );
- @\end{verbatim}
-
- 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:
- # 15 2 0 1
- 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:
-
- @\begin{verbatim}
- VIEWCLEAR();
- VIEW( axes, off );
- VIEWSTATE( "LngrVecs" );
- VIEWSTATE( "DrawSolid" );
- VIEWSAVE( "matrix1" );
- VIEWREMOVE( "axes" );
- VIEWDISC();
- @\end{verbatim}
- $
-
- @\subsubsection{VIEWOBJ}
- !VIEWOBJ
-
- @\begin{verbatim}
- VIEWOBJ( GeometricTreeType Object )
- @\end{verbatim}
-
- Displays the (geometric) object(s) as given in {\bf Object}.
- {\bf Object} may be any GeometricType or a list of other
- GeometricTypes nested to an arbitrary level.
-
- Unlike {\em 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:
-
- @\begin{verbatim}
- VIEWOBJ( list( view_mat, Axes ) );
- @\end{verbatim}
-
- displays the predefined object {\bf Axes} in the viewing window using the
- viewing matrix VIEW\_MAT.
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{System variables}
- &System variables
-
- System variables are predefined objects in the system. Any time {\em IRIT} is
- executed, these variable are automatically defined and set to values which
- are sometimes machine dependent. These are {\em 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.
-
- @\subsubsection{AXES}
- !AXES
- Predefined polyline object (PolylineType) that describes the $XYZ$ axes.
- $
-
- @\subsubsection{DRAWCTLPT}
- !DRAWCTLPT
- Predefined Boolean variable (NumericType) that controls whether curves'
- control polygons and surfaces' control meshes are drawn (TRUE) or not
- (FALSE). Default is FALSE.
- $
-
- @\subsubsection{FLAT4PLY}
- !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.
- $
-
- @\subsubsection{MACHINE}
- !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.
- $
-
- @\subsubsection{ POLY\_APPROX\_OPT}
- !POLY_APPROX_OPT
- A variable controlling the algorithm to convert surfaces to polygons.
- This two digit number control the method that is used to subdivide a surface
- into polygons.
- The first digit (units) can be one of:
- # 4 2 0 1
- 1
- An alternate 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:
- # 4 2 0 1
- 0
- A fixed sized regular grid. The side of the grid is set
-
- via the RESOLUTION variable.
- 1
- This mode is {\em 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.
-
- {\em Recommended} choice for optimal polygonization.
- 3
- This mode is {\em not} for general use.
- #
- $
-
- @\subsubsection{POLY\_APPROX\_UV}
- !POLY_APPROX_UV
- A Boolean predefined variable. If TRUE, UV values of surface polygonal
- approximation are placed on attribute lists of vertices.
- $
-
- @\subsubsection{POLY\_APPROX\_TOL}
- !POLY_APPROX_TOL
- A numeric predefined tolerance control on the distance between the surface
- and its polygonal approximation in POLY\_APPROX\_OPT settings.
- $
-
- @\subsubsection{PRSP\_MAT}
- !PRSP_MAT
- Predefined matrix object (MatrixType) to hold the perspective matrix
- used/set by VIEW and/or INTERACT commands. See also VIEW\_MAT.
- $
-
- @\subsubsection{RESOLUTION}
- !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.
- $
-
- @\subsubsection{VIEW\_MAT}
- !VIEW_MAT
- Predefined matrix object (MatrixType) to hold the viewing matrix used/set
- by VIEW and/or INTERACT commands. See also PRSP\_MAT.
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{System constants}
- &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:
-
- @\begin{verbatim}
- MAGENTA;
- @\end{verbatim}
-
- @\subsection{AMIGA}
- !AMIGA
- A constant designating an AMIGA system, in the MACHINE variable.
- $
-
- @\subsubsection{APOLLO}
- !APOLLO
- A constant designating an APOLLO system, in the MACHINE variable.
- $
-
- @\subsubsection{BLACK}
- !BLACK
- A constant defining a BLACK color.
- $
-
- @\subsubsection{BLUE}
- !BLUE
- A constant defining a BLUE color.
- $
-
- @\subsubsection{COL}
- !COL
- A constant defining the COLumn direction of a surface or a trivariate mesh.
- $
-
- @\subsubsection{CTLPT\_TYPE}
- !CTLPT_TYPE
- A constant defining an object of type control point.
- $
-
- @\subsubsection{CURVE\_TYPE}
- !CURVE_TYPE
- A constant defining an object of type curve.
- $
-
- @\subsubsection{CYAN}
- !CYAN
- A constant defining a CYAN color.
- $
-
- @\subsubsection{DEPTH}
- !DEPTH
- A constant defining the DEPTH direction of a trivariate mesh.
- See TBEZIER, TBSPLINE.
- $
-
- @\subsubsection{E1}
- !E1
- A constant defining an E1 (X only coordinate) control point type.
- $
-
- @\subsubsection{E2}
- !E2
- A constant defining an E2 (X and Y coordinates) control point type.
- $
-
- @\subsubsection{E3}
- !E3
- A constant defining an E3 (X, Y and Z coordinates) control point type.
- $
-
- @\subsubsection{E4}
- !E4
- A constant defining an E4 control point type.
- $
-
- @\subsubsection{E5}
- !E5
- A constant defining an E5 control point type.
- $
-
- @\subsubsection{FALSE}
- !FALSE
- A zero constant. May be used as Boolean operand.
- $
-
- @\subsubsection{GREEN}
- !GREEN
- A constant defining a GREEN color.
- $
-
- @\subsubsection{HP}
- !HP
- A constant designating an HP system, in the MACHINE variable.
- $
-
- @\subsubsection{IBMOS2}
- !IBMOS
- A constant designating an IBM system running under OS2, in the MACHINE
- variable.
- $
-
- @\subsubsection{IBMNT}
- !IBMNT
- A constant designating an IBM system running under Windows NT, in the MACHINE
- variable.
- $
-
- @\subsubsection{KV\_FLOAT}
- !KV_FLOAT
- A constant defining a floating end condition uniformly spaced knot vector.
- $
-
- @\subsubsection{KV\_OPEN}
- !KV_OPEN
- A constant defining an open end condition uniformly spaced knot vector.
- $
-
- @\subsubsection{KV\_PERIODIC}
- !KV_PERIODIC
- A constant defining a periodic end condition with uniformly spaced knot
- vector.
- $
-
- @\subsubsection{LIST\_TYPE}
- !LIST_TYPE
- A constant defining an object of type list.
- $
-
- @\subsubsection{MAGENTA}
- !MAGENTA
- A constant defining a MAGENTA color.
- $
-
- @\subsubsection{MATRIX\_TYPE}
- !MATRIX_TYPE
- A constant defining an object of type matrix.
- $
-
- @\subsubsection{MSDOS}
- !MSDOS
- A constant designating an MSDOS system, in the MACHINE variable.
- $
-
- @\subsubsection{NUMERIC\_TYPE}
- !NUMERIC_TYPE
- A constant defining an object of type numeric.
- $
-
- @\subsubsection{OFF}
- !OFF
- Synonym of FALSE.
- $
-
- @\subsubsection{ON}
- !ON
- Synonym for TRUE.
- $
-
- @\subsubsection{P1}
- !P2
- A constant defining a P1 (W and WX coordinates, in that order) rational
- control point type.
- $
-
- @\subsubsection{P2}
- !P2
- A constant defining a P2 (W, WX, and WY coordinates, in that order) rational
- control point type.
- $
-
- @\subsubsection{P3}
- !P3
- A constant defining a P3 (W, WX, WY, and WZ coordinates, in that order)
- rational control point type.
- $
-
- @\subsubsection{P4}
- !P4
- A constant defining a P4 rational control
- point type.
- $
-
- @\subsubsection{P5}
- !P5
- A constant defining a P5 rational control
- point type.
- $
-
- @\subsubsection{PARAM\_CENTRIP}
- !PARAM_CENTRIP
- A constant defining a centripetal length parametrization.
- $
-
- @\subsubsection{PARAM\_CHORD}
- !PARAM_CHORD
- A constant defining a chord length parametrization.
- $
-
- @\subsubsection{PARAM\_UNIFORM}
- !PARAM_UNIFORM
- A constant defining an uniform parametrization.
- $
-
- @\subsubsection{PI}
- !PI
- The constant of 3.141592...
- $
-
- @\subsubsection{PLANE\_TYPE}
- !PLANE_TYPE
- A constant defining an object of type plane.
- $
-
- @\subsubsection{POINT\_TYPE}
- !POINT_TYPE
- A constant defining an object of type point.
- $
-
- @\subsubsection{POLY\_TYPE}
- !POLY_TYPE
- A constant defining an object of type poly.
- $
-
- @\subsubsection{RED}
- !RED
- A constant defining a RED color.
- $
-
- @\subsubsection{ROW}
- !ROW
- A constant defining the ROW direction of a surface or a trivariate mesh.
- $
-
- @\subsubsection{SGI}
- !SGI
- A constant designating an SGI system, in the MACHINE variable.
- $
-
- @\subsubsection{STRING\_TYPE}
- !STRING_TYPE
- A constant defining an object of type string.
- $
-
- @\subsubsection{SURFACE\_TYPE}
- !SURFACE_TYPE
- A constant defining an object of type surface.
- $
-
- @\subsubsection{SUN}
- !SUN
- A constant designating a SUN system, in the MACHINE variable.
- $
-
- @\subsubsection{TRIMSRF\_TYPE}
- !TRIMSRF_TYPE
- A constant defining an object of type trimmed surface.
- $
-
- @\subsubsection{TRIVAR\_TYPE}
- !TRIVAR_TYPE
- A constant defining an object of type trivariate function.
- $
-
- @\subsubsection{TRUE}
- !TRUE
- A non zero constant. May be used as Boolean operand.
- $
-
- @\subsubsection{UNDEF\_TYPE}
- !UNDEF_TYPE
- A constant defining an object of no type (yet).
- $
-
- @\subsubsection{UNIX}
- !UNIX
- A constant designating a generic UNIX system, in the MACHINE variable.
- $
-
- @\subsubsection{VECTOR\_TYPE}
- !VECTOR_TYPE
- A constant defining an object of type vector.
- $
-
- @\subsubsection{WHITE}
- !WHITE
- A constant defining a WHITE color.
- $
-
- @\subsubsection{YELLOW}
- !YELLOW
- A constant defining a YELLOW color.
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- @\section{Animation}
- @\label{sec-animation}
- !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.
-
- @\subsection{How to create animation curves in IRIT}
- !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 names:
- # 30 2 1 1
- 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.
-
- The animation curves are all attached as an attribute named "animation"
- to the object OBJ.
-
- Example:
- @\begin{verbatim}
- 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 ) );
- @\end{verbatim}
-
- 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:
- @\begin{verbatim}
- CREPARAM( mov_x, 3.0, 5.0 );
- @\end{verbatim}
-
- 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. For example:
-
- @\begin{verbatim}
- mov_x = cbezier( ctlpt( E1, 0.0 ),
- ctlpt( E1, 1.0 ) );
- attrib(obj1, "animation", list( mov_x ) );
- free(mov_x);
-
- mov_x = cbezier( ctlpt( E1, 2.0 ),
- ctlpt( E1, 3.0 ) );
- attrib(obj2, "animation", list( mov_x ) );
- free(mov_x);
- @\end{verbatim}
-
- @\subsection{A more complete animation example}
- !A more complete animation example
-
- @\begin{verbatim}
- 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 );
- @\end{verbatim}
-
- 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.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- @\section{Display devices}
- !Display devices
-
- The following display device drivers are available,
- # 22 3 0 1
- 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 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 ({\em IRIT})
- using IPC (inter process communication). On Unix and Window NT sockets are
- used. A Windows NT client can talk to a server ({\em 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.
-
- The server ({\em 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:
-
- @\begin{verbatim}
- setenv IRIT_DISPLAY xgldrvs -s-
- @\end{verbatim}
-
- The display device must be in a directory that is in the {\bf 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:
-
- @\begin{verbatim}
- xgldrvs -s solid1.dat irit.mat
- @\end{verbatim}
-
- Effectively, all the display devices are also data display programs
- (poly3d, which was the display program prior to version 4.0, is retired
- in 4.0). 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 {\em IRIT}, but will not cause {\em IRIT} to
- quit as might logically expected. In fact, the next time {\em 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.):
-
- @\begin{itemize}
- @\item
- {\bf COLOR}: Selects the drawn color of the object to be one of the 8/16
- predefined colors in the {\em IRIT} system: white, red, green, blue,
- yellow, cyan, magenta, black.
- {\bf RGB}: Overwrites (if supported) the COLOR attribute (if given) and
- sets the color of the object to the exact prescribed RGB set.
- {\bf DWIDTH}: Sets the width in pixels of the drawn object, when drawn as
- a wireframe.
- @\end{itemize}
-
- 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 xgldrvs can render shaded models, and so only it will
- honor a {\bf DrawSolid} configuration options.
-
- @\subsection{Command Line Options}
- !Command Line Options
-
- @\begin{verbatim}
- ???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]
- [-f PolylineOpti SampPerCrv] [-l LineWidth] [-r] [-B] [-2]
- [-d] [-D] [-L NormalLen] [-4] [-b BackGround] [-S LgtSrcPos]
- [-Z ZMin ZMax] [-M] [-P] [-x ExecAnim] [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -s}: Runs the driver in a Standalone mode. Otherwise, the driver will
- attempt to communicate with the {\em IRIT} server.
- @\item
- {\bf -u}: Forces a Unit matrix. That is, input data are {\em not}
- transformed at all.
- @\item
- {\bf -n}: Draws normals of vertices.
- @\item
- {\bf -N}: Draws normals of polygons.
- @\item
- {\bf -i}: Draws internal edges (created by {\em IRIT}) - default is not to
- display them, and this option will force displaying them as well.
- @\item
- {\bf -c}: Sets depth cueing on. Drawings that are closer to the viewer will
- be drawn in more intense color.
- @\item
- {\bf -C}: Cache the piecewise linear geometry so curves and surface can
- be redisplay faster. Purging it will free memory, on the other hand.
- @\item
- {\bf -m}: Provides some more information on the data file(s) parsed.
- @\item
- {\bf -a}: Sets the support of antialiased lines.
- @\item
- {\bf -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.
- @\item
- {\bf -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.
- @\item
- {\bf -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.
- @\item
- {\bf -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.
- @\item
- {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
- into polylines. If PolyOpti == 0, equally spaced intervals are used.
- Otherwise, an adaptive subdivision that optimizes the samples is
- employed.
- @\item
- {\bf -l LineWidth}: Sets the linewidth, in pixels. Default is one pixel wide.
- @\item
- {\bf -r}: Rendered mode. Draws object as solid.
- @\item
- {\bf -B}: Back face culling of polygons.
- @\item
- {\bf -2}: Double buffering. Prevents screen flicker on the expense of
- possibly less colors.
- @\item
- {\bf -d}: Debug objects. Prints to stderr all objects read from communcation
- port with the server {\em IRIT}.
- @\item
- {\bf -D}: Debug input. Prints to stderr all characters read from communcation
- port with the server {\em IRIT}. Lowest level of communication.
- @\item
- {\bf -L NormalLen}: Sets the length of the drawn normals in thousandths of
- a unit.
- @\item
- {\bf -4}: Forces four polygons per almost flat region in the surface to
- polygon conversion. Otherwise two polygons only.
- @\item
- {\bf -b BackGround}: Sets the background color as three RGB integers in the
- range of 0 to 255.
- @\item
- {\bf -S LgtSrcPos}: Sets the lighting via the light source position.
- @\item
- {\bf -Z ZMin ZMax}: Sets the near and far Z clipping planes.
- @\item
- {\bf -M}: Draw control mesh/polygon of curves and surfaces, as well.
- @\item
- {\bf -x ExecAnim}: 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.
- @\item
- {\bf -P}: Draws curves and surfaces (surfaces are drawn using a set of
- isocurves, see -I, or polygons, see -f).
- @\item
- {\bf -z}: Prints version number and current defaults.
- @\end{itemize}
-
- @\subsection{Configuration Options}
- !Configuration Options
-
- The configuration file is read {\em before} the command line options are
- processed. Therefore, all options in this section can be overriden
- by the appropriate command line option, if any.
-
- @\begin{itemize}
- @\item
- {\bf TransPrefPos:} Preferred location (Xmin, YMin, Xmax, Ymax) of the
- transformation window.
- @\item
- {\bf ViewPrefPos:} Preferred location (Xmin, YMin, Xmax, Ymax) of the
- viewing window.
- @\item
- {\bf BackGround:} Background color. Same as '-b'.
- @\item
- {\bf Internal:} Draws internal edges. Same as '-i'.
- @\item
- {\bf DrawVNormal:} Draws normals of vertices. Same as '-n'.
- @\item
- {\bf DrawPNormal:} Draws normals of polygons. Same as '-n'.
- @\item
- {\bf MoreVerbose:} Provides some more information on the data file(s)
- parsed. Same as '-m'.
- @\item
- {\bf UnitMatrix:} Forces a Unit matrix. That is, input data are {\em not}
- transformed at all. Same as '-u'.
- @\item
- {\bf DrawSolid:} Requests a shaded surface rendering, as opposed to isocurve
- surface representation.
- @\item
- {\bf BFaceCull:} Requests the removal of back facing polygons, for better
- visibility.
- @\item
- {\bf DoubleBuffer:} Requests drawing using a double buffer, if any.
- @\item
- {\bf NumOfIsolines:} Specifies number of isolines per surface, per
- direction. Same as '-I'.
- @\item
- {\bf SamplesPerCurve:} Specifies the samples per (iso)curve. See '-f'.
- @\item
- {\bf PolylineOpti:} Controls the method used to subdivide a curve into
- polylines that approximate it. See '-f'.
- @\item
- {\bf LineWidth:} Sets the linewidth, in pixels. Default is one pixel
- wide. Same as '-l'
- @\item
- {\bf AdapIsoDir:} Selects the direction of the adaptive isoline
- rendering.
- @\item
- {\bf FineNess:} Controls the fineness of the surface to polygon subdivision.
- See '-F'.
- @\item
- {\bf PolygonOpti:} Controls the method used to subdivide a surface into
- polygons that approximate it. See '-F'.
- @\item
- {\bf DepthCue:} Set depth cueing on. Drawings that are closer to the
- viewer will be drawn in more intense color. Same as '-c'.
- @\item
- {\bf FourPerFlat:} Forces four polygons per almost flat region in the
- surface to polygon conversion. Otherwise two polygons only. Same as
- '-4'.
- @\item
- {\bf AntiAlias:} Request the drawing of anti aliased lines.
- @\item
- {\bf DrawSurfaceMesh:} Draws control mesh/polygon of curves and surfaces,
- as well. Same as '-M'.
- @\item
- {\bf DrawSurfacePoly:} Draws curves and surfaces (surfaces are drawn using
- a set of isocurves, see -I, or polygons, see -f). Same as '-P'.
- @\item
- {\bf StandAlone:} Runs the driver in a Stand alone mode. Otherwise, the
- driver will attempt to communicate with the {\em IRIT} server. Same
- as '-s'.
- @\item
- {\bf TransMode:} Selects between object space transformations and screen
- space transformation.
- @\item
- {\bf ViewMode:} Selects between perspective and orthographic views.
- @\item
- {\bf NormalLength:} Sets the length of the drawn normals in thousandths of
- a unit. Same as '-L'.
- @\item
- {\bf DebugObjects:} Debug objects. Prints to stderr all objects read
- from the communcation port with the server {\em IRIT}. Same as '-d'.
- @\item
- {\bf DebugEchoInput:} Debug input. Prints to stderr all characters read
- from the communcation port with the server {\em IRIT}. Lowest level of
- communications.
- @\item
- {\bf LightSrcPos:} Sets the location of the (first) light source as a rational
- four coefficient location. W of zero sets the light source at infinity.
- @\end{itemize}
-
- @\subsection{Interactive mode setup}
- !Interactive mode setup
-
- Commands that affect the status of the display device can also be sent
- via the communication port with the {\em IRIT} server. The following commands
- are recognized as string objects with object name of "COMMAND\_":
- # 20 2 0 1
- {\bf BEEP}
- Makes some sound.
- {\bf CLEAR}
- Clears the display area. All objects are deleted.
- {\bf DCLEAR}
- Delayed clear. Same as CLEAR but delayed until next
-
- object is sent from the server. Useful for animation.
- {\bf DISCONNECT}
- Closes connection with the server, but does not quit.
- {\bf EXIT}
- Closes connection with the server and quits.
- {\bf GETOBJ NAME}
- Requests the object named NAME that is returned in the
-
- output channel to the server.
- {\bf MSAVE NAME}
- Saves the transformation matrix file by the name NAME.
- {\bf REMOVE NAME}
- Request the removal of object named NAME from display.
- {\bf ANIMATE TMin TMax Dt}
- Animates current scene from TMin to TMax in Dt steps.
- {\bf STATE COMMAND}
- Changes the state of the display device. See below.
- #
- The following commands are valid for the STATE COMMAND above,
- # 16 2 0 1
- {\bf MoreSense:}
- More sensitive mouse control.
- {\bf LessSense:}
- Less sensitive mouse control.
- {\bf ScrnObject:}
- Toggle screen/object transformation mode.
- {\bf PerspOrtho:}
- Toggles perspective/orthographic trans. mode.
- {\bf DepthCue:}
- Toggles depth cueing drawing.
- {\bf DrawSolid:}
- Toggles isocurve/shaded solid drawing.
- {\bf BFaceCull:}
- Cull back facing polygons.
- {\bf DblBuffer:}
- Toggles single/double buffer mode.
- {\bf AntiAlias:}
- Toggles anti aliased lines.
- {\bf DrawIntrnl:}
- Toggles drawing of internal lines.
- {\bf DrawVNrml:}
- Toggles drawing of normals of vertices.
- {\bf DrawPNrml:}
- Toggles drawing of normals of polygons.
- {\bf DSrfMesh:}
- Toggles drawing of control meshes/polygons.
- {\bf DSrfPoly:}
- Toggles drawing of curves/surfaces.
- {\bf 4PerFlat:}
- Toggles 2/4 polygons per flat surface regions.
- {\bf MoreIso:}
- Doubles the number of isolines in a surface.
- {\bf LessIso:}
- Halves the number of isolines in a surface.
- {\bf FinrAprx:}
- Doubles the number of samples per curve.
- {\bf CrsrAprx:}
- Halves the number of samples per curve.
- {\bf LngrVecs:}
- Doubles the length of displayed normal vectors.
- {\bf ShrtrVecs:}
- Halves the length of displayed normal vectors.
- {\bf WiderLns:}
- Doubles the width of the drawn lines.
- {\bf NarrwLns:}
- Halves the width of the drawn lines.
- {\bf FinrAdapIso:}
- Doubles the number of adaptive isocurves.
- {\bf CrsrAdapIso:}
- Halves the number of adaptive isocurves.
- {\bf FinerRld:}
- Doubles number of ruled surfaces in adaptive isocurves.
- {\bf CrsrRld:}
- Halves number of ruled surfaces in adaptive isocurves.
- {\bf RuledSrfApx:}
- Toggles ruled surface approx. in adaptive isocurves.
- {\bf AdapIsoDir:}
- Toggles the row/col direction of adaptive isocurves.
- {\bf Front:}
- Selects a front view.
- {\bf Side:}
- Selects a side view.
- {\bf Top:}
- Selects a top view.
- {\bf Isometry:}
- Selects an isometric view.
- {\bf Clear:}
- Clears the viewing area.
- #
- Obviously not all state options are valid for all drivers.
- The {\em 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 {\em IRIT}
- server, modes can be interactively modified on most of the display devices
- using a pop-up menu that is activated using the {\em 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.
-
- @\subsection{Animation Mode}
- !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
- @(Section~\ref{sec-animation}).
-
- 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.
-
- @\subsection{Specific Comments}
- !Specific Comments
-
- @\begin{itemize}
- @\item
- The x11drvs supports the following X Defaults (searched at ~/.Xdefaults):
- @\begin{verbatim}
- #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
- @\end{verbatim}
- @\item
- 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/object translation, depth
- cue on/off, orthographic/perspective projection, wireframe/solid display,
- single/doubble buffering, showing/hiding normals, including/excluding
- surface mesh, surface isolines/polygons, and four/two per flat. Xglmdrvs
- allowes inclusion/exclusion of internal edges, and in xmtdrvs pro/anti
- aliasing. Scales set normals length, lines width, buttons sensitivity,
- the number of islolines and samples.
- @\item
- 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.
- @\item
- In os2drvs, only -G is used to specify the dimensions of the parent window
- that holds both the viewing and the transformation window.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- @\section{Utilities - General Usage}
- !Utilities - General Usage
-
- The {\em 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:
-
- @\begin{verbatim}
- poly3d-h solid1.dat | irit2ps - > solid1.ps
- @\end{verbatim}
-
- 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 {\em last}
- transformation matrices found (VIEW\_MAT and PRSP\_MAT) are actually used.
-
- Example:
-
- @\begin{verbatim}
- poly3d-h solid1.dat | x11drvs solid1.dat - solid1.mat
- @\end{verbatim}
-
- 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 {\em automatically}
- uncompressed on read and write. The following is legal under unix,
-
- @\begin{verbatim}
- poly3d-h solid1.dat.Z | x11drvs solid1.dat.Z - solid1.mat
- @\end{verbatim}
-
- where solid1.dat.Z was saved from within IRIT using the command
-
- @\begin{verbatim}
- save( "solid1.dat.Z", solid1 );
- @\end{verbatim}
-
- 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.
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- @\section{poly3d-h - Hidden Line Removing Program}
- !poly3d-h - Hidden Line Removing Program
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
- @\subsection{Introduction}
- &Introduction
-
- poly3d-h is a program to remove hidden lines from a given polygonal model.
- Freeform objects are preprocessed into polygons with controlled fineness.
- @See Figure~\ref{fig-poly3dh} for some output examples of using this tool.
- @\begin{figure}
- @\vspace{4.3in}
- @\special{psfile=user_man/solid2h.ps hscale=50 vscale=50 hoffset=-20 voffset=50}
- @\special{psfile=user_man/molecule.ps hscale=50 vscale=50 hoffset=130 voffset=-40}
- @\special{psfile=user_man/dodechdr.ps hscale=50 vscale=50 hoffset=240 voffset=80}
- @\caption{Some examples of the use of hidden line removal tool poly3d-h to
- @ remove hidden lines.}
- @\label{fig-poly3dh}
- @\end{figure}
-
- 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 {\em IRIT} one can
- ensure that a model consists of convex polygons only using the CONVEX command:
- @\begin{verbatim}
- CnvxObj = convex( Obj );
- @\end{verbatim}
- 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 {\em IRIT} data
- file that can be viewed using any of the display devices, for example.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- poly3d-h [-b] [-m] [-i] [-e #Edges] [-H] [-4] [-W Width]
- [-F PolyOpti FineNess] [-q] [-o OutName] [-c] [-z] DFiles > OutFile
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -b}: BackFacing - if an object is closed (such as most models created by
- {\em IRIT}), back facing polygons can be deleted, therefore speeding up
- the process by at least a factor of two.
- @\item
- {\bf -m}: More - provides some more information on the data file(s) parsed.
- @\item
- {\bf -i}: Internal edges (created by {\em IRIT}) - default is not to
- display them, and this option will force displaying them as well.
- @\item
- {\bf -e n}: Number of edges to use from each given polygon (default all).
- Handy as '-e 1 -4' for freeform data.
- @\item
- {\bf -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.
- @\item
- {\bf -4}: Forces four polygons per almost flat region in the surface to
- polygon conversion. Otherwise two polygons only.
- @\item
- {\bf -W Width}: Selects a default width for visible lines in inches.
- @\item
- {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
- surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
- FineNess. See also -4.
- @\item
- {\bf -q}: Quiet mode. No printing aside from fatal errors. Disables -m.
- @\item
- {\bf -o OutName}: Name of output file. Default is stdout.
- @\item
- {\bf -z}: Prints version number and current defaults.
- @\item
- {\bf -c}: Clips data to screen (default). If disabled ('-c-'), data
- outside the view screen ([-1, 1] in x and y) are also processed.
- @\end{itemize}
-
- Some of the options may be turned on in poly3d-h.cfg. They can be then
- turned off in the command line as '-?-'.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Configuration}
- &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.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &Usage
-
- As this program is not interactive, usage is quite simple, and the only
- control available is using the command line options.
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- @\section{poly3d-r - A Simple Data Rendering Program}
- !poly3d-r - A Simple Data Rendering Program
-
- Retired. Sources can be found in the contrib directory, but this program is
- no longer supported. A new renderer is expected soon.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Illustrt - Simple line illustration filter}
- !Illustrt - Simple line illustration filter
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- @\subsection{Introduction}
- &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.
-
- @See Figure~\ref{fig-illustrt} for some output examples of using this tool.
- @\begin{figure}
- @\vspace{3in}
- @\special{psfile=user_man/solid1.ps hscale=50 vscale=50 hoffset=0 voffset=-50}
- @\special{psfile=user_man/icosahdr.ps hscale=50 vscale=50 hoffset=220 voffset=-50}
- @\caption{Some examples of the use of the illustration tool illustrt.}
- @\label{fig-illustrt}
- @\end{figure}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- illustrt [-I #IsoLines] [-S #SampPerCrv] [-s] [-M] [-P] [-p]
- [-l MaxLnLen] [-a] [-t TrimInter] [-o OutName] [-Z InterSameZ]
- [-m] [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -I \#IsoLines}: Specifies number of isolines per surface, per direction.
- @\item
- {\bf -S \#SampPerCrv}: Specifies the samples per (iso)curve.
- @\item
- {\bf -s}: sorts the data in Z depth order that emulates hidden line removal
- once the data are drawn.
- @\item
- {\bf -M}: Dumps the control mesh/polygon as well.
- @\item
- {\bf -P}: Dumps the curve/surface as isocurves.
- @\item
- {\bf -p}: Dumps vertices of polygons/lines as points.
- @\item
- {\bf -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.
- @\item
- {\bf -a}: takes into account the angle between the two (poly)lines that
- intersect when computing how much to trim. See also -t.
- @\item
- {\bf -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.
- @\item
- {\bf -o OutName}: Name of output file. Default is stdout.
- @\item
- {\bf -Z InterSameZ}: The maximal Z depth difference of intersection curves
- to be be considered invalid.
- @\item
- {\bf -m}: More talkative mode. Prints processing information.
- @\item
- {\bf -z}: Prints version number and current defaults.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &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:
-
- @\begin{verbatim}
- illustrt -s -l 0.1 solid1.dat | irit2ps -W 0.05 -d 0.2 0.6 -u - > solid.ps
- @\end{verbatim}
-
- 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 {\em IRIT} data files, so output can be handled
- like any other data set. illustrt does the following processing to the input
- data set:
-
- @\begin{itemize}
- @\item
- 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.
- @\item
- 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.
- @\item
- 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.
- @\item
- Generates vertices of polygons in the input data set as points in output data
- controlled via the '-p' flag.
- set.
- @\item
- 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.
- @\end{itemize}
-
- Here is a more complex example. Make sure tubular is properly set via
- "attrib(solid1, "tubular", 0.7);" and invoke:
-
- @\begin{verbatim}
- 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
- @\end{verbatim}
-
- 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,Length,Distance,LengthRandom,DistanceRandom,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,Length,Distance,LengthRandom,DistanceRandom,Width".
- Examples:
-
- @\begin{verbatim}
- 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");
- @\end{verbatim}
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Dat2Bin - Data To Binary Data file filter}
- !DAT2BIN - Data To Binary Data file filter
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- dat2bin [-t] [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -t}: Dumps data to stdout as text instead of binary.
- {\bf -z}: Print version number and current defaults.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &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:
-
- @\begin{verbatim}
- dat2bin b58polys.dat > b58polys.bdt
- dat2bin -t b58polys.bdt | more
- @\end{verbatim}
-
- 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
- {\em illegal}:
-
- @\begin{verbatim}
- dat2bin b58polys.dat | xglmdrvs -
- @\end{verbatim}
-
- 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.
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Dat2Irit - Data To IRIT file filter}
- !DAT2IRIT - Data To IRIT file filter
-
- Converts '.dat' and '.bdt' data files to '.irt' {\em IRIT} scripts.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- dat2irit [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -z}: Print version number and current defaults.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &Usage
-
- It may be sometimes desired to convert .dat data files into a form that
- can be fed back to {\em IRIT} - a '.irt' file. This filter does exactly that.
-
- Example:
-
- @\begin{verbatim}
- dat2irit b58.dat > b58-new.irt
- @\end{verbatim}
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Dxf2Irit - DXF (Autocad) To IRIT filter}
- !DXF2IRIT - DXF (Autocad) To IRIT filter
-
- Due to lack of real documentation on the DXF format (for surfaces), this
- filter is not really complete. It only work for polygons, and is provided
- here only for those desperate enough to try and fix it...
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Irit2Dxf - IRIT To DXF (Autocad) filter}
- !IRIT2DXF - IRIT To DXF (Autocad) filter
-
- Due to lack of real documentation on the DXF format (for surfaces), this
- filter is not really complete. It works only for polygons, and is provided
- here only for those desperate enough to try and fix it...
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Irit2Iv - IRIT To SGI's Inventor filter}
- !IRIT2IV - IRIT To SGI's Inventor filter
-
- IV is the format used by the Inventor modeling/rendering package from SGI.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- irit2iv [-l] [-4] [-P] [-F PolyOpti FineNess] [-f PolyOpti SampPerCrv]
- [-T] [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -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.
- @\item
- {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
- @\item
- {\bf -P}: Polygonize freeform shapes. Default is to leave freeform curves
- and surfaces as is.
- @\item
- {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
- surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
- FineNess. See also -4.
- @\item
- {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
- into polylines. If PolyOpti == 0, equally spaced intervals are used.
- Otherwise, an adaptive subdivision that optimizes the samples is
- employed.
- @\item
- {\bf -T}: Talkative mode. Prints processing information.
- @\item
- {\bf -z}: Prints version number and current defaults.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &Usage
-
- Irit2Iv converts freeform surfaces and polygons into polygons and
- saved in iv Inventor's ascii file format.
-
- Example:
-
- @\begin{verbatim}
- irit2iv solid1.dat > solid1.iv
- @\end{verbatim}
-
- Surfaces are converted to polygons with fineness control:
-
- @\begin{verbatim}
- irit2iv -F 0 16 - view.mat < saddle.dat > saddle.iv
- @\end{verbatim}
-
- Note the use of '-' for stdin.
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Irit2Nff - IRIT To NFF filter}
- !IRIT2NFF - IRIT To NFF filter
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- irit2nff [-l] [-4] [-c] [-F PolyOpti FineNess] [-o OutName] [-T] [-g]
- [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -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.
- @\item
- {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
- @\item
- {\bf -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.
- @\item
- {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
- surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
- FineNess. See also -4.
- @\item
- {\bf -o OutName}: Name of output file. By default the name of the first data
- file from the {\em DFiles} list is used. See below on the output files.
- @\item
- {\bf -g}: Generates the geometry file only. See below.
- @\item
- {\bf -T}: Talkative mode. Prints processing information.
- @\item
- {\bf -z}: Prints version number and current defaults.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &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:
-
- @\begin{verbatim}
- irit2nff -c -l -F 0 8 b58.dat
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- irit2nff -c -l -g -F 0 64 b58.dat
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- xgldrvs b58.dat
- irit2nff -l -F 0 32 b58.dat irit.mat
- @\end{verbatim}
-
- where irit.mat is the viewing matrix created by xgldrvs.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Advanced Usage}
- &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
- {\em IRIT}. See also the ATTRIB {\em IRIT} command.
-
- If a certain surface should be finer than the rest of the scene, one can
- set a "resolution" attribute which specifies the {\em relative} FineNess
- resolution of this specific surface.
-
- Example:
-
- @\begin{verbatim}
- attrib( srf1, "resolution", 2 );
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- attrib( srf1, "kd", 0.3 );
- attrib( srf1, "shine", 30 );
- @\end{verbatim}
-
- Surface color is controlled in two levels. If the object has an RGB
- attribute, it is used. Otherwise, a color, as set via the {\em IRIT} COLOR
- command, is used if set.
-
- Example:
-
- @\begin{verbatim}
- attrib( tankBody, "rgb", "244,164,96" );
- @\end{verbatim}
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Irit2Plg - IRIT To PLG (REND386) filter}
- !IRIT2PLG - IRIT To PLG (REND386) filter
-
- PLG is the format used by the rend386 real time renderer for the IBM PC.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- irit2plg [-l] [-4] [-F PolyOpti FineNess] [-T] [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -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.
- @\item
- {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
- @\item
- {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
- surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
- FineNess. See also -4.
- @\item
- {\bf -T}: Talkative mode. Prints processing information.
- @\item
- {\bf -z}: Prints version number and current defaults.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &Usage
-
- Irit2Plg converts freeform surfaces and polygons into polygons in a
- format that can be used by the REND386 renderer.
-
- Example:
-
- @\begin{verbatim}
- irit2plg solid1.dat > solid1.plg
- @\end{verbatim}
-
- Surfaces are converted to polygons with fineness control:
-
- @\begin{verbatim}
- irit2plg -F 0 16 - view.mat < saddle.dat > saddle.plg
- @\end{verbatim}
-
- Note the use of '-' for stdin.
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Irit2Ps - IRIT To PS filter}
- !IRIT2PS - IRIT To PS filter
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- irit2ps [-l] [-4] [-s Size] [-I #UIso[:#VIso[:#WIso]]] [-F PolyOpti FineNess]
- [-f PolyOpti SampPerCrv] [-M] [-G] [-P] [-W LineWidth]
- [-w WidenLen WidenWidth] [-b R G B] [-c] [-C] [-T] [-i] [-o OutName]
- [-d [Zmin Zmax]] [-D [Zmin Zmax]] [-p PtType PtSize] [-u] [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -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.
- @\item
- {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
- @\item
- {\bf -s Size}: Controls the size of the postscript output in inches.
- Default is to fill the entire screen.
- @\item
- {\bf -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.
- @\item
- {\bf -F PolygonOpti FineNess}: Optimality of polygonal approximation of
- surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
- FineNess. See also -4.
- @\item
- {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
- into polylines. If PolyOpti == 0, equally spaced intervals are used.
- Otherwise, an adaptive subdivision that optimizes the samples is
- employed.
- @\item
- {\bf -M}: Dumps the control mesh/polygon as well.
- @\item
- {\bf -G}: Dumps the curve/surface (as freeform geometry). Default. See -I,
- -C, -f for control on polyline approximation.
- @\item
- {\bf -P}: Dumps the curve/surface (as polygons). See -F, -l, -4 for control
- on polygonal approximation.
- @\item
- {\bf -W \#LineWidth}: Sets the line drawing width in inches. Default is
- as thin as possible. This option will overwrite only those objects
- that do {\em 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.
- @\item
- {\bf -w WidenLen WidenWidth}: If end points of polylines should be made
- wider, and if so to what width.
- @\item
- {\bf -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.
- @\item
- {\bf -c}: Creates a {\em color} postscript file.
- @\item
- {\bf -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.
- @\item
- {\bf -T}: Talkative mode. Prints processing information.
- @\item
- {\bf -i}: Internal edges (created by {\em IRIT}) - the default is not to
- display them, and this option will force displaying them as well.
- @\item
- {\bf -o OutName}: Name of output file. Default is stdout.
- @\item
- {\bf -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.
- @\item
- {\bf -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.
- @\item
- {\bf -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.
- @\item
- {\bf -u}: Forces a unit matrix transformation, i.e. no transformation.
- @\item
- {\bf -z}: Prints version number and current defaults.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &Usage
-
- Irit2Ps converts freeform surfaces and polygons into a postscript file.
-
- Example:
-
- @\begin{verbatim}
- irit2ps solid1.dat > solid1.ps
- @\end{verbatim}
-
- Surfaces are converted to polygons with fineness control:
-
- @\begin{verbatim}
- irit2ps -f 0 32 -c -W 0.01 saddle.dat > saddle.ps
- @\end{verbatim}
-
- creates a postscript file for the saddle model, in color, and with
- lines 0.01 inch thick.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Advanced Usage}
- &Advanced Usage
-
- One can specify several attributes that affect the way the postscript
- file is generated. The attributes can be generated within {\em IRIT}.
- See also the ATTRIB {\em 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:
-
- @\begin{verbatim}
- attrib( srf1, "width", 0.02 );
- @\end{verbatim}
-
- 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, with a value equal to the gray level desired.
-
- Example:
-
- @\begin{verbatim}
- attrib( poly, "fill", 0.5 );
- @\end{verbatim}
-
- will fill poly with \%50 gray.
-
- If an object, a polygon for example, needs to be painted in a gray level
- instead of black, a "gray" attribute should be set, with a value equal
- to the gray level desired.
-
- Example:
-
- @\begin{verbatim}
- attrib( poly, "gray", 0.5 );
- @\end{verbatim}
-
- will draw 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.
-
- @\begin{verbatim}
- attrib( poly, "dash", "[0.006 0.0015 0.001 0.0015] 0" );
- @\end{verbatim}
-
- 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 {\em IRIT} COLOR command is used.
-
- Example:
-
- @\begin{verbatim}
- attrib( Ball, "rgb", "255,0,0" );
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- attrib( final, "tubular", 0.7 );
- @\end{verbatim}
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Irit2Ray - IRIT To RAYSHADE filter}
- !IRIT2RAY - IRIT To RAYSHADE filter
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- irit2ray [-l] [-4] [-G GridSize] [-F PolyOpti FineNess]
- [-f PolyOpti SampPerCrv] [-o OutName] [-g] [-p Zmin Zmax] [-P]
- [-M] [-T] [-I #UIso[:#VIso[:#WIso]]] [-s ObjSeq#] [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -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.
- @\item
- {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
- @\item
- {\bf -G GridSize}: Usually objects are grouped as {\em lists} of polygons.
- This flags will coerce the usage of the RAYSHADE {\em grid} structure,
- with {\em GridSize} being used as the grid size along the object
- bounding box's largest dimension.
- @\item
- {\bf -F PolygonOpti FineNess}: Optimality of polygonal approximation of
- surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
- FineNess. See also -4.
- @\item
- {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
- into polylines. If PolyOpti == 0, equally spaced intervals are used.
- Otherwise, an adaptive subdivision that optimizes the samples is
- employed.
- @\item
- {\bf -o OutName}: Name of output file. By default the name of the first data
- file from the {\em DFiles} list is used. See below on the output
- files.
- @\item
- {\bf -g}: Generates the geometry file only. See below.
- @\item
- {\bf -p Zmin Zmax}: Sets the ratios between the depth cue and the width of
- the dumped {\em polylines}. See also -P. Closer lines will be drawn
- wider.
- @\item
- {\bf -P}: Forces dumping polygons as polylines with thickness controlled
- by -p.
- @\item
- {\bf -M}: If -P (see -P and -p) then converts the control mesh/polygon
- to polylines which are represented as a sequence of truncated
- cones.
- @\item
- {\bf -T}: Talkative mode. Prints processing information.
- @\item
- {\bf -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.
- @\item
- {\bf -s ObjSeq\#}: Sets object sequence number if no object name. Default 1.
- @\item
- {\bf -z}: Prints version number and current defaults.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &Usage
-
- Irit2Ray converts freeform surfaces into polygons in a format that can
- be used by RAYSHADE. 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:
-
- @\begin{verbatim}
- irit2ray -l -F 0 8 b58.dat
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- RAYSHADE -p -W 256 256 b58.ray > b58.rle
- @\end{verbatim}
-
- Once done with parameter setting for RAYSHADE, a fine approximation of the
- model can be created with:
-
- @\begin{verbatim}
- irit2ray -l -g -F 0 64 b58.dat
- @\end{verbatim}
-
- 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
-
- @\begin{verbatim}
- irit2ray -G 5 -P -p -0.0 0.5 solid1.dat
- @\end{verbatim}
-
- 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
-
- @\begin{verbatim}
- irit2ray -G 5 -P -p -0.1 1.0 saddle.dat
- @\end{verbatim}
-
- which dumps the isolines extracted from the saddle surface with varying
- thickness.
-
- Each time a data file is saved in {\em IRIT}, it can be saved with the
- viewing matrix of the last INTERACT by saving the VIEW\_MAT object as well.
- I.e.:
-
- @\begin{verbatim}
- save( "b58", b58 );
- @\end{verbatim}
-
- However one can overwrite the viewing matrix by appending a new matrix
- in the end of the command line, created by the display devices:
-
- @\begin{verbatim}
- os2drvs b58.dat
- irit2ray -l -F 0 16 b58.dat irit.mat
- @\end{verbatim}
-
- 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.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Advanced Usage}
- &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
- {\em IRIT}. See also the ATTRIB {\em IRIT} command.
-
- If a certain surface should be finer than the rest of the scene, one can
- set a "resolution" attribute which specifies the {\em relative} FineNess
- resolution of this specific surface.
-
- Example:
-
- @\begin{verbatim}
- attrib( srf1, "resolution", 2 );
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- attrib( srf1, "transp", "0.3" );
- attrib( srf1, "texture", "wood" );
- @\end{verbatim}
-
- Surface color is controlled in two levels. If the object has an RGB
- attribute, it is used. Otherwise a color as set via the {\em IRIT} COLOR
- command is being used if set.
-
- Example:
-
- @\begin{verbatim}
- attrib( tankBody, "rgb", "244,164,96" );
- @\end{verbatim}
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Irit2Scn - IRIT To SCENE (RTrace) filter}
- !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.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- irit2scn [-l] [-4] [-F PolyOpti FineNess] [-o OutName] [-g] [-T] [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -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.
- @\item
- {\bf -4}: Four - Generates four polygons per flat patch.
- @\item
- {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
- surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
- FineNess. See also -4.
- @\item
- {\bf -o OutName}: Name of output file. By default the name of the first data
- file from {\em DFiles} list is used. See below on the output files.
- @\item
- {\bf -g}: Generates the geometry file only. See below.
- @\item
- {\bf -T}: Talkative mode. Prints processing information.
- @\item
- {\bf -z}: Prints version number and current defaults.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &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:
-
- @\begin{verbatim}
- irit2scn -l -F 0 8 b58.dat
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- irit2scn -l -g -F 0 64 b58.dat
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- wntdrvs b58.dat
- irit2scn -l -F 0 8 b58.dat irit.mat
- @\end{verbatim}
-
- 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.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Advanced Usage}
- &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
- {\em IRIT}. See also the ATTRIB {\em IRIT} command.
-
- If a certain surface should be finer than the rest of the scene, one can
- set a "resolution" attribute which specifies the {\em relative} FineNess
- resolution of this specific surface.
-
- Example:
-
- @\begin{verbatim}
- attrib( srf1, "resolution", 2 );
- @\end{verbatim}
-
- 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:
-
- @\begin{verbatim}
- attrib( srf1, "SCNrefraction", 0.3 );
- @\end{verbatim}
-
- Surface color is controlled in two levels. If the object has an RGB
- attribute, it is used. Otherwise a color as set via {\em IRIT} COLOR command
- is used if set.
-
- Example:
-
- @\begin{verbatim}
- attrib( tankBody, "rgb", "244,164,96" );
- @\end{verbatim}
- $
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Irit2Xfg - IRIT To XFIG filter}
- !IRIT2Xfg - IRIT To XFIG filter
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Command Line Options}
- &Command line options
-
- @\begin{verbatim}
- irit2xfg [-s Size] [-t XTrans YTrans] [-I #UIso[:#VIso[:#WIso]]]
- [-f PolyOpti SampPerCrv] [-F PolyOpti FineNess] [-M] [-G] [-T]
- [-i] [-o OutName] [-z] DFiles
- @\end{verbatim}
-
- @\begin{itemize}
- @\item
- {\bf -s Size}: Size in inches of the page. Default is 7 inches.
- @\item
- {\bf -t XTrans YTrans}: X and Y translation. of the image. Default is (0, 0).
- @\item
- {\bf -I \#UIso[:\#VIso]}: Specifies the number of isolines per surface, per
- direction. If \#VIso is not specified, \#UIso is used for \#VIso as
- well.
- @\item
- {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
- into polylines. If PolyOpti == 0, equally spaced intervals are used.
- Otherwise, an adaptive subdivision that optimizes the samples is
- employed.
- @\item
- {\bf -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.
- @\item
- {\bf -M}: Dumps the control mesh/polygon as well.
- @\item
- {\bf -G}: Dumps the freeform geometry.
- @\item
- {\bf -T}: Talkative mode. Prints processing information.
- @\item
- {\bf -i}: Internal edges (created by {\em IRIT}) - default is not to
- display them, and this option will force displaying them as well.
- @\item
- {\bf -o OutName}: Name of output file. By default the name of the first data
- file from {\em DFiles} list is used. See below on the output files.
- @\item
- {\bf -z}: Prints version number and current defaults.
- @\end{itemize}
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\subsection{Usage}
- &Usage
-
- Irit2Xfg converts freeform surfaces and polygons into polylines in a format
- that can be used by XFIG.
-
- Example:
-
- @\begin{verbatim}
- irit2Xfg -l -f 0 16 saddle.dat > saddle.xfg
- @\end{verbatim}
-
- However, one can overwrite the viewing matrix by appending a new matrix
- in the end of the command line, created by the display devices:
-
- @\begin{verbatim}
- x11drvs b58.dat
- irit2Xfg -l -f 0 16 b58.dat irit.mat > saddle.xfg
- @\end{verbatim}
-
- where irit.mat is the viewing matrix created by x11drvs.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- @\section{Data File Format}
- !DATAFILE Format
-
- This section describes the data file format used to exchange data between
- {\em IRIT} and its accompanying tools.
-
- @\begin{verbatim}
- [OBJECT {ATTRS} OBJNAME
- [NUMBER n]
-
- | [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 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 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 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 | P1 | P2 | P3 | P4 | P5
-
- ATTRS -> [ATTRNAME ATTRVALUE]
- | [ATTRNAME]
- | [ATTRNAME ATTRVALUE] ATTRS
-
- @\end{verbatim}
-
- 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 noever hold different geometry 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 '\verb+[+'. This
- simplifies and disambiguates the parsing.
-
- * Comments may appear between '\verb+[+OBJECT ...\verb+]+' blocks, or
- immediately after OBJECT OBJNAME, and only there.
-
- A comment body can be anything not containing the '\verb+[+' or the
- '\verb+]+' tokens (signals start/end of block). Some of the comments in
- the above definition are {\em 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:
-
- @\begin{verbatim}
- 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_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]
- ]
- ]
- ]
- @\end{verbatim}
- $
-
- @\section{Bugs and Limitations}
- !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, {\em 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.
- $
-
- @\end{document}
-
-