Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #2007 > unrolled thread
| Started by | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| First post | 2014-09-03 19:50 +0200 |
| Last post | 2014-09-03 20:46 -0400 |
| Articles | 7 — 5 participants |
Back to article view | Back to comp.lang.postscript
Constant line thickness after scale Cecil Westerhof <Cecil@decebal.nl> - 2014-09-03 19:50 +0200
Re: Constant line thickness after scale abeddie <abeddie@hotmail.com> - 2014-09-03 11:26 -0700
Re: Constant line thickness after scale Mark Carroll <mtbc@bcs.org> - 2014-09-03 19:35 +0100
Re: Constant line thickness after scale Cecil Westerhof <Cecil@decebal.nl> - 2014-09-04 10:42 +0200
Re: Constant line thickness after scale ken <ken@spamcop.net> - 2014-09-04 10:16 +0100
Re: Constant line thickness after scale Mark Carroll <mtbc@bcs.org> - 2014-09-03 19:34 +0100
Re: Constant line thickness after scale tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2014-09-03 20:46 -0400
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2014-09-03 19:50 +0200 |
| Subject | Constant line thickness after scale |
| Message-ID | <871trs1tlw.fsf@Equus.decebal.nl> |
With the following code I can draw an ellipse:
25 dup translate
2 setlinewidth
4 1 scale
0 dup 4 0 360 arc closepath stroke
showpage
But at east and west the line thickness is bigger as at north and
south. Is it possible to draw an ellipse which has a constant line
thickness?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [next] | [standalone]
| From | abeddie <abeddie@hotmail.com> |
|---|---|
| Date | 2014-09-03 11:26 -0700 |
| Message-ID | <0ba7d7d7-5aba-4799-8dff-48a251f4ec7e@googlegroups.com> |
| In reply to | #2007 |
On Wednesday, September 3, 2014 2:09:23 PM UTC-4, Cecil Westerhof wrote: > With the following code I can draw an ellipse: > > 25 dup translate > > 2 setlinewidth > > 4 1 scale > > 0 dup 4 0 360 arc closepath stroke > > showpage > > > > But at east and west the line thickness is bigger as at north and > > south. Is it possible to draw an ellipse which has a constant line > > thickness? > > > > -- > > Cecil Westerhof > > Senior Software Engineer > > LinkedIn: http://www.linkedin.com/in/cecilwesterhof Reverse the scale before calling stroke: 0 dup 4 0 360 arc closepath .25 1 scale stroke
[toc] | [prev] | [next] | [standalone]
| From | Mark Carroll <mtbc@bcs.org> |
|---|---|
| Date | 2014-09-03 19:35 +0100 |
| Message-ID | <87oauw5z7a.fsf@ixod.org> |
| In reply to | #2008 |
abeddie <abeddie@hotmail.com> writes: > Reverse the scale before calling stroke: > > 0 dup 4 0 360 arc closepath .25 1 scale stroke That's really neat, I had never seen that: scaling the line's path without actually affecting the stroked line like that. I wonder where else I should have used this but didn't know to. -- Mark
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2014-09-04 10:42 +0200 |
| Message-ID | <87lhpzzshu.fsf@Equus.decebal.nl> |
| In reply to | #2008 |
Op Wednesday 3 Sep 2014 20:26 CEST schreef abeddie@hotmail.com:
> On Wednesday, September 3, 2014 2:09:23 PM UTC-4, Cecil Westerhof wrote:
>> With the following code I can draw an ellipse:
>>
>> 25 dup translate
>>
>> 2 setlinewidth
>>
>> 4 1 scale
>>
>> 0 dup 4 0 360 arc closepath stroke
>>
>> showpage
>>
>>
>>
>> But at east and west the line thickness is bigger as at north and
>>
>> south. Is it possible to draw an ellipse which has a constant line
>>
>> thickness?
>>
>>
>>
>> --
>>
>> Cecil Westerhof
>>
>> Senior Software Engineer
>>
>> LinkedIn: http://www.linkedin.com/in/cecilwesterhof
>
> Reverse the scale before calling stroke:
>
> 0 dup 4 0 360 arc closepath .25 1 scale stroke
Works like a charm. I used it for:
4 4 translate
20 20 translate
gsave
4 {
4 1 scale
0 dup 5 0 360 arc closepath
.25 1 scale
stroke
45 rotate
} repeat
grestore
0 dup 5 0 360 arc closepath fill
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [next] | [standalone]
| From | ken <ken@spamcop.net> |
|---|---|
| Date | 2014-09-04 10:16 +0100 |
| Message-ID | <MPG.2e723e52a5a4a4989898c7@usenet.plus.net> |
| In reply to | #2013 |
In article <87lhpzzshu.fsf@Equus.decebal.nl>, Cecil@decebal.nl says... > > Reverse the scale before calling stroke: > > > > 0 dup 4 0 360 arc closepath .25 1 scale stroke Or just use gsave/grestore:
[toc] | [prev] | [next] | [standalone]
| From | Mark Carroll <mtbc@bcs.org> |
|---|---|
| Date | 2014-09-03 19:34 +0100 |
| Message-ID | <87tx4o5z9n.fsf@ixod.org> |
| In reply to | #2007 |
Cecil Westerhof <Cecil@decebal.nl> writes: > With the following code I can draw an ellipse: > 25 dup translate > 2 setlinewidth > 4 1 scale > 0 dup 4 0 360 arc closepath stroke > showpage > > But at east and west the line thickness is bigger as at north and > south. Is it possible to draw an ellipse which has a constant line > thickness? You can get it pretty close to an ellipse, with even line thickness, not by using scale, but by using curveto. Unfortunately, my usual function for doing this isn't handy on this computer, but http://www.tinaja.com/glib/ellipse4.pdf looks well-conceived. Searching for Bézier postscript ellipse might find you some further good stuff. -- Mark
[toc] | [prev] | [next] | [standalone]
| From | tlvp <mPiOsUcB.EtLlLvEp@att.net> |
|---|---|
| Date | 2014-09-03 20:46 -0400 |
| Message-ID | <1l9uxzusb8rrk$.1ggmdkjrhsmit$.dlg@40tude.net> |
| In reply to | #2007 |
On Wed, 03 Sep 2014 19:50:19 +0200, Cecil Westerhof wrote: > With the following code I can draw an ellipse: > 25 dup translate > 2 setlinewidth > 4 1 scale > 0 dup 4 0 360 arc closepath stroke > showpage > > But at east and west the line thickness is bigger as at north and > south. Is it possible to draw an ellipse which has a constant line > thickness? I'd try reordering the 2nd and 3rd lines, so: > 25 dup translate > 4 1 scale > 2 setlinewidth > 0 dup 4 0 360 arc closepath stroke Does that help for you? Cheers, -- tlvp -- Avant de repondre, jeter la poubelle, SVP.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.postscript
csiph-web