29.11.2012 Views

MetaFun - Pragma ADE

MetaFun - Pragma ADE

MetaFun - Pragma ADE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

98<br />

Another case when top and friends cannot be applied in a general way is the following. Consider<br />

the three paths:<br />

path p, q, r ;<br />

p := fullcircle scaled 3cm ;<br />

q := p shifted (7cm,0cm) ;<br />

r := center p -- center q ;<br />

We draw these paths with:<br />

draw p withpen pencircle scaled 10pt withcolor .625red ;<br />

draw q withpen pencircle scaled 10pt withcolor .625yellow ;<br />

draw r withpen pencircle scaled 20pt withcolor .625white ;<br />

The line is drawn from center to center and since the line has a non zero width and a round line<br />

cap, it extends beyond this point.<br />

If we want to line to stop at the circular paths, we can cut off the pieces that extend beyond those<br />

paths.<br />

pair pr, qr ;<br />

pr := p intersectionpoint r ;<br />

qr := q intersectionpoint r ;<br />

r := r cutbefore pr cutafter qr ;<br />

This time we get:<br />

A few more details Only this far

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!