Article View: comp.lang.postscript
Article #7125Re: Flowers ...
From: Brian Reid
Date: Wed, 04 May 1988 22:44
Date: Wed, 04 May 1988 22:44
45 lines
1949 bytes
1949 bytes
In article <24203@bbn.COM> dkovar@bbn.com (David C. Kovar) writes:
> Odd question: Does anyone have any PostScript routines to draw flowers
>of any sort?
>-David Kovar
Here's the one I use. It draws a side view, for architectural elevations, of
a simple cartoon flower plant with two leaves. Depending on the size that you
want to draw it you can piddle with the "npetals" parameter; it's set to 4 in
this version.
% draw a 1-unit-high flower rooted at the current point
% (Brian Reid, April 1985)
/flower {
gsave 1 200 div dup scale currentpoint translate
% stem
0 10 moveto -6 7 -7 70 2 95 curveto
6 105 17 152 12 183 curveto
gsave 1 setgray 9 setlinewidth stroke grestore
7 setlinewidth stroke
% right leaf
newpath -20 0 moveto 10 0 lineto
13 35 43 90 71 120 curveto
40 105 -3 40 -20 0 curveto
gsave 1 setgray fill grestore 2 setlinewidth stroke
% left leaf
-20 0 moveto 10 0 lineto
0 40 -30 96 -55 140 curveto
-35 85 -19 35 -20 0 curveto
gsave 1 setgray fill grestore 2 setlinewidth stroke
% petals
gsave 12 183 translate 1 0.7 scale
/npetals 4 def /petalangle 360 npetals div def
1 setlinewidth /petlength 55 def
/dy petalangle sin petlength mul def petalangle 2 div rotate
npetals
{newpath 0 0 moveto petlength dy petlength dy neg 0 0 curveto
gsave 1 setgray fill grestore stroke petalangle rotate}
repeat
newpath 0 0 12 0 360 arc fill
grestore
grestore
} bind def
Technical Details
Message-ID:
<423@bacchus.DEC.COM>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!ames!amdcad!decwrl!reidReferences:
<1089@sask.UUCP> <2042@bgsuvax.UUCP> <9340@sol.ARPA> <24203@bbn.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!ames!amdcad!decwrl!reid From: reid@decwrl.dec.com (Brian Reid) Newsgroups: comp.lang.postscript Subject: Re: Flowers ... Message-ID: <423@bacchus.DEC.COM> Date: 4 May 88 22:44:38 GMT References: <1089@sask.UUCP> <2042@bgsuvax.UUCP> <9340@sol.ARPA> <24203@bbn.COM> Reply-To: reid@decwrl.UUCP (Brian Reid) Organization: DEC Western Research Lines: 44