Is it possible to draw a 3d plot as line art with tikz? For example, Is it possible to draw z=x*exp(-x^2-y^2) with smooth line art style? Something like the following figure for z=x^3-3x*y^2.

Asked
Active
Viewed 242 times
3
-
2This might help to get this started: Simulating hand-drawn lines. – Peter Grill Jan 11 '19 at 07:08
-
@Peter Grill: I do not think that the OP is looking for a line style other than normal smooth curves. I believe the question is about drawing just significant lines of a 3d plot as in the example. – hpekristiansen Jan 11 '19 at 09:53
-
@hpekristiansen: If that is the case then the reference to "line art" style should be removed from the question. – Peter Grill Jan 12 '19 at 00:32
-
Something like this: https://eclecticcats.wordpress.com/2014/03/25/tikzpgf-part-2-drawing-3d-shapes/ – Jan 13 '19 at 04:49
1 Answers
2
Asymptote is probably the better tool for serious 3d functions:
import graph3;
size(200,0);
currentprojection=perspective(10,8,9);
real f(pair z) {return z.x*exp(-(z.x**2)-(z.y**2));}
surface s=surface(f,(-1.4,-1.4),(1.4,1.4),nx=20,Spline);
draw(s,lightgray,meshpen=black+thick(),nolight,render(merge=true));
If you have a full TeX installation, then it will be already installed. texdoc asy tells you how to run it, and then if you do asy to bring up the interactive prompt, typing help will open the manual. It's very powerful but there is a lot to learn.
As the relevant help page will tell you, asy can be integrated into your LaTeX source file.
Thruston
- 42,268
