Thread View: adobe.postscript.programming
5 messages
5 total messages
Started by Mike_LeFrancois
Thu, 18 Dec 2003 16:19
programming patterns in languagelevel 3
Author: Mike_LeFrancois
Date: Thu, 18 Dec 2003 16:19
Date: Thu, 18 Dec 2003 16:19
24 lines
1918 bytes
1918 bytes
I am writing code that produces a cross-section of various layers. To differentiate the layers I am trying to use various patterns such as: hatching with straight lines, diagonal lines, cross-hatching, circles, etc.. However, I am finding it difficult to create just evenly spaced vertical and horizontal lines. The following is a sample code that (I think should) produces a evenly spaced cross-hatching pattern, or grid type of pattern:
<< /PatternType 1 % Tiling pattern
/PaintType 1 % Colored
/TilingType 3
/BBox [50 0 100 100]
/XStep 10
/YStep 10
/PaintProc
{
pop % pop pattern dictionary
%0.0 0.0 0.0 setrgbcolor
72.0 72.0 scale 0 setlinewidth
0 1 50 {0 moveto 0 11 rlineto} for
0 1 50 {0 exch moveto 8 0 rlineto} for
stroke
} bind
> % End prototype pattern dictionary
This works on a standard page ok. However, when I try it on my drawing the cross-hatching comes out not evenly spaced. Any ideas? Also, does anybody know a good informational place to get postscript code in languatelevel 3 for producing such patterns. I still need to come up with circles and other various types of standard patterns. Thanks.
Re: programming patterns in languagelevel 3
Author: Aandi_Inston
Date: Thu, 18 Dec 2003 17:44
Date: Thu, 18 Dec 2003 17:44
3 lines
760 bytes
760 bytes
Are you making sure to call makepattern only once? Aandi Inston
Re: programming patterns in languagelevel 3
Author: Mike_LeFrancois
Date: Fri, 19 Dec 2003 16:31
Date: Fri, 19 Dec 2003 16:31
7 lines
1215 bytes
1215 bytes
yes, I am calling makepattern only once, but once for each pattern where I have three at the moment. Actually, since I've posted the message I got the majority of the patterns to work. The trouble I found was with the BBox I had set and the XStep, YStep for the pattern spacing in the BBox. Though, at 100% visualization the lines don't look evenly spaced. However, if you zoom in they actually are. Still, does anybody know a good place to find information on LanguageLevel 3 pattern algorithms for hatching and such???? Thanks for the reply by Aandi Inston..
Re: programming patterns in languagelevel 3
Author: Mike_LeFrancois
Date: Fri, 19 Dec 2003 22:38
Date: Fri, 19 Dec 2003 22:38
10 lines
1070 bytes
1070 bytes
Does anybody know how to make angled cross hatching patterns?? I can't seem to make a negatively slopping line happen, only positive?
0 1 1{0 moveto 10 10 rlineto} for
will draw the positive slopes since dx,dy have values to change, but what is the needed code to make the lines go negative???
Also, dashes?? I though that
[3] 0 setdash was suppost to make dashed lines??
Any help would be greatly appreciated..
Re: programming patterns in languagelevel 3
Author: Aandi_Inston
Date: Sat, 20 Dec 2003 10:15
Date: Sat, 20 Dec 2003 10:15
16 lines
1554 bytes
1554 bytes
>Does anybody know how to make angled cross hatching patterns?? I can't seem to make a negatively slopping line happen, only positive?
>
>0 1 1{0 moveto 10 10 rlineto} for
>
>will draw the positive slopes since dx,dy have values to change, but what is the needed code to make the lines go negative???
At its simplest you can make a mirror image with 1 -1 scale (but
remember to do everything below the origin).
>
>Also, dashes?? I though that
>[3] 0 setdash was suppost to make dashed lines??
Should do, provided you use stroke. Don't forget the dash size is
affected by the scale factor.
Aandi Inston
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads