In Asymptote, I'd like to draw two intersecting planes, one with a solid color and another with some pattern (e.g. checkerboard), so that it would look okay if printed black and white. However, the pattern module doesn't appear to work.
The code below is what I'm trying to get to work, with the statement that I wished drew that plane commented out (I understand of course that function doesn't exist, I just don't know which one to use).
settings.prc = false;
defaultpen(fontsize(10pt));
import three;
import graph3;
import patterns;
size(11cm,0);
real rot_param = 0.01;
currentprojection=perspective((10000,-20000,100000),up=(-rot_param,1-rot_param,0));
currentlight = (4,-1,4);
render render = render(compression=Low, merge = true);
limits((0,0,0), (3,3,3));
real delta = 0.75;
real dterm = (1-delta)/delta;
draw(surface(O -- (dterm,0,0) -- (3,3-dterm,0) -- (3,3,0) -- cycle), orange+opacity(0.5), render);
draw(surface(O -- (3,3,0) -- (0,3,0) -- cycle), orange+opacity(0.5), render);
draw(surface(O -- (3,3,0) -- (3,3,3) -- (0,0,3) -- cycle), lightred+opacity(0.5), render);
draw(surface((dterm,0,0) -- (3,3-dterm,0) -- (3,3-dterm,3) -- (dterm,0,3) -- cycle), lightblue+opacity(0.5), render);
// Does not work!
//filldraw(surface((dterm,0,0) -- (3,3-dterm,0) -- (3,3-dterm,3) -- (dterm,0,3) -- cycle), pattern("checker"));
xaxis3("",Bounds,black+dashed,InTicks(3,1));
yaxis3("",Bounds,black+dashed,InTicks(3,1));
//zaxis3("",Bounds,black,InTicks(3,1));
draw(O -- 3.5X,arrow=Arrow3);
label("$\gamma(C)$",3.7X);
draw(O -- 4Y,dashed, arrow=Arrow3);
label("$\gamma(D)$",4.2Y);
draw(O -- 4Z,arrow=Arrow3);
label("$\phi(C,\theta_0)$",(-0.2,0,5));
label("1",(-0.1,0,3));
draw(box((0,0,3),(3,3,3)), black+linewidth(0.6pt));
draw((0,3,0) -- (0,3,3), dashed);
draw((3,3,0) -- (3,3,3));
draw((3,0,0) -- (3,0,3));
This is how it looks (I'd like to make at least the blue plane checkerboard):
I would be very grateful if anyone knows how to do this. In case you can't tell I have some other problems too, so I'll just throw these out there if anyone happens to know:
- I'm using perspective but I'd like to use the "oblique" perspective except from "below", so that the axis pointing "out of the screen" ($\phi(C,\theta_0)$ ) is actually pointing up and to the left a bit. I've tried to approximate it as you can see. Is there a way to do this?
- How do I get the last "3"s to show up as labels on the axis?
- I don't want the vertical axis to scale (I want it bigger than it appears, so I'm just relabeling, e.g. the 1). Is there a way to do this automatically?
for
loop to draw each square as a separate surface.grid3
module. You might also check out Figure 70 on this page. Any method you use will require you to draw the surface using a different method than you are using, and the nestedfor
loop is by far the simplest method to learn.currentprojection = oblique(angle=-45);
. According to the documentation, "If an optional real argument is given, the negative z axis is drawn at this angle in degrees."