perm filename GEMOLD.DOC[DOC,BGB] blob sn#019099 filedate 1973-06-15 generic text, type T, neo UTF8
00100	SAILON NUMBER 68			                GEOMED MANUAL
00200	
00300	
00400	STANFORD ARTIFICIAL INTELLIGENCE LABORATORY		     MAY 1972
00500	OPERATING NOTE NUMBER 68
00600	
00700	
00800	                   GEOMED  -  A GEOMETRIC EDITOR.
00900	
01000	
01100	                          Bruce g. Baumgart
01200	
01300	
01400	ABSTRACT:
01500	
01600		GEOMED  is  for making and editing polyhedra and so may be
01700	characterized as a 3D drawing program.
02000	
02100	                              CONTENTS
02200	
02300	
02400			INTRODUCTION.
02500	
02600			POLYHEDRONS.
02700	
02800			COMMANDS.
02900	
03000			REPRESENTATIONS.
03100	
03200			EXAMPLES.
03300	
03400			APPENDICES.
     

00100	INTRODUCTION - 1971 of GEOMED-II.
00200	
00300		GEOMED itself is for making and editing polyhedra.    However
00400	the  larger goal I had in mind when undertaking GEOMED was to achieve
00500	a means of entering 3D data into the computer to form a World  Model,
00600	so  that  a  synthetic  image  could  be  generated  to  be compared,
00700	contrasted and correlated with real images.
00800	
00900		GEOMED can now do about all that  I  need  from  it  for  the
01000	moment,  the demands of the larger goal now seem to lie in comparing,
01100	contrasting and correlating images as well  as  projecting  2D  blobs
01200	into  3D  bodies,  solving  for camera locations and orientations and
01300	pushing the cart hardware around.
01400	
01500		A binary dump copy of GEOMED  can  be  started  by  typing  R
01600	GEOMED  at a III display.  The source files of GEOMED are filed under
01700	the pppn [GEO,BGB] and may either be  on  the  DSK  or  on  the  cart
01800	project  UDP.  The  GEOMED  of  1971  was written in SAIL and did use
01900	SAIL's associative data structure facility, LEAP.
02000	
02100	
02200	INTRODUCTION - 1972 of GEOMED-IV.
02300	
02400		GEOMED has been rewritten twice again now, the third  version
02500	involved  getting  GEOMED's  models  out of LEAP and into the "Winged
02600	Edged" data structure that was orginally  developed  for  the  hidden
02700	line  eliminator,  OCCULT.   The  fourth  version  was  started  as a
02800	conversion to NEW SAIL, but the pain of being a guinea pig to frequent
02900	and poorly thought out compiler changes coercised me to convert GEOMED
03000	into the PDP-10's machine code, using the FAIL assembler.
03100	
03200	
03300	
03400	Abbreviations
03500		wrt	with respect to
03600		pdl	push down list
03700		ccw	counter clockwise
03800		cw	clockwise
03900		α	control key
04000		β	meta key
04100		ε	meta control keys
     

