Graphics and media/Collections of tips and tricks/Fill-unfill or even-odd rule in Metafun

Unofficial ConTeXt Wiki mirror

Last modified: 2025-01-18

Metapost doesn't support 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 eofill. To fill a shape using the even-odd rule we need a sequence of nofill ending with a eofill statement, as it can be seen in the following examples.

Some examples