[metapost] Merging oultines in Metapost
Boguslaw Jackowski
B_Jackowski at GUST.org.pl
Sat Jul 19 15:11:43 CEST 2008
Hi,
Filipe:
>> How can one make Metapost merge contours and output only the resulting
>> composite outlines?
Taco:
> IIRC, the package 'roex' has a macro called remove_overlap, but
> I do not know first-hand how to use it. The package is officially
> for metafont, but it should work in metapost as well, I think.
No, it will not work. It heavily depends on manipulating bitmaps
(in order to decide whether given areas touch each other or one
is embedded in the other).
In general, merging outlines is a tough problem.
Reasonable results can be expected only if paths are not
(nearly) tangent. The reason is simple -- tangency is an
infinitesimal property, while Matapost and Metafont work in
a discrete space.
I rewrote roex for Metapost, simplyfying it significantly,
and it is available as a single macro `find_outlines'
in the plain_ex.mp package which, in turn, is an element of
the METATYPE1 package:
http://en.wikipedia.org/wiki/METATYPE1
I don't think that downloading the whole METATYPE1 package makes sense
(although it is rather tiny as for nowadays standards ;-) therefore
I've put the relevent stuff at the address
http://bopcompl.dyndns.org/4mplist/
namely:
plain_ex.mp -- the package
plain_ex.pdf -- the doc
plain_e_.mp -- illustrations for the doc
Cheers -- Jacko
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Bogus\l{}aw Jackowski: B_Jackowski at GUST.ORG.PL
----------------------------------------------------------------
Hofstadter's Law: It always takes longer than you expect, even
when you take into account Hofstadter's Law.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
More information about the metapost
mailing list