[metapost] Merging oultines in Metapost

Filipe fjsc3 at yahoo.co.uk
Fri Jul 18 17:31:05 CEST 2008


How can one make Metapost merge contours and output only the resulting
composite outlines? 

As a minimal example, let's say that one draws two squares that overlap:

  path pp;
  pp = unitsquare;
  fill pp;
  fill pp shifted (1/2,1/2);

Instead of having the resulting eps containing the two overlapping squares,
how can they be merged into a single closed path?

Obviously, in this case the path is so simple that it could be easily done
"by hand". But is there a general function or macro to do this automatically
for more complicated outlines?

My apologies if this has a trivial solution or has been discussed before.


More information about the metapost mailing list