texmf-dist/doc/metapost/base/source-tutorial/fill.mp
raw| 1 | if scantokens(mpversion) > 1.005: |
| 2 | outputtemplate := |
| 3 | else: |
| 4 | filenametemplate |
| 5 | fi |
| 6 | "%j.mps"; |
| 7 | |
| 8 | beginfig(0); |
| 9 | % Set unit size to 72bp = 1in |
| 10 | u:=72; |
| 11 | |
| 12 | % Define path |
| 13 | path p; |
| 14 | p:=(0,0){right}..{dir 45}(3*u/4,u/4){dir 45}..{up}(u,u)--cycle; |
| 15 | |
| 16 | % Fill the path |
| 17 | fill p withcolor red; |
| 18 | |
| 19 | % Draw the path |
| 20 | draw p; |
| 21 | endfig; |
| 22 | end |