PostScript Path Combine -
i have begun learning postscript in order produce graphics latex , have no idea how combine path stroke affect outer border of drawn shape. code follows:
/black { 0 0 0 1 setcmykcolor } def /gold { 0.02 0.17 0.72 0.05 setcmykcolor } def newpath % center 1/2w , 1/2h /cx { 1200 2.0 div } def % center-x /cy { 600 2.0 div } def % center-y /r { 600 9.0 div 4 mul 2.0 div } def % star's radius cx r 0 cos mul add cy r 0 sin mul add moveto cx r 144 cos mul add cy r 144 sin mul add lineto cx r 288 cos mul add cy r 288 sin mul add lineto cx r 72 cos mul add cy r 72 sin mul add lineto cx r 216 cos mul add cy r 216 sin mul add lineto closepath gsave gold fill grestore 1 setlinewidth black stroke
when stroke drawn, lines crossing shape drawn. know if there way have outer border of shape stricken , not inner lines. rather not have calculate lines forming star intersect, i.e. keep 5 lines instead of getting 10 smaller ones.
note also, learning ps as-is , not wanting use external programs (read illustrator , like). purpose of question built knowledge of postscript.
simplest stroke first , fill. may want double linewidth doing cuts lines in half.
%... closepath gsave 2 setlinewidth black stroke grestore gold fill
Comments
Post a Comment