

Node: Top,  Prev: ,  Next: ,  Up: (MODEL),


This document is the reference manual for  the harness Draw, Draw is a
command  interpreter based on TCL and  a graphical system used to test
and demonstrate  CAS.CADE  modeling  libraries. In this   document are
described the basics of the TCL command  language and Draw extensions,
the commands to do geometry and the commands to do topology.



* Menu:

* Overview::
* The command language::
* Basic commands::
* Geometry commands::
* Topology commands::
* Index::


Node: Overview,  Prev: ,  Next: The command language,  Up: Top,


Draw is a test and development harness for CAS.CADE. It is intended to
provide a flexible and easy-to-use means  of testing and demonstrating
the CAS.CADE modeling libraries.

Draw can be  used interactively to  create, display and modify objects
such as curves, surfaces and topological shapes.

Scripts can be written to customize  Draw and perform tests. New types
of objects  and new commands  can be  added  using the  C++ programing
language.

Draw is basically made up of 

- a command interpreter based on the TCL command language

- a 3d graphic viewer based on the X system

- a basic set of commands covering scripts, variables and graphics

- a set of geometric  commands, allowing to  create and modify  curves
and surfaces  and  to use  CAS.CADE  geometry algorithms.  This set of
commands is optional

- a set of topological commands  to create and  modify BRep shapes and
to use the CAS.CADE topology algorithms

As a rule  there is an "official"  set  of commands for  each delivery
unit  in   the modeling   libraries : GEOMETRY,    TOPOLOGY, ADVALGOS,
GRAPHIC, PRESENTATION



* Menu:

* Contents of the documentation::
* Getting started::


Node: Contents of the documentation,  Prev: ,  Next: Getting started,  Up: Overview,


This documentation describes 

- the command language

- the basic set of commands

- the graphical commands

- the geometry set of commands

- the topology set of commands

This document does  not describe the  other sets of commands  and does
not explain how to extend Draw using C++.

This document is mainly a  reference manual, it contains  descriptions
of  commands, all  descriptions have the   same format which is  above
illustrated with the exit command.



* Menu:

* exit::


Node: exit,  Prev: ,  Next: ,  Up: Contents of the documentation,


SYNOPSIS


	exit


PURPOSE


Terminates the Draw, TCL session. If the commands are read from a file
using the source command this will terminante reading from the file.


EXAMPLE


	# this is a very short example
	exit


SEE ALSO


source


Node: Getting started,  Prev: Contents of the documentation,  Next: ,  Up: Overview,


We will now try a simple example. The first thing  to do is to setup a
Draw executable,  check if the DRAW and  TCL  ULs are visible  in your
workbench with the wok command "ulinuse". If  DRAW does not appear you
should check with your workshop manager to install DRAW and TCL.

We will now suppose that you have a DRAW version, at least DRAW-7 (use
"ulinuse -v" to check so).   You must now find  an executable.  Let us
try TGEOMETRY.    Just type  TGEOMETRY,  if  you do  not get  a prompt
"Draw[1]> " you must create an executable by  linking the program from
the  source example  TestDraw.cxx which   can  be  found  in the   src
directory of the UL.

Draw displays prompt and waits for commands,  here is a sample session
:


EXAMPLE


# create Two views 2d and axonometric 
Draw[1]> av2d				
# create a 2d circle
Draw[2]> circle c 0 0 1 0 5
Draw[3]> 2dfit

# trim the circle and dump it
Draw[4]> trim c c 0 pi/2
Draw[5]> dump c


0*********** Dump of c *************
Trimmed curve
Parameters : 0 1.5707963267949
Basis curve :
Circle
  Center :0, 0 
  XAxis  :1, 0 
  YAxis  :-0, 1 
  Radius :5

# make a 3d circle from it, and turn it into a bspline

Draw[6]> to3d c c
Draw[7]> fit
Draw[8]> convert c c
Draw[9]> dump c


0*********** Dump of c *************
BSplineCurve rational
  Degree 2, 3 Poles, 2  Knots
Poles :

   1 : 5, 0, 0  1
   2 : 5, 5, 0  0.707106781186548
   3 : 3.06161699786838e-16, 5, 0  1
Knots :

   1 :  0 3
   2 :  1.5707963267949 3


EXAMPLE


# make a surface of revolution from the spline
Draw[10]> fit
Draw[11]> help rev
reverse         : reverse name ... 
revsurf         : revsurf name curvename x y z dx dy dz

# here you must click on the curve with the mouse
Draw[12]> revsurf s . 5 5 0 -1 1 0
Pick an object
Draw[13]> fit

# rotate the view
Draw[14]> u
Draw[15]> erase c
c 

# make a bspline surface and intersect with a plane
Draw[20]> convert s s
Draw[21]> fit
Draw[22]> plane p 5 5 5 1 1 1 1 0 0
Draw[23]> intersect c p s

# pick on one of the intersection curves
# you may get c_2 onstead of c_1
Draw[24]> whatis .
Pick an object
c_1 is a  a 3d curve
Draw[25]> clear
Draw[27]> rename c_1 c
Draw[28]> fit

# save the curve, use any directory where you can write
Draw[29]> datadir $env(WBCONTAINER)/data/default
/adv_20/BAG/data/default
Draw[30]> save c curveinter
c
Draw[31]> exit


In  this example  some geometrical   operations have been   performed,
objects have been displayed and wrote to files.



Node: The command language,  Prev: Overview,  Next: Basic commands,  Up: Top,


The command language used in Draw is the  TCL command language.  It is
highly recommended, if you want to use  Draw extensively, to read some
TCL documentation like "TCL and the  TK Toolkit" by John K. Ousterhout
(Addison-Wesley).

The following section  is a short outline  of the TCL language and its
extensions incorporated in Draw. The following topics will be covered.

- syntax of the TCL language

- accessing variables in TCL and Draw

- control structures

- procedures



* Menu:

* Syntax of TCL::
* Accessing variables in TCL and Draw::
* lists::
* Control Structures::
* Procedures::


Node: Syntax of TCL,  Prev: ,  Next: Accessing variables in TCL and Draw,  Up: The command language,


TCL  is an interpreted command    language,  it is  not a   structured
language like C, Pascal,  LISP or Basic, it is  rather a line oriented
language like a shell  (csh for example).  However you will  find that
TCL   is  easier to  use  than  shell  because  control structures and
procedure are easier to define. TCL is  also faster than shell because
it does not fork a process for each command.

The  basic program for TCL  is a script. A  script consists  of one or
more commands. Commands are separated by newlines or semicolons.


EXAMPLE

	set a 24
	set b 15
	set a 25; set b 15


Each command consists of one or more words, the first word is the name
of a command  and  additional words are  arguments  for that  command.
Words are separated by spaces  or tabs. In  the preceding example each
command has three words. There may be any number of words in a command
and each word is a string of arbitrary length.

The  evaluation of a  command by TCL  follows two steps.  In the first
step  the    command  is  parsed  and  broken  into   words  and  some
substitutions are performed. In the  second step the command procedure
corresponding to  the first  word is called  with  the other words  as
arguments. In  the first   step there  is only   string  manipulation,
meaning is given to  the words only in the  second step by the command
procedure.

The following substitutions are performed by TCL

- Variable substitution is triggered by the $ character (as with csh),
the content of the variable is substituted,  {} may be  used as in csh
to enclose the name of the variable.


EXAMPLE


	# set a variable value
	set file documentation

	# a simple substitution, set psfile to documentation.ps
	set psfile $file.ps

	# another substitution, set pfile to documentationPS
	set pfile ${file}PS

	# a last one, 
	# delete files NEWdocumentation and OLDdocumentation
	foreach prefix {NEW OLD} {rm $prefix$file}


- Command substitution is triggered by the [] characters. The brackets
must enclose a valid script, this scrit is evaluated and the result is
substituted. This is similar to the `command` construction in csh.


EXAMPLE


	set degree 30
	set pi 3.14159265

	# expr is a command evaluating a numeric expression
	set radian [expr $pi*$degree/180]


- Backslash substitution is  triggered by the backslash character.  It
is  used  to  insert special characters  like  :   $,[,].  A backslash
terminated line is continued on the following line.

TCL   uses two  forms of  quoting   to prevent  substitution and  word
breaking.

- Double quote quoting enables to define  a string with space and tabs
as a single word, substitutions are still performed inside the "".


EXAMPLE


	# set msg to "the price is 12.00$"
	set price "\$ 12.00"
	set msg "the price is $price"


-  Braces  quoting prevent all    the  substitutions. Braces are  also
nested. The  main use of braces is  to defer evaluation  when defining
procedures and control structures. Braces are useful to present nicely
TCL scripts on multiple lines.


EXAMPLE


	set x 0

	# this will loop for ever 
	# because while argument is "0 < 3"
	while "$x < 3" {set x [expr $x+1]}

	# this will terminate as expected because
	# while argument is {$x < 3}
	while {$x < 3} {set x [expr $x+1]}

	# this can be written also
	while {$x < 3} {
	   set x [expr $x+1]
	}

	# the following cannot be written
	# because while requires two arguments
	while {$x < 3} 
	{
	   set x [expr $x+1]
	}


Comments start with a # character as the first  non blank character in
a command. If  you want to comment at  the end  of  the line you  must
precede the comment by semi-colon to end the preceding command.


EXAMPLE


	# This is a comment
	set a 1 # this is not a comment

	set b 1; # this is a comment


Last  but not least thing  to know  about parsing in   TCL is that the
number of  words is  never changed  by  substitution.  For example the
result  of a substitution is always  a single word.  This is different
than csh but it  is very convenient  as the behavior  of the parser is
more predictable.  Sometimes it  may be necessary  to enforce a second
round  of evaluation to  reparse, the  eval command  is useful to that
purpose. This command  concatenates  all its arguments   and evaluates
this script.


EXAMPLE


	# I want to delete two files
	set files "foo bar"

	# this will fail because rm will receive only one argument
	# and complain that "foo bar" does not exists
	exec rm $files

	# a second evaluation will do it
	eval exec rm $files


Node: Accessing variables in TCL and Draw,  Prev: Syntax of TCL,  Next: lists,  Up: The command language,


TCL variables have only string  values. Note that even numeric  values
are stored as  string literals and computations  with the expr command
start by parsing the strings. This approach is not sufficient for Draw
where  variables  with other kinds   of values are  necessary, such as
curves, surfaces or topological shapes.

Fortunately  TCL provides a mechanism  to link user data to variables,
this mechanism is used  with Draw.  Draw  variables are TCL  variables
with associated data.    The   string value  of  a Draw    variable is
meaningless, it is usually set to the name  of the variable itself, so
preceding  a  Draw variable with  a $  do not  change  the result of a
command.  The content of a  Draw variable is accessed with appropriate
commands. There are many kinds of Draw variables,  and new ones may be
added with  C++.  We  will  describe later geometric   and topological
variables, for the moment we will only describe the numeric variables.

Draw numeric variables  can be used within  an expression whereever  a
Draw comand requires  a numeric value. The  expr command is useless in
this  case. Those variables are not  stored as strings but as floating
point values.


EXAMPLE


	# dset is used for numeric variables
	# pi is a predefined Draw variable
	
	dset angle pi/3 radius 10
	point p radius*cos(angle) radius*sin(angle) 0


At the beginning the difference between  TCL and Draw variables may be
confusing but you will be quickly used to it.  My advice is to use TCL
variable only  for strings and to   use Draw for  numerics  as you can
avoid the  expr command.  Usually for  geometry and topology  you will
only need numbers no strings.



* Menu:

* set, unset::
* dset, dval::


Node: set, unset,  Prev: ,  Next: dset, dval,  Up: Accessing variables in TCL and Draw,


SYNOPSIS


	set varname [value]

	unset varname [varname varname ...]


PURPOSE


Use the set command  to assign a string   value to a variable. If  the
variable does not exist it is created.

Without the   value argument the  command  returns the content  of the
variable.

Use the unset command  to destroy the variables. This  is is also used
to destroy Draw variables.


EXAMPLE


	set a "Hello world"
	set b "Goodbye"
	set a
	==> "Hello world"
	unset a b
	set a
	==> Error message....


WARNINGS


The set command can set only one variable, unlike the dset command.


SEE ALSO

dset, dval


Node: dset, dval,  Prev: set, unset,  Next: ,  Up: Accessing variables in TCL and Draw,


SYNOPSIS


	dset varname expression [varname expression ...]

	dval expression



PURPOSE


Use the dset  command to assign values  to Draw numeric variables. The
expression  may be   any numeric  expression  including  Draw  numeric
variables, as any Draw command expecting a numeric expression there is
no need for $ or expr. The dset command can  assign many variables, if
there is an odd number of argument the last  variable will be assigned
a value of 0. If the variable does not exist it will be created.

Use dval  to evaluate an  expression containing Draw numeric variables
and return the result as a string, including  a single variable.  This
not useful for Draw commands as they usually interpret expression, but
this is useful for TCL basic commands expecting strings.


EXAMPLE


	# z is set to 0
	dset x 10 y 15 z
	
	# no $ required for Draw commands
	point p x y z

	# puts prints a string
	puts "x = [dval x], cos(x/pi) = [dval cos(x/pi)]"


WARNINGS


In TCL parentheses are not considered as special characters, so do not
forget to quote  an expression if it  contains spaces to avoid parsing
different words.

(a + b) is parsed as three words, "(a + b)" or (a+b) are correct.


SEE ALSO

set, unset


Node: lists,  Prev: Accessing variables in TCL and Draw,  Next: Control Structures,  Up: The command language,


TCL uses  lists a lot, a  list is  only  a string  containing elements
separated by spaces or tabs. If  the string contains braces the braced
part count for one element, this allows to put lists in lists.


EXAMPLE


	# a list of 3 strings
	"a b c"

	# a list of two strings the first is a list of 2
	"{a b} c"


Many TCL  commands return lists and  the foreach  command is an useful
way to loop on list elements.


Node: Control Structures,  Prev: lists,  Next: Procedures,  Up: The command language,


TCL allows repetition of an  execution using control structures.   The
control structures are implemented  with commands and their syntax  is
very similar to their C  counterpart (if, while, switch,..). There are
two   main differences  with  C. Do    not use parentheses  to enclose
conditions but  braces, do not  start the script  on the  next line or
your command will not have enough argument.




* Menu:

* if::
* while, for, foreach::
* break, continue::


Node: if,  Prev: ,  Next: while, for, foreach,  Up: Control Structures,


SYNOPSIS


	if condition script [elseif script .... else script]


PURPOSE


If evaluate the condition and evaluate the script if the condition is
true, and so on.


EXAMPLE


	# note the position of the braces
	# even if you find it ugly, you must do it this way

	if {$x > 0} { 
		puts "positive"
         } elseif {$x == 0} {
		puts "null"
         } else {
		puts "negative"
	 }


Node: while, for, foreach,  Prev: if,  Next: break, continue,  Up: Control Structures,


SYNOPSIS


	while condition script

	for init condition reinit script

	foreach varname list script


PURPOSE


The three loop structures are similar to their C or csh equivalent. It
is important to  use braces to delay  evaluation.  foreach will assign
the elements of the list to the variable before evaluating the script.