00100	POLYHEDRONA & THE SCHLEGEL DIAGRAM.
00200	
00300		"Leonardo  da  Vinci made skeletal models of polyhedra, using
00400	strips of wood for their edges and leaving the faces to be  imagined.
00500	When such a model is seen in perspective from a position just outside
00600	the center of one face, this face appears as a large polygon with all
00700	the  remaining  faces  filling  its  interior.  Such a drawing of the
00800	solid is called a Schlegel Diagram."
00900	
01000		"The Schlegel diagram for a  polyhedron  shows  at  a  glance
01100	which vertices belong to which edges and faces.  Each face appears as
01200	a region bounded by edges, except the `initial' face, which  encloses
01300	all  the  others. To ensure a one-to-one correspondence between faces
01400	and regions we merely have to associate the  initial  face  with  the
01500	infinite exterior region."
01600	
01700					- page 152, Coxeter's Geometry.
     

00100	POLYHEDRA	-	THE EULER EQUATION.
00200	
00300		"Any polyhedron that can be represented by a Schlegel diagram
00400	is said to be `simply connected' or `Eulerian', because its numerical
00500	properties satisfy Euler's formula:
00600	
00700	                            F - E + V = 2
00800	
00900	which  is  valid  not  only  for  the  Schlegel  diagram  of  such  a
01000	polyhedron, but for any connected `map' formed by a finite number  of
01100	points  and  line  segments  decomposing a plane into non-overlapping
01200	regions: the only restriction is that there  must  be  at  least  one
01300	vertex.
01400	
01500		"A proof resembling Euler's may be expressed as follows.  Any
01600	connected  map  can be built up, edge by edge, from the primitive map
01700	that consists of a single isolated vertex. At  each  stage,  the  new
01800	edge  either  joins  an  old vertex to a new vertex, or joins two old
01900	vertices. In the former case, V and E are each increased by 1 while F
02000	is  unchanged;  in  the latter, V is unchanged while E and F are each
02100	increased by 1.  In either case, the combination F-E+V is  unchanged.
02200	At  the  beginning,  when  there  is  only  one vertex and one region
02300	(namely, all the rest of the plane), we have
02400	
02500		               F - E + V  =  1 - 0 + 1  =  2.
02600	
02700		"This value 2 is maintained throughout the whole construction.
02800	Thus, Euler's formula holds for every plane map.  In  particular,  it
02900	holds  for  every Schlegel diagram, and so for every simply connected
03000	polyhedron."
03100	
03200					- page 152, Coxeter's Geometry.
03300	
03400	
03500	
03600	Euler's  formula  can  be  extended for polyhedra that are allowed to
03700	have Holes or Handles:
03800	
03900	                         F - E + V = 2 - 2*H
04000	
04100	GEOMED commands preserve the above formula,  so  consequently  all
04200	GEOMED polyhedrons are Topologically Eulerian.
     

00100	COMMANDS.
00200	
00300	
00400		GEOMED is invoked by single character commands. Commands that
00500	require arguments refer to the topmost positions  of  a  scratch  pad
00600	pushdown list.  The commands fall into five major groups:
00700	
00800	
00900	GROUP - 1.
01000	The Four Primitive Topology Commands.
01100		V - Vertex Body Creation.
01200		E - Edge and Vertex Creation.
01300		J - Join two old vertices forming a new edge and face.
01400		G - Glue two faces together.
01500	
01600	
01700	GROUP - 2.
01800	Compound Topology Commands.
01900		K - Delete.
02000		S - Sweep.
02100		M - Midpoint of an edge creation.
02200	       αR - Rotational solid completion.
02300	
02400	
02500	GROUP - 3.
02600	Geometric Commands.
02700		Translation.
02800		Rotation.
02900		Dilation.
03000		Reflection.
03100	   ...on 3 axes: x, y, and z;
03200	   ...in 2 directions + or -, ccw or cw, more or less;
03300	   ...wrt a frame of reference: World Frame, Body Frame, Relative Frame.
03400	   ...wrt a strength of transformation, 1 foot, 20 degrees, 16 percent.
03500	
03600	
03700	GROUP - 4.
03800	The Scratch Pad PDL Commands.
03900		push, pop, swap, get, and so on.
04000	
04100	
04200	GROUP - 5.
04300	The Input, Output and Display Commands.
     

00100	COMMANDS  -  GROUP 1.
00200	
00300	                THE FOUR PRIMITIVE TOPOLOGY COMMANDS.
00400	
00500	
00600	V - VERTEX BODY CREATION.
00700	
00800		This command creates a polyhedron consisting  of  one  vertex
00900	and  one  face.  The  vertex  is  placed  at the world origin.  Every
01000	polyhedron is derived from  a  Vertex  Body.  The  terms  "body"  and
01100	"polyhedron" are equivalent in GEOMED.
01200		The V command takes no arguments and leaves  the  new  body,
01300	face and vertex on the stack with the vertex on top.
01400	
01500	
01600	E - EDGE AND VERTEX CREATION.
01700	
01800		This command creates a new edge and  a  new  vertex  starting
01900	from  an  old  vertex.  The E command requires two arguments, the top
02000	argument is the old vertex and the second argument must be one of the
02100	faces  to  which  the vertex belongs.  The new edge and vertex become
02200	associated with the given face.
02300		The  E  command,  increments  the  NCNT,  which  is mentioned
02400	elsewhere, and is used to form solids of rotation.
02500	
02600	
02700	J - JOIN OLD VERTICES  -  FACE AND EDGE CREATION.
02800	
02900		This  command  creates  a  new  face  and  a new edge.  The J
03000	command has two forms.  The general form of the J command expects two
03100	vertices  of  the same face to be given on the top of the pdl, and it
03200	returns in their place a new edge and a new face  with  the  edge  on
03300	top.
03400		The wire form of the J command applies only to  a  face  that
03500	doesn't  have  a  closed perimeter, which in fact approximates a wire
03600	with two ends free.  In this case the top argument is a Vertex End of
03700	the wire and the second argument is the Face of the wire.  The wire J
03800	command returns the other end of the  wire  in  top  and  leaves  the
03900	second argument unchanged. The J command clears the NCNT.
04000	
04100	
04200	G - GLUE TWO FACES TOGETHER.
04300	
04400		This  command  takes  two  faces from the top of the pdl. The
04500	faces must be nearly coincidant and of opposite orientation. The  two
04600	faces  are  deleted  along  with all the edges and vertices of one of
04700	them.  If there were two bodies, then one remains. A  body  glued  to
04800	itself  forms  either  a  hole  or  a handle. When the glue drys, the
04900	resulting body is returned.
     

00100	COMMANDS  -  GROUP 2.
00200	
00300	                     COMPOUND TOPOLOGY COMMANDS.
00400	
00500	
00600	D - DELETE.
00700	
00800		This  command  takes  the  top body, face, edge or vertex and
00900	deletes all parts of the body to which it belongs.  The  camera  body
01000	and NIL will not be deleted.
01100	
01200	
01300	S - SWEEP.
01400	
01500		This  command  sweeps  a  face into either a sheet or a solid
01600	depending on the NCNT. If the NCNT is zero, then SWEEP returns a  new
01700	face  coincident with the given face and connected to it by new sweep
01800	edges and rectangular sweep faces forming a prism.  Furthermore, a  β
01900	sweep  forms a pyramid on the given face and returns the peak vertex,
02000	while α sweep and ε sweep form antiprisms. An antiprism is  merely  a
02100	prism with the rectangular sweep faces split into triangles.
02200		When the NCNT is non-zero, only the first NCNT edges  of  the
02300	argument  face's  perimeter are swept into new faces.   Thus NCNT new
02400	faces are created and the argument face  is  returned  somewhat  more
02500	complicated  than  before. See the SPHERE example to clarify sweeping
02600	out a solid of rotation.
02800	
02900	
03000	R - Rotational Solid Completion.
03100	
03200		After  a  wire  has  been  swept  around, you have a shell of
03300	rotation.  To change a shell into a solid all that remains to be done
03400	is  do  a series of J commands on the leading and lagging vertices of
03500	the shell. The R command, using the NCNT  to  step  around  the  pole
03600	caps, calls the J-command for all the necessary pairs. The sweep face
03700	is taken as an argument and nothing is returned.
03800	
03900	
04000	M - MIDPOINT.
04100	
04200		This  command  takes an edge argument and creating a new edge
04300	and a new vertex makes the appropriate modifications to the body  and
04400	returns a the midpoint vertex of the given edge.
     

00100	COMMANDS  -  GROUP 3.
00200	
00300	                       HOMEOMORPHIC COMMANDS.
00400	
00500		"The criterion that distinguishes one geometry from another
00600		is the group of transformations under which the propositions
00700		remain true."		- Klein's Erlangen Program, 1872.
00800	
00900	The Euclidean Transformations are Translation,  Rotation,  Reflection
01000	and  Dilation.   Homeomorphic is Greek for "same form", and refers to
01100	the so called "rubber sheet" transformations that do not  change  the
01200	topology of faces, edges and vertices. The Top of the scratch pad pdl
01300	is transformed by hitting one of the  following  Euclidean  Transform
01400	characters:
01500	
01600	  :	Transform in the positive direction wrt the X-axis.	
01700	  ;	Transform in the negative direction wrt the X-axis.
01800	  )	Transform in the positive direction wrt the Y-axis.
01900	  (	Transform in the negative direction wrt the Y-axis.
02000	  *	Transform in the positive direction wrt the Z-axis.
02100	  -	Transform in the negative direction wrt the Z-axis.
02200	
02300	Clearly these characters are not mnemonics, they were chosen  because
02400	they do not require the TOP key and are conveniently grouped in pairs
02500	under one's right hand.
02600	
02700	The Transform is selected by keying the control bits or or  prefixing
02800	the  command  with a control key character of suffering a preselected
02900	default Transform:
03000	
03100			default  -  usually TRANSLATION.
03200	α      		ROTATION.
03300	β		DILATION.
03400	ε	 	REFLECTION.
03500	
03600	
03700	The Euclidean Transformation default selection characters are:
03800	
03900	!		TRANSLATION.
04000	@		ROTATION.
04100	=		DILATION.
04200	∃		REFLECTION.
     

00100	COMMANDS  -  GROUP 3  - continued.
00200	
00300	                     Euclidean Transformations.
00400	
00500		Translation  moves  the Top object in the direction specified
00600	by one unit of translation strength.  Similairly Rotation rotates the
00700	Top object about the axis specified by one unit of rotational strength.
00800	Positive Rotations are ccw and negative rotations are cw.
00900	
01000		Dilations refer to a  three  state  dilation  axis  selector.
01100	Dilation  state  1  causes  dilation  on the specified axis, dilation
01200	state 2 causes dilation on the two axes not indicated,  and  dilation
01300	state  3  causes  dilation  on  all the axis indicated.  The dilation
01400	selector is advanced by typing the letter A, Advance  Axis  Selector.
01500	The  state of the dilation axis selector is displayed as a digit 1, 2
01600	or 3 just to the right of the dilation strength's per  cent  sign  in
01700	the editor status display at the upper right of the III screen.
01800	
01900		And  finally,  Reflections act only on the axis specified and
02000	always in the world frae of reference.  I have found little  use  for
02100	reflections and consquently their power has atrophied.
     

00100	COMMANDS  -  GROUP 3  - continued.
00200	
00300	                         Frames of Reference
00400	
00500	
00600	The Frame of Reference of the Euclidean Transformations
00700	is determined by the FRAME switch.
00800		FRAME	0	is the world frame.
00900		FRAME	1	is the body  frame.
01000		FRAME	2	is the relative  frame.
01100	The Frame switch is incremented modulo 3 by the F-command.
01200	
01300		The body frame of a body is its datum.
01400	
01500		The body frame of a face is  a  frame  of  reference  with  a
01600	z-axis  thru  the  center  of  mass  of the face and pointing out the
01700	exterior side of the face normal to the plane of the face.
01800	
01900		The body frame of a face is computed by placing an origin  at
02000	the face's average vertex (a pseudo center of mass), and by extending
02100	the i-unit-vector from the origin towards the  first  vertex  of  the
02200	face's  perimeter  list,  the k-unit-vector is normal to the plane of
02300	the face, as determined by the first three points  of  the  perimeter
02400	list,  and  points  outwards  from  the  face's  exterior  side.  The
02500	j-unit-vector is the  k-unit-vector  crossed  into
02600	the i-unit-vector for right handedness.
02700	
02800		The body frame of an edge or vertex is taken from the body to
02900	which it belongs.
03000	
03100		Transformation  in  the Relative frame of reference transform
03200	the Top object wrt to body frame of reference of the second object on
03300	the  PADPDL.  If the second object doesn't exist or isn't a body then
03400	the world frame is used.
     

00100	COMMANDS  -  GROUP 3  -  continued.
00200	
00300	Strength of Transformation
00400	
00500	The strength of a Euclidean Transformation can be halved or
00600	doubled by keying the Transform's control bits and by striking
00700	a left or right square bracket respectively.
00800	
00900		/	Halve a Transformation Strength.
01000		\	Double a Transformation Strength.
01100	
01200	The strength of a Euclidean Transformation can be set by keying the
01300	Transform's control bits and by striking a digit from 0 to 9.
01400	
01500	For Translation:
01600		0	1/16 of a foot,  A "binary inch".
01700		4	One Foot.
01800		9	32 Feet.
01900		N	Where 0 ≤ N ≤ 9 yield 2.0↑(N-4) feet,
02000			but you only need to memorize the 0,4,9 in
02100			order to keep your head straight.
02200	For Rotation:
02300		9	π/2
02400		8	π/4
02500		   etc
02600	For Dilation:
02700		0	100%
02800		1	10%
02900		2	20%
03000		   etc
03100		9	90%
     

00100	COMMANDS  -  GROUP 3  -  continued.
00200	
00300	Setting the Strengths
00400	
00500		The strengths of the Euclidean Transformations can be entered
00600	numerically by typing λ,π or % followed by a numerical argument.   In
00700	command formats given below x & y are scanned as real numbers,  while
00800	n,  m,  d & s are scanned as integers. Integers can be typed in place
00900	of reals with no ill affect, whereas reals  typed  for  integers  are
01000	Fixed.
01100	
01200	For Translation:
01300		λx	feet.		Initially set to 1 foot.
01400		λx'	feet.
01500		λx'y"	feet and inches.
01600		λy"	inches.
01700	For Rotation:
01800		π/m	pi fraction.	Initially set to π/4.
01900		πn/m	pi fraction.
02000		πx	radians.
02100		πd,m,s	degrees, minutes, seconds of arc.
02200	For Dilation:
02300		%x	0.01 ≤ x ≤ 100.00.  Divisions by zero are shunned.
02400			Initial set to 75%
02500	
     

00100	COMMANDS  -  GROUP 4.
00200	
00300	                    THE SCRATCH PAD PDL COMMANDS.
00400	
00500		All GEOMED commands that require arguments refer to  the  top
00600	elements of an itemvar pushdown stack.  The stack is displayed on the
00700	leftside of the III screen. The first element on the stack is  called
00800	"TOP"  or  "ARG1",  the second element will be called "ARG2", and the
00900	third element "ARG3".
01000	
01100	↑ 	POP the scratch pad pdl.
01200	↓	PUSH the TOP of the scratch pad pdl onto the scratch pad pdl.
01300	
01400	↔	SWAP the TOP and ARG2.
01500	,	SWAP TOP  and ARG3.
01600	~(tilde)SWAP ARG2 and ARG3.
01700	
01800	.	PUSH the camera body item onto the scratch pad pdl.
01900	
02000	⊗link	Retrieve the Values of the link.  Namely the set link⊗TOP is
02100		pushed onto the stack.
02200	`link	Retrieve the Objects of the link.  Namely the set link`TOP is
02300		pushed onto the stack.
02400	
02500	→	Cdr a perimeter list. To look at a perimeter of a face, get
02600		the face on the top of the stack and push it, then cdr along.
02700	←	UnCdr a perimeter list.
02800	
02900	α↑	POP and then keep popping until a Body is on top
03000		or the stack becomes empty.
03100	β↑	Clear the stack.
03200	
03300	Nstr	Name the top body by the string str.
03400	Wstr	Push the body named string str on the PADPDL.
03500	Wn	Get the body, item numbered n.
03600	?	List all the bodies.
     

00100	COMMANDS  -  GROUP 5.
00200	
00300	                 INPUT, OUTPUT AND DISPLAY COMMANDS.
00400	
00500	O	Output the top body of the PADPDL into a B3D file.
00600	I	Input a B3D file to the  PADPDL.
00700	P	Output a PLT file of the current display.
00800	
00900		GEOMED will ask the user for file names when they are needed.
01000	On  B3D  output if you wish to make a file of several bodies then you
01100	do not close the output when you are given the chance.
01200	
01300		PLT Files can be plotted on the CALCOMP by running PLTVEC and
01400	answering it self explanatory questions.
01500	
01600	
01700	CO	Camera location, orientation, focal and raster constants Output.
01800	CI 	Camera location, orientation, focal and raster constants Input.
01900	CP	Camera  focal and raster constants printed on the TTY.
02000	
02100	
02200	MODIFICATION OF CAMERA PARAMETERS
02300	
02400		GEOMED's  camera model is parameterized by three integers and
02500	three real numbers called respectively LDX, LDY, LDZ, PDX,  PDY,  and
02600	FOCAL.   LDX  and  LDY  are  the  logical  raster  half  size and are
02700	initially 144 by 108, and represent  half  the  number  of  rows  and
02800	columns in the image.  PDX and PDY are the physical raster half size,
02900	which is initially 5.3 by 4 millimeters and FOCAL is the focal length
03000	of   the  camera  model  and  is  initially  12.5  millimeters  which
03100	corresponds to the wide angle lens that is on the cart.  LDZ  happens
03200	to always be 1000 and is inaccessibe to users.
03300	
03400		αX	LDX		βX	PDX
03500		αY	LDY		βY	PDY
03600	
03700		αF	FOCAL
     

00100	INPUT-OUTPUT OF GEOMED COMMAND LANGUAGE EXTERNAL FILES
00200	
00300	⊂  -  LEFT HORSE SHOE, OPEN COMMAND FILE.
00400	⊃  -  RIGHT HORSE SHOE, CLOSE COMMAND FILE.
00500	X  -  EXECUTE EXTERNAL COMMAND FILE.
00600	
00700		The Examples at the end of this write up are in the  FILE.GEO
00800	external  command format. GEO files are written in ASCII mode 0, with
00900	or without line numbers.   Lines without tabs  are  ignored  and  are
01000	presumed  to be commentary. In a line with tabs all characters before
01100	the first tab are presumed  to  be  sequence  numbers  or  tags,  all
01200	characters  between  the  first tab and the second tab or end of line
01300	are executed as GEOMED commands.   All characters beyond  the  second
01400	tab are presumed to be commentary. Thus the line format is:
01500	
01600	TAG	Operations	Comment
01700	TAG	Operations	Comment
01800	TAG	Operations	Comment
01900	TAG	Operations	Comment
02000	
02100	
02200		For what it may be worth, the GEO file format  is  clearly  a
02300	representation for polyhedrons and scenes of polyhedrons. At one time
02400	I considered it very significant that GEOMED commands were so utterly
02500	concise as compared to B3D files for the same object, and I had hoped
02600	that my robot could have a large dictionery of  objects  which  would
02700	only  be  expanded  into  B3D when such an object was expected to be in
02800	view.
     

00100	COMMANDS  -  GROUP 5.
00200	
00300	Editor Status Display
00400	
00500	_	flip FLAGV,  Display markings on the TOP object.
00600		All the vertices of the top object are marked with asterisks
00700		and if the object is a face the edges are marked by a perimeter
00800		serial number.
00900	
01000	∂	flip FLAGD, Display the datum of the TOP object.
01100	
01200	≡	flip FLAGED, Suppress the Editor Status Display.
01300	
01400	≠	flip FLAGRS, Suppress the main display refresh.
01500	
01600	#	output a screen full of carriage return line feeds.
01700	
01800	L	flip Label mode flag.
01900	
     

00100	COMMANDS  -  GROUP 5.
00200	
00300	Koloring and Fotometry.
00400	
00500	K - KOLOR COMMAND.
00600		
00700		The color command sets the parameters named RED, GREEN, BLUE,
00800	ALBEDO,  SPECUL  and  LUMEN of a face datum. These six parameters are
00900	presently packed into a single word of six bytes  and  assume  values
01000	between  0  and  100 (well really 0 to 63). The Kolor command takes a
01100	string argument which is  an  arbitrarily  ordered  concatenation  of
01200	color words, where a color word begins with the initial letter of one
01300	of the six parameters (R, G, B, A, S, or L) followed by  one  or  two
01400	digits.   Thus:  KOLORING  ←  G40  B60  would  tend  to give things a
01500	Turquoise appearance when Video Synthesized.
01600	Koloring can be applied to both faces and bodies, naturaly in the
01700	later case all the faces of that body are colored.
01800	
01900	The approximate meanings of the Kolor and Fotometry coefficients are:
02000		RED	-	percent of intensity seen thru a red filter.
02100		GREEN	-	percent of intensity seen thru a green filter.
02200		BLUE	-	percent of intensity seen thru a blue filter.
02300		ALBEDO	-	equivalent to reflectance, per cent of light
02400				power out wrt light power into a face.
02500		SPECUL  -	per cent of "metalic-look", zero specul is
02600				diffuse Lambert law's cosine light scattering,
02700				100% specul will mirror the light source
02800				angle of incidence is equal to the angle of
02900				reflection law light scattering.
03000		LUMEN	-	per cent of "glows-in-the-dark", GEO bodies
03100				can not be light sources wrt to each other
03200				but a little luminousity models the appearance
03300				of an Ambient light level and diminishes that
03400				high-contrast 2001 deep-space look.
     

00100	TVCUT and TVHIDE
00200	
00300		In order to generate a sixbit synthetic Television picture in
00400	the so called "Pingle" or ".DAT" or "Ten Word Header" format,  Output
00500	the   bodies  you  want,  and  the  desired  camera;  then  type  "RU
00600	TVCUT[GEO,BGB]" and answer the easy questions having to do with  file
00700	names;  then type "RU TVHIDE[GEO,BGB]" and again give file names when
00800	asked.  TVHIDE also may ask for other parameters, type zeroes to  get
00900	default values.
     

00100	                 GEOMED'S POLYHEDRON REPRESENTATION
00200	                         Polyhedrons in LEAP
00300	
00400		Bodies, Faces, Edges and Vertices are represented  by  items.
00500	In  GEOMED  only  Bodies  and  Vertices have datums.   The datum of a
00600	vertex is a real array [1:3] containing the x, y, and  z  coordinates
00700	of that vertex in feet wrt an arbitrary frame of reference called the
00800	World Frame.
00900	
01000	The datum of a body is a real array [1:4,1:3] of which the fourth row
01100	is  the locus of the body in world coordinates.  The first three rows
01200	of the body datum contain the components of the  i,  j,  and  k  unit
01300	vectors which determine the orientation of the body.
01400	
01500	Body  items  are  linked  to  Face, Edge, and Vertex items by Linking
01600	Items named BF, BE, and BV respectively:
01700	
01800				BF⊗body≡face
01900				BE⊗body≡edge
02000				BV⊗body≡vertex
02100	
02200	Face items are linked to Edge and Vertex items by linking items named
02300	FE and FV respectively:
02400	
02500				FE⊗face≡edge
02600				FV⊗face≡vertex
02700	
02800	Edge items are linked to Vertex items by a  linking  item  named  EV:
02900	
03000				EV⊗edge≡vertex
03100	
03200	Furthermore,  Face  items  themselves  are  used  to  link  edges and
03300	vertices in ccw order as seen from the exterior  side  of  the  face.
03400	The  faces  of  solid  bodies have two sides, an exterior side and an
03500	interior side.  The  canonical  form  of  the  perimeter  list  of  a
03600	triangular face would include the following associations:
03700	
03800				face⊗face≡vertex1,
03900				face⊗vertex1≡edge1
04000				face⊗edge1≡vertex2
04100				face⊗vertex2≡edge2
04200				face⊗edge2≡vertex3
04300				face⊗vertex3≡NIL
04400	
04500	NIL is merely an item used to terminate perimeter lists.
04600	
04700	GEOMED's linking items  happened  to  come  out  going  in  the  same
04800	direction  as  Hand Eye's linking items, namely from larger things to
04900	smaller. The correspondence is as follows:
05000		BF  for  FACE			FE  for  BOUNDARY
05100		BE  for  LINE			FV  for  CORNER
05200		BV  for  POINT			EV  for  ENDPT
     

00100	                   GEOMED'S POLYHEDRON FILE FORMAT
00200	
00300		B3D,  Bodies in 3D, formated files are the primary product of
00400	the Geometric Editor.
00500	
00600		A B3D file is written in binary mode and is  composed  of  an
00700	arbitrary  number  of  body blocks terminated by a zero word or an EOF
00800	condition. A body block is composed of a  Body  Header,  a  Table  of
00900	Vertices, a Table of Edges and a Table of Face Perimeter Lists.
01000	
01100		The  Body  Header  must have at least three words.  The first
01200	word must contain the Vertex Count, the second word must contain  the
01300	Edge  Count.   Further words are optional for Input to GEOMED. GEOMED
01400	outputs The last 12 words contain the Body's Datum.
01500	
01600		The Table of Vertices is made up of 3-word blocks  containing
01700	the  x,  y,  and z World Coordinates of each vertex of the body.  The
01800	Table of Edges has 1-word per edge.    Each  half  of  an  edge  word
01900	contains  a non-zero positive integer which is the number of a vertex
02000	in the vertex table.
02100	
02200		The Table of Face perimeter lists consists of variable length
02300	blocks  of  Perimeter  Words which are prefixed by a zero word.  Each
02400	Perimeter  Word  contains  two  non-zero  positive   integers   which
02500	represent    a  Vertex  Table Number and an Edge Table Number and are
02600	stored in the left  and  right  halves  respectively.   As  mentioned
02700	above,  the end of the body block, which is also the end of the Table
02800	of Face Perimeter Lists, is marked by a -1 word.
     

00100	SUMMARY OF THE B3D FILE FORMAT
00200	
00300	begin	"body block"
00400	α BODY HEADER - The minimal body header consists of XWD -1,3 ↔ M ↔ N;
00500		XWD -1,WRDCNT;		α BODY DELIMITER, WRDCNT = NUMBER OF WORDS IN THE HEADER;
00600		INTEGER M;		α NUMBER OF VERTICES IN THIS BODY;
00700		INTEGER N;		α NUMBER OF EDGES IN THIS BODY;
00800		SIXBIT BNAME;		α NAME OF THE BODY OR ZERO;
00900		REAL RADIUS;		α MAXIMUM DISTANCE BETWEEN A VERTEX AND THE BODY'S ORIGIN;
01000		REAL ARRAY BDATUM[1:4,1:3];	α THE BODY'S DATUM - ORIENTATION/LOCATION MATRIX;
01100	
01200	α TABLE OF VERTICES;
01300		REAL X1,Y1,Z1;
01400		REAL X2,Y2,Z2;
01500		etc.
01600		REAL Xm,Ym,Zm;
01700	
01800	α TABLE OF EDGES;
01900		XWD I1,J1;		α I's & J's are vertex table indices;
02000		XWD I2,J2;
02100		etc.
02200		XWD In,Jn;
02300	
02400	α TABLE OF FACES;
02500	begin	"face block"
02600	
02700	α face header  -  the minimal face header consists of XWD -2,1;
02800		XWD -2,WRDCNT;		α FACE DELIMITER, WRDCNT = NUMBER OF WORDS IN FACE HEADER;
02900		BYTES Q;		α Reflectance [0-8], Specular Coef [9-17], Radiance [18-35];
03000	α face contents;
03100		XWD V1,E1;		α Perimeter List of Vertex and Edge pointers in ccw order;
03200		XWD V2,E2;
03300		etc.
03400		XWD Vp,Ep;
03500	end	"face block"
03600		   until an XWD -1, or XWD -2 shows up.
03700	end	"body block"
03800		   until a 0 or an EOF shows up.
03900	
04000	α EOF;
04100		0;
     

00100	EXAMPLES
00200	
00300		In  the  hard  cover  version  of  this  write  up  there are
00400	illustrations which go along with the examples.  However,  since  you
00500	are  reading  the  cheap paper back version, you will have to key the
00600	examples into the machine at a III display console in  order  to  see
00700	the illustrations.
00800	
00900	A CUBE
01000	
01100	1.	V_	Vertex body creation and "MARKED" display mode.
01200	2.	:)	positions the vertex in the first quadrant.
01300	3.	\	doubles strength of translation.
01400	4.	E;	make an edge and vertex and move left.
01500	5.	E(	edge vertex down.
01600	6.	E:	edge vertex right.
01700	7.	J↑	connect the first and last vertices of the wire
01800			forming a new edge and a new face, you now
01900			have a square lamina.
02000	8.	/	halves the strength of translation.
02100	9.	-	pushes the face lamina away from you.
02200	10.	S	sweeps the square face into a very thin solid.
02300	11.	**↑	moves the new face towards you.
02400	
02500	ANOTHER CUBE
02600	
02700	1.	V_	Vertex body creation and "MARKED" display mode.
02800	2.	:)	positions the vertex in the first quadrant.
02900	3.	\	doubles strength of translation.
03000	4.	E;	make an edge and vertex and move left.
03100	5.	↑S(	get the wire face on top and sweep it into a lamina.
03200	6.	J	clear the NCNT.
03300	7.	/*\	position the lamina face in the z direction.
03400	8.	S-↑	sweep the lamina into a solid and pop it off.
03500	
03600	A TETRAHEDRON   (not regular)
03700	
03800	1.	V:π2/3		Position a vertex.
03900	2.	@E*E*J!↑	Make a triangular base.
04000	3.	β S*↑	Sweep out a pyramid from the base.
04100	
04200	A REGULAR OCTAHEDRON
04300	
04400	1.	V:)		Position a vertex.
04500	2.	\E;E(E:J	Make a square lamina.
04600	3.	↑↑⊗BF		Get the faces of the lamina.
04700	4.	λ1.414212	Enter the square root of two.
04800	5.	β S -↑	Sweep out two pyramids.
04900		β S *↑
     

00100	EXAMPLES  -  continued.
00200	
00300	A REGULAR ICOSAHEDRON
00400	1.	V\\:
00500	2.	π2/5
00600	3.	@E*E*E*E*J!
00700	4.	↑↑⊗BF
00800	5.	α 9 α ; π/5
00900	6.	λ1.4
01000	7.	( α S )) α (
01100	8.	β S λ2.4
01200	9.	)↑ β S(
01300	
01400	A SPHERE
01500	1.	V\\(		Position a vertex to the south  pole.
01600	2.	@6*\		Move it north to the antarctic circle.
01700	3.	E*E*E*E*	Sweep out a meridian wire.
01800		E*E*E*↑
01900	4.	S(S(S(S(	Form the globe by sweeping the first meridian
02000		S(S(S(S(	about the Y-axis.
02100		S(S(S(S(
02200		S(S(S(
02300	5.	R↑		Seal up the sweep face forming pole cap faces
02400				and converting a spherical sheet into a solid.
02500	
02600	A TORUS
     

00100	A DODECAHEDRON
00200		1.	\\v/:)-\E;E(E:J↑S*↑
00300						Like in Euclid's construction,
00400						(Elements, Book XIII, proposition 17)
00500						we start with a cube.
00600		2.	⊗BE			Make Midpoints on the twelve edges.
00700			M↑M↑M↑M↑
00800			M↑M↑M↑M↑
00900			M↑M↑M↑M↑
01000		3.	λ0.191			The edges of the cube are
01100			\\			diagonals in the faces of the
01200						duodecahedron.  The 0.191 as well
01300						as the 0.308 below are derived
01400						by alittle trigonometry on the sly.
01500		4.	⊗BV			Position the midpoints on their faces.
01600			(↑ *↑ )↑ *↑
01700			;↑ :↑ (↑ :↑
01800			-↑ ;↑ )↑ -↑
01900		5.	α ↑			Flush the other points.
02000		6.	λ0.308			Another magic constant.
02100			\\
02200		7.	⊗BV			Position the midpoints above their faces.
02300			-↑ ;↑ -↑ :↑
02400			)↑ )↑ *↑ (↑
02500			;↑ (↑ *↑ :↑
     

00500	TETRAHEDRON
00600	
00800	
00900	SOMA BLOCKS
01000		the step:	V![:)-]E;E(E:J↑S*↑⊗BFS:↑↑↑S)↑↑↑
01100		the el:		V![:)-]E;E(E:J↑S*↑⊗BFS:↑↑S;↑S)↑↑↑
01200		the te:		V![:)-]E;E(E:J↑S*↑⊗BFS:↑↑↑S)↑↑S*↑
01300		the zigzag:	V![:)-]E;E(E:J↑S*↑⊗BFS:↑↑↑S)⊗FE↑`FES*↑↑↑↑↑↑↑↑
01400	 	the left hand:	V![:)-]E;E(E:J↑S*↑⊗BFS:↑↑↑S)⊗FE↑↑`FES;↑↑↑↑↑↑↑
01500		the right hand:	V![:)-]E;E(E:J↑S*↑⊗BFS:↑↑↑S)⊗FE↑↑↑`FES-↑↑↑↑↑↑
01600		the corner stone:
01700				V]>∧E]<`FVS∨JS¬↔↑`BF↔↑[⊃[@[∧>]!
01800				V]>∧E]<`FVS∨JS¬↔↑`BF↔↑[⊃[@[∧>]!]>∧¬]>¬
01900	
02000	A KNOT
02100	"J"	S@:!:S@:!:S@:!:S@:!:S@:!:S@:!:S)))))),((((((,
02200	"K"	S@*!*S@*!*S@*!*S@*!*S@*!*S@*!*S::::::,;;;;;;******,
02300	"L"	S@)!)S@)!)S@)!)S@)!)S@)!)S@)!)S******,------,
02400	END;
     

