[sdiy] cool tool for panel designs
Don Tillman
don at till.com
Sun Feb 6 17:18:01 CET 2005
> From: "JH." <jhaible at debitel.net>
> Date: Sun, 6 Feb 2005 00:05:09 +0100
>
> Looks great -
>
> But what do they mean with "radius in points" ??
Hey JH,
"Point" is a measurement unit used in the printing industry, most
typically to specify the height of a font. A point is 1/72 of an
inch. (For you metric folks, that's 28.35 points per centipede.) A
typical font might be 12, 15 or 18 points in height.
This tool is really just plugging parameters into a simple PostScript
program that draws the dial. And then it uses some convertomatic code
to present the other output forms. PostScript uses points as it's
default measurement unit, which makes sense given its application.
I have long recommend doing panel design by learning the PostScript
language, writing out the panel in raw PostScript, and sending that to
a laser printer. Here are a couple postings from a few years ago,
including an example that looks similar to the code generated by the
tool.
-- Don
----------------------------------------------------------------
Date: Wed Oct 31 09:35:50 -0800 2001
From: Don Tillman <don at till.com>
To: apogeesunset at juno.com
CC: synth-diy at dropmix.xs4all.nl
Subject: Re: [sdiy] Front panel labeling
Date: Wed, 31 Oct 2001 08:36:05 -0800
From: Casey J Crane <apogeesunset at juno.com>
Thanks for all the response to my front panel label question. Don
Tillman suggested I use "Raw Postscript" What do I need for that ?
Special software ?
So, Basically, what is postscript ?
PostScript is a "page description language", the language that most
laser printers use to print stuff. The technology is owned by Adobe,
but most of it is based on work from Xerox PARC (like almost all
modern computer technologies).
PostScript is a very simple stack based language. (If you use an HP
calculator you're half way there.) The syntax is a little hard to
read, but no compiler is needed. The exciting thing about it is the
set of functions that are available for doing all sorts of 2D graphics
operations on paper output and the fact that you can build up and
customize these operations for your needs. Line drawing, filling,
rotation, translation, scaling, colors, curves, regions... everything
you need, because that's what the printer uses to print everything
you normally print.
Best way to learn is to pick up a copy of the "PostScript Lanaguage
Tutorial and Cookbook" and the "PostScript Language Reference
Manual". (These are somewhat old, they may have been replaced with
something with a similar title.) The physical books are nice to have,
but you can also download a free copy of the reference manual from
Adobe.
http://www.adobe.com
Just use your favorite text editor to write the PostScript code (I use
Emacs with PostScript mode!) and ship it to your printer.
To save trees while you try things out I highly recommend a program
called "GhostScript" which will do a screen display.
http://www.ghostscript.com
Adobe Photoshop can read PostScript and render it beautifully, but
doesn't provide any debugging help. With PhotoShop you can make gif
files to include your artwork in a web page; I've used this technique
for a number of the articles on my web site.
-- Don
--
Don Tillman
Palo Alto, California, USA
don at till.com
http://www.till.com
----------------------------------------------------------------
Date: Tue May 28 11:26:17 -0700 2002
From: Don Tillman <don at till.com>
To: amajorel at teaser.fr
CC: synth-diy at dropmix.xs4all.nl
Subject: Re: [sdiy] dial graduations
> Date: Tue, 28 May 2002 15:33:48 +0200
> From: Andre Majorel <amajorel at teaser.fr>
>
> On 2002-05-23 21:25 -0700, Don Tillman wrote:
>
> > > From: "Michael Ruberto" <frankentron at hotmail.com>
> > > Date: Thu, 23 May 2002 21:46:25 -0400
> > >
> > > I am in the process of designing front panel graphics for all of
> > > my modules so I can have them laser etched. the biggest problem
> > > so far is creating the tick marks to go around the knobs. I am
> > > doing it "by hand" in photoshop but it is really quite time
> > > consuming. is hand drawing these the only way to go?
> >
> > This is very easy to do in raw PostScript.
>
> Interesting. Would you care to post a code fragment, for those
> of us who don't mumble PostScript in their sleep ?
(Hey, you wouldn't ask this of that guy who suggests doing everything
with a PIC!)
Below is a PostScript program for drawing three dial scales, complete
with center crosses. See, it's easy.
Note that there are several very cool features about this approach.
It's accurate in the sense that you can say "I want this switch
*here*", where here is the measurement you specifcy with respect to any
other point you specify. You can parameterize stuff, so that if you
decide later to change the style of something you only have to change
one parameter. And you have complete control over everything.
----------------
initgraphics
%% scale to inches
72.0 72.0 scale
%% draw the center cross
/center-cross-size 0.25 def
/draw-center-cross {
gsave
1.0 72.0 div setlinewidth
-0.5 center-cross-size mul 0.0 moveto
+0.5 center-cross-size mul 0.0 lineto
0.0 -0.5 center-cross-size mul moveto
0.0 +0.5 center-cross-size mul lineto stroke
grestore
} def
/dial-inside-radius 0.5 def
/dial-outside-radius 0.75 def
/dial-arc 270 def
%% draw a dial here
%% stack:
%% n divisions
/draw-dial {
gsave
currentpoint translate
draw-center-cross
0 1 2 index
{
gsave
1 index div dial-arc mul dial-arc 0.5 mul sub rotate
0.0 dial-inside-radius moveto
0.0 dial-outside-radius lineto stroke
grestore
} for
grestore
pop
} def
1.5 72.0 div setlinewidth
%% draw a few dials
2.0 8.0 moveto 10 draw-dial
4.0 8.0 moveto 10 draw-dial
6.0 8.0 moveto 10 draw-dial
showpage
----------------
-- Don
--
Don Tillman
Palo Alto, California, USA
don at till.com
http://www.till.com
More information about the Synth-diy
mailing list