[metapost] intersectiontimes peculiarity

Troy Henderson thenders at gmail.com
Wed Apr 24 13:49:41 CEST 2013


> the algorithm works quite nicely -- we use it in our engines generating
> fonts for many years.
>

How can I redefine one of the paths and call intersect_curves again?  For
example, the following errors due to inconsistent equations.

Troy

--

input intersect_curves;
input quicksort;

beginfig(0);
    u:=28;
    path p[\\];

p1:=(0,0){up}..(1,1){right}..(4,-2){down}..(1,-5){left}..(0,-4){up}..(2,-2){up}..cycle;
    draw p1 scaled u;


    % First choice for p2
    p2:=(1,-5.5)--(1,1.5);
    intersect_curves(p);
    quicksort p2(1,p2num);
    draw p2 scaled u;
    for i=1 upto p2num: fill fullcircle scaled 3 shifted (point p2[i] of p2
scaled u); endfor;

    % Second choice for p2
    p2:=(3,-5.5)--(3,1.5);
    intersect_curves(p);
    quicksort p2(1,p2num);
    draw p2 scaled u;
    for i=1 upto p2num: fill fullcircle scaled 3 shifted (point p2[i] of p2
scaled u); endfor;

endfig;

end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/metapost/attachments/20130424/1b4d4909/attachment.html>


More information about the metapost mailing list