[dev-context] incorrect internal mptopdf conversion

Hans Hagen pragma at wxs.nl
Mon Jan 22 14:47:55 CET 2007


Sanjoy Mahajan wrote:
>> ok, i fixed it; was a bug in the rline to handler in concat mode 
>>     
>
> Great, thanks for that.
>
>   
>> btw, your graphic contains 90% junk ps (covered by successive
>> draws), maybe some picture magic without picture resets
>>     
>
> Indeed, I was surprised by the length of the mps file.  Oh, it just
> hit me the reason for all the junk ps.  It is my 'thinko', so thanks
> for pointing me to the problem.
>
> I meant to draw the rotated picture of one triangle six times.
> Instead I rotated the currentpicture and drew it on the
> currentpicture, so I ended up with 2^6 triangles -- with most of the
> code overlapping.  It looked right so I didn't think about it enough.
>
> What I had:
>
>   currentpicture := currentpicture shifted (-z1) scaled 0.7;
>   for i = 1 upto 6:
>     % this line causes the doubling each time
>     draw currentpicture rotated (60*i);
>   endfor
>
> Instead, what I should do to avoid the overlapping:
>
>   currentpicture := currentpicture shifted (-z1) scaled 0.7;
>   tpic := currentpicture
>   for i = 1 upto 5:   % i=6 redraws the original one
>     draw tpic rotated (60*i);
>   endfor
>
> For those curious about the math behind the picture: The picture
> solves the problem of "how do you bisect an equilateral triangle [into
> two equal areas] using the shortest path?"
> <web.mit.edu/18.098/notes/picture-proofs.pdf> has the details in
> section 4.5.
>   
or something 

picture p ; p := image(
	draw like usual 
) ; 

for ... draw p rotated ... .. 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the dev-context mailing list