00100	APPENDIX  -  THE HOMOGENEOUS HOBGOBLIN.
00200	
00300		I  wish  to  justify  GEOMED's  Euclidean  Representation  of
00400	vertices. For the benefit of the innocent reader,  the  orthodox  and
00500	academically    respectable   representation   is   the   Homogeneous
00600	Representation.    The  Homogeneous  Representation  was   used   and
00700	published  by  Roberts  -  in  an  appendix to his Machine Perception
00800	paper.
00900	
01000		GEOMED does not use the  homogeneous  representation  because
01100	Rotation,   Translation   and  Perspective  Projection  require  more
01200	execution time and vertices  require  more  memory  when  homogeneous
01300	coordinates  are  used  in a floating format on conventional computer
01400	hardware such as a PDP-10.
01500	
01600		Although Roberts' paper clearly states that the advantage  of
01700	the  homogeneous  representation is for scaling integers, others have
01800	gone forth teaching and implementing the  homogeneous  representation
01900	in  circumstances  where the Euclidean representation would have been
02000	more concise and economical.
02100	
02200		For me, homogenity really becomes a hobgoblin not when it  is
02300	wasting  CPU  and  memory cycles but rather when some one attempts to
02400	convince me that it is more mathematically elegant than the Euclidean
02500	geometry of three space polyhedrons.
     

