diff options
author | Karl Berry <karl@freefriends.org> | 2015-08-02 21:30:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-08-02 21:30:22 +0000 |
commit | c4cbbdc6c246816defebc2afa9fd9b82b42118e3 (patch) | |
tree | 478c48d21c8f6bd82b7520f146168e9db82bc56c /Master/texmf-dist/metapost | |
parent | 008ccd78c7a2d5abf3e17cb872cf1536f6192ecb (diff) |
shapes (2aug15)
git-svn-id: svn://tug.org/texlive/trunk@38024 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost')
-rw-r--r-- | Master/texmf-dist/metapost/shapes/shapes.mp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Master/texmf-dist/metapost/shapes/shapes.mp b/Master/texmf-dist/metapost/shapes/shapes.mp index 33b20ddd3d7..e868003b030 100644 --- a/Master/texmf-dist/metapost/shapes/shapes.mp +++ b/Master/texmf-dist/metapost/shapes/shapes.mp @@ -73,6 +73,10 @@ enddef; boolean modcircle; modcircle := true; pen modcirclepen; modcirclepen := pencircle scaled 1; pen modshapepen; modshapepen := pencircle scaled 1; +boolean modticks; modticks := false; +numeric nummodticks; nummodticks := 12; +numeric ticklen; ticklen := 0.1in; +pen tickpen; tickpen := pencircle scaled 1; def modstar(expr numpoints,numbers,numstar) = picture modfigure; if (modcircle = true): @@ -80,6 +84,23 @@ modfigure := image(draw fullcircle scaled 1in withpen modcirclepen;); else: modfigure := image(); fi; +picture modtickpic; +if (modticks = true): +modtickpic := image( +pair tickstart[]; pair tickend[]; +tickstart[0] = (0,0) shifted (0,0.5in); +tickend[0] = tickstart[0] shifted (0,ticklen); +draw tickstart[0]--tickend[0] withpen tickpen; +for i=1 upto (nummodticks-1): +tickstart[i] = tickstart[i-1] rotatedaround +((0,0), (360/nummodticks)); +tickend[i] = tickend[i-1] rotatedaround +((0,0), (360/nummodticks)); +draw tickstart[i]--tickend[i] withpen tickpen; +endfor; +); +addto modfigure also modtickpic; +fi pickup modshapepen; pair p[]; pair q[]; picture addition; @@ -120,6 +141,23 @@ modfigure := image(draw fullcircle scaled 1in withpen modcirclepen); else: modfigure := image(); fi +picture modtickpic; +if (modticks = true): +modtickpic := image( +pair tickstart[]; pair tickend[]; +tickstart[0] = (0,0) shifted (0,0.5in); +tickend[0] = tickstart[0] shifted (0,ticklen); +draw tickstart[0]--tickend[0] withpen tickpen; +for i=1 upto (nummodticks-1): +tickstart[i] = tickstart[i-1] rotatedaround +((0,0), (360/nummodticks)); +tickend[i] = tickend[i-1] rotatedaround +((0,0), (360/nummodticks)); +draw tickstart[i]--tickend[i] withpen tickpen; +endfor; +); +addto modfigure also modtickpic; +fi pair p[]; pair q[]; picture addition; pickup modshapepen; |