EXAMPLE


	# while example
	dset x 1.1
	while {[dval x] < 100} {
		circle c 0 0 x
		dset x x*x
	}

	# for example
	# incr var d, incremente une variable de d (defaut 1)
	for {set i 0} {$i < 10} {incr i} {
		dset angle $i*pi/10
		point p$i cos(angle0 sin(angle) 0
	}

	# foreach example
	foreach object {crapo tomson lucas} {display $object}



SEE ALSO


break, continue



Node: break, continue,  Prev: while, for, foreach,  Next: ,  Up: Control Structures,


SYNOPSIS


 	break

 	continue


PURPOSE


Within  loops  the, break and  continue commands  have the same effect
than in  C. break interrupts the  innermost loop and continue steps to
the next iteration.


EXAMPLE


	# search the index for which t$i has value "secret"
	for {set i 1} {$i <= 100} {incr i} {
		if {[set t$i] == "secret"} break;
	}


Node: Procedures,  Prev: Control Structures,  Next: ,  Up: The command language,


TCL can be extended by defining procedures using the proc command. The
proc commandsetup a  context of local  variables, binds  arguments and
executes a TCL script.

The only confusing point in procedures  is that variables are strictly
local, and  as they  are   implicitly created  when  used it   may  be
difficult to detect the errors.

There  are  two means to  access a  variable outside  the scope of the
current procedure.  The global command may be used to declare a global
variable (a variable outside all procedures), the upvar command can be
used to access a variable in the scope of the caller. In TCL arguments
are always string  values, the only way to  pass Draw variables is  to
pass by reference, i.e.   passing the name of  the variable  and using
the upvar command as in the following examples.

TCL is not a  strongly typed language, it  is  thus very difficult  to
detect programming errors and debugging can be tedious, TCL procedures
are not designed for large scale  software development but for testing
and simple command or interactive writing.



* Menu:

* proc::
* global, upvar::


Node: proc,  Prev: ,  Next: global, upvar,  Up: Procedures,


SYNOPSIS


	proc arglist script


PURPOSE


Use  the proc command  to define a procedure, arglist   is the list of
arguments, it  must be an  empty list  if there  are no  arguments. An
argument  may have  a default value,  it  is then a  list  of the form
{argument value}. The script is the body of the procedure.

The return command is used to give a return value to the procedure.


EXAMPLE


	# simple procedure
	proc hello {} {
		puts "hello world"
	}

	# procedure with arguments and default values
	proc distance {x1 y1 {x2 0} {y2 0}} {
		set d [expr (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)]
		return [expr sqrt(d)]
	}

	# we could not resist the classical one
	proc fact n {
		if {$n == 0} {return 1} else {
			return [expr n*[fact [expr n -1]]]
		}
	}


SEE ALSO


global, upvar


Node: global, upvar,  Prev: proc,  Next: ,  Up: Procedures,


SYNOPSIS


	global varname [varname ...]

	upvar varname localname [varname localname ...]


PURPOSE


Use  the global  command to access   top level variables.  Unlike in C
global variables are not visible in procedures.

Use the upvar command to give a local name to a variable in the caller
scope, this is when an argument is the name of a variable instead of a
value, this  is call by  reference and it is the  only way to use Draw
variables as arguments.

Note in  the  following examples that   the $ is  always necessary  to
access the arguments.


EXAMPLE


	# convert degree to radian
	# pi is a global variable
	proc deg2rad (degree} {
		global pi
		return [dval pi*$degree/180.]
	}

	# create line with a point and an angle
	proc linang {linename x y angle} {
		upvar linename l
		line l $x $y cos($angle) sin($angle)
        }
		


Node: Basic commands,  Prev: The command language,  Next: Geometry commands,  Up: Top,


We  will now   describe all the  commands  defined  in  the basic Draw
package. Some of the commands are  TCL commands, but  most of them are
defined by Draw. Those commands are found in all Draw applications.

The commands are grouped in four sections 

- general commandsused for Draw and TCL management

- variable commands used to manage Draw variables, storing, dumping ...

- graphic commands used to manage the graphic system : views ...

- variables display commands are used to manage the display of objects



* Menu:

* General commands::
* Variables management commands::
* Graphic Commands::
* Variables display commands::


Node: General commands,  Prev: ,  Next: Variables management commands,  Up: Basic commands,


This section describes some  useful commands, help to get information,
source to eval a script from a file, spy  to capture the commands in a
file, cpulimit limit the  process cpu time,  wait to waste some  time,
chrono to time commands.



* Menu:

* help::
* source::
* spy::
* cpulimit::
* wait::
* chrono::


Node: help,  Prev: ,  Next: source,  Up: General commands,


SYNOPSIS


	help [command [helpstring group]]


PURPOSE


Provides help or modifies the help information.

help,  without arguments  list all groups    and the commands  in each
group.

help command, provides information on a command or  a set of commands,
command  may be a   shell-like regular expression. * is  automatically
added at the end so that all completing commands match.


help command  helpstring group, defines  helpstring to be the help for
command,  put the command in  the group. The   group defaults to "User
commands".


EXAMPLE


# Gives help on all command starting with a
help a

# defines help for the help command
help {help [command [helpstring group = "Use commands"]]} "DRAW Basic Commands"


Node: source,  Prev: help,  Next: spy,  Up: General commands,


SYNOPSIS


	source file


PURPOSE


Reads and evaluates commands from a file.

The exit command will terminate the file.


SEE ALSO

exit


Node: spy,  Prev: source,  Next: cpulimit,  Up: General commands,


SYNOPSIS


	spy [file]


PURPOSE


Save interactive commands in the file.  If there is already spying the
current file is closed.  spy without  argument closes the current file
and  stops spying.

If a command returns an error it is saved with a comment mark.

The file created by spy can be played with the source command.


EXAMPLE


# from now all commands will be saved in the file "session"
spy session

# the file "session" is closed and commands are not saved
spy


SEE ALSO

source


Node: cpulimit,  Prev: spy,  Next: wait,  Up: General commands,


SYNOPSIS


	cpulimit [nbseconds]


PURPOSE


The process will be interrupted after nbseconds of cpu, this is useful
during tests  to   avoid infinite loops.  cpulimit   without arguments
removes all existing limits.


EXAMPLE


	#limit cpu to one hour
	cpulimit 3600


Node: wait,  Prev: cpulimit,  Next: chrono,  Up: General commands,


SYNOPSIS


	wait [nbseconds]


PURPOSE


Interrupt  execution   for nbseconds, the default    value is ten (10)
seconds.  This is usefull in a  demo to give people   time to admire a
nice picture.


EXAMPLE


	# You have ten seconds ...
	wait 



Node: chrono,  Prev: wait,  Next: ,  Up: General commands,


SYNOPSIS


	chrono [ name start/stop/reset/show]


PURPOSE


The chrono command  has two usages,  without arguments  it toggles the
timing of commands. When chronometers  are activated each command will
be timed, i.e. the cpu and user time of the command will be printed.

With arguments the chrono  command is used  to manage chronometers,  a
chronometer  is  a  special kind  of Draw    variable used to  measure
time. The following action can be performed on a chronometer.

- start : to run the chronometer.

- stop : to stop the chronometer.

- reset : to reset the chronometer to 0.

- show : to display the current time.

Chronometers  are  useful to print  partial  times as in the following
example, the timing of the command foreach will only give you the time
for all the process.


EXAMPLE


	# use of a chronometer
	chrono swatch
	foreach face {f1 f2 f3 f4 f5} {
		chrono swatch reset
		processface $face
		chrono swatch stop
		puts "$face is processed"
		chrono swatch show
	}


Node: Variables management commands,  Prev: General commands,  Next: Graphic Commands,  Up: Basic commands,


We describe now commands used to manage Draw variables. isdraw test if
a variable  is a draw variable, directory  list draw variables, whatis
gives the type of a  variable, dump prints  the content of a variable,
rename and copy  change  the content  of variables,  datadir, save and
restore are used to put the contents of variables in files.




* Menu:

* isdraw, directory::
* whatis, dump::
* rename, copy::
* datadir, save, restore::


Node: isdraw, directory,  Prev: ,  Next: whatis, dump,  Up: Variables management commands,


SYNOPSIS


	isdraw varname

	directory [pattern]


PURPOSE


Use  isdraw to test  if  a variable is   a draw variable, isdraw  will
return 1 if there is a Draw value attached to the variable.

Use directory to return a list of all Draw global variables matching a
pattern, like the shell ls command.


EXAMPLE


	set a 1
	isdraw a
	===> 0

	dset a 1
	isdraw a
	===> 1

	circle c 0 0 1 0 5
	isdraw c
	===> 1

	# to destroy all Draw objects with name containing curve
	foreach var [directory *curve*] {unset $var}


SEE ALSO

whatis


Node: whatis, dump,  Prev: isdraw, directory,  Next: rename, copy,  Up: Variables management commands,


SYNOPSIS


	whatis varname [varname ...]

	dump varname [varname ...]
	

PURPOSE


Use  whatis to get  a  short information   about a Draw  variable, the
result depends  on the type of the  object. Usually it  is the name of
the type.

Use dump to  get a long information about  a Draw variable, the result
depends on the type of  the object. Usually it is  a full dump (may be
rather long for geometry or topology).


EXAMPLE


	dset x 3
	whatis x
	==> x is a numeric

	dump x
	==> *********** Dump of x *************
	==> 3


WARNINGS


The behavior of whatis on other variables (not Draw) is not excellent.


Node: rename, copy,  Prev: whatis, dump,  Next: datadir, save, restore,  Up: Variables management commands,


SYNOPSIS


	rename varname tovarname  [varname tovarname ...]

	copy varname tovarname  [varname tovarname ...]


PURPOSE


Use   rename to change   the name  of   a Draw variable, the  original
variable  does not  exist  any  more, note   that the content  is  not
modified, only the name is changed.

Use  copy to make  a new variable   with a copy of   the content of an
existing variable.   The exact behavior of copy  is type dependent, in
some cases   the content may  still  be  shared (see  the  topological
variables for example).


EXAMPLE


	circle c1 0 0 1 0 5
	rename c1 c2

	# curves are copied, c2 will not be modified
	copy c2 c3
	2dtranslate c3 10 0



Node: datadir, save, restore,  Prev: rename, copy,  Next: ,  Up: Variables management commands,


SYNOPSIS


	datadir [data-path]

	save name [filename]

	restore filename [name]


PURPOSE


Use save  and restore to  transfert the  content  of Draw variables to
files,  the files are located  in the  data directory.

Use save to write a file  in the data directory  with the content of a
variable, by default the name of the file is the name of the variable,
to give a different name use a second argument.

Use restore to read  the content of a file  in the data directory in a
local variable, by default the name of the variable if the name of the
file, to give a different name use a second argument.

The exact  content of  the file is  type  dependent, they are  usually
ASCII files, so they are architecture independnts.



EXAMPLE


	# note how TCL access shell environment variables
	# using $env()
	datadir $env(WBCONTAINER)/data/default
	datadir
	==> /adv_20/BAG/data/default

	box b 10 20 30
	save b theBox
	
	# when TCL does not find a command it tries a shell command
	ls [datadir]
	==> theBox

	restore theBox
	datadir ./bugs
	datadir
	==> /adv_20/BAG/data/bugs

	# now the box is saved in both the default and data directories
	save theBox



Node: Graphic Commands,  Prev: Variables management commands,  Next: Variables display commands,  Up: Basic commands,


Graphic  commands  are used to manage  the  Draw graphic system.  Draw
provides a 2d and a 3d viewer with up to  30 views, views are numbered
and    the index  of   the view  is  visible  in  the    title of  the
window. Objects are  displayed  in all 2d views   or in  all  3d views
depending on their type but never on both.

The view  and delete commands  are the basic view management commands,
but  useful procedures for screen layout  are defined, axo, left, top.

Commands are provided  to modify the view  parameters, fit,  zoom, pu,
pd, pl, pr to pan, u,d,l,r to rotate. fu, fd to change the focal.

The  view parameters commands  process all views or  only one view, in
this case the index of the view must be given as the first argument. A
command  control 3d views or   2d views, the 2d  views  version of the
command starts with 2d, for example zoom and 2dzoom.

Colors are numbered from 1  to 15, the  aspect can be changed with the
color command.

To put some text on the screen use the dtext command.

Postscript drawings  can  be made with  the hardcopy  command and  xwd
files with the xwd command.

To use the mouse you can use the pick and the wclick commands.




* Menu:

* view, delete::
* axo, pers, top, ...::
* mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom::
* pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr::
* fit, 2dfit::
* u, d, l, r::
* focal, fu, fd::
* color::
* dtext::
* hardcopy, hcolor, xwd::
* wclick, pick::


Node: view, delete,  Prev: ,  Next: axo, pers, top, ...,  Up: Graphic Commands,


SYNOPSIS


	view index type [X Y W H]

	delete [index]


PURPOSE


view is the basic view  creation command. It  creates a new view  with
the given   index,  if a  view already   exits with  this index it  is
destroyed. The view is created with default parameters and X Y W H are
the  position and dimensions on  the window on the  screen, they are X
window system coordinates in pixel, 0,0 being the upper left corner of
the   screen.  Default values are 0,   0, 500, 500  which  is not very
convenient.

Usually it is far simpler to use the procedures as axo, top, left to
create views.

delete destroy a view, if no index is given all views are destroyed.

The type is a four letter upper case code among the followings 

- AXON	: Axonometric view

- PERS  : Perspective view

- +X+Y  : View on the two axes (i.e. a top view), other codes are
	  -X+Y +Y-Z etc...

- -2D- : 2d view

The  index, the  type,  the current zoom are  displayed  in the window
title.


EXAMPLE


	# this is the content of the mu4 procedure
	proc mu4 {} {
		delete
		view 1 +X+Z 320 20 400 400
		view 2 +X+Y 320 450 400 400
		view 3 +Y+Z 728 20 400 400
		view 4 AXON 728 450 400 400
	}


SEE ALSO


axo, pers, top, bottom, left, right, front, back, mu4
v2d, av2d, smallview


Node: axo, pers, top, ...,  Prev: view, delete,  Next: mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom,  Up: Graphic Commands,


SYNOPSIS


	axo

	pers

	...

	smallview type


PURPOSE


All these  commands  are  procedures used  to  define  standard screen
layout, they delete all  existing views and   create some views.   The
layout usually abides by the european convention, i.e. the top view is
under the front view.

- axo  : One big axonometric view

- pers : One big perspective view

- top, bottom, left, right, front, back : One big  axis view

-  mu4 : Four views layout with front, left, top and axo

- v2d : One big 2d view

- av2d : Two views, one 2d and one axo

The smallview command creates a view at the right bottom of the screen
with the given type. See the view command for the type list.



EXAMPLE


	# just try them !!

	# here we give the body of smallview

	proc smallview {{v AXON}} {
		delete
		view 1 $v 728 450 400 400
	}


SEE ALSO


view, delete


Node: mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom,  Prev: axo, pers, top, ...,  Next: pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr,  Up: Graphic Commands,


SYNOPSIS


	mu [index]

	2dmu [index]

	zoom [index] value

	wzoom


PURPOSE


Use mu (magnify up) to increase the zoom in a view or  in all views by
a factor of  10%. md (magnify down) decrease  the zoom by the  inverse
factor. 2dmu and 2dmd do the same on one or all 2d views.

Use zoom  or  2dzoom to set the   zoom  factor to  a given  value. The
current zoom is always displayed in the window title.

Use wzoom (window zoom) to select with the mouse the  area you want to
zoom in a view. You will be prompted for two graphic selections in the
same  view and the  rectangle you  defined will  be  set to the  whole
window of the view.


EXAMPLE


	# set a zoom of 2.5 on all 2d views
	zoom 2.5

	# magnify on 
	mu 1



SEE ALSO


fit, 2dfit


Node: pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr,  Prev: mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom,  Next: fit, 2dfit,  Up: Graphic Commands,


SYNOPSIS


	pu [index]

	pd [index]


PURPOSE


Use the pu, .. commands to pan the  view, pu and  pd pan vertically up
and down,  pl and pr pan  horizontally left and   right. The views are
panned by a quantity of 40 pixels.


EXAMPLE


	# pan up the first view
	pu 1



SEE ALSO

fit, 2dfit


Node: fit, 2dfit,  Prev: pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr,  Next: u, d, l, r,  Up: Graphic Commands,


SYNOPSIS


	fit [index]

	2dfit [index]


PURPOSE


Use the fit command to compute automatically a best zoom and panning on
the content of the view. The content of the view will be centered and
fit the whole window.

When fitting all views a unique zoom is computed for all the views, so
each view is not  best fitted but all views  are on the same scale. To
compute a best fit on all views fit them one by one.


EXAMPLE


	# fit only view 1
	fit 1

	# fit all 2d views
	2dfit


SEE ALSO

zoom, mu, pu


Node: u, d, l, r,  Prev: fit, 2dfit,  Next: focal, fu, fd,  Up: Graphic Commands,


SYNOPSIS


	u [index]

	d [index]

	l [index]

	r [index]


PURPOSE


Rotate the view in the up, down, left or right direction  by five
degrees. This is only for axonometric and perspective views.


EXAMPLE


	# rotate the view up
	u


Node: focal, fu, fd,  Prev: u, d, l, r,  Next: color,  Up: Graphic Commands,


SYNOPSIS


	focal [index] value

	fu [index]

	fd [index]


PURPOSE


Use the  focal method  to change the   focal distance for  perspective
views. The focal is the distance form the eye to the view point. A low
focal  increases the perspective  effect, a  high  focal looks like an
axonometric. The default value is 500.

Use fu and fd to increase or decrease the focal value by 10%. fd makes
the eye closer to the object.


EXAMPLE


	# create a perspective and look closer
	pers
	repeat 10 fd


WARNINGS


A negative or null focal is not a bright idea !!


SEE ALSO

pers


Node: color,  Prev: focal, fu, fd,  Next: dtext,  Up: Graphic Commands,


SYNOPSIS


	color index name


PURPOSE


Set the color to a value, index is the index of the color between 0
and 15, name is a X window color name. The list can be found in the
file rgb.txt in the X library directory.

The default value are

0 White
, 1 Red
, 2 Green
, 3 Blue
, 4 Cyan
, 5 Gold
, 6 Magenta
, 7 Marron
, 8 Orange
, 9 Pink
, 10 Salmon
, 11 Violet
, 12 Yellow
, 13 Khaki
, 14 Coral



EXAMPLE


	# change the hue of the blue
	color 3 "navy blue"


WARNINGS


The color change will be visible on the next  redraw of the views, for
example after fit or mu.


Node: dtext,  Prev: color,  Next: hardcopy, hcolor, xwd,  Up: Graphic Commands,


SYNOPSIS


	dtext [x y [z]] string


PURPOSE


Display a string in all 3d or 2d views.  If no coordinates are given a
graphic selection  is required. If  two coordinates are given the text
is created in 2d views at  this position, with  3 coordinates the text
is created in 3d views. The coordinates are real space coordinates.


EXAMPLE


	# mark the origins
	dtext 0 0 "This is the 2d origin"
	dtext 0 0 0 "This is the 3d origin"

	# write on the views
	dtext "You just clicked here"


Node: hardcopy, hcolor, xwd,  Prev: dtext,  Next: wclick, pick,  Up: Graphic Commands,


SYNOPSIS


	hardcopy [index]

	hcolor index width gray
	
	xwd [index] filename


PURPOSE


The hardcopy   command creates a  postcript file  named post.ps  in the
current  directory. This file  contains  the postscript description of
the view index, or of all the views.

The hcolor command   lets you  change   the  aspect of   lines in  the
postscript file, it allows to specify a width and a gray level for one
of the 16 colors. width is measured in points, the default value is 1,
gray is a grey level from 0 = black to 1 = white, the default value is
0. All colors are bound to the default values at the beginning.

The xwd command  creates an X window xwd  file from a view, by default
index is 1.   To visualize an  xwd file you  can use the unix  command
xwud.


EXAMPLE


	# all blue lines (color 3) 
	# will be half-width and grey

	hcolor 3 0.5 

	# make a postscript file and print it
	hardcopy
	lpr post.ps

	# make an xwd file and display it
	xwd theview
	xwud -in theview


WARNINGS


There are bugs  when using hardcopy  without index with more than  one
view.

You need a postscript printer or your harcopy will not look great.


SEE ALSO

color


Node: wclick, pick,  Prev: hardcopy, hcolor, xwd,  Next: ,  Up: Graphic Commands,


SYNOPSIS


	wclick

	pick  index X Y Z b [nowait]


PURPOSE


Use  the wclick command to wait  until a mouse  button is clicked, the
message   "just click" is displayed.    This  is useful to let  people
admire a drawing until they are fed up with it.

Use the pick command to get a graphical input, the arguments must be
names for variables where the results are stored.

- index : will be the index of the view where the input was made

- X,Y,Z : Are 3d coordinates in real world

- b : b is the mouse button 1,2 or 3

When there is an extra argument its value  is not used and the command
do not wait for a button click, the value of b  may then be 0 if there
was no click. This option is useful for tracking the pointer.

Note that the results are stored in Draw numeric variables.


EXAMPLE


	# make a circle at mouse location
	pick index x y z b
	circle c x y z 0 0 1 1 0 0 0 30

	# make a dynamic circle at mouse location
	# stop when a button is clicked
	# (see the repaint command)

	dset b 0
	while {[dval b] == 0} {
		pick index x y z b nowait
		circle c x y z 0 0 1 1 0 0 0 30
		repaint
	}


SEE ALSO

repaint


Node: Variables display commands,  Prev: Graphic Commands,  Next: ,  Up: Basic commands,


Many Draw objects  can  be displayed,  for example curves,   surfaces,
shapes.  Draw provides commands to manage the  display of the objects.
display, donly  are used to display  objects, erase, clear, 2dclear to
erase them.  The autodisplay command is used   to control if variables
are displayed as soon as created.

The variable name "." (dot) has a special status within Draw, any draw
command expecting a Draw  object as argument  can be passed a dot. The
meaning of the dot is the following.

If the  dot is an input  argument a graphical  selection will be made,
instead of getting the object  from a variable.  Draw will ask you  to
select an object on a view.

If the dot is  an output argument, an  unnamed object will be created,
of  course this will make   sense only for  graphical  objects, if you
create an  unnamed  number you will not  be  able  to  access it. This
feature is useful when you want to create objects for display only.

If you do not see what you expected while  executing loops or sourcing
files you may want to consider the repaint and dflush commands.


EXAMPLE


	# use dot to dump an object on the screen
	dump .

	# display points on a curve c
	# with dot no variables are created
	for {set i 0} {$i <= 10} {incr i} {
		cvalue c $i/10 x y z
		point . x y z
	}

	# point p x y z
	# would have displayed only one point
	# because the precedent content of a variable is erased


	# point p$i x y z
	# is an other solution, creating variables
	# p0, p1, p2, ....

	# give a name to a graphic object
	rename . x



* Menu:

* autodisplay::
* display, donly::
* erase, clear, 2dclear::
* repaint, dflush::


Node: autodisplay,  Prev: ,  Next: display, donly,  Up: Variables display commands,


SYNOPSIS


	autodisplay [0/1]


PURPOSE


By default Draw displays automatically any graphical object as soon as
it is created. This behavior known as  autodisplay can be removed with
this command. Without  arguments, autodisplay  toggles the autodisplay
mode, the command always returns the current mode.

When autodisplay is off, using the dot return argument is ineffective.


EXAMPLE


	# c is dislayed
	circle c 0 0 1 0 5

	# toggle the mode
	autodisplay
	==> 0
	circle c 0 0 1 0 5

	# c is erased, but not displayed
	display c


SEE ALSO

display


Node: display, donly,  Prev: autodisplay,  Next: erase, clear, 2dclear,  Up: Variables display commands,


SYNOPSIS


	display varname [varname ...]

	donly  varname [varname ...]


PURPOSE


Use display to make objects visible. Use donly to make objects visible
and erase all other objects, it stands for "display only".

As you  may have  guessed "display ."  is quite  useless, "donly ." is
very useful to extract one object from a messy screen.


EXAMPLE


	# to see everybody
	foreach var [directory] {display $var}

	# to select two objects and erase the others
	donly . .



SEE ALSO

erase


Node: erase, clear, 2dclear,  Prev: display, donly,  Next: repaint, dflush,  Up: Variables display commands,


SYNOPSIS


	erase [varname varname ...]

	clear

	2dclear


PURPOSE


Use erase to erase objects from all the views, erase without arguments
erase everything in 3d and 2d. To erase unnamed objects use "erase .".

Use clear to erase  only 3d objects and 2dclear  for 2d objects, erase
without arguments is the same thing as "clear; 2dclear".


EXAMPLE


	# erase all guys with name starting by c_
	foreach var [directory c_*] {erase $var}

	# clear 2d views
	2d clear


SEE ALSO


display


Node: repaint, dflush,  Prev: erase, clear, 2dclear,  Next: ,  Up: Variables display commands,


SYNOPSIS


	repaint

	dflush


PURPOSE


The repaint command enforces pending repaint  of the views. The dflush
command flushes the graphic buffers.  These commands are useful within
loops or in scripts.

A  new object is immediatly displayed,  but when an object is modified
or erased the whole view must be repainted. To avoid doing it too many
times, Draw only sets a flag and delays the  repaint to the end of the
command when the new prompt is issued. Within a script you may want to
display immediatly  the result of a  modification, the repaint command
will repaint the views if the flag is raised and clear the flag.

Graphical operations are buffered by Draw (and also  by the X system),
usually the buffer is flushed   at the end  of  a command and   before
graphical selection. If  you want to  flush the buffer within a script
use the dflush command.


EXAMPLE


	# See the example with the pick command


SEE ALSO

pick


Node: Geometry commands,  Prev: Basic commands,  Next: Topology commands,  Up: Top,


Draw  provides a set of commands  to test geometry libraries. Geometry
libraries are provided with the GEOMETRY  UL. These commands are found
in the TGEOMETRY executable, or in  any Draw executable  as long as it
includes the GeometryTest commands.

The geometry with Draw includes new  types of variables

- The 2d and 3d point will be referred to as Draw points.

- The 2d curve, it is exactly the same as the Geom2d_Curve class. Will
be referred to as Draw 2d curve.

- The 3d  curve and the surface,  they are exactly the Geom_Curve  and
Geom_Surface classes.  Will  be referred  to as  Draw  curve  and Draw
surface.

Please refer to  the  Geom and Geom2d   packages to learn  more  about
CAS.CADE geometry.

Draw geometric variables never share their data, the copy command will
always make a complete copy of the content of the variable.

The following sections cover the topics 

-  crves creation,  the different types  of curves  and how to create
them.

- surfaces creation, the different types of surfaces and how to create
them.

- curves and surfaces modification, commands  to modify the definition
of curves and surfaces, a majority is for bezier and bspline.

- geometric transformations, i.e. translation, rotation, mirror, ...

- analysis  of  curves  and   surfaces, commands to  compute   points,
derivatives, curvatures.

- intersections of surfaces and curves.

- approximations of set of points to create curves and surfaces.

- construction of 2d circles and lines by constraints like tangency.

- the  last  section describes  commands which control  the display of
curves and surfaces.

When possible the commands are general, i.e. they process 2d curves 3d
curves and surfaces, for example the circle command may create a 2d or
a 3d circle  depending on the number  of  arguments and the  translate
command will process points, curves or  surfaces depending on the type
of the argument. So when  you do not find a  command in a section  you
may look in another section, for example the trim command is described
in the surface section but it can be used with curves.




* Menu:

* Creation of curves::
* Creation of surfaces::
* Modifications of Curves and surfaces::
* Transformations::
* Analysis of curves and surfaces ::
* Intersections::
* Approximations::
* Constraints::
* Display::


Node: Creation of curves,  Prev: ,  Next: Creation of surfaces,  Up: Geometry commands,


To  create  points use the point   command, to create  curves use the
command corresponding to the type. The types of curves are :

- Analytical curves : line, circle, ellipse, parabola, hyperbola. 

- Polar curves : beziercurve, bsplinecurve.

-  Trimmed curves and Offset  curves made  from  other curves with the
trim and offset command.  Note that  the trim  and offset command  are
described in the surface section, as they work on curves or surfaces.

- Bspline  curves (NURBS) can be  created from other curves  using the
convert command (see the surface creation).

- Curves can be created from surface isoparametric lines with the uiso
and viso commands.

- 3d curves  can be created from 2d  curves and the contrary using the
to3d  and to2d commands. The project   command more generally computes
the 2d curve on a surface.

Curves are displayed with an arrow to indicate the last parameter.



* Menu:

* point::
* line::
* circle::
* ellipse::
* hyperbola::
* parabola::
* beziercurve, 2dbeziercurve::
* bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve::
* uiso, viso::
* to2d, to3d::
* project::


Node: point,  Prev: ,  Next: line,  Up: Creation of curves,


SYNOPSIS


	point name x y [z]


PURPOSE


Use the point command to create a 2d or 3d point, depending on the
number of arguments.


EXAMPLE


	# 2d point
	point p1 1 2

	# 3d point
	point p2 10 20 -5



Node: line,  Prev: point,  Next: circle,  Up: Creation of curves,


SYNOPSIS


	line name x y [z] dx dy [dz]


PURPOSE


Use the line  command  to create a  3d  or 2d line.   x  y z are   the
coordinates of  the origin of the  line,  dx, dy, dz  is the direction
vector. Of course the dimension must be  consistent, either line l x y
dx dy in 2d or line l x y z dx dy dz in 3d.

A  line is parametrised  by the length  starting form the origin along
the direction vector, the direction vector will be normalised, it must
not be null. The lines are infinite, but not the drawing.


EXAMPLE


	# a 2d line at 45 degrees of the X axis
	line l2d 0 0 1 1

	# a 3d line trough the point 10 0 0 parallel to Z
	line l 10 0 0 0 0 1


Node: circle,  Prev: line,  Next: ellipse,  Up: Creation of curves,


SYNOPSIS


	circle name x y [z [dx dy dz]] [ux uy [uz]] radius


PURPOSE


Use this  command to create a 2d  or  a 3d circle,  in  2d x,y are the
coordinates of the center and ux, uy is the vector in the direction of
the origin of the parameters, by default this direction is (1,0) the X
axis. Use another vector to change the origin of parameters.

In 3d x,y,z are the coordinates of the  center, dx,dy,dz is the normal
vector defining the plane through the center where the circle is, this
vector is normalised and must  not be null, by  default this vector is
(0,0,1) i.e. the Z axis.  ux,uy,uz is  the direction of the origin, if
it is not given a default direction will be computed, this vector must
not be null or parallel to dx,dy,dz.

The circle is parametrised by the  angle in [0,2*pi] starting from the
origin. Note  that the specification of origin  direction and plane is
the same for all analytical curves and surfaces.


EXAMPLE


	# A 2d circle of radius 5 centered at 10,-2
	circle c1 10 -2 5

	# an other 2d circle with a user defined origin
	# the point of parameter 0 on this circle will be
	# 1+sqrt(2),1+sqrt(2)
	circle c2 1 1 1 1 2

	# a 3d circle, center 10 20 -5, axis Z, radius 17
	circle c3 10 20 -5 17

	# same 3d circle with axis Y
	circle c4 10 20 -5 0 1 0 17

	# full 3d circle, axis X, origin on Z
	circle c5 10 20 -5 1 0 0 0 0 1 17

	


Node: ellipse,  Prev: circle,  Next: hyperbola,  Up: Creation of curves,


SYNOPSIS


	ellipse name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius


PURPOSE


Create a 2d or 3d ellipse, the first arguments are the same as for the
circle to define the center  and the system of  axis. The ellipse will
have  firstradius on its  X axis and  secondradius  on its Y axis. The
ellipse is parametrised by [0,2*pi] starting from the  X axis going to
the Y axis. Note that this is not an  angle, the local parametrisation
of the ellipse is (firstradius * cos(t), secondradius * sin(t))


EXAMPLE


	# default 2d ellipse
	ellipse e1 10 5 20 10

	# 2d ellipse at angle 60 degree
	ellipse e2 0 0 1 2 30 5

	# 3d ellipse, in the XY plane
	ellipse e3 0 0 0 25 5

	# 3d ellipse in the X,Z plane with axis 1, 0 ,1
	ellipse e4 0 0 0 0 1 0 1 0 1 25 5



SEE ALSO


circle


Node: hyperbola,  Prev: ellipse,  Next: parabola,  Up: Creation of curves,


SYNOPSIS


	hyperbola name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius


PURPOSE


Create a 2d or 3d ellipse, the first arguments are the same as for the
circle to define the center and the system of axis. The hyperbola will
have firstradius on its X  axis and secondradius  on its Y axis.  This
values  are not real  radius but  the  coefficients of  the parametric
equation, where  the  parameters run    for -infinite  to    +infinite
(firstradius * ch(t),  secondradius * sh(t)).  Note that the hyperbola
has only one branch, the one in the X direction.


EXAMPLE


	# default 2d hyperbola, with asymptotes 1,1 -1,1
	hyperbola h1 0 0  30 30

	# 2d hyperbola at angle 60 degree
	hyperbola h2 0 0 1 2 20 20

	# 3d hyperbola, in the XY plane
	hyperbola h3 0 0 0 50 50



SEE ALSO


circle


Node: parabola,  Prev: hyperbola,  Next: beziercurve, 2dbeziercurve,  Up: Creation of curves,


SYNOPSIS


	parabola name x y [z [dx dy dz]] [ux uy [uz]] focal


PURPOSE


Create  a 2d or 3d  parabola in the   axis-system defined by the first
arguments (see  the  circle command),  the origin  is the apex  of the
parabola and focal  is the coefficient in the  parametric equation : (
x= t*t / 4*focal, y = t).


EXAMPLE


	# 2d parabola
	parabola p1 0 0 50

	# 2d parabola with convexity +Y
	parabola p2 0 0 0 1 50

	# 3d parabola in the Y-Z plane, convexity +Z
	parabola p3 0 0 0 1 0 0 0 0 1 50


SEE ALSO

circle


Node: beziercurve, 2dbeziercurve,  Prev: parabola,  Next: bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve,  Up: Creation of curves,


SYNOPSIS


	beziercurve name nbpoles x1 y1 z1 [w1] x2 y2 z2 [w2] ....

	2dbeziercurve name nbpoles x1 y1 z1 [w1] x2 y2 z2 [w2] ....


PURPOSE


Use the beziercurve command  to create a 3d curve,  give the number of
poles then  the   coordinates of  the  poles,   the   degree will   be
nbpoles-1.  You can give  weights with the poles  to create a rational
curve, you must give weights for all poles or for none.

Use  2dbeziercurve to create  a 2d curve with   the same conditions as
above.


EXAMPLE


	# a rational 2d bezier curve (arc of circle)
	2dbeziercurve ci 3 0 0 1 10 0 sqrt(2.)/2. 10 10 1

	# a 3d bezier curve, not rational
	beziercurve cc 4 0 0 0 10 0 0 10 0 10 10 10 10


Node: bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve,  Prev: beziercurve, 2dbeziercurve,  Next: uiso, viso,  Up: Creation of curves,


SYNOPSIS


	bsplinecurve name degree nbknots k1 m1 ... x1 y1 z1 w1 ...

	2dbsplinecurve name degree nbknots k1 m1 ... x1 y1 w1 ...

	pbsplinecurve name degree nbknots k1 m1 ... x1 y1 z1 w1 ...

	2dpbsplinecurve name degree nbknots k1 m1 ... x1 y1 w1 ...


PURPOSE


Use the bsplinecurve commands  to create 3d  or  2d NURBS curves,  the
pbsplinecurve  and   2dpbsplinecurve commands      create     periodic
curves. Degree  is the  degree for  the curves,  nbknots the number of
knots,  then you must  give  the knots with  their multiplicities, the
knots must  be non decreasing,   if succcessive  knots are  equal  the
multiplicities will be added, multiplicities must be lower or equal to
the degree, on non  periodic curves the  first and last multiplicities
can  be equal to degree+1, this  is even  recommended  if you like the
curve to go from the first pole to the last pole.  On a periodic curve
the first and last multiplicity must be equal.

The poles must be given with their weights, use weights of 1 for a non
rational curve, the number of poles must be

For a non periodic curve, Sum of multiplicities - degree + 1

For a periodic curve, Sum of multiplicities - last multiplicity


EXAMPLE


	# a 2d periodic circle (parameter from 0 to 2*pi !!)
	dset h sqrt(3)/2
	2dpbsplinecurve c 2 \
	4 0 2 pi/1.5 2 pi/0.75 2 2*pi 2 \
	0 -h/3 1 \
	0.5 -h/3 0.5 \
	0.25 h/6 1 \
	0 2*h/3 0.5 \
	-0.25 h/6 1 \
	-0.5 -h/3 0.5 \
	0 -h/3 1 


Node: uiso, viso,  Prev: bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve,  Next: to2d, to3d,  Up: Creation of curves,


SYNOPSIS


	uiso name surface u

	viso name surface u


PURPOSE


Use these commands to create a U or V isoparametric curve from a surface.


EXAMPLE


	# create a cylinder and extract to iso curves
	# see the cylinder command

	cylinder c 10
	uiso c1 c pi/6
	viso c2 c 5


WARNINGS


It is not possible to extract isoparametric curves on offset surfaces.


Node: to2d, to3d,  Prev: uiso, viso,  Next: project,  Up: Creation of curves,


SYNOPSIS


	to3d name curve2d [plane]

	to2d name curve3d [plane]


PURPOSE


to3d and to2d commands  are used to create a  3d curve from a 2d curve
and a 2d curve   from a 3d curve.   The  transformation uses  a planar
surface  to define the  XY plane in  3d, by default  this plane is the
default OXY plane.  to3d  always gives a correct  result, but to2d may
surprise you as it is  not a projection.  It is  always correct if the
curve  is planar and  parallel to the plane  of projection, the points
defining the  curve  are projected  onto the plane   but a circle will
remain a circle for example, it will not be changed to an ellipse.


EXAMPLE


	# the following commands
	circle c 0 0 5
	plane p -2 1 0 1 2 3
	to3d c c p

	# will create the same circle as
	circle c -2 1 0 1 2 3 5


SEE ALSO


project


Node: project,  Prev: to2d, to3d,  Next: ,  Up: Creation of curves,


SYNOPSIS


	project name curve3d surface


PURPOSE


Computes    the 2d curve  in   the   parametric space  of  the surface
correponding  to the 3d curve.  This  can be  used  only on analytical
surface and for curves lying on the surface.


EXAMPLE


	# intersect a cylinder and a plane
	# and project the resulting ellipse on the cylinder
	# this will create a 2d sinusoid-like bspline
	cylinder c 5
	plane p 0 0 0 0 1 1
	intersect i c p
	project i2d i c


Node: Creation of surfaces,  Prev: Creation of curves,  Next: Modifications of Curves and surfaces,  Up: Geometry commands,


To create surfaces use also the type, types of surfaces are

- Analytical surface : plane, cylinder, cone, sphere, torus.

- Polar surfaces : beziersurf, bsplinesurf

-  Trimmed and Offset surface,  using the commands trim, trimu, trimv,
offset.

-  Surface of Revolution and  Extrusion, created  from curves with the
revsurf and extsurf commands.

-  NURBS surface  can be  constructed from   other  surfaces using the
convert command.

Surfaces are displayed  with isoparametric  lines, a small  parametric
line is displayed  at 1/10 of U  with a length  1/10 of V to  show the
parametrisation.



* Menu:

* plane::
* cylinder::
* cone::
* sphere::
* torus::
* beziersurf::
* bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf::
* trim, trimu, trimv::
* offset::
* revsurf::
* extsurf::
* convert::


Node: plane,  Prev: ,  Next: cylinder,  Up: Creation of surfaces,


SYNOPSIS


	plane name [x y z [dx dy dz [ux uy uz]]]


PURPOSE


Uses  this command to create  an infinite plane, a  plane  is the same
thing as a 3d  coordinate system, x,y,z is the  origin, dx, dy, dz  is
the Z direction  and  ux, uy, uz is  the  X direction.  The   plane is
perpendicular to Z  and X is the  U  parameter. dx,dy,dz and  ux,uy,uz
must not be  null and not colinear. ux,uy,uz  will  be modified to  be
orthogonal to  dx,dy,dz. There are  default values for  the coordinate
system, if no  arguments are given  the  default is the global  system
(0,0,0), (0,0,1),  (1,0,0), if only the origin  is given the  axis are
the default  ones (0,0,1), (1,0,0), if the  origin and the Z  axis are
given the X axis is generated perpendicular to  the Z axis.  Note that
this definition will be used for all analytical surfaces.


EXAMPLE


	# a plane through the point 10,0,0 perpendicular to X
	# with U direction on Y 
	plane p1 10 0 0 1 0 0 0 1 0 

	# an horixontal plane with origin 10, -20, -5
	plane p2 10 -20 -5


Node: cylinder,  Prev: plane,  Next: cone,  Up: Creation of surfaces,


SYNOPSIS


	cylinder name [x y z [dx dy dz [ux uy uz]]] radius


PURPOSE


A cylinder is defined by a coordinate system, just like a plane, and a
radius. The cylinder is an infinite cylinder  with the Z axis as axis,
the  U  parameter  is  the angle   starting  from  X going  to   the Y
direction. The V  coordinate is the  length along the Z  axis starting
from the origin.


EXAMPLE


	# a cylinder on the default Z axis, radius 10
	cylinder c1 10

	# a cylinder, also with Z axis but with origin 5, 10, -3
	cylinder c2 5 10 -3 10

	# a cylinder through the origin 
	# with longitude pi/3 and latitude pi/4 (euler angles)
	dset lo pi/3. la pi/4.
	cylinder c3 0 0 0 cos(la)*cos(lo) cos(la)*sin(lo) sin(la) 10


SEE ALSO

plane


Node: cone,  Prev: cylinder,  Next: sphere,  Up: Creation of surfaces,


SYNOPSIS


	cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius


PURPOSE


Creates a cone in the  coordinate system, the radius  is the radius of
the section of the cone  in the XY plane,  the semi-angle is the angle
in degree of the cone with the axis, it  should be between -90 and 90,
both and 0  excluded. The  vertex is on  the Z  axis  in the  negative
direction at a distance radius/tan(semi-angle) from the origin. If the
radius is 0 the vertex is the origin.

To parametrise the cone,  U is  the angle  starting  from 0, in  the Y
direction,   V is the length   along  the the  side  starting from the
origin, in the local system V = Z / cos(semi-angle).

The definition of the cone may seem redundant but it is very useful to
disconnect the origin of the V parameter and the apex, mainly for very
small angle when the cone is  like a cylinder,  the useful part of the
surface may  be very far from  the  apex and  would require very large
parameter values.


EXAMPLE


	# a cone a 45 degree at the origin on Z
	cone c1 45 0

	# a cone on axis Z with radius r1 at z1 and r2 at z2
	cone c2 0 0 z1 180.*atan2(r2-r1,z2-z1)/pi r1


WARNINGS

The angle is in degree.


SEE ALSO

plane


Node: sphere,  Prev: cone,  Next: torus,  Up: Creation of surfaces,


SYNOPSIS


	sphere name [x y z [dx dy dz [ux uy uz]]] radius


PURPOSE


Creates a  sphere  in a local coordinate  system  defined like for the
lane command. The   sphere is centered at  the  origin with  the given
radius. To  parametrise the sphere, U  is the angle from  X to Y, U is
between o and  2*pi, V is  the angle in the  half-circle at angle U in
the  plane  containing the Z axis,  V  is between -pi/2  and pi/2. The
poles  are the points  Z = +/-  radius, their parameters are U,+/-pi/2
for any U in 0,2*pi.


EXAMPLE


	# a sphere at the origin
	sphere s1 10

	# a sphere at 10 10 10, with poles on the axis 1,1,1
	sphere s2 10 10 10 1 1 1 10


SEE ALSO

plane


Node: torus,  Prev: sphere,  Next: beziersurf,  Up: Creation of surfaces,


SYNOPSIS


	torus name [x y z [dx dy dz [ux uy uz]]] major minor


PURPOSE


Creates a torus  in the local coordinate system  with the given  major
and minor radius, Z is the axis for the major radius. The major radius
can be lower than the minor one.

To parametrize a torus, U is the angle from X to  Y, V is the angle in
the plane at angle U from the XY plane to Z. U and V are in 0,2*pi.


EXAMPLE


	# a torus at the origin
	torus t1 20 5

	# a torus in another system
	torus t2 10 5 -2  2 1 0 20 5


SEE ALSO

plane


Node: beziersurf,  Prev: torus,  Next: bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf,  Up: Creation of surfaces,


SYNOPSIS


	beziersurf name nbupoles nbvolpes x y z [w] ....


PURPOSE


Use this command to create a bezier surface, rational or not. You must
first give the numbers  of poles in  the  U and V  directions, degrees
will be nbupoles-1  and  nbvpoles-1. Then give the   nbupoles*nbvpoles
poles, starting with U.  i.e.  P(1,1) P(2,1) ,... P(nbupoles,1) P(1,2)
,... P(nbupoles,nbvpoles).  You can omit weights, but  if you give one
weight you must give them all.


EXAMPLE


	# a non-rational degree 2,3 surface
	beziersurf s 3 4 \
	0 0 0  10 0 5  20 0 0 \
	0 10 2 10 10 3 20 10 2 \
	0 20 10 10 20 20 20 20 10 \
	0 30 0 10 30 0 20 30 0


SEE ALSO

beziercurve


Node: bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf,  Prev: beziersurf,  Next: trim, trimu, trimv,  Up: Creation of surfaces,


SYNOPSIS


	bsplinesurf name udegree nbuknots uknot umult ... nbvknot  vknot vmult ...  x y z w ...

	upbsplinesurf ...

	vpbsplinesurf ...

	uvpbsplinesurf ...
		    

PURPOSE


Use  the bsplinesurf     command   to create    NURBS   surfaces,  the
upbsplinesurf  command to  create  a  NURBS   surface  periodic in  U,
vpbsplinesurf periodic in V, and uvpbsplinesurf periodic in UV.

The description is similar to the bsplinecurve command, first you give
the degree in U and the knots in U with their multiplicities, then the
same in V. The poles follow, the number of poles is the product of the
number in  U and  the  number in V,  see  bsplinecurve to compute  the
number of poles,  the poles are first given  in U as in the beziersurf
command.  Note that  you must give  the  weights, use  1 for  rational
surface.


EXAMPLE


	# create a bspline surface of degree 1 2
	# with two knots in U and three in V

	bsplinesurf s \
	1 2 0 2 1 2 \
	2 3 0 3 1 1 2 3 \
	0 0 0 1  10 0 5 1  \
	0 10 2 1 10 10 3 1 \
	0 20 10 1 10 20 20 1 \
	0 30 0 1 10 30 0 1
	


WARNINGS

The weights are mandatory.


SEE ALSO

bsplinecurve
beziersurf
convert


Node: trim, trimu, trimv,  Prev: bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf,  Next: offset,  Up: Creation of surfaces,


SYNOPSIS


	trim newname name [u1 u2 [v1 v2]]

	trimu newname name [u1 u2]

	trimv newname name [v1 v2]


PURPOSE


The trim  commands  are used  to  create  trimmed  curves  or  trimmed
surfaces.   Note that trimmed  curves and surfaces  are classes of the
Geom packages. The  trim  command creates a  new trimmed  curve from a
curve,  or a new trimmed  surface in u  and  v from  a surface.  trimu
creates  a u  trimmed surface, and  trimv a  vtrimmed surface.  If  no
parameters are given,   the  command recreates   the  basis curve  and
surface if the argument is trimmed. The curves can  be either 2d or 3d
curves.  If  the  trimming  parameters are   decreasing,  direction is
reversed if the curve or surface is not periodic.

Note that  a  trimmed curve or surface  contains  a copy  of the basis
geometry, so  modifying it will  not modify the trimmed geometry. Note
also that trimmig  a trimmed geometry  will not create multiple levels
of trimming, the basic geometry will be used.


EXAMPLE


	# create a 3d circle
	circle c 0 0 0 10

	# trim it, use the same variable, the original is destroyed
	trim c c 0 pi/2

	# original can be recovered !
	trim orc c

	# trim again
	trim c c pi/4 pi/2

	# original is not the trimmed curve but the basis
	trim orc c

	# as the circle is periodic the two following commands are identical
	trim cc c pi/2 0
	trim cc c pi/2 2*pi

	# trim an infinite cylinder
	cylinder cy 10
	trimv cy cy 0 50


SEE ALSO

reverse


Node: offset,  Prev: trim, trimu, trimv,  Next: revsurf,  Up: Creation of surfaces,


SYNOPSIS


	offset newname name distance [dx dy dz]


PURPOSE


Use the offset command to create offset  curve or surface from a basis
curve or surface at a  given distance, offset  curves and surfaces are
classes from  the Geom package. The  curve can be  a 2d or a 3d curve,
for a 3d curve  you must give also  a  vector dx,dy,dz to compute  the
offsets, usually for a planar  curve this vector is  the normal to the
plane containing the curve.

The offset curve or  surface copies the   basis geometry which  can be
modified later.


EXAMPLE


	# graphical demonstration that the outline of a torus
	# is the offset of an ellipse
	# Please do this in a top view

	smallview +X+Y
	dset angle pi/6
	torus t 0 0 0 0 cos(angle) sin(angle) 50 20
	fit
	ellipse e 0 0 0 50 50*sin(angle)
	# note that the distance can be negative
	offset l1 e 20 0 0 1
	offset l2 e -20 0 0 1
	
	# Admire...


Node: revsurf,  Prev: offset,  Next: extsurf,  Up: Creation of surfaces,


SYNOPSIS


	revsurf newname curvename x y z dx dy dz


PURPOSE


This command creates a surface of revolution  from a 3d curve, this is
the  class SurfaceOfRevolution from   Geom, x,y,z and dx,dy,dz defines
the axis  of revolution. To parametrize a  surface of revolution U, is
the angle around the axis, starting from the curve, V is the parameter
of the curve.


EXAMPLE


	# another way to make a torus like surface
	circle c 50 0 0 20
	revsurf s c 0 0 0 0 1 0


Node: extsurf,  Prev: revsurf,  Next: convert,  Up: Creation of surfaces,


SYNOPSIS


	extsurf newname curvename dx dy dz


PURPOSE


Use the extsurf command to create a surface of linear extrusion from a
3d  curve. dx,dy,dz is the  direction of  extrusion.  To parametrize a
surface of extrusion, U is the parameter on the curve, V is the length
along the direction of extrusion.


EXAMPLE


	# an elliptic cylinder
	ellipse e 0 0 0 10 5
	extsurf s e 0 0 1
	# to make it finite
	trimv s s 0 10



Node: convert,  Prev: extsurf,  Next: ,  Up: Creation of surfaces,


SYNOPSIS


	convert newname name


PURPOSE


The convert command creates a NURBS 2d curve, 3d curve or surface from
any  2d curve, curve,   and  surface. essentially  conics  curves  and
quadric surfaces are turned to NURBS, it does not process offsets.


EXAMPLE


	# turn a 2d arc of circle into a 2d nurbs
	circle c 0 0 5
	trim c c 0 pi/3
	convert c c

	# an easy way to make a planar bspline surface
	plane p
	trim p p -1 1 -1 1
	convert p p


WARNINGS


Offset curves and surfaces are not processed.


SEE ALSO

bsplinecurve, bsplinesurf


Node: Modifications of Curves and surfaces,  Prev: Creation of surfaces,  Next: Transformations,  Up: Geometry commands,


Draw provides commands to modify curves and surfaces, some of them are
general, others are restricted to bezier or bsplines.

General modification are

- Reversing the parametrisation : reverse, ureverse, vreverse.

Modifications for bezier and bspline are 

- Exchanging U and V on a surface : exchuv

- segmentation, segment, segsur

- Increasing the degree, incdeg, incudeg, incvdeg

- moving poles, cmovep, movep, movecolp, moverowp

- moving a point on a curve or a surface, cmovepoint, movepoint

Modifications for bezier are 

- adding and removing poles, insertpole, rempole, remcolpole, remrowpole

Modifications for bspline are 

-  inserting  and removing   knots, insertknot,  remknot, insertuknot,
remuknot, insetvknot, remvknot

- modifying periodic curves and surfaces, setperiodic, setnotperiodic,
setorigin, setuperiodic,  setunotperiodic,   setuorigin, setvperiodic,
setvnotperiodic, setvorigin




* Menu:

* reverse, ureverse, vreverse::
* exchuv::
* segment, segsur::
* incdeg, incudeg, incvdeg::
* cmovep, movep, movecolp, moverowp::
* cmovepoint, movepoint::
* insertpole, rempole, remcolpole, remrowpole::
* insertknot, insertuknot, insertvknot::
* remknot, remulnot, remvknot::
* setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic::
* setorigin, setuorigin, setvorigin::


Node: reverse, ureverse, vreverse,  Prev: ,  Next: exchuv,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	reverse curvename

	ureverse surfacename

	vreverse surfacename


PURPOSE


Use the reverse  command to reverse the  parametrisation of a 3d or 2d
curve, use ureverse  or vreverse to reverse the  U or V parameter of a
surface.  Note  that the    new  parameters of  the  curve  may change
according to the type of curve. For example they will change sign on a
line or stay 0,1 on a bezier.

Reversing a parameter on an analytical surface  may create an indirect
coordinate system,  i.e. for example Z  is not the  cross product of X
and Y, because reversing a parameter will reverse only one axis.


EXAMPLE


	# reverse a trimmed 2d circle
	circle c 0 0 5
	trim c c pi/4 pi/2
	reverse c

	# dumping c will show that it is now trimmed between
	# 3*pi/2 and 7*pi/4 i.e. 2*pi-pi/2 and 2*pi-pi/4


WARNINGS


The geometry has been  modified, if you want  to keep the curve or the
surface you must copy it before.


Node: exchuv,  Prev: reverse, ureverse, vreverse,  Next: segment, segsur,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	exchuv surfacename


PURPOSE


For a bezier or bspline surface this command exchange the U and V parameters.


EXAMPLE


	# exchanging u and v on a spline (made from a cylinder)
	# this is impossible on the cylinder
	cylinder c 5
	trimv c c 0 10
	convert c c
	exchuv c


Node: segment, segsur,  Prev: exchuv,  Next: incdeg, incudeg, incvdeg,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	segment curve ufirst ulast

	segsur surface ufirst ulast vfirst vlast


PURPOSE


Use the segment and segsur  commands to segment respectively a  bezier
or   bspline curve and  surface.  This  command  modifies the curve to
restrict it  between  the new parameters.   This command  must  not be
confused with the trim command which creates a new geometry.


EXAMPLE


	# segment a bezier curve in half
	beziercurve c 3 0 0 0 10 0 0 10 10 0
	segment c 0.5 1


Node: incdeg, incudeg, incvdeg,  Prev: segment, segsur,  Next: cmovep, movep, movecolp, moverowp,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	incdeg curvename newdegree

	incudeg surfacename newdegree

	incvdeg surfacename newdegree


PURPOSE


Use the incdeg command to increase the degree of a 2d or 3d bezier or
bspline curve to a new value higher than the current one. Use incudeg
and incvdeg to increase the degree in U or V of a surface.


EXAMPLE


	# make a planar bspline and increase the degree to 2 3
	plane p 
	trim p p -1 1 -1 1
	convert p p
	incudeg p 2
	incvdeg p 3


WARNINGS


The geometry is modified.


Node: cmovep, movep, movecolp, moverowp,  Prev: incdeg, incudeg, incvdeg,  Next: cmovepoint, movepoint,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	cmovep curve index dx dy [dz]

	movep surface uindex vindex dx dy dz

	movecolp uindex dx dy dz

	moverowp vindex dx dy dz


PURPOSE


Use the move methods to translate poles of a bezier or a bspline curve
or surface. cmovep and movep translate the pole with the given index.

movecolp and moverowp translate a whole column or row of poles.


EXAMPLE


	# start with a plane
	# turn to bspline, raise degree and raise poles
	plane p
	trim p p -10 10 -10 10
	convert p p
	incud p 2
	incvd p 2
	movecolp p 2 0 0 5
	moverowp p 2 0 0 5
	movep p 2 2 0 0 5


Node: cmovepoint, movepoint,  Prev: cmovep, movep, movecolp, moverowp,  Next: insertpole, rempole, remcolpole, remrowpole,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	cmovepoint curve u dx dy [dz]

	movepoint surface u v dx dy dz


PURPOSE


Use the cmovepoint command to modify a curve so the point of parameter
u have a new position translated by dx,dy,dz (no dz in 2d).

Use   the  movepoint command  to modify   a  surface so   the point of
parameters u,v have a new position translated by dx,dy,dz.


EXAMPLE


	# Create a spline curve and move 100 times a point

	bsplinecurve bscurv  \
	3 2  -1.0 4   1.0 4  0 0 0 1   1 0 0 1   2 0 0 1   3 0 0 1

	incdeg bscurv 10
	translate bscurv 0 -4 0

	set i 1
	repeat 100 {cmovepoint bscurv 0.3 0. 0.05 0.0e0 ; incr i 1; repaint}
	dump bscurv

	set i 1
	repeat 100 {cmovepoint bscurv 0.3 0. -0.05 0.0e0 ; incr i 1;repaint}



WARNINGS


The geometry is modfied. Do not confuse with cmovep and movep which
modifies a pole and not a point.


SEE ALSO


cmovep, movep


Node: insertpole, rempole, remcolpole, remrowpole,  Prev: cmovepoint, movepoint,  Next: insertknot, insertuknot, insertvknot,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	insertpole curvename index x y [z] [w]

	rempole curvename index

	remcolpole surfacename index

	remrowpole surfacename index


PURPOSE


Use the insertpole command  to insert a new pole  on a 2d or 3d bezier
curve, you can  add a weight for the  pole, the default value  for the
weight is 1. The pole is added at the position after the index, use an
index 0 to insert before the first pole.

Use the rempole command to remove a pole from a 2d or 3d bezier curve,
you must leave at least two poles in the curves.

Use the remcolpole and remrowpole commands to remove a column or a row
of poles from a bezier surface.  A column is in the  V direction and a
row in the U direction, the resulting  degree must be  at least 1, i.e
there are two rows and two columns.


EXAMPLE


	# start with a segment, insert a pole at end
	# then remove the central pole

	beziercurve c 2 0 0 0 10 0 0
	insertpole c 2 10 10 0
	rempole c 2



Node: insertknot, insertuknot, insertvknot,  Prev: insertpole, rempole, remcolpole, remrowpole,  Next: remknot, remulnot, remvknot,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	insertknot curvename knot [mult]
	
	insertuknot surfacename knot [mult]

	insertvknot surfacename knot [mult]



PURPOSE


Insert knots in the  knot sequence of  a bspline curve or surface, use
insertknot for   a curve, you  must  give a  knot   value and a target
multiplicity, the default multiplicity is  1.  If  there is already  a
knot with  the given value  its multiplicity will be  raised if  it is
lower than the target multiplicity. Use insertuknot and insertvknot to
insert knots in a surface.


EXAMPLE


	# create a cylindrical surface and insert a knot
	cylinder c 10
	trim c c 0 pi/2 0 10
	convert c c
	insertuknot c pi/4 1


Node: remknot, remulnot, remvknot,  Prev: insertknot, insertuknot, insertvknot,  Next: setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	remknot index [mult] [tol]

	remuknot index [mult] [tol]

	remvknot index [mult] [tol]


PURPOSE


To  remove a knot from the  knot sequence of  a curve or a surface use
the remknot   commands, give the  index  of the  knot  and  the target
multiplicity, default is    0 to  remove   the knot,   if the   target
multiplicity is   not  0,  the  multiplicity  of   the  knot will   be
lowered. You can give a tolerance value to  control the process as the
curve  may be modified, if the  tolerance is  low  the removal will be
done only   if the curve is not   modified. By default  the removal is
always done.


EXAMPLE


	# bspline circle, remove a knot
	circle c 0 0 5
	convert c c
	incd c 5
	remknot c 2


WARNINGS


The curve or the surface may be modified.


Node: setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic,  Prev: remknot, remulnot, remvknot,  Next: setorigin, setuorigin, setvorigin,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	setperiodic curve

	setnotperiodic curve

	setuperiodic surface

	setunotperiodic surface

	setvperiodic surface

	setvnotperiodic surface


PURPOSE


setperiodic turns a  bspline curve in   a periodic bspline  curve, the
knot vector is the same and excess poles are  truncated, the curve may
be  modified   if it   was  not  closed.    setnotperiodic removes the
periodicity of a periodic curve, poles are duplicated. Note that knots
are added at  the begining  and  the end  of the  knot vector  and the
multiplicity are knot set to degree+1 at the start and the end.


EXAMPLE


	# a circle deperiodicised
	circle c 0 0 5
	convert c c
	setnotperiodic c


Node: setorigin, setuorigin, setvorigin,  Prev: setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic,  Next: ,  Up: Modifications of Curves and surfaces,


SYNOPSIS


	setorigin curvename index

	setuorigin surfacename index

	setuorigin surfacename index


PURPOSE


Use these commands to change the origin  of the parameters on periodic
curves or surfaces, the new origin must be an existing knot. To set an
origin outside a knot you must first insert a knot with the insertknot
command.


EXAMPLE


	# a torus with new U and V origins
	torus t 20 5
	convert t t
	setuorigin t 2
	setvorigin t 2



SEE ALSO


insertknot


Node: Transformations,  Prev: Modifications of Curves and surfaces,  Next: Analysis of curves and surfaces ,  Up: Geometry commands,


Draw provides commands to apply linear transformations to geometric
objects, they include translation, rotation, mirror and scale.




* Menu:

* translate, 2dtranslate::
* rotate, 2drotate::
* pmirror, lmirror, smirror, 2dpmirror, 2dlmirror::
* pscale, 2dpscale::


Node: translate, 2dtranslate,  Prev: ,  Next: rotate, 2drotate,  Up: Transformations,


SYNOPSIS


	translate name [name ...] dx dy dz

	2dtranslate name [name ...] dx dy


PURPOSE


To translate  3d  points,   curves  and  surfaces use   the  translate
commands, giving a vector dx,dy,dz.  You  can translate more than  one
object with the same command.

For 2d points or curves use the 2dtranslate command.


EXAMPLE


	# 3d translation
	point p 10 20 30
	circle c 10 20 30 5
	torus t 10 20 30 5 2
	translate p c t 0 0 15


WARNINGS


Objects are modified.


Node: rotate, 2drotate,  Prev: translate, 2dtranslate,  Next: pmirror, lmirror, smirror, 2dpmirror, 2dlmirror,  Up: Transformations,


SYNOPSIS

	
	rotate name [name ...] x y z dx dy dz angle

	2drotate name [name ...] x y angle


PURPOSE


To rotate a 3d point,  curve or surface use   the rotate command.  You
must give an  axis of rotation with  a point x,y,z, a  vector dx,dy,dz
and an angle in degree.

For a 2d rotation you must only give the center and the angle. In 3d
or 2d the angle can be negative.


EXAMPLE


	# make an helix of circles
	circle c0 10 0 0 3
	for {set i 1} {$i <= 10} {incr i} {
		copy c[expr $i-1] c$i
		translate c$i 0 0 3
		rotate c$i 0 0 0 0 0 1 36
	}


Node: pmirror, lmirror, smirror, 2dpmirror, 2dlmirror,  Prev: rotate, 2drotate,  Next: pscale, 2dpscale,  Up: Transformations,


SYNOPSIS


	pmirror name [name ...] x y z

	lmirror name [name ...] x y z dx dy dz

	smirror name [name ...] x y z dx dy dz

	2dpmirror name [name ...] x y

	2dlmirror name [name ...] x y dx dy


PURPOSE


The  mirrors  command make  a  mirror transformation   of  a 3d or  2d
geometry. pmirror is the point  mirror, or central symetry, lmirror is
the  line mirror  or axial symetry,  smirror is  the surface mirror or
planar symetry, the plane of symetry is perpendicular to dx,dy,dz.

In  2d we  have only 2dpmirror,  the  point symetry, and 2dlmirror the
axis symetry.


EXAMPLE


	# build 3 images of a torus

	torus t 10 10 10 1 2 3 5 1
	copy t t1
	pmirror t1 0 0 0
	copy t t2
	lmirror t2 0 0 0 1 0 0
	copy t t3 
	smirror t3 0 0 0 1 0 0


Node: pscale, 2dpscale,  Prev: pmirror, lmirror, smirror, 2dpmirror, 2dlmirror,  Next: ,  Up: Transformations,


SYNOPSIS


	pscale name [name ...] x y z s

	2dpscale name [name ...] x y s


PURPOSE


Use  the pscale and  2dpscale commands to  transform  an object with a
point scaling  (central homotetic).  You must give  the center and the
scaling factor.  Using a scaling factor of -1 is similar to pmirror.


EXAMPLE


	# double the size of a sphere
	sphere s 0 0 0 10
	pscale s 0 0 0 2


Node: Analysis of curves and surfaces ,  Prev: Transformations,  Next: Intersections,  Up: Geometry commands,


Draw   provides methods to     compute  information about curves   and
surfaces.

- Use coord to find the coordinates of a point.

- Use cvalue and    2dcvalue to compute  points and    derivatives on
curves.

- Use svalue to compute points and derivatives on a surface.

- Use localprop   and minmaxcurandif to   compute the curvature  on  a
curve.

- Use parameters to compute U,V values for a point on a surface.

- Use proj and 2dproj to project a point on a curve or a surface.

- Use surface_radius to compute the curvalture on a surface.




* Menu:

* coord::
* cvalue, 2dcvalue::
* svalue::
* localprop, minmaxcurandif::
* parameters::
* proj, 2dproj::
* surface_radius::


Node: coord,  Prev: ,  Next: cvalue, 2dcvalue,  Up: Analysis of curves and surfaces ,


SYNOPSIS


	coord point x y [z]


PURPOSE


The  coord command will   store in  the   variable x,   y  and  z  the
coordinates of the point.


EXAMPLE


	# translate a point
	point p 10 5 5
	translate p 5 0 0
	coord p x y z
	# x value is 15


SEE ALSO

point


Node: cvalue, 2dcvalue,  Prev: coord,  Next: svalue,  Up: Analysis of curves and surfaces ,


SYNOPSIS


	cvalue curve u [x y z [d1x d1y d1z [d2x d2y d2z]]] [P]

	2dcvalue curve u [x y [d1x d1y [d2x d2y]]] [P]


PURPOSE


Depending on the number of arguments this command  computes on a curve
at a given parameter : the  coordinates in x,y,z, the first derivative
in d1x,d1y,d1z, the second derivative in d2x,d2y,d2z  and set in P the
point of coordinates x,y,z.


EXAMPLE


	# on a bezier curve at parameter 0
	# the point is the first pole
	# the derivative is the vector first to second pole 
	# multiplied by the degree
	# the second derivative is the difference
	#  first to second pole, second to third pole
	# multiplied by degree * degree-1
	2dbeziercurve c 4 0 0 1 1 2 1 3 0
	2dcvalue c 0 x y d1x d1y d2x d2y P

	# values of x y d1x d1y d2x d2y
	# are 0 0 3 3 0 -6
	# and displays the point P(0,0,3)


Node: svalue,  Prev: cvalue, 2dcvalue,  Next: localprop, minmaxcurandif,  Up: Analysis of curves and surfaces ,


SYNOPSIS


	svalue surface u v [x y z [dux duy duz dvx dvy dvz [d2ux d2uy
d2uz d2vx d2vy d2vz d2uvx d2uvy d2uvz]]] [P]


PURPOSE


Use  the svalue command to compute  point and derivatives on a surface
at a  pair of parameter  values, the  result depends on  the number of
arguments. You can compute up  to order two  of derivation and display
the resulting point.


EXAMPLE


	# display points on a sphere
	sphere s 10
	for {dset t 0} {[dval t] <= 1} {dset t t+0.01} {
	   svalue s t*2*pi t*pi-pi/2 x y z
	   point . x y z
	}

	# can also be written
	sphere s 10
	for {dset t 0} {[dval t] <= 1} {dset t t+0.01} {
	   svalue s t*2*pi t*pi-pi/2 .
	}


Node: localprop, minmaxcurandif,  Prev: svalue,  Next: parameters,  Up: Analysis of curves and surfaces ,


SYNOPSIS


	localprop curve u
	
	minmaxcurandif curve


PURPOSE


The localprop  command computes on a  curve the  curvature and display
the osculationg circle. The  minmaxcurandif command computes and print
the parameters where the curvature is minimum or maximum on a curve.


EXAMPLE


	# show curvature at the center of a bezier curve
	beziercurve c 3 0 0 0 10 2 0 20 0 0
	localprop c 0.5


SEE ALSO

surface_radius


Node: parameters,  Prev: localprop, minmaxcurandif,  Next: proj, 2dproj,  Up: Analysis of curves and surfaces ,


SYNOPSIS


	parameters surface x y z u v


PURPOSE


The parameters command returns in variables u and  v the parameters on
the surface of  the 3d point x,y,z. This  command can be used  only on
analytical surfaces, plane, cylinder, cone, sphere, torus.


EXAMPLE


	# Compute parameters on a plane
	plane p 0 0 10 1 1 0
	parameters p 5 5 5 u v
	# the values of u and v are 0 5


Node: proj, 2dproj,  Prev: parameters,  Next: surface_radius,  Up: Analysis of curves and surfaces ,


SYNOPSIS


	proj name x y z

	2dproj name xy


PURPOSE


Use proj to project a point on a  curve or a  surface and 2dproj for a
2d  curve, the  command  will  compute  and display  all points  at an
extreme distance. The  lines joining the point  to the projections are
created with names such as ext_1, ext_2, ...


EXAMPLE


	# project point on a torus
	torus t 20 5
	proj t 30 10 7


Node: surface_radius,  Prev: proj, 2dproj,  Next: ,  Up: Analysis of curves and surfaces ,


SYNOPSIS


	surface_radius surface u v [c1 c2]


PURPOSE


Use the  surface radius command  to compute  the  main curvatures of a
surface at parameters u,v. If there are extra arguments the curvatures
are stored in variables c1 and c2.


EXAMPLE


	# computes curvatures of a cylinder
	cylinder c 5
	surface_radius c pi 3 c1 c2


WARNINGS


The radii are displayed and the curvatures are returned, the radius is
the inverse of the curvature.


Node: Intersections,  Prev: Analysis of curves and surfaces ,  Next: Approximations,  Up: Geometry commands,


To  compute intersections of surfaces,   use the intersect command; to
compute intersections of 2d curves, use the 2dintersect command.




* Menu:

* intersect::
* 2dintersect::


Node: intersect,  Prev: ,  Next: 2dintersect,  Up: Intersections,


SYNOPSIS


	intersect name surface1 surface2 [tolerance]


PURPOSE


Use the intersect  command to intersect  two surfaces, if there is one
intersection curve it will be named "name", if there are more than one
they will be named "name_1", "name_2", ... The precision of the result
is the given tolerance,  this is important  when a spline is fitted to
the result curve. The default tolerance is 1e-7.


EXAMPLE


	# create an ellipse
	cone c 45 0
	plane p 0 0 40 0 1 5
	intersect e c p


Node: 2dintersect,  Prev: intersect,  Next: ,  Up: Intersections,


SYNOPSIS


	2dintersect curve1 curve2


PURPOSE


Display the intersection points between two 2d curves.


EXAMPLE


	# intersect two 2d ellipses
	ellipse e1 0 0 5 2
	ellipse e2 0 0 0 1 5 2
	2dintersect e1 e2


Node: Approximations,  Prev: Intersections,  Next: Constraints,  Up: Geometry commands,


Draw   provides   commandd   to  create   curves    and  surfaces   by
approximations.  2dapprox to fit  a curve through  2d points. appro to
fit  a curve through  3d points. surfapp and  grilapp to fit a surface
through 3d points. 2dinterpolate can be used to interpolate a curve.




* Menu:

* appro, 2dapprox, 2dinterpolate::
* surfapp, grilapp::


Node: appro, 2dapprox, 2dinterpolate,  Prev: ,  Next: surfapp, grilapp,  Up: Approximations,


SYNOPSIS


	appro name nbpoints [curve]

	2dapprox name name nbpoints [curve / x1 y1 x2 y2 ...] 

	2dinterpolate name name nbpoints [curve / x1 y1 x2 y2 ...] 


PURPOSE


Fit a curve through a set of points, first  give the number of points,
then there   are three ways   to  give the points.  Without  arguments
interactivly click  the points,  with a  curve  argument  computes the
points on the curve, else give a list of points.


EXAMPLE


	# pick ten points and they will be fit
	2dapprox c 10


Node: surfapp, grilapp,  Prev: appro, 2dapprox, 2dinterpolate,  Next: ,  Up: Approximations,


SYNOPSIS


	surfapp name nbupoints nbvpoints x y z ....

	grilapp name nbupoints nbvpoints xo dx yo dy z11 z12 ...


PURPOSE


Use   surfapp   to   fit a    surface  through an    array   of points
nbupoints*nbvpoints. grilapp do  the same but  the  x,y coordinates of
the points are on a grid starting at x0,y0 with steps dx,dy.


Node: Constraints,  Prev: Approximations,  Next: Display,  Up: Geometry commands,


The command cirtang is used to construct 2d  circles tangent to curves
and lintan to construct 2d lines tangent to curves.




* Menu:

* cirtang::
* lintan::


Node: cirtang,  Prev: ,  Next: lintan,  Up: Constraints,


SYNOPSIS


	cirtang name  c1 c2 c3


PURPOSE


The  cirtang  command will build   all  circles satsifying  the  three
constraints  c1,c2,c3.  The constraints are   either, a curve then the
circle must be  tangent to that curve,   a point then the  circle must
pass through that point, a radius for the circle.  Only one constraint
can  be a radius.  The  solutions will be  stored  in variables called
name_1, name_2, ...


EXAMPLE


	# a point, a line and a radius. 2 solutions
	point p 0 0
	line l 10 0 -1 1
	cirtan c p l 4


Node: lintan,  Prev: cirtang,  Next: ,  Up: Constraints,


SYNOPSIS


	lintan name curve curve [angle]


PURPOSE



The lintan command will build all 2d lines tangent to two curves. If a
third angle  argument  is given the second   curve must be a line  and
lintan  will build  all lines tangent  to the  first curve  making the
given angle  with the  line.   The angle  is defined  in  degree.  The
solutions are named name_1, name_2, ...


EXAMPLE


	# lines tangent to 2 circles, 4 solutions
	circle c1 -10 0 10
	circle c2 10 0 5
	lintan l c1 c2


Node: Display,  Prev: Constraints,  Next: ,  Up: Geometry commands,


Draw     provides  commands to   control    the  display of  geometric
objects. Some  display parameters are used  for all  objects, some are
valid only for  surfaces, some are  valid only for bezier and bspline,
and some only for bspline.

On curve and surfaces you can control the display mode (how points are
computed)  with the dmode  command.  And the   parameters for the mode
with the defle command and the discr command to control the deflection
and the discretisation.

On  surfaces you    can control the   number   of isoparametric curves
displayed on the surface with the nbiso command.

On bezier and bspline curve and surface you can toggle the display of
the control points with the clpoles and shpoles commands.

On bspline curves and surfaces you can toggle the display of the knots
with the shknots clknots commands.



* Menu:

* dmod, discr, defle::
* nbiso::
* clpoles, shpoles::
* clknots, shknots::


Node: dmod, discr, defle,  Prev: ,  Next: nbiso,  Up: Display,


SYNOPSIS


	dmode name [name ...] u/d

	discr name [name ...] nbintervals

	defle name [name ...] deflection


PURPOSE


You can choose   the display mode for a   curve or a  surface with the
dmode command. The display mode defines how the points are computed to
create the polygon  to display the  curve or the  surface.

In "u"  mode, known as uniform  deflection, the points are computed to
keep the  polygon  at a distance  lower  than the deflection  from the
geometry. The  deflection is set with the  defle command. This mode is
more computer intensive.

In "d"  mode,  known as  discretisation, a fixed  number of  points is
computed, this  number  is set  with the discr  command.   This is the
default mode. On a bspline the fixed  number of points is computed for
each span of the curve. (A span is the interval between two knots).

If  the   curves  are    not smooth  you  can    either  increase  the
discretisation  or lower the  deflection,  depending  on the mode   in
use. This will increase the number of points.


EXAMPLE


	# increment the number of points on a big circle
	circle c 0 0 50 50
	discr 100

	# change the mode
	dmode c u


Node: nbiso,  Prev: dmod, discr, defle,  Next: clpoles, shpoles,  Up: Display,


SYNOPSIS


	nbiso surface [surface  ...] nbuiso nbviso


PURPOSE

	
Use the nbiso  command to change  the  number of  isoparametric curves
displayed  on a surface  in  the U and V   directions. Note that on  a
bspline surface  by  default  isoparametrics  are displayed  at  knots
values, using nbiso will remove this feature.


EXAMPLE


	# display 35 meridians and 15 parallels on a sphere
	sphere s 20
	nbiso s 35 15


Node: clpoles, shpoles,  Prev: nbiso,  Next: clknots, shknots,  Up: Display,


SYNOPSIS


	clpoles name

	shpoles name


PURPOSE


On bezier and  bspline  curves and   surfaces the control  polygon  is
displayed by default, you can suppress it with the clpoles command and
restore it with the shpoles command.


EXAMPLE


	# create a bezier curve and erase the poles
	beziercurve c 3 0 0 0 10 0 0 10 10 0
	clpoles c


Node: clknots, shknots,  Prev: clpoles, shpoles,  Next: ,  Up: Display,


SYNOPSIS


	clknots name

	shknots name


PURPOSE


By default on a  bspline curve and  surface knots are displayed with a
marker at the points  with a parametric value equal  to the knots. You
can remove  them with the clknots  commands and restore them  with the
shknots command.


EXAMPLE


	# hide the knots on a circle converted to spline
	circle c 0 0 5
	convert c c
	clknots c


Node: Topology commands,  Prev: Geometry commands,  Next: Index,  Up: Top,


Draw  provides a set of commands  to test topology libraries. Topology
libraries are provided with the  TOPOLOGY UL. Those commnads are found
in the  TTOPOLOGY  executable   or in any   executable   including the
BRepTest commands.

The topology adds a new type of  variable in Draw, the shape variable,
shape is a topological object, it can be a Vertex,  an Edge, a Wire, a
Face, a Shell, a Solid, a CompSolid or a Compound,  you are invited to
refer to the topology documentation for more information.

Shapes are usually shared,  i.e. the Draw  copy command will create  a
new shape sharing its representation with the original, but two shapes
sharing  their  topology can  be moved independently  (see the section
about transformations for more details).

The following sections cover the topics

- Basic shape commands, to handle the structure of shapes and control
the display.

-  Curves  and   surfaces  topology,  methods  to   make topology from
geometry, or vice versa.

- The profile method to make planar profiles.

- Primitive construction commands. Box, cylinder, ...

- Sweeping of shapes.

- Transformations of shapes. Translation, copy, ....

- Topological operations, also known as booleans.

- Local operations. Features, holes.

- Drafting and blending.

- Analysis of shapes. Length, area, volume....



* Menu:

* Basic topology::
* Curve and surfaces topology::
* Making profiles::
* Primitives::
* Sweeping::
* Topology transformation::
* Topological operations::
* Local operations::
* Drafting and blending::
* Topology analysis::


Node: Basic topology,  Prev: ,  Next: Curve and surfaces topology,  Up: Topology commands,


The basic  set of  commands  allows simple  operations  on shapes,  or
stepwise constructions of objects which  may be far from simple.  They
are useful for analysis of shapes structure.

- Shapes are displayed with isoparametric curves on the faces, this is
controlled with the isos command. The number of points used to display
the shapes curves can be modified with the discretisation command.

- To  modify  topological   attributes such  as  the  orientation  use
orientation, complement and invert.

-  To analyse   the structure  of  a  shape, use  explode,  exwire and
nbshapes.

- To create   shapes by  stepwise  construction,  use emptycopy,  add,
compound.




* Menu:

* isos, discretisation::
* orientation, complement, invert::
* explode, exwire, nbshapes::
* emptycopy, add, compound::


Node: isos, discretisation,  Prev: ,  Next: orientation, complement, invert,  Up: Basic topology,


SYNOPSIS


	isos [name ...] nbisos

	discretisation nbpoints


PURPOSE


Shapes are displayed  by a set of curves,  the edges and isoparametric
curves on the faces.  There is color coding for  the edges, a red edge
is  an isolated edge (belongs to   no faces), a  green edge  is a free
boundary edge (belongs  to one face), a  yellow edge is  a shared edge
(at least two faces).

You can change the number of  isoparametric curves on shapes using the
isos commands. Nnote that the  same number  is  used for  the U and  V
directions, if you give no shape arguments the value  you give will be
the new default value (originally 2), if  you give no arguments at all
the command prints the current default value.

You can change the default number of points used to display the curves
with the discretisation command. The original value is 30.


EXAMPLE


	# Display only the edges (the wireframe)
	isos 0


WARNINGS


Do not get confused with the geometric commands nbisos and discr which
control the display of geometry.


Node: orientation, complement, invert,  Prev: isos, discretisation,  Next: explode, exwire, nbshapes,  Up: Basic topology,


SYNOPSIS


	orientation name [name ...] F/R/E/I
	
	complement name [name ...]

	invert name


PURPOSE


These commands are used to change the orientation of shapes.

The orientation command sets one of the four values, FORWARD, REVERSED,
INTERNAL, EXTERNAL

The   complement command changes    the   current orientation to   its
complement, FORWARD <-> REVERSED, INTERNAL <-> EXTERNAL.

The invert command creates a new shape which is a copy of the original
with all subshapes orientation  reversed. It is  useful for example to
reverse the normals of a solid.


EXAMPLE


	# invert normals of a box
	box b 10 20 30
	normals b 5
	invert b
	normals b 5


Node: explode, exwire, nbshapes,  Prev: orientation, complement, invert,  Next: emptycopy, add, compound,  Up: Basic topology,


SYNOPSIS


	explode name [C/So/Sh/F/W/E/V]

	exwire name

	nbshapes name


PURPOSE


The explode command is very useful to extract  subshapes from a shape,
the subshapes will be named name_1, name_2, ... Note that they are not
copied but shared with the original.  Without other arguments than the
shape explode will extract the first sublevel of shapes, the shells of
a solid, the  edges of a wire for  example.  With  an argument explode
will extract all subshapes of the given type,  C for compounds, So for
solids, Sh for shells, F  for faces, W for  wires, E for edges, V  for
vertices.

The  exwire command  is a  special case  of   explode for  wires which
extract the edges in an  ordered way  if  possible. i/e/ each edge  is
connected to the following one by a vertex.

The  nbshapes command counts the  number of shapes  of  each type in a
shape.


EXAMPLE


	# on a box
	box b 10 20 30

	# whatis returns the type and various information
	whatis b
	=> b is a shape SOLID FORWARD Free Modified	

	# make one shell
	explode b
	whatis b_1
	=> b_1 is a shape SHELL REVERSED Modified Orientable Closed

	# extract the edges b_1, ... , b_12
	explode b e
	==> b_12

	# count subshapes
	nbshapes b
	==>
	Number of shapes in b
	 VERTEX    : 8
	 EDGE      : 12
	 WIRE      : 6
	 FACE      : 6
	 SHELL     : 1
	 SOLID     : 1
	 COMPSOLID : 0
	 COMPOUND  : 0
	 SHAPE     : 34
	


Node: emptycopy, add, compound,  Prev: explode, exwire, nbshapes,  Next: ,  Up: Basic topology,


SYNOPSIS


	emptycopy [newname] name

	add name toname

	compound [name ...] compoundname


PURPOSE


The emptycopy command creates a new shape from an existing one without
subshapes, only the geometry, if there is one,  is used. The new shape
is  stored with  the   same  name  if   the newname  argument  is  not
given. This command is useful to modify a frozen shape, a frozen shape
is a shape used by an other shape, it cannot be modifed, so it must be
emptycopied and its subshape may be reinserted with the add command.

The  add command insert a  reference to a shape in   an other one, the
shapes must be compatible (you cannot insert a face  into an edge) and
the modified shape must not be  frozen.  (However, using emptycopy and
add requires caution).

The compound command is very safe, it  creates a compound from shapes,
if no shapes are given the compound is empty.


EXAMPLE


	# a compound with three boxes

	box b1 0 0 0 1 1 1
	box b2 3 0 0 1 1 1
	box b3 6 0 0 1 1 1
	compound b1 b2 b3 c


Node: Curve and surfaces topology,  Prev: Basic topology,  Next: Making profiles,  Up: Topology commands,


This group  of commands is used to  create topology from shapes and to
extract shapes geometry. Note   that these commands are  low-level, to
create    faces or wires the  profile   command described  in the next
section is usually more appropriate.

- To create vertices use the vertex command.

- To create edges use the edge, mkedge commands.

- To create wires use the wire, polyline, polyvertex commands.

- To create faces use the mkplane, mkface commands.

- To extract the geometry from edges or faces use the mkcurve and
mkface commands.

- To extract the 2d curves for edges on faces use the pcurve command.




* Menu:

* vertex::
* edge, mkedge::
* wire, polyline, polyvertex::
* mkplane, mkface::
* mkcurve, mkface::
* pcurve::


Node: vertex,  Prev: ,  Next: edge, mkedge,  Up: Curve and surfaces topology,


SYNOPSIS


	vertex name [x y z / p edge]


PURPOSE


Creates a vertex at a  3d location, the  location is a x,y,z point  or
the point at parameter p on an edge.


EXAMPLE


	vertex v1 10 20 30


Node: edge, mkedge,  Prev: vertex,  Next: wire, polyline, polyvertex,  Up: Curve and surfaces topology,


SYNOPSIS


	edge name vertex1 vertex2

	mkedge edge curve [surface] [pfirst plast] [vfirst [pfirst] vlast [plast]] 


PURPOSE


The edge command creates a straight line edge between two vertices. Of
course they must not be at the same location.

The mkedge command allows the creation  of edges from  curves, it is a
quite complete command corresponding to the BRepAPI_MakeEdge class. It
can create an edge from  a curve, two parameters can  be given for the
vertices (the default are the first and last parameters of the curve),
vertices can also be given  with their parameters, this option  allows
to  inhibate the creation of  new  vertices, if  the parameters of the
vertices are    not  given they are  computed    by projection on  the
curve. Instead of a 3d curve a 2d curve and a surface can be given.


EXAMPLE


	# straight line edge
	vertex v1 10 0 0
	vertex v2 10 10 0
	edge e1 v1 v2

	# make a circular edge
	circle c  0 0 0 5
	mkedge e2 c 0 pi/2

	# the same result may be achieved with a trimmed curve
	# trimmed curves are recognised removed my mkedge
	trim c c 0 pi/2
	mkedge e2 c


Node: wire, polyline, polyvertex,  Prev: edge, mkedge,  Next: mkplane, mkface,  Up: Curve and surfaces topology,


SYNOPSIS


	wire name name1 [name2 ...]

	polyline name x1 y1 z1 x2 y2 z2 ...

	polyvertex name v1 v2 ...


PURPOSE


The wire command creates a wire from edges or wires,  the order of the
elements  must  ensure  that  the  wire  is  connected.   The vertices
locations  are compared to   detect  connection, if the vertices   are
differents new  edges are created  to ensure topological connectivity,
so the original edge may be copied in the wire.

The polyline command creates a polygonal wire from points coordinates,
to make a closed wire you should repeat the first point at the end.

The polyvertex command creates a polygonal wire from vertices.


EXAMPLE


	# create two polygonal wires
	# and glue them

	polyline w1 0 0 0 10 0 0 10 10 0
	polyline w2 10 10 0 0 10 0 0 0 0
	wire w w1 w2	


Node: mkplane, mkface,  Prev: wire, polyline, polyvertex,  Next: mkcurve, mkface,  Up: Curve and surfaces topology,


SYNOPSIS


	mkplane name wire

	mkface mkface name surface [ufirst ulast vfirst vlast]


PURPOSE


Use the mkplane command  to make a face  from a planar wire, the plane
surface will be  constructed with  an  orientation  to keep  the  face
inside the wire.

Use the mkface command to make a face from a surface, parameter values
can be given to trim a rectangular area, the default are the bounds of
the surface.


EXAMPLE


	# make a polygonal face
	polyline f 0 0 0 20 0 0 20 10 0 10 10 0 10 20 0 0 20 0 0 0 0
	mkplane f f

	# make a cylindrical face
	cylinder g 10
	trim g g -pi/3 pi/2 0 15
	mkface g g


Node: mkcurve, mkface,  Prev: mkplane, mkface,  Next: pcurve,  Up: Curve and surfaces topology,


SYNOPSIS


	mkcurve name edge
	
	mksurface name face


PURPOSE


Use the mkcurve command  to create a 3d curve  from an edge, the curve
will be  trimmed to the  edge boundaries, this  is not possible if the
edge has no 3d curve.

Use the mksurface command to make a surface from a face, the surface
is not trimmed.


EXAMPLE


	# make a line
	vertex v1 0 0 0
	vertex v2 10 0 0
	edge e v1 v2
	mkcurve l e


Node: pcurve,  Prev: mkcurve, mkface,  Next: ,  Up: Curve and surfaces topology,


SYNOPSIS


	pcurve [name edge] face


PURPOSE


The pcurve command extracts the 2d curve of an edge  on a face. If the
only argument is a face the command extracts all  the curves and color
them according to their orientation.  This is very  useful to check if
the edges    in  a face  are   correctly  oriented,  i.e.   they  turn
counterclockwise.


EXAMPLE


	# view the pcurves of a face
	plane p 
	trim p p -1 1 -1 1
	mkface p p
	av2d; # a 2d view
	pcurve p
	2dfit


WARNINGS


If you do not see anything, may  you forgot to create  a 2d view or to
fit it woth the 2dfit command.


Node: Making profiles,  Prev: Curve and surfaces topology,  Next: Primitives,  Up: Topology commands,


The  profile command is  a  powerfull tool  to  create planar faces or
wires made   of   straight lines an  circles   which  are  current  in
mechanical applications.




* Menu:

* profile::


Node: profile,  Prev: ,  Next: ,  Up: Making profiles,


SYNOPSIS


	profile name [instruction parameters instruction parameters ....]


PURPOSE


The  profile command  creates  a   planar  profile  from   a list   of
instructions.  The profile  is created in 2d on  a plane starting from
point 0,0 and  direction X (1,0), some  instructions creates a segment
of line or   an arc of   circle moving the  point  and setting  a  new
direction to the tangent of the profile. Other instructions modify the
current direction, the plane or terminate the profile.

Instructions are one or  two upper or  lowercase letter, followed by a
fixed number of arguments. The angles are given in degree.


- O X Y Z, Set the origin of the plane (default value is 0 0 0)

- P DX DY DZ UX UY UZ, Set the normal and X direction of the plane,
(default value is 0 0 1 1 0 0, an X Y plane)

- X DX, Move the point along X axis.

- Y DY, Move the point along Y axis.

- L DL, Move the point along the current direction by length DL.

- XX X, Set point X coordinate (absolute value).

- YY Y, Set point Y coordinate (absolute value).

- T DX DY, Translate the point.

- TT X Y, Set the point (absolute coordinates).

- R Angle, Rotate the direction (clockwise).

- RR Angle, Set the direction (absolute angle from X axis).

- D DX DY, Set the direction (DX DY will be normalized).

The instructions starting with I  will   intersect the line defined   by the
point and the direction with a curve and move to this new point.

- IX X, Intersect with a vertical (absolute X value).

- IY Y, Intersect with an horizontal (absolute X value).

- C Radius Angle, Make an arc of circle tangent to the current direction.

By  default the profile  is closed and a face  is created, to create a
closed or open   wire  the following instructions  may  be  used.  The
profile will be terminated.

- W, Make a closed wire.

- WW, Make an open wire.


EXAMPLE


	# Make a square with two fillets on the top 
	# and a half-circle on the bottom
	
	profile f x 5 r -90 c 5 180 x 5 y 8 c 2 90 xx 2 c 2 90


Node: Primitives,  Prev: Making profiles,  Next: Sweeping,  Up: Topology commands,


Primitive commands allow the creation of simple shapes.

- box and wedge commands.

- pcylinder, pcone, psphere, ptorus commands.




* Menu:

* box, wedge::
* pcylinder, pcone, psphere, ptorus::


Node: box, wedge,  Prev: ,  Next: pcylinder, pcone, psphere, ptorus,  Up: Primitives,


SYNOPSIS


	box name [x y z] dx dy dz

	wedge name dx dy dz ltx / xmin zmin xmax xmax


PURPOSE


Use  the box  command to   create a  box   parallel to  the axes  with
 dx,dy,dz dimensions.  x,y,z  is the corner  of the box, by default it
is the origin.

Use the wedge  command to create  a wedge, a wedge  has six faces, one
face in  the OXZ plane has  dimensions dx,dz the  other face is in the
plane y  = dy.    It  has  dimensions ltx,dz   or  it is    bounded by
xmin,zmin,xmax,zmax. The other faces are  defined between those faces.
The face in the y=yd plane may  be degenerated into a  line if ltx = 0
or a point if xmin =  xmax and ymin  = ymax, in  this case there are 5
faces. To position the wedge use the ttranslate and trotate commands.


EXAMPLE


	# a box at the origin
	box b1 10 20 30
	
	# an other box
	box b2 30 30 40 10 20 30

	# a wedge
	wedge w1 10 20 30 5

	# a wedge with a sharp edge (5 faces)
	wedge w2 10 20 30 0

	# a pyramid
	wedge w3 20 20 20 10 10 10 10


Node: pcylinder, pcone, psphere, ptorus,  Prev: box, wedge,  Next: ,  Up: Primitives,


SYNOPSIS


	pcylinder name [plane] radius height [angle]

	pcone name [plane] radius1 radius2 height [angle]

	pcone name [plane] radius1 radius2 height [angle]

	psphere name [plane] radius1 [angle1 angle2] [angle]

	psphere name [plane] radius1 radius2 [angle1 angle2] [angle]


PURPOSE


All  these commands create   solids in the default  coordinate system,
using the Z axis as the axis of revolution and the X axis as origin of
angles.   To  use  another system  you  can  translate and rotate  the
resulting solid  or  use a plane  as  the first  argument to specify a
coordinate  system.   Note that  this is   quite different because the
translation and  rotation only change  the  coordinate  system of  the
object.  All  primitives have an optional  last  argument which  is an
angle  in degree around  the  Z axis, starting from   the X axis.  The
default is 360.

The  pcylinder command creates a cylindrical   block around with given
radius and height.

The pcone command creates a truncated cone of given height with radius
radius1 in  the plane z =  0 and radius2 in the  plane z = heigth. The
radii must not be negative but one of them can be null.

The psphere command creates a solid sphere  centered at the origin, if
two angles angle1 and  angle2 are given the solid  will be  limited by
two planes at latitude angle1 and angle2 in degree. The angles must be
increasing and in the range -90,90.

The ptorus command creates a solid torus centered at the origin around
the z axis with given radii, if two increasing angles in degree in the
range 0 360 are given the solid will be bounded by two planar surfaces
at these positions on the circle.


EXAMPLE


	# make a can
	pcylinder cy 5 10

	# a quarter of trucated cone
	pcone co 15 10 10 90

	# three-quarters of sphere
	psphere sp 10 270

	# half torus
	ptorus to 20 5 0 90


Node: Sweeping,  Prev: Primitives,  Next: Topology transformation,  Up: Topology commands,


Sweepinf creates shapes by sweeping a shape along a path.

- prism sweeps along a direction.

- revol sweeps around an axis.

- pipe sweeps along a wire.





* Menu:

* prism::
* revol::
* pipe::


Node: prism,  Prev: ,  Next: revol,  Up: Sweeping,


SYNOPSIS


	prism name shape dx dy dz ["Copy | Inf | SemiInf]


PURPOSE


The  prism command creates  a  new shape by  sweeping  a shape along a
direction. Any  shape can be swept, a   vertex gives an edge,  en edge
gives a face, a face gives a solid...

The sweeping is  done along  the vector  dx dy dz.  The original shape
will be shared in  the result unless   "Copy" is specified. If  Inf is
specified  the  prism is infinite  in  both directions, if  SemiInf is
specified  the prism is infinite  in the  dx,dy,dz direction, then the
length of the vector has no meaning.


EXAMPLE


	# sweep a planar face to make a solid
	polyline f 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 0 0 0
	mkplane f f
	prism p f 0 0 10


Node: revol,  Prev: prism,  Next: pipe,  Up: Sweeping,


SYNOPSIS


	revol name shape x y z dx dy dz angle [Copy]


PURPOSE


The revol command creates a new  shape by sweeping  a shape around the
axis x,y,z dx,dy,dz by  an angle in  degree. As with the prism command
the shape can be of any type and is not shared if Copy is specified.


EXAMPLE


	# shell by wire rotation
	polyline w 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 
	revol s w 20 0 0 0 1 0 90


Node: pipe,  Prev: revol,  Next: ,  Up: Sweeping,


SYNOPSIS


	pipe name wire shape


PURPOSE


The pipe command creates a shape by sweeping a shape known as the
profile along a wire known as the spine.


EXAMPLE


	# sweep a circle along a bezier curve to make a solid pipe
	beziercurve spine 4 0 0 0 10 0 0 10 10 0 20 10 0
	mkedge spine spine
	wire spine spine
	circle profile 0 0 0 1 0 0 2
	mkedge profile profile
	wire profile profile
	mkplane profile profile
	pipe p spine profile


Node: Topology transformation,  Prev: Sweeping,  Next: Topological operations,  Up: Topology commands,


Transformations are application  of matrices, when the  transformation
is  non deforming,  like translation or  rotation,  the object is  not
copied, we use the topology  local coordinate system feature. The copy
can be enforced with the tcopy command.

- tcopy makes a copy of the structure of a shape.

- ttranslate, trotate, tmove, reset moves a shape.

- tmirror, tscale always modify the shape.




* Menu:

* tcopy::
* tmove, treset::
* ttranslate, trotate::
* tmirror, tscale::


Node: tcopy,  Prev: ,  Next: tmove, treset,  Up: Topology transformation,


SYNOPSIS


	tcopy name toname [name toname ...]


PURPOSE


Copy the structure of a shape in a new shape, including the geometry.


EXAMPLE


	# create an edge from  a curve and copy it
	beziercurve c 3 0 0 0 10 0 0 20 10 0
	mkedge e1 c
	ttranslate e1 0 5 0
	tcopy e1 e2
	ttranslate e2 0 5 0
	
	# now modify the curve, only e1 will be modified
	cmovep c 2 0 0 20


Node: tmove, treset,  Prev: tcopy,  Next: ttranslate, trotate,  Up: Topology transformation,


SYNOPSIS


	tmove name [name ...] shape

	reset name [name ...]


PURPOSE


The tmove and reset command are used to modify  the location, or local
coordinate system  of  a shape,  tmove  applies  to some  shapes   the
location  of a  given shape.  reset  removes the location of  a shape,
restoring it in its original coordinate system.


EXAMPLE


	# create two boxes
	box b1 10 10 10
	box b2 20 0 0 10 10 10
	# translate the first box
	ttranslate b1 0 10 0
	# and apply the same location to b2
	tmove b2 b1
	# return to original positions
	reset b1 b2


Node: ttranslate, trotate,  Prev: tmove, treset,  Next: tmirror, tscale,  Up: Topology transformation,


SYNOPSIS


	ttranslate [name ...] dx dy dz

	trotate [name ...] x y z dx dy dz angle


PURPOSE


Use the ttranslate  command to translate a  set  of shapes by  a given
vector, and the  trotate command to rotate  them  by a given angle  in
degree around  an axis. Both commands  only modify the location of the
shape. When transforming multiple shapes the same location is used for
all the shapes,  when a command is used   for each shape,  even if the
translation or the rotation are the same, a new location is created.

Locations  are very economic in   the data structure because  multiple
occurrences of an object share the topological description.


EXAMPLE


	# make rotated copy of a sphere and cylinders
	pcylinder c1 30 5
	copy c1 c2
	ttranslate c2 0 0 20
	psphere s 3
	ttranslate s 25 0 12.5
	for {set i 0} {$i < 360} {incr i 20} {
	  copy s s$i
	  trotate s$i 0 0 0 0 0 1 $i
	}


Node: tmirror, tscale,  Prev: ttranslate, trotate,  Next: ,  Up: Topology transformation,


SYNOPSIS


	tmirror name x y z dx dy dz
	
	tscale name x y z scale


PURPOSE


The tmirror command makes a mirror copy of a shape about a plane x,y,z
dx,dy,dz, the tscale command applies a central homothety to the shape.


EXAMPLE


	# mirror a portion of cylinder about the YZ plane
	pcylinder c1 10 10 270
	copy c1 c2	
	tmirror c2 15 0 0 1 0 0
	# and scale it
	tscale c1 0 0 0 0.5


Node: Topological operations,  Prev: Topology transformation,  Next: Local operations,  Up: Topology commands,


Topological operations includes the boolean operations, they are using
intersections.

- fuse, cut, common are the boolean operations.

- section, psection computes sections.




* Menu:

* fuse, cut, common::
* section, psection::


Node: fuse, cut, common,  Prev: ,  Next: section, psection,  Up: Topological operations,


SYNOPSIS


	fuse name shape1 shape2

	cut name shape1 shape2

	common name shape1 shape2


PURPOSE


Creation  of a new  shape by a  boolean  operation between two shapes,
fuse is  the union, cut  substract the second to  the first, common is
the intersection.


EXAMPLE


	# the four boolean operations between a box and a cylinder

	box b 0 -10 5 20 20 10
	pcylinder c 5 20

	fuse s1 b c
	ttranslate s1 40 0 0

	cut s2 b c
	ttranslate s2 -40 0 0

	cut s3 c b
	ttranslate s3 0 40 0

	common s4 b c
	ttranslate s4 0 -40 0


Node: section, psection,  Prev: fuse, cut, common,  Next: ,  Up: Topological operations,


SYNOPSIS


	section name shape1 shape2

	psection name shape plane


PURPOSE


The section  command creates a  compound  with the  intersection edges
created from the faces of  two shapes, this is  the section line.  The
psection command do the same between a shape and  a plane. This is the
planar section.


EXAMPLE


	# section line between a cylinder and a box
	pcylinder c 10 20
	box b 0 0 5 15 15 15
	trotate b 0 0 0 1 1 1 20
	section s b c

	# planar section of a cone
	pcone c 10 30 30
	plane p 0 0 15 1 1 2
	psection s c p


Node: Local operations,  Prev: Topological operations,  Next: Drafting and blending,  Up: Topology commands,


Local operations are boolean operations restricted to some faces of a
solid.

- localope is the general local operation command, to perform local
boolean operations.

- hole, firsthole, holend, blindhole are various commands to create
cylindrical holes.




* Menu:

* localope::
* hole, firsthole, holend, blindhole, holecontrol::


Node: localope,  Prev: ,  Next: hole, firsthole, holend, blindhole, holecontrol,  Up: Local operations,


SYNOPSIS


	localope name shape tool F/C face [face ...]


PURPOSE


Use the localope command to perform a  local operation on a shape with
a  tool. The operation   is a fusion or a   cut (use 'F' or  'C'). The
operation will  be restricted  to  the designates  faces. The  tool is
intersected only  with the given  faces  and other faces  necessary to
close the intersection curves.

This operation is the basis for features implementation.


EXAMPLE


	# make a box and fuse a cylinder on one side
	box b 10 10 10
	pcylinder c 1 20
	ttranslate c 5 5 -5
	
	# click on the top or bottom face and observe the result...
	localope a b c F .


Node: hole, firsthole, holend, blindhole, holecontrol,  Prev: localope,  Next: ,  Up: Local operations,


SYNOPSIS


	hole name shape  Or.X Or.Y Or.Z Dir.X Dir.Y Dir.Z Radius [Pfrom Pto]

	firsthole name shape Or.X Or.Y Or.Z Dir.X Dir.Y Dir.Z Radius

	holend name shape Or.X Or.Y Or.Z Dir.X Dir.Y Dir.Z Radius

	blindhole name shape Or.X Or.Y Or.Z Dir.X Dir.Y Dir.Z Radius Length

	holecontrol [0/1]


PURPOSE


Use the hole  commands to make a  cylindrical hole in  a solid, in any
case you must give  an axis  and a  radius  with Or.X Or.Y Or.Z  Dir.X
Dir.Y Dir.Z Radius. 

- hole will make a hole through  the whole solid or between parameters
Pfrom and Pto on the axis.

- firsthole will make only the  first possible hole along the positive
side of the axis.

- holend will make  all possible holes along the  positive side of the
axis.

- blindhole will make  a blind hole of depth  Length starting from the
origin of the axis on the positive side.

The holecontrol command  is   used  to set   or display  the   control
mode. When the value is 1  a check of  validity is performed after all
the hole commands.


EXAMPLE


	# make a hole through a cylinder

	pcylinder c 5 10

	firsthole r c 0 -10 5 0 1 0 1


WARNINGS


If the axis does not intersect the solid  nothing is done, this is not
the same as a full boolean operation.


Node: Drafting and blending,  Prev: Local operations,  Next: Topology analysis,  Up: Topology commands,


Drafting is  the creation  of  a new shape by   tilting faces with  an
angle, blending is the creation of a new shapes by rounding of edges.

- Use the depouille command for drafting.

- Use the blend command for simple blending.

- Use the chfi2d command for blending or chamfering planar faces.

- Use fubl for a fusion + blending operation.

- Use buildevol, mkevol, updatevol to make varying radius blending.




* Menu:

* depouille::
* blend::
* chfi2d::
* fubl::
* mkevol, updatevol, buildevol::


Node: depouille,  Prev: ,  Next: blend,  Up: Drafting and blending,


SYNOPSIS


depouille name shape dirx diry dirz face angle x y x dx dy dz [face angle...]


PURPOSE


Use this command to create a  new shape by drafting  faces of a shape,
you  must  give the shape  to  be drafted  and the  drafting direction
(think of it  as an unmolding direction), then  faces with  angles and
axis of rotation.  The faces must  be faces of  the shape, you can use
the dot syntax to pick the faces.


EXAMPLE


	# draft a face of a box
	box b 10 10 10
	explode b f
	depouille a b 0 0 1 b_2 10 0 10 0 1 0 5


Node: blend,  Prev: depouille,  Next: chfi2d,  Up: Drafting and blending,


SYNOPSIS


	blend name shape radius edge [radius edge ...]


PURPOSE


The blend  command creates a new  shape by rounding  edges of a shape,
you must give the  shape and pairs radius, edge.  The edge must  be in
the shape, you may use the dot syntax.  Not that the blend is expanded
to other  edges when  the  faces are tangent.  Blends  are also called
fillets.


EXAMPLE


	# blend a box, click on an edge
	box b 20 20 20
	blend b b 2 .


Node: chfi2d,  Prev: blend,  Next: fubl,  Up: Drafting and blending,


SYNOPSIS


	chfi2d result face [edge1 edge2 (F radius/CDD d1 d2/CDA d ang) ....]


PURPOSE


Creates a  new face name  result from an  existing face adding fillets
and chamfers. The face must be planar, if  it is a  wire a planar face
can  be made with the mkplane  command. Multiples fillets and chamfers
can be built.

edge1 edge2 F radius,   builds a fillet of  the  given radius  on  the
vertex connecting the two edges.

edge1 edge2 CDD d1  d2, builds a chamfer on the vertex  connecting the
two edges with distance d1 on edge1 and d2 on edge2.

edge1 edge2 CDA d  ang, builds a chamfer on  the vertex connecting the
two  edges at distance d  on edge1 making  an  angle ang (degree) with
edge1.


EXAMPLE


	# Make a fillet and the two kinds of vertices 
	# with graphical selection of the edges

	polyline f 0 0 0 20 0 0 20 10 0 10 10 0 10 30 0 0 30 0 0 0 0
	mkplane f f

	chfi2d f f . . F 3 . . CDD 1 2 . . CDA 1.5 60


SEE ALSO

mkplane


Node: fubl,  Prev: chfi2d,  Next: mkevol, updatevol, buildevol,  Up: Drafting and blending,


SYNOPSIS


	fubl name shape1 shape2 radius


PURPOSE


Make a fusion boolean operation between two shapes then blend the
intersection edges with the radius.


EXAMPLE


	# fuse-blend two boxes
	box b1 20 20 5
	copy b1 b2
	ttranslate b2 -10 10 3
	fubl a b1 b2 1


SEE ALSO

fuse
blend


Node: mkevol, updatevol, buildevol,  Prev: fubl,  Next: ,  Up: Drafting and blending,


SYNOPSIS


	mkevol name shape

	updatevol edge u1 radius1 [u2 radius2 ...]

	buildevol


PURPOSE


These three commands work   together  to blend shapes  with   evolving
radius. First you give  the shape and the name  of the result with the
mkevol  command.    Then you describe  edges   to be blended  with the
updatevol command., for each edge you give a  set of pairs : parameter
radius, the  parameters will be  scaled along the  edge and the radius
function interpolated for  the  whole  edge.  At last  the   buildevol
command computes the result.


EXAMPLE


	# makes an evolved radius on a box
	box b 10 10 10
	mkevol b b
	# click an edge
	updatevol . 0 1 1 3 2 2
	buildevol


Node: Topology analysis,  Prev: Drafting and blending,  Next: ,  Up: Topology commands,


Analysis of  shapes includes  the  commands  to  compute length,  area
volumes and inertia properties.

- Use lprops, sprops, vprops to compute properties.

- Use bounding to display the bounding box of a shape.




* Menu:

* lprops, sprops, vprops::
* bounding::


Node: lprops, sprops, vprops,  Prev: ,  Next: bounding,  Up: Topology analysis,


SYNOPSIS


	lprops shape

	sprops shape

	vprops shape


PURPOSE


lprops  computes massic properties  of all  edges  in the shape with a
linear density of 1, sprops of all faces  with a surfacic density of 1
and vprops of all solids with a density of 1.

The  three commands print the  mass,  which is  either the length, the
area  or  the volume, the  coordinates of  the center of  gravity, the
matrix of inertia and  the moments. The center   and the main axis  of
inertia are displayed.


EXAMPLE


	# volume of a cylinder
	pcylinder c 10 20
	vprops c
	==> results
	Mass : 6283.18529981086

	Center of gravity : 
	X = 4.1004749224903e-06
	Y = -2.03392858349861e-16
	Z = 9.9999999941362

	Matrix of Inertia : 
	366519.141445068 5.71451850691484e-12 0.257640437382627
	5.71451850691484e-12 366519.141444962 2.26823064169991e-10
	0.257640437382627 2.26823064169991e-10 314159.265358863

	Moments : 
	IX = 366519.141446336
	IY = 366519.141444962
	IZ = 314159.265357595


Node: bounding,  Prev: lprops, sprops, vprops,  Next: ,  Up: Topology analysis,


SYNOPSIS


	bounding shape


PURPOSE


Display the bounding box of a shape and returns the string "xmin ymin
zmin xmax ymax zmax"


EXAMPLE


	# bounding box of a torus
	ptorus t 20 5
	bounding t
	==> 
	-25.000000100000001 -25.000000100000001 -5.0000001000000003 
	25.000000100000001 25.000000100000001 5.0000001000000003


Node: Index,  Up: Top,

2dapprox command                *Note appro, 2dapprox, 2dinterpolate::
2dbeziercurve command           *Note beziercurve, 2dbeziercurve::
2dbsplinecurve command          *Note bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve::
2dclear command                 *Note erase, clear, 2dclear::
2dcvalue command                *Note cvalue, 2dcvalue::
2dfit command                   *Note fit, 2dfit::
2dintersect command             *Note 2dintersect::
2dlmirror command               *Note pmirror, lmirror, smirror, 2dpmirror, 2dlmirror::
2dmd command                    *Note mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom::
2dmu command                    *Note mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom::
2dpbsplinecurve command         *Note bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve::
2dpd command                    *Note pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr::
2dpl command                    *Note pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr::
2dpmirror command               *Note pmirror, lmirror, smirror, 2dpmirror, 2dlmirror::
2dpr command                    *Note pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr::
2dproj command                  *Note proj, 2dproj::
2dpscale command                *Note pscale, 2dpscale::
2dpu command                    *Note pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr::
2drotate command                *Note rotate, 2drotate::
2dtranslate command             *Note translate, 2dtranslate::
2dzoom command                  *Note mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom::
add command                     *Note emptycopy, add, compound::
appro command                   *Note appro, 2dapprox, 2dinterpolate::
approximation                   *Note appro, 2dapprox, 2dinterpolate::
area                            *Note lprops, sprops, vprops::
autodisplay command             *Note autodisplay::
av2d command                    *Note axo, pers, top, ...::
axo command                     *Note axo, pers, top, ...::
back command                    *Note axo, pers, top, ...::
beziercurve command             *Note beziercurve, 2dbeziercurve::
beziersurf command              *Note beziersurf::
blend command                   *Note blend::
blindhole command               *Note hole, firsthole, holend, blindhole, holecontrol::
boolean operations              *Note fuse, cut, common::
bottom command                  *Note axo, pers, top, ...::
bounding command                *Note bounding::
box command                     *Note box, wedge::
box, bounding                   *Note bounding::
break command                   *Note break, continue::
bsplinecurve command            *Note bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve::
bsplinesurf command             *Note bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf::
buildevol command               *Note mkevol, updatevol, buildevol::
chamfer 2d                      *Note chfi2d::
chfi2d command                  *Note chfi2d::
chrono command                  *Note chrono::
circle command                  *Note circle::
cirtang command                 *Note cirtang::
clear command                   *Note erase, clear, 2dclear::
clknots command                 *Note clknots, shknots::
clpoles command                 *Note clpoles, shpoles::
cmovep command                  *Note cmovep, movep, movecolp, moverowp::
cmovepoint command              *Note cmovepoint, movepoint::
color command                   *Note color::
command                         *Note Syntax of TCL::
common command                  *Note fuse, cut, common::
complement command              *Note orientation, complement, invert::
compound command                *Note emptycopy, add, compound::
cone command                    *Note cone::
cone solid                      *Note pcylinder, pcone, psphere, ptorus::
continue command                *Note break, continue::
convert command                 *Note convert::
coord command                   *Note coord::
coordinate system               *Note plane::
copy command                    *Note rename, copy::
copying shapes                  *Note tcopy::
cpulimit command                *Note cpulimit::
curvature                       *Note localprop, minmaxcurandif::
curvature of surfaces           *Note surface_radius::
curve from edge                 *Note mkcurve, mkface::
curve to edge                   *Note edge, mkedge::
cut command                     *Note fuse, cut, common::
cvalue command                  *Note cvalue, 2dcvalue::
cylinder command                *Note cylinder::
cylinder solid                  *Note pcylinder, pcone, psphere, ptorus::
d command                       *Note u, d, l, r::
datadir command                 *Note datadir, save, restore::
defle command                   *Note dmod, discr, defle::
delete command                  *Note view, delete::
depouille command               *Note depouille::
derivative on curves            *Note cvalue, 2dcvalue::
dflush command                  *Note repaint, dflush::
directory command               *Note isdraw, directory::
discr command                   *Note dmod, discr, defle::
discretisation command          *Note isos, discretisation::
display command                 *Note display, donly::
display of curves and surfaces  *Note Display::
display of shapes               *Note isos, discretisation::
dmod command                    *Note dmod, discr, defle::
donly command                   *Note display, donly::
dot argument                    *Note Variables display commands::
Draw variables                  *Note Accessing variables in TCL and Draw::
dset command                    *Note dset, dval::
dtext command                   *Note dtext::
dump command                    *Note whatis, dump::
dump of image                   *Note hardcopy, hcolor, xwd::
dval command                    *Note dset, dval::
edge command                    *Note edge, mkedge::
edge from curve                 *Note edge, mkedge::
edge to curve                   *Note mkcurve, mkface::
ellipse command                 *Note ellipse::
emptycopy command               *Note emptycopy, add, compound::
environment variables           *Note datadir, save, restore::
erase command                   *Note erase, clear, 2dclear::
euler angles                    *Note cylinder::
eval command                    *Note Syntax of TCL::
exchuv command                  *Note exchuv::
exec command	                   *Note Syntax of TCL::
exit command                    *Note exit::
explode command                 *Note explode, exwire, nbshapes::
exploring a shape               *Note explode, exwire, nbshapes::
expr command                    *Note Syntax of TCL::
extsurf command                 *Note extsurf::
exwire command                  *Note explode, exwire, nbshapes::
face creation                   *Note profile::
face from surface               *Note mkplane, mkface::
fd command                      *Note focal, fu, fd::
features                        *Note localope::
fillet 2d                       *Note chfi2d::
fillets                         *Note blend::
firsthole command               *Note hole, firsthole, holend, blindhole, holecontrol::
fit command                     *Note fit, 2dfit::
focal command                   *Note focal, fu, fd::
for command                     *Note while, for, foreach::
foreach command                 *Note while, for, foreach::
free boundary                   *Note isos, discretisation::
front command                   *Note axo, pers, top, ...::
fu command                      *Note focal, fu, fd::
fubl command                    *Note fubl::
fuse command                    *Note fuse, cut, common::
global command                  *Note global, upvar::
grilapp command                 *Note surfapp, grilapp::
hardcopy command                *Note hardcopy, hcolor, xwd::
hcolor command                  *Note hardcopy, hcolor, xwd::
help command                    *Note help::
hole command                    *Note hole, firsthole, holend, blindhole, holecontrol::
holecontrol command             *Note hole, firsthole, holend, blindhole, holecontrol::
holend command                  *Note hole, firsthole, holend, blindhole, holecontrol::
hyperbola command               *Note hyperbola::
if command                      *Note if::
incdeg command                  *Note incdeg, incudeg, incvdeg::
incr command                    *Note while, for, foreach::
incudeg command                 *Note incdeg, incudeg, incvdeg::
incvdeg command                 *Note incdeg, incudeg, incvdeg::
inertia                         *Note lprops, sprops, vprops::
insertknot command              *Note insertknot, insertuknot, insertvknot::
insertpole command              *Note insertpole, rempole, remcolpole, remrowpole::
insertuknot command             *Note insertknot, insertuknot, insertvknot::
insertvknot command             *Note insertknot, insertuknot, insertvknot::
intersect command               *Note intersect::
invert command                  *Note orientation, complement, invert::
isdraw command                  *Note isdraw, directory::
isoparametric curves            *Note uiso, viso::
isos command                    *Note isos, discretisation::
knot insertion                  *Note insertknot, insertuknot, insertvknot::
knot removal                    *Note remknot, remulnot, remvknot::
knots display                   *Note clknots, shknots::
l command                       *Note u, d, l, r::
layout of views                 *Note axo, pers, top, ...::
left command                    *Note axo, pers, top, ...::
length                          *Note lprops, sprops, vprops::
line command                    *Note line::
lintan command                  *Note lintan::
lmirror command                 *Note pmirror, lmirror, smirror, 2dpmirror, 2dlmirror::
localope command                *Note localope::
localprop command               *Note localprop, minmaxcurandif::
location                        *Note tmove, treset::
longitude and latitude          *Note cylinder::
lprops command                  *Note lprops, sprops, vprops::
md command                      *Note mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom::
minmaxcurandif command          *Note localprop, minmaxcurandif::
mirroring shapes                *Note tmirror, tscale::
mkcurve command                 *Note mkcurve, mkface::
mkedge command                  *Note edge, mkedge::
mkevol command                  *Note mkevol, updatevol, buildevol::
mkface command                  *Note mkcurve, mkface::
mkplane command                 *Note mkplane, mkface::
movecolp command                *Note cmovep, movep, movecolp, moverowp::
movep command                   *Note cmovep, movep, movecolp, moverowp::
movepoint command               *Note cmovepoint, movepoint::
moverowp command                *Note cmovep, movep, movecolp, moverowp::
mu command                      *Note mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom::
mu4 command                     *Note axo, pers, top, ...::
nbiso command                   *Note nbiso::
nbshapes command                *Note explode, exwire, nbshapes::
numeric variables               *Note Accessing variables in TCL and Draw::
offset command                  *Note offset::
orientation command             *Note orientation, complement, invert::
parabola command                *Note parabola::
parameters command              *Note parameters::
pbsplinecurve command           *Note bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve::
pcone command                   *Note pcylinder, pcone, psphere, ptorus::
pcurve command                  *Note pcurve::
pcylinder command               *Note pcylinder, pcone, psphere, ptorus::
pd command                      *Note pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr::
periodic bsplines               *Note bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf::
pers command                    *Note axo, pers, top, ...::
pi                              *Note Accessing variables in TCL and Draw::
pick command                    *Note wclick, pick::
pipe command                    *Note pipe::
pl command                      *Note pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr::
planar section                  *Note section, psection::
plane command                   *Note plane::
pmirror command                 *Note pmirror, lmirror, smirror, 2dpmirror, 2dlmirror::
point command                   *Note point::
pole insertion and removal      *Note insertpole, rempole, remcolpole, remrowpole::
poles display                   *Note clpoles, shpoles::
polyline command                *Note wire, polyline, polyvertex::
polyvertex command              *Note wire, polyline, polyvertex::
postscript                      *Note hardcopy, hcolor, xwd::
pr command                      *Note pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr::
prism command                   *Note prism::
proc command                    *Note proc::
procedure                       *Note proc::
profile command                 *Note profile::
proj command                    *Note proj, 2dproj::
project command                 *Note project::
pscale command                  *Note pscale, 2dpscale::
psection command                *Note section, psection::
psphere command                 *Note pcylinder, pcone, psphere, ptorus::
ptorus command                  *Note pcylinder, pcone, psphere, ptorus::
pu command                      *Note pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr::
quoting                         *Note Syntax of TCL::
r command                       *Note u, d, l, r::
radius of curvature             *Note localprop, minmaxcurandif::
reference, call by              *Note global, upvar::
remcolpole command              *Note insertpole, rempole, remcolpole, remrowpole::
remknot command                 *Note remknot, remulnot, remvknot::
rempole command                 *Note insertpole, rempole, remcolpole, remrowpole::
remrowpole command              *Note insertpole, rempole, remcolpole, remrowpole::
remulnot command                *Note remknot, remulnot, remvknot::
remvknot command                *Note remknot, remulnot, remvknot::
rename command                  *Note rename, copy::
repaint command                 *Note repaint, dflush::
restore command                 *Note datadir, save, restore::
reverse command                 *Note reverse, ureverse, vreverse::
revol command                   *Note revol::
revsurf command                 *Note revsurf::
right command                   *Note axo, pers, top, ...::
rotate command                  *Note rotate, 2drotate::
rotating shapes                 *Note ttranslate, trotate::
rounding                        *Note chfi2d::
save command                    *Note datadir, save, restore::
scaling shapes                  *Note tmirror, tscale::
screen layout                   *Note axo, pers, top, ...::
script                          *Note Syntax of TCL::
section command                 *Note section, psection::
segment command                 *Note segment, segsur::
segsur command                  *Note segment, segsur::
selection, graphical            *Note Variables display commands::
set command                     *Note set, unset::
setnotperiodic command          *Note setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic::
setorigin command               *Note setorigin, setuorigin, setvorigin::
setperiodic command             *Note setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic::
setunotperiodic command         *Note setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic::
setuorigin command              *Note setorigin, setuorigin, setvorigin::
setuperiodic command            *Note setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic::
setvnotperiodic command         *Note setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic::
setvorigin command              *Note setorigin, setuorigin, setvorigin::
setvperiodic command            *Note setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic::
shknots command                 *Note clknots, shknots::
shpoles command                 *Note clpoles, shpoles::
smallview command               *Note axo, pers, top, ...::
smirror command                 *Note pmirror, lmirror, smirror, 2dpmirror, 2dlmirror::
source command                  *Note source::
sphere command                  *Note sphere::
sphere solid                    *Note pcylinder, pcone, psphere, ptorus::
sprops command                  *Note lprops, sprops, vprops::
spy command                     *Note spy::
spying session                  *Note spy::
substitution                    *Note Syntax of TCL::
surface to face                 *Note mkplane, mkface::
surface_radius command          *Note surface_radius::
surfapp command                 *Note surfapp, grilapp::
svalue command                  *Note svalue::
sweeping                        *Note prism::
tangent circle                  *Note cirtang::
tangent line                    *Note lintan::
TCL                             *Note Syntax of TCL::
tcopy command                   *Note tcopy::
text display                    *Note dtext::
tmirror command                 *Note tmirror, tscale::
tmove command                   *Note tmove, treset::
to2d command                    *Note to2d, to3d::
to3d command                    *Note to2d, to3d::
top command                     *Note axo, pers, top, ...::
torus command                   *Note torus::
torus solid                     *Note pcylinder, pcone, psphere, ptorus::
translate command               *Note translate, 2dtranslate::
translating shapes              *Note ttranslate, trotate::
treset command                  *Note tmove, treset::
trim command                    *Note trim, trimu, trimv::
trimu command                   *Note trim, trimu, trimv::
trimv command                   *Note trim, trimu, trimv::
trotate command                 *Note ttranslate, trotate::
tscale command                  *Note tmirror, tscale::
ttranslate command              *Note ttranslate, trotate::
u command                       *Note u, d, l, r::
uiso command                    *Note uiso, viso::
unnamed objects                 *Note Variables display commands::
unset command                   *Note set, unset::
upbsplinesurf command           *Note bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf::
updatevol command               *Note mkevol, updatevol, buildevol::
upvar command                   *Note global, upvar::
ureverse command                *Note reverse, ureverse, vreverse::
uvpbsplinesurf command          *Note bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf::
v2d command                     *Note axo, pers, top, ...::
value on curves                 *Note cvalue, 2dcvalue::
value, call by                  *Note global, upvar::
vertex command                  *Note vertex::
view command                    *Note view, delete::
viso command                    *Note uiso, viso::
volume                          *Note lprops, sprops, vprops::
vpbsplinesurf command           *Note bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf::
vprops command                  *Note lprops, sprops, vprops::
vreverse command                *Note reverse, ureverse, vreverse::
wait command                    *Note wait::
wclick command                  *Note wclick, pick::
wedge command                   *Note box, wedge::
whatis command                  *Note whatis, dump::
while command                   *Note while, for, foreach::
window                          *Note view, delete::
wire command                    *Note wire, polyline, polyvertex::
wire exploration                *Note explode, exwire, nbshapes::
word                            *Note Syntax of TCL::
wzoom command                   *Note mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom::
xwd command                     *Note hardcopy, hcolor, xwd::
xwud                            *Note hardcopy, hcolor, xwd::
zoom command                    *Note mu, md, 2dmu, 2dmd, zoom, 2dzoom, wzoom::