00100	APPENDIX  -  SHORT COMINGS.
00200	
00300		GEOMED doesn't have:
00400	
00600			Animation.
00700			Space War Buttons.
00800			Light pen or Tablet.
00900			Arcs and Higher Ordered Surfaces.
01000			Compound Bodies.
01100			Advanced Language Features - Macros, Iteration,
01200				Conditional, Command Editing, External
01300				Command Files, and so on.
01400			Conflicting Bodies.
01500			Cuts.
01600			Data Disc Display.
01700			Blunder Recovery.
01800			Extraordinary Speed.
01900			or a completely worked out mathematical formalism.
02000	
02100	
02200	RESERVE
02300		The iteration notation will be { n | commands }.
     

00100	SUMMARY OF SWITCHES
00200	
00300	switch		commentary
00400	
00500	
00600	Q - FRMORG
00700		FRMORG affects world frame rotations.
00800		TRUE *		rotation about a world axis,
00900				thru the world origin.
01000		FALSE		rotation about a parallel to a world axis,
01100				thru the body origin.
01200		FRMORG is flipped by the Q-command.
01300		The state of FRMORG is indicated by an asterisked in the
01400		Editor's Status Display.  The asterisk is present when
01500		FRMORG is true and absent when FRMORG is false.
01600	
01700	F - FRAME
01800		FRAME is a three state switch that affects translation,
01900		rotation and dilation.
02000		state-1	indicates World Frame of Reference.
02100		state-2	indicates Body  Frame of Reference.
02200		state-3	indicates Relative Frame of Reference.
02300		FRAME is incremented, modulo 3, by the F-command.
02400	
02500	A - AXECNT
02600		AXECNT affects  only dilations.
02700		state-1 indicates dilation only on the specified axis.
02800		state-2 indicates dilation on the two axes not specified.
02900		state-3 indicates dilation on all three axes.
03000		The state of dilation is indicated by a digit to the right of
03100		the dilation strength's percent sign in the GEOMED Status Display.
03200		AXECNT is incremented, modulo 3, by the A-command.
03300