我正在尝试在PostScript中为我的徽标程序找到等效的代码:
PROC FRACTAL( SIZE )
IF SIZE < 1 THEN
FORWARD 5
ELSE
LEFT 90
RIGHT 90
RIGHT 90
RIGHT 90
RIGHT 90
RIGHT 90
FORWARD 60
ENDIF
PROC MAIN( VOID )
FRACTAL( 5 )到目前为止,我得到了
%!
%(debug.ps/db5.ps)run traceon stepon currentfile cvx debug
/Xpos { 300 } def
/Ypos { 500 } def
/Heading { 0 } def
/Arg { 0 } def
/RIGHT {
Heading exch add Trueheading
/Heading exch store
} def
/LEFT {
Heading exch sub Trueheading
/Heading exch store
} def
/Trueheading {
360 mod dup
0 lt { 360 add } if
} def
/FORWARD {
dup Heading sin mul
exch Heading cos mul
2 copy Newposition
rlineto
} def
/Newposition {
Heading 180 gt Heading 360 lt
and { neg } if exch
Heading 90 gt Heading 270 lt
and { neg } if exch
Ypos add /Ypos exch def
Xpos add /Xpos exch def
} def
/SIZE { 5 } def
/FRACTAL{
1 dict begin
/SIZE exch def
SIZE
1
lt
{
5
FORWARD
}{
90
LEFT
90
RIGHT
90
RIGHT
90
RIGHT
90
RIGHT
90
RIGHT
60
FORWARD
} ifelse
end
} def
/MAIN{
5
FRACTAL
} def
Xpos Ypos moveto
MAIN
stroke
showpage 这个解决方案基于这里的这个问题:Logo to PostScript mini-Compiler
这段代码对我来说看起来很好,但是由于某些原因PS不想显示图片。
发布于 2014-04-07 12:44:35
postscript的翻译是正确的。问题是Logo程序没有做任何有趣的事情。
https://stackoverflow.com/questions/22694476
复制相似问题