Here is what I am trying to draw that in LaTeX.
1 Answer
For 3D graphics, Asymptote is probably the best of the LaTeX-friendly graphics programming languages. I am a beginner at Asymptote, but 15 minutes with Charles Staat's tutorial produced this:
And here's the program that produced it.
import three;
size3(100,100,100);
currentprojection = perspective(10,7,4);
surface i = shift(-1/2,-1/2,-1/2) * unitcube;
path3[] ii = shift(-1/2,-1/2,-1/2) * unitbox;
surface o = scale3(2) * i;
path3[] oo = scale3(2) * ii;
draw(i, red+opacity(0.5));
draw(o, grey+opacity(0.3));
draw(ii);
draw(oo);
I've no idea if this is good style, and I'm sure there must be a better way to draw the edges of a surface. The tutorial explains how to add labels.
EDIT: There is indeed a better way to draw the edges of a surface; all you have to do is pass a second colour to the draw command.
draw(i, red+opacity(0.5),black);
draw(o, white+opacity(0.3),black);
Then there is no need for the unitbox
objects.
-
1An external programme is definitely superior for 3D. Except for maybe pstricks, which I am not sufficiently familiar with to say one way or another. But TikZ really isn't good for 3D.... (Which is to say, you can make stunning stuff but neither easily nor flexibly, although
tikz-3dplot
is definitely helpful. But it is having to work so hard to fake something which Asymptote seems to handle easily.) Your '15 minutes' comment almost persuades me even I could learn to use it a little ;).– cfrFeb 23, 2016 at 12:20 -
@cfr - yes I keep thinking the same thing, but Metapost always lures me back... Charles Staats' work on the Asymptote tutorial is first class (although still incomplete).– ThrustonFeb 23, 2016 at 12:26
-
-
There's a
filldraw
command. Can you use that with asurface
or only apath
?– cfrFeb 23, 2016 at 12:34 -
1@cfr, see updated answer - all you need is to pass a second colour - simple, but not very obvious to this novice!– ThrustonFeb 23, 2016 at 18:24
diagrams
or something package-neutral might be better as you didn't specify any package. Buttikz-pgf
is closer thanword
;).