[Edu-sig] Re: Python Programming: An Introduction to ComputerScience

Arthur ajsiegel at optonline.net
Sat Dec 13 14:11:26 EST 2003

>In sum, when writing geometric objects to output media, there's a way to go
>wherein anything specific to the medium is saved to the "writer" object,
>while anything purely geometric, and common to all media, is saved in the
>geometric object.  The pure geometry is kept separate from the messy
>details of I/O.

If I am following you:

In PyGeo the geometric "reality" is separated from the drawing, for a number
of reasons. My Vpython objects, which draw, are related to my geometric
objects which "are", but they are not those objects themselves.  

Partly because of the corner cases. If, say, my point defined as the
intersection of 2 lines moves off to infinity, I have a drawing problem.  I
cheat and put it, well, very far away - but not so far away as would create
havoc in the rendering.  The point itself knows where it really is - at

'Til now, I have been using Vpython to output to Povray.  But am moving
toward each geometric object having its own method to output itself to
Povray format.

And if VPython goes away, I can always plug in a different rendering system
without changing anything too near the core of what PyGeo is. Think it is
sensible, and standard, design practice for this kind of thing.


More information about the Edu-sig mailing list