GroupDIY

General Discussions => The Lab => Topic started by: fum on October 01, 2004, 08:34:35 PM

Title: Math geeks and panel graphics unite
Post by: fum on October 01, 2004, 08:34:35 PM
Hey there.  I'm workin on a decent way to print out scales ( other than buying a full scale graphics app like Corel Draw)

I've got the shell of an application created that will save stuff out to a jpg file.

I need help with the formulas to calculate the positions in an x y coordinate system for the scale values, for a given radius, based on degree.  If you can give me a rough formula, I can take it from there

For example:
Given radius of 30 , if you wanted a scale in 30 degree increments, I need to calculate x y coordinates where to place the graphic objects, given that the center of the scale will be 0,0.

Once I get this part going, I'll add on the other features to make it cool, and put it up for people to download.

Any help out there?  I'm googling at present, but thought I'd ask =)

Regards

ju
Title: Math geeks and panel graphics unite
Post by: mcs on October 01, 2004, 08:42:34 PM
Don't save to jpeg - that's my advice. jpeg is not a format for graphics - it's for photos.

Saving stuff in PostScript is VERY easy - you can even calculate the scales etc. in the PS code. PostScript can be imported in a lot of drawing apps, you can open it in Photoshop and you can convert is to PDF format without loosing any quality.

I can help you with PostScript programming (I could also help with jpeg stuff, but I don't like that idea :wink:).

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: fum on October 01, 2004, 09:03:48 PM
postscript should be fine, or perhaps a vector graphics format.

Regards

ju
Title: Math geeks and panel graphics unite
Post by: mcs on October 01, 2004, 09:17:45 PM
Quote from: "fum"
postscript should be fine, or perhaps a vector graphics format.

PostScript is a vector graphics format - as well as a programming language :cool:

But do explain your idea a bit more detailed - what do you want to do?

I would probably make something web-based. Use a form to input values, and then spit out EPS, PDF or PNG files.

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: fum on October 01, 2004, 09:23:01 PM
the idea is to write a java application(will work on any platform this way) with screen divided into two panels.  One to vary the parameters of the scale, and a display on the other side to show you realtime what your getting.  Variable radius, degrees, editable scale values, etc.

Once you've got your scale the way you like, save it to the file format of choice, from there you can import it to your application of choice.

One good option would be HPGL, for those who use Front panel express.  

I've been using Photoshop, so any format it supports gets me there.

ju
Title: Math geeks and panel graphics unite
Post by: CJ on October 01, 2004, 09:29:54 PM
Darn I used to be able to convert Polar to x,y in my sleep.
 :sad:
I'm thinkin  tangent and unit circle.
wrong again!

 X= R*cos(Theta)
Y= R*sin(Theta)

r is radius
Title: Math geeks and panel graphics unite
Post by: mcs on October 01, 2004, 10:19:24 PM
I just played around a bit...

This bit of code:

Code: [Select]
/Xpos 100 def
/Ypos 100 def
/outrad 40 def
/inrad 25 def
/steps 9 def
/stepsize 300 steps div def
/deg 300 stepsize 2 div sub def

/Tegn
{
/deg deg stepsize add def
Xpos Ypos moveto
Xpos Ypos outrad deg deg arc
stroke
} def

steps {Tegn} repeat

1 setgray Xpos Ypos inrad 0 360 arc fill

showpage


Produces this scale:

(http://stiftsbogtrykkeriet.dk/~mcs/Scale.gif)

No hard math needed :green:

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: fum on October 01, 2004, 10:50:42 PM
ya gotta think like a computer for that one.   looks stack based. =)

we'll see what I come up with once I get the chillins sleepin

=)

ju
Title: Math geeks and panel graphics unite
Post by: fum on October 02, 2004, 01:29:12 AM
Okay,

I've got something, it's gonna take me a few days to make it cool, but I've got the rough drawing mechanism worked out to so that I can print the scales on the screen.

After spending a couple hours or so working on this, I've decided that using PostScript is  cheating, as it really was designed to do this kinda thing  :grin: Good developers cheat  :thumb:

I'm ending up using radians in some of my calculations, and I honestly didn't know what a radian was when I started.

Stay tuned

