I have just begun learning PostScript in order to produce graphics for LaTeX and I have no idea how to combine a path with itself so the stroke only affect the outer border of the drawn shape. My code is as follows:
/black { 0 0 0 1 setcmykcolor } def
/gold { 0.02 0.17 0.72 0.05 setcmykcolor } def
newpath
% the center is 1/2w and 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 the stroke is drawn, the lines crossing the shape are drawn. I would like to know if there is a way to only have the outer border of the shape stricken and not the inner lines. i would rather not have to calculate where the lines forming the star intersect, i.e. keep 5 lines instead of getting 10 smaller ones.
Note also, that I am learning PS as-is and am not wanting to use external programs (read Illustrator and the like). The purpose of this question is to built up my knowledge of PostScript.
Simplest would be to do the stroke first and then the fill. You may want to double your linewidth as doing this effectively cuts the lines in half.