
Mathematical Illustrations: A manual of geometry and postscript - noch
http://www.math.ubc.ca/~cass/graphics/manual/
======
dahart
I wasn't expecting to see a 3d rendering treatment!

> Drawing complicated scenes in much more complicated in 3D than in 2D—and
> more interesting, since some real ideas are required. Much high-end 3D
> drawing, for example in video games or movies, relies on a pixel-by-pixel
> treatment. the pixels in hardware designed for this purpose incorporate a
> depth coordinate—that is to say, depth with respect to the plane of the
> screen—and pixels are colored in the order of their depth, so that close
> pixels are painted after far ones. This hardware option is unavailable to
> PostScript, which is essentially device-independent. The PostScript program
> itself must therefore be responsible for keeping track of depth. The
> standard method for doing this is to use a binary space partition.

Yeah, this is a good reminder that there's no Z-buffer in vector rendering. I
haven't used painter's algorithm for a couple decades, but this makes me want
to play with PostScript and code up a little 3d surface renderer with a BSP
tree and painter's algorithm.

I'm also reminded of ray tracing in PostScript
[http://www.realtimerendering.com/resources/RTNews/html/rtnv6...](http://www.realtimerendering.com/resources/RTNews/html/rtnv6n2.html#art11)

------
IvanK_net
I wrote my own PostScript interpreter three months ago, which runs in a
browser :) You can play with it at
[http://www.ivank.net/veci/pdfi/](http://www.ivank.net/veci/pdfi/) There are
also some demos from 80s and 90s.

~~~
srean
This would pair perfectly with
[http://www.pugo.org/project/pshttpd/](http://www.pugo.org/project/pshttpd/)
\-- a webserver written in postscript.

------
kilovoltaire
I remember being delighted when I learned that .ps "images" were actually
programs.

At some point I wanted to make a book of PostScript code on left pages /
graphical output on right pages, but I only made four pages:

[https://github.com/hrldcpr/geno-pheno#geno--
pheno](https://github.com/hrldcpr/geno-pheno#geno--pheno)

~~~
imglorp
What's really cool is you could build window systems based on shipping around
PS fragments instead of bitmaps. SUN's NeWS had a ton of technical advantages
for networked workstations such as display and scale independence and smaller
wire size. It was also interesting because PS could do a bunch of calculation
on the display device, like draw the graph of a math function, and that spec
could be encapsulated in other code. It could also do I/O which was
interesting in a UI capacity, ie OpenWindows.

Right around this same time, X11 was coming up on other platforms like HP and
Apollo, and it seems to have "won", and NeWS disappeared.

I wonder if the time is right for a resurgence in this idea, now that we're
rethinking compositors, X servers, Wayland etc etc.

[https://en.wikipedia.org/wiki/NeWS](https://en.wikipedia.org/wiki/NeWS)

~~~
blacksmith_tb
That sounds a lot like Display Postscript[1] from the Next days, which lives
on in OSX/macOS as a superset of PDF.

1:
[https://en.wikipedia.org/wiki/Display_PostScript](https://en.wikipedia.org/wiki/Display_PostScript)

------
amelius
One thing that bothers me (Chapter 6, page 11) is how they approximate a
circle using quadratic Bezier curves, and say that "an approximation by eight
quadratic curves is just about indistinguishable from a true circle." However,
if you look at the picture on the next page, you can clearly see the
difference.

~~~
mtreis86
That is not an illustration of eight quadratic curves, it is an illustration
of four.

"The figure below shows how the curve x^2+y^2−1=0 is approximated by four
quadratic curves (in red). An approximation by eight quadratic curves is just
about indistinguishable from a true circle."

------
waynecochran
This is fantastic. IMHO, Adobe should have just stuck with PostScript and
forgot about PDF. I remember having to create fractal images for research
papers and my dissertation -- the only way to allow them to render at any
resolution was to write a program in PostScript -- (very cool to program
figures for a paper)! -- no idea if you can program PDF's this way (which,
unlike PostScript, I can't edit with a text editor since they're binary).

~~~
pletnes
PDFs can, and typically do, contain postscript. Ps2pdf is one «compiler» you
could use.

~~~
waynecochran
Yep. But I am not sure what value PDF's add to PS.

~~~
derrasterpunkt
PDF is interpreted PostScript. It is not a programming language as PostScript
is.

Edit: PostScript has to be interpreted and rendered, PDF only has to rendered.
You can't jump to page 100 in a PostScript if you haven't interpreted page 1
to 99 before. A PDF can do that.

~~~
waynecochran
PDF is interpreted too -- actually a subset of PS -- in fact you can write
programs that work in PostScript that PDF will not handle in the same
transparent way. The PS2PDF translator will have to render those pieces ahead
of time -- in PS, the printer can render/interpret the code in a way that is
optimal for the printer. That's why I used it.

Still, advantage PostScript.

~~~
derrasterpunkt
You cannot write programs in PDF. As I have written, it is not a programming
language. It is already interpreted. For your use-case a PostScript file is
better, that's why you used it. But most of the time all graphics for a given
page are prerendered and therefore static. If all page content is vector based
you can render a PDF in every resolution you need.

In my little printing world I like to have control over the page, I don't like
that the printer (RIP) can control the page "in a way that is optimal for the
printer". I am responsible for the output, not the printer. If something goes
wrong inside the RIP, the printer doesn't pay the damages, I am. And things
can get costly.

It is also pretty resource intensive to work with PS (because it has to be
interpreted every time you want to have a look at it). All things considered
(and there are a lot more differences) it is simply more pleasant to work with
PDF instead of PS. That's why the majority uses it. But it definitely has
flaws, too.

------
cormullion
If you want to run many of the examples in this book, you can (on a Mac)
usually create and save a text file (with .ps suffix) and then double-click
the file in the Finder. The ps2pdf distiller should convert the contents to
PDF and open in Preview. (Not all the IO functions are available, though.)

------
growingconcern
I took this course at UBC and it was great. Programming postscript to render
3D animated shapes was mind-blowing. Especially cool was that you needed to
build _everything_ from scratch