ju
Title: Math geeks and panel graphics unite
Post by: rafafredd on October 02, 2004, 01:33:31 AM
I think it´s a great idea to make this tool. It´s definetly needed...
Title: Math geeks and panel graphics unite
Post by: CJ on October 02, 2004, 01:39:05 AM
Compare your printed results with what you are after.
I have done hours of graphics only to have them mis-scaled by the printer.
That way you catch it before commiting your expesive Lazzertran or whatever medium you use.
 :evil:
Title: Math geeks and panel graphics unite
Post by: fum on October 02, 2004, 02:03:03 AM
I hear ya.  I always print tests to paper, and hold it up to the light with the panel behind to make sure it looks spiffy.  :grin:

I'm doing panels for a pair of SSL clones at present, and I've got the words all lined up, but I want *****in scales around my knobs ( now don't be talkin about the scales around my knobs  :shock: )

ju
Title: Math geeks and panel graphics unite
Post by: fum on October 02, 2004, 02:12:49 AM
okay, here's the first output as jpg ( sorry mcs, already had this part figured)

Nothin fancy, but.....

(http://shinybox.com/diy/scale.jpg)
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 08:31:13 AM
Quote from: "cjenrick"
I have done hours of graphics only to have them mis-scaled by the printer.

Which is why PostScript is great - the calculations are done BY the printer, so nothing gets "distorted"...

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 08:38:38 AM
Quote from: "fum"
ya gotta think like a computer for that one.   looks stack based. =)

Yes, PostScript is a great mind-exercise language :wink:

How does your code work? Do you calculate the start and end coordinates for the lines? If so writing that in PS or HPGL format shouldn't be too difficult. But adding text would be much easier in PS than in HPGL...

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 12:01:12 PM
Quote from: "mcs"
I would probably make something web-based. Use a form to input values, and then spit out EPS, PDF or PNG files.

I had to see how difficult it would be do make a CGI version. It wasn't difficult at all - it took half an hour... Here it is: http://stiftsbogtrykkeriet.dk/~mcs/Scale.html

EPS version only though...

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: daArry on October 02, 2004, 01:00:56 PM
nice1 :thumb:
Title: Math geeks and panel graphics unite
Post by: rafafredd on October 02, 2004, 01:12:48 PM
Mikkel, you are fast!

Can you implement the numbers?
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 01:14:32 PM
Quote from: "rafafredd"
Mikkel, you are fast!

Can you implement the numbers?

What numbers? Numbers next to the lines? I can try...

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: rafafredd on October 02, 2004, 01:21:57 PM
yeah, like a DB scale...

You know, something like starting number and steps, so we get a dB scale.

Lets say -20 starting and 5db steps, in a 12 position scale would output:

-20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35 dB

Got that?
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 01:52:10 PM
Something like this?

(http://stiftsbogtrykkeriet.dk/~mcs/Scale2.gif)

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 02:16:36 PM
I think I cracked that one also. Here's another test:

(http://stiftsbogtrykkeriet.dk/~mcs/Scale3.gif)

Still no hard math involved, but I did have to look up something in the "Blue book"...

Could this "tool" be remotely useful to anybody? If so I could add PDF or other output formats.

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: fum on October 02, 2004, 03:50:08 PM
completely useful.

this is the tool I'm working on building.

Here are the other features I intended:

Variable stroke size and length for the lines.

Variable scale names( the ability to create a list of titles that would appear next to the scales, so instead of 1-10, you could put in -60, -50.  Or close, closer, disco, for that matter).  Also the ability to vary font size for scale names.  Also the ability to specify the name on the inside or outside of the scale.

The ability to specifiy a start and finish offset ( this would allow the printing of scales for the Lorlin type switches that are 2X6 or 4X3).

The ability to create sub-ticks, and specify their length.

The ability to substitue a small circle instead of a line(for either major or minor ticks)

The ability to vary the degree of tick separation.

None of these features seem like rocket science, and to me, would make my panels "dead sexy".

This is where I'm headed with this, the way it's going, you're beatin me to the punch  :grin:


I did manage to figure out a way to save in PNG format from my app, as the JPG was really crap when rendered.

Regards

ju
Title: Math geeks and panel graphics unite
Post by: rafafredd on October 02, 2004, 04:02:55 PM
You are aproaching perfection, MCS.

That´s really useful, at least for me...

It would be nice to have a downloadable .EXE version... Would this be possible? Or can I just save the web browser page and run it from my HD?
Title: Math geeks and panel graphics unite
Post by: fum on October 02, 2004, 04:11:56 PM
He'd have to provide the cmd file that's being referenced as well, in order to run it locally, which means it's likely to only work on a pc for local stuff.

regards

ju
Title: Math geeks and panel graphics unite
Post by: alk509 on October 02, 2004, 06:10:36 PM
This is nice! How about a smal "X" to mark the center of the scale?

Peace,
Al.
Title: Math geeks and panel graphics unite
Post by: rafafredd on October 02, 2004, 06:21:09 PM
Yes, it would be needed for drilling.
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 06:55:47 PM
Here's a small update.

Here's a new sample scale:

(http://stiftsbogtrykkeriet.dk/~mcs/Scale4.gif)

And here's the settings I used:

(http://stiftsbogtrykkeriet.dk/~mcs/ScaleSettings.gif)

As you can see I updated the webpage with the new version...

The X in the center is coming right up :green:

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: daArry on October 02, 2004, 07:22:13 PM
a very tidy app ;)

I dont spose u have/can do a eps to hpgl convertor do ya?
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 07:29:29 PM
Quote from: "fum"
Variable scale names( the ability to create a list of titles that would appear next to the scales, so instead of 1-10, you could put in -60, -50.

This part is done (I think).

Quote
Or close, closer, disco, for that matter).

A bit more difficult because of the text placement, but not too difficult...

Quote
Also the ability to vary font size for scale names.

No problem - any font size you want :)

Quote
The ability to specifiy a start and finish offset ( this would allow the printing of scales for the Lorlin type switches that are 2X6 or 4X3).

A start and end angle you mean? No problem - I'll work on that tomorrow...

Quote
The ability to create sub-ticks, and specify their length.
The ability to substitue a small circle instead of a line(for either major or minor ticks)

Also quite possible - but you will end up with a lot of settings...

Quote
The ability to vary the degree of tick separation.

Que?

Quote
This is where I'm headed with this, the way it's going, you're beatin me to the punch  :grin:

I hope you don't mind - I'm just having a bit of fun...

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 07:40:40 PM
Quote from: "rafafredd"
It would be nice to have a downloadable .EXE version... Would this be possible? Or can I just save the web browser page and run it from my HD?

The .cmd file is a REXX script, so you can run it on anything with a REXX interpreter (from PC-DOC to mainframes - including Macs). But since it's a CGI script, you would have to run a local webserver also...

But you don't really need the software. Most of the "software" is actually included in the file you download. If you open the file in a text editor, you'll see this bit near the top:
Code: [Select]
% User supplied settings
/outrad 70 def
/inrad 60 def
/steps 11 def
/numsz -5 def
/startnum 25 numsz sub def
/text ( Testing 1 2 3 ) def
% End user supplied settings

Just change the numbers (and text), and you have a new scale.

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: fum on October 02, 2004, 07:57:48 PM
As to variance of tick separation.  some stepped switches vary the angle of separation between clicks.  so you'll want the ability to specify how many degrees between steps ( this goes in tandem with the start and finish offset).  In this fashion, you can say, I need 6 steps, with 35 degrees space at the beginning, and 12 degrees between clicks.

As to you crankin this  out quicker, it doesn't bother me one bit.  To me I thought it was something useful that I need in a bad way, and that the overall group could benefit from.  You've either got more spare cycles, or a bigger noggin,  so I'm happy either way  :thumb:

So yes, what I had in mind had a lot of options, but would be very flexible.  You could create anything from what is on the front of an LA2A, to any of the other projects floatin around.

Oh, and have I told you recently that you rule :!:  :green:  :guinness:

on question.  Is the points scale completely relative in postscript?

Regards

ju
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 07:58:17 PM
Quote from: "daArry"
a very tidy app ;)

I dont spose u have/can do a eps to hpgl convertor do ya?

You can convert it to HPGL using either CorelDRAW or pstoedit - but the result isn't that great.. I'll see if it can be improved though.

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: fum on October 02, 2004, 08:00:36 PM
bump, we posted at the same time, want to make sure you caught that =)
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 08:40:53 PM
Quote from: "fum"
As to variance of tick separation.  some stepped switches vary the angle of separation between clicks.  so you'll want the ability to specify how many degrees between steps ( this goes in tandem with the start and finish offset).  In this fashion, you can say, I need 6 steps, with 35 degrees space at the beginning, and 12 degrees between clicks.

I may be a bit slow (or I had too much wine at dinner), but I don't really understand your example. Is the spacing between the 6 steps 35° or 12° (or both)?

Quote
As to you crankin this  out quicker, it doesn't bother me one bit.  To me I thought it was something useful that I need in a bad way, and that the overall group could benefit from.  You've either got more spare cycles, or a bigger noggin,  so I'm happy either way  :thumb:

I have just solved a lot of strange problems in PostScript - like making invoices from an IBM S36 (meant for a matrix printer) look nice and "modern" on a colour laser...

Quote
Oh, and have I told you recently that you rule :!:  :green:  :guinness:

Thanks!

Quote
on question.  Is the points scale completely relative in postscript?

Points are used to define positions in "user space". A point is 1/72" (if you didn't know), and 0.0 is the lower left corner.

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 08:47:46 PM
Quote from: "mcs"
but the result isn't that great.. I'll see if it can be improved though.

I made some changes to the "scale drawing engine" :green:, and now the pstoedit produced HPGL file starts to look better.

This is what it looks like when imported into CorelDRAW:

(http://stiftsbogtrykkeriet.dk/~mcs/ScalePlot.gif)

Could anybody check the HPGL file in Front Panel Designer? Here it is: http://stiftsbogtrykkeriet.dk/~mcs/Scale3.plt

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: daArry on October 02, 2004, 09:18:16 PM
Here's the result on importing hpgl into FPD:

http://notapplicable.co.uk/audiolab/mcs-scale.pdf
Title: Math geeks and panel graphics unite
Post by: mcs on October 02, 2004, 09:26:57 PM
Quote from: "daArry"
Here's the result on importing hpgl into FPD:

That looks OK to me? I have never used FPD, so I don't know what it's supposed to look like...

If it's OK, I'll add HPGL output tomorrow.

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: fum on October 02, 2004, 11:21:51 PM
Quote

fum wrote:
As to variance of tick separation. some stepped switches vary the angle of separation between clicks. so you'll want the ability to specify how many degrees between steps ( this goes in tandem with the start and finish offset). In this fashion, you can say, I need 6 steps, with 35 degrees space at the beginning, and 12 degrees between clicks.
Quote

mcs wrote:
I may be a bit slow (or I had too much wine at dinner), but I don't really understand your example. Is the spacing between the 6 steps 35° or 12° (or both)?



this is saying start at 35 degrees, and make 6 steps 12 degrees apart.  So 35, 47, 59, etc.

regards

ju
Title: Math geeks and panel graphics unite
Post by: Mark Burnley on October 03, 2004, 06:48:02 AM
Wow,

You software guys can knock it out quick...

...I'd still be greasing my hole punches at this stage in a project!

 :wink:

Good work!

 :guinness:

Mark
Title: Math geeks and panel graphics unite
Post by: fum on October 03, 2004, 12:44:01 PM
oh, and in my cold medicine induced stupor, I didn't look at it from all angles, and  the stuff I listed above is covered if you can specify pre and post offset.  :grin:

ju
Title: Math geeks and panel graphics unite
Post by: on October 03, 2004, 03:08:17 PM
sorry for the slightly off topic. after youve got these diagrams drawn out, how do you transfer them onto the chassis? silk screening or something?
Title: Math geeks and panel graphics unite
Post by: mcs on October 03, 2004, 06:33:12 PM
Quote from: "fum"
oh, and in my cold medicine induced stupor, I didn't look at it from all angles, and  the stuff I listed above is covered if you can specify pre and post offset.  :grin:

That's why I didn't really understand what you wanted to do...

I have added the HPGL option BTW, so test away. But please be patient - it takes 10-30s to do the HPGL convertion.

The "generator" was out of order for about 10 minutes while I updated it - sorry about that...:wink:

I have also changed the text algorithm so the text gets placed more accurately (and so that text labels are possible), but I won't have time to update the script on the server with that until tomorrow.

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: PRR on October 03, 2004, 10:18:15 PM
> the JPG was really crap when rendered.

JPG has a quality setting, from nearly uncompressed to very small and totally jaggy.

JPG compression works really well for photographs, really bad for hard line art. Setting compression to nearly-none gives good results, and files smaller than BMP, but JPG is really overkill for 2-color line art.

GIF is perfect for this. It only supports 16/256 colors, but that is plenty. Its compression is very simplistic, but works great for big areas of the same color (and poorly for photographs with lots of detail). GIF is lossless (assuming you start with less than 256 colors).

Problem with GIF is that it is a CRT format, and translation to printer is uncertain. Some browsers render GIF as 72DPI on 300DPI printers by just printing each dot 4-wide/high. This gives 4% error from what you might expect: fine for web pages, bad if you need to fit a meter or switch. Smarter browsers and image programs may do more clever things, not always what you want.

PostScript not only has an unambiguous notion of dimension on the output device (printer), it can do all the calculations for you. Of course that assumes you have a PostScript printer, that it has no bugs, etc.

PDF, PostScript's child, "should" render exactly, but the darn Acrobat PDF renderer always wants to do things its own way.

Is it now impossible to walk into an art store and find small protractors and compasses?

> since it's a CGI script, you would have to run a local webserver also...

Most CGI apps can be run at the command line, redirecting output to a file. Oh wait: command lines are obsolete, aren't they?
Title: Math geeks and panel graphics unite
Post by: fum on October 03, 2004, 11:07:01 PM
Quote from: "PRR"
> the JPG was really crap when rendered.

JPG has a quality setting, from nearly uncompressed to very small and totally jaggy.



I was using Suns JPG codec, as included in jre 1.3 (com.sun.image.codec.jpeg.*), and had it set to :

param.setQuality(0.75f, false);

which is high quality, supposedly.  Could crank it up to 1, but it matters not now, as we have this *****in postscript version thanks to Mikkel.

It's a great thing when geeks run amok  :thumb:

ju < not a graphics programmer, doesn't play one on tv
Title: Math geeks and panel graphics unite
Post by: fum on October 03, 2004, 11:19:08 PM
Quote from: "chikkenguy"
sorry for the slightly off topic. after youve got these diagrams drawn out, how do you transfer them onto the chassis? silk screening or something?


There are many ways, depending on your budget and/or DIY'itude.

We should probably put together a meta for this info, but here's a quick rundown of possibilities ( that you would probably search the archives for and find info on):

silkscreen
laser engraving
lazertran tranfer paper
toner transfer ala SSLTech
electrochemical etch

Hope this gets you started  :grin:

ju
Title: Math geeks and panel graphics unite
Post by: mcs on October 04, 2004, 02:05:08 AM
Quote from: "fum"
We should probably put together a meta for this info, but here's a quick rundown of possibilities

Yes, that would probably be a good idea - the "transfer to panel" part is by far the most difficult...

Best regards,

Mikkel C. SImonsen
Title: Math geeks and panel graphics unite
Post by: mcs on October 04, 2004, 02:14:08 AM
Quote from: "PRR"
PostScript not only has an unambiguous notion of dimension on the output device (printer), it can do all the calculations for you. Of course that assumes you have a PostScript printer, that it has no bugs, etc.

I don't think there are too many bugs, as long as I only use simple level 1 PS.

Quote
Most CGI apps can be run at the command line, redirecting output to a file. Oh wait: command lines are obsolete, aren't they?

Yes, you can run it on the command line. But having to provide some parameters as environment variables and others in a URL-encoded string on STDIN does make it a bit user-unfriendly...

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: mcs on October 04, 2004, 06:34:53 PM
Quote from: "mcs"
I have also changed the text algorithm so the text gets placed more accurately (and so that text labels are possible)

I have just updated the script with the new code - I don't know if anybody will notice the difference (yet) though...

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: mcs on October 05, 2004, 07:58:38 PM
Here are a couple of new samples:

(http://stiftsbogtrykkeriet.dk/~mcs/Scale5.gif)

(http://stiftsbogtrykkeriet.dk/~mcs/Scale6.gif)

Now with optional subticks, ugly-font support and variable start/stop angles. I will update the script with these functions soon - custom labels coming soon...

I have added PNG and PDF formats BTW.

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: fum on October 05, 2004, 08:19:17 PM
Shaweet!  Thanks Mikkel! :thumb:
Title: Math geeks and panel graphics unite
Post by: rafafredd on October 05, 2004, 08:21:18 PM
MCS, you are great!
Title: Math geeks and panel graphics unite
Post by: mik on October 06, 2004, 06:41:34 PM
I love this place!
Title: Math geeks and panel graphics unite
Post by: mcs on October 06, 2004, 08:26:42 PM
I added the third version now - including a short manual.

Please test and report bugs :green:

Here's the URL, so you don't have to dig it up in the thread: http://stiftsbogtrykkeriet.dk/~mcs/Scale.html

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: CJ on October 06, 2004, 08:41:41 PM
Scale-O-Matic! I love it!
darn, where were you a year ago? :twisted:
 :guinness:  :guinness:  :guinness:  :guinness:
Title: Math geeks and panel graphics unite
Post by: Kev on October 06, 2004, 10:25:03 PM
yes indeed,

excellent work there Mikkel.
I'm still experimenting.
 :thumb:

...  :sad: however, I'm not succeeding at the moment with PDF.
IE crashed and the PDF was blank.
show us the parameters of that test print above as an example.
Title: Math geeks and panel graphics unite
Post by: rafafredd on October 06, 2004, 10:36:20 PM
Now it´s very PRO, man!!!

 :grin:
Title: Math geeks and panel graphics unite
Post by: owel on October 06, 2004, 11:02:04 PM
This is great.... sorry for being a newb, how do you guys transfer this to a chassis? Lazertran?
Title: Math geeks and panel graphics unite
Post by: CJ on October 06, 2004, 11:03:07 PM
:cool:
Title: Math geeks and panel graphics unite
Post by: fum on October 06, 2004, 11:16:58 PM
Allright, this just keeps getting better.  One more feature request.  

Can you make the number of sub-ticks a variable, such that you could have 4 sub-ticks between steps?

I know, I know, give the people what they want, and they'll nickel and dime ya to death  :grin:

take a peek:

http://shinybox.com/diy/buss-squisher/panels.jpg

Thanks Mikkel  :thumb:   :guinness:

ju
Title: Math geeks and panel graphics unite
Post by: rafafredd on October 06, 2004, 11:45:54 PM
Quote from: "fum"
Can you make the number of sub-ticks a variable, such that you could have 4 sub-ticks between steps?


Or none, for that matter....

It would be nice, Mikkel, if it´s not a pain.
Title: Math geeks and panel graphics unite
Post by: mcs on October 07, 2004, 05:41:58 AM
Quote from: "cjenrick"
darn, where were you a year ago? :twisted:

Right here - or at "the other place" I guess...

Quote from: "Kev"
...  :sad: however, I'm not succeeding at the moment with PDF.
IE crashed and the PDF was blank.

Yes, IE does that a lot - I'm not really sure if the cause is the Acrobat Reader plugin or IE. When the plugin "sees" a PDF file it doesn't like (which includes many types of PDFs) it acts strange. That probably causes IE to crash. But if IE does what it's told it should give you the option of saving the PDF instead of opening it. Does it? If you save the PDF file and open it in AR afterwards you'll have no problems. The bugs are in the AR plugin, not in AR itself. AR has many other bugs, but not this one :wink:

Quote
show us the parameters of that test print above as an example.

They are here: http://stiftsbogtrykkeriet.dk/~mcs/ScaleSettings2.gif

Quote from: "fum"
Can you make the number of sub-ticks a variable, such that you could have 4 sub-ticks between steps?

Yes, I'll have a look at that.

Quote from: "rafafredd"
Or none, for that matter....

Just select "Subticks: no", or am I misunderstanding something?

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: VacuumVoodoo on October 07, 2004, 06:51:41 AM
This is very impressive. After having done scales in Corel this will make life much easier, thanks.

Would it be too time consuming/difficult to add a few features:

Tick shape: for example a dot, specifiy diameter for major tick and a different dot diameter for minor tick.

Radii in mm or inches instead of points ? - would that introduce scaling errors to postscript ?

Text instead of ticks ?

Yeh, i know, the crazy swedes are never satsified... :grin:
Title: Math geeks and panel graphics unite
Post by: mcs on October 07, 2004, 06:16:20 PM
Quote from: "VacuumVoodoo"
This is very impressive. After having done scales in Corel this will make life much easier, thanks.

Whenever I have needed to draw something "difficult" like this, I have often written it in PostScript. I have even done graphics for websites that way...

Quote
Tick shape: for example a dot, specifiy diameter for major tick and a different dot diameter for minor tick.

What's next? Pink elephants? :green:

Something like this:
(http://stiftsbogtrykkeriet.dk/~mcs/Scale7.gif)

Do you want dots or circles (or both)?
The subtics are half size as it is now. Either half length or half diameter. Is that OK?

Quote
Radii in mm or inches instead of points ? - would that introduce scaling errors to postscript ?

I could multiply with 2.83 to convert from mm to points. That would only cause a small error.

Quote
Text instead of ticks ?

I will probably make no ticks an option - you can still specify the text for the lables- That option isn't ready yet though...

Quote
Yeh, i know, the crazy swedes are never satsified... :grin:

I'm not easy to satsify either  :wink:

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: VacuumVoodoo on October 08, 2004, 03:01:41 AM
That's exactly what i had in mind, thanks.

As for the pink elephants - No thanks, i hate pink :green:
Title: Math geeks and panel graphics unite
Post by: mcs on October 14, 2004, 02:19:06 PM
I updated the script a bit. Now you can select the "tick" types - lines, circles or dots.

If anybody can write a simple PostScript procedure for drawing pink elephants I will add that also :green:

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: mik on October 15, 2004, 01:26:43 PM
thank you
Title: Math geeks and panel graphics unite
Post by: mcs on October 15, 2004, 04:48:24 PM
Quote from: "Viitalahde"
How about llamas?

Something like this:

(http://stiftsbogtrykkeriet.dk/~mcs/Llama1.gif)

Here's a closeup:

(http://stiftsbogtrykkeriet.dk/~mcs/Llama2.gif)

Here's the code:
Code: [Select]
/DrawLlama
{
/deg deg stepsize add def
Xpos Ypos moveto
Xpos Ypos inrad deg deg arc
currentpoint moveto
-4 -8 rmoveto
gsave
currentpoint translate
currentpoint newpath
0.15 0.15 scale
0 0.9 0 setrgbcolor
/l {lineto} def
57 3 moveto
57 4 l 58 38 l 55 44 l 51 49 l 43 52 l 36 53 l
33 56 l 33 80 l 33 99 l 28 106 l 26 109 l
22 113 l 19 114 l 13 114 l 6 109 l
5 106 l 5 78 l 0 56 l 0 42 l 3 32 l 6 26 l 9 15 l
9 4 l 12 0 l 12 6 l 14 10 l 15 16 l 19 15 l
24 15 l 24 11 l 20 2 l 21 0 l 23 2 l
24 5 l 28 9 l 29 11 l 33 16 l 40 17 l 41 11 l
45 3 l 47 3 l 47 10 l 45 13 l 45 18 l 49 20 l
51 13 l 54 4 l 55 2 l
closepath fill
0 setgray
21 108 2 0 360 arc fill
7 108 2 0 360 arc fill
0.95 setgray
20 104 moveto
7 104 l 7 101 l 8 96 l 10 92 l 14 92 l 21 98 l
closepath fill
0 0.8 0 setrgbcolor
19 101 moveto
11 100 l 11 97 l 13 96 l 15 96 l
closepath fill
grestore
} def


Feel free to send me improvement to the code :green:

Best regards,

Mikkel C. Simonsen
Title: Math geeks and panel graphics unite
Post by: fum on October 15, 2004, 05:09:45 PM
Man, I may have to use the llamas on my green pre's =)