0

When I used asymptote function project I met some strange problem with picture scaling. So, here is an example:

import three;
settings.render = 0;
size(8cm,0);

path3 p1 = unitsquare3;

triple T1 = (0,0,0);
triple T2 = (0.8,0,0);
path3 t = T1 -- T2;

transform3 s1 = shift((0.3,0.2,0)) * rotate(65,(0,0,1));
transform3 s2 = shift((0.1,0.5,0)) * rotate(-20,(0,0,1));

path3 b_1 = s1 * t;
path3 b_2 = s2 * t;

draw(project(p1)); 
draw(project(b_1));
draw(project(b_2));
label("$\beta$",(0.95,0.95,0),N);

So, we can see such result: enter image description here

Let us change the code above:

draw(p1); 
draw(b_1);
draw(b_2);

And we can see:enter image description here

Let us change again this code:

draw(project(p1)); 
draw(b_1);
draw(project(b_2));

And we can see now the third picture:

enter image description here

Change again:

draw(p1); 
draw(b_1);
draw(project(b_2));

In this case we can see the second picture again:

enter image description here

How to explain such strange behavior of function project?

2
  • 1
    It seems that the objects drawn withproject(path3) do not respect the size constraint. It means that asymptote does not take it into account for the final and automatic size of the picture. project is used in three.asy but through the deferred drawing. At last : why do you use project ?
    – O.G.
    Jun 15 '17 at 21:23
  • Thank you (I've not enough rep to estimate your comment). This is 'stripped' example from experiments with geoespace module.
    – Vladimir
    Jun 16 '17 at 4:29
1

You can prevent the viewpoint from being adjusted by inserting after import three; the line

currentprojection=perspective(1,1,1,autoadjust=false);
2
  • I tried to use currentprojection=perspective(5,4,2,autoadjust=false); and this method doesn't work for me. The types of pictures look like in the pictures of question.
    – Vladimir
    Jun 16 '17 at 4:23
  • In any case, thanks, and if I can force your method to work, I'll appreciate the answer.
    – Vladimir
    Jun 16 '17 at 4:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.