Changes

Jump to navigation Jump to search
1,081 bytes added ,  08:05, 17 December 2020
FInally created the page!
Metapost doesn't support [https://en.wikipedia.org/wiki/Even%E2%80%93odd_rule even-odd rule] filling so it uses a fake unfilling via a background color. This is problematic in cases when one deals with e.g. transparency. To overcome this difficulty, Metafun implements some extensions, such as <code>eofill</code>. To fill a shape using the even-odd rule we need a sequence of <code>nofill</code> ending with a <code>eofill</code> statement, as it can be seen in the following examples.

== Some examples ==

<context source="yes">
%Adapted from Metafun's manual
\startMPpage
nofill fullsquare scaled 2cm ;
nofill fullsquare scaled 2cm shifted (1cm,0) ;
eofill fullsquare scaled 2cm shifted (0,1cm) withcolor darkred;
\stopMPpage
</context>

<context source="yes">
\startMPpage
path A; A := (unitcircle shifted (-center unitcircle)) scaled 4cm;
path B; B := (unitcircle shifted (-center unitcircle)) scaled 1cm;
path C; C := B shifted (left*1.4cm);
nofill A; nofill B; eofill C withcolor darkblue;
\stopMPpage
</context>

[[Category:Graphics]]
[[Category:Metapost]]

Navigation menu