[metapost] glyph operator and contours order

Laurent Méhats laurent.mehats at gmail.com
Sun Feb 6 16:15:45 CET 2011

Le 06/02/2011 12:26, luigi scarso a écrit :
>         so my question would be: given two
>         non intersecting nor self-intersecting cycles, is there a proper
>         way to
>         decide whether one lies inside the other ?
> An idea:
> Let c1 is a set of bezier curves that make a cycle, so it can be
> parametrized with t in [0,N];
> let c2 another cycle.
> Let c1 & c2 not intersecting , c1 not self intersecting, c2 not self
> intersecting
> for tn = 1 to N:
>  r(tn) = straight line from c1(t=0) to c1(t=tn);
>   if r(tn) intersect c2 then c2_is_inside_c1=true; break

Thanks. I had a similar idea but we can't be sure that the 'r(tn)'
straight lines lie inside c1 (I'm thinking to a U-shaped cycle). So it
could be the case that we find c2 to be inside c1 while actually it is
not. It may not be harmful for the problem at hand, but not satisfactory

Laurent Méhats

More information about the metapost mailing list