[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pre-release



On Thu, 10 Apr 2003, Jay Belanger wrote:

> "Andrew D. Hwang" <ahwang@mathcs.holycross.edu> writes:
>
> > The camera capabilities from the 0.9 code are being retro-fitted to the
> > 0.8.10 sources as a kind of smoke test. There's a semi-usable tarball at
>
> I've been semi-using it, to see how well it works on the old stuff.
> I haven't be playing with any of the new features.
>
> > * All "P" functions return type <triple> (P(x,y) = (x,y,0)), so most
> >  declarations of type <pair> need to be changed.
>
> I changed a lot of "pair"s to "triples"s to get my old stuff to
> compile.  Is that what I'm supposed to do?
>
Yes. :(

The <pair> type is now used only for "the screen plane", which a user file
should never reference directly. The solution is to seek-and-replace:

#!/bin/sh
for file in *.xp
do
	mv $file $file.tmp &&
	sed 's/ pair / triple /g' $file.tmp > $file
done

(The spaces before and after ensure that the string "pair" embedded in
another symbol won't be replaced; this isn't wholly robust, but may also
be unnecessary, depending on the existing names in the file.)

> This is minorly bothersome, since they were two-dimensional. [...]
>
Agreed. Probably points will come to be called "Point"s (or even "P"s).
The current naming has grown ("like a fungus", one might legitimately
say), but is designed in TNG. For now, you can put the line

typedef triple point; // pick a convenient alias :)

in epix.h after the declaration of the <triple> class (or in each input
preamble, ugh...) which will, in conjunction with the substitution above,
allow you to do, e.g.,

point p1 = P(1,0);

> Oh, by the way, Line isn't working right.
>
I forgot to mention this; it'll be restored soon, with the same behavior
as before in 2-D figures, though with truncation determined by the 3-D
"clip_box". There are two conceptually different types of truncation:
* cropping (trimming in the screen plane, a la clipplot)
* clipping (trimming in the object space, as in clipmesh)
Regarding terminology, "cropping" fits well with the object-camera-screen
metaphor, but "clipping" is less desirable, both because it used to mean
"cropping" and because it doesn't suggest (to me) the 3-D operation of
cutting an object to fit into a specified region (usually a rectangular
box). Any suggestions that are brief, evocative, and unlikely to be
confused with "crop"...? (Or maybe they should be "trim" and "chop"?)

Sorry for the inconveniences!

--Andy

Andrew D. Hwang			ahwang at mathcs dot holycross dot edu
Department of Math and CS	http://mathcs.holycross.edu/~ahwang
College of the Holy Cross	(508) 793-2458 (Office: 320 Swords)
Worcester, MA, 01610-2395	(508) 793-3530 (fax)