13

I would like to use a few simple 3d diagrams in my LaTeX document. They primarily consist of polyline segments in 3d, along with an occasional simple surface (e.g. paraboloid). There are two questions:

1) Is there a good way to draw polylines in 3d that conveys the depth? I thought about fading based on distance from the eye, and also of shadows of the drawing on the coordinate planes, but I am not sure how well it'd work in practice. I'd love hear how others solved this/see some examples that I can imitate.

2) What are the drawing packages that are compatible with LaTeX that would make the task of drawing easier. I know of asymptote which can draw parametric 3d surfaces, but are there others?

Caramdir
  • 89,023
  • 26
  • 255
  • 291
Boris Bukh
  • 1,374
  • Is there a picture somewhere showing what you want to achieve? I'm afraid that I don't understand what a "polyline segment" is (my lamentable ignorance, I know). – Andrew Stacey Oct 30 '10 at 11:20
  • 1
    I mention a 3d extension to Metapost in an answer to another question. – Charles Stewart Oct 30 '10 at 11:31
  • @Andrew: I mean a sequence of line segments so that beginning of one is joined to the end of the other. Alternatively: a sequence of points joined by line segments – Boris Bukh Oct 30 '10 at 11:44
  • I'd still like to see a picture of what you would consider a "true" depiction of a 3D line drawing ... – Andrew Stacey Oct 30 '10 at 16:36
  • A surface made of sequences of points joined by line segments is also known as a mesh surface. – Display Name Dec 07 '10 at 00:57
  • Concerning 1), the only way I know is to use stereo pairs--pairs of 3d pictures from slightly different perspectives placed next to each other, such that if you focus your eyes behind or in front of the paper, you see a third, three-dimensional version. (You may be familiar with the "magic eye" pictures; it's the same principle.) Speaking for myself, I was never able to visualize the twisted cubic even when I had interactive images I could rotate at will; but I finally understood what it looked like after realizing it as a stereo pair. – Charles Staats Mar 06 '13 at 23:26

5 Answers5

13

Asymptote is definitely a tool to look at, it can do nut just parametric surfaces, but graphs of functions, and I believe even isosurfaces, although I am not sure.

Take a look at sketch. It does not seem to be great at surfaces, though.

Metapost can do pretty interesting things, take a look at these examples.

Jan Hlavacek
  • 19,242
7

Maybe this doesn't answer your specific question, but nowadays, the standard answer concerning graphics seems to be: Use TikZ. See TeXample.net for some 3d examples.

Hendrik Vogt
  • 37,935
  • Thanks. I do know of TikZ, and do use it occasionally. However, it is a 2D package: it cannot render surfaces other than balls, one needs to calcule all the projections by hand, etc. – Boris Bukh Oct 30 '10 at 10:48
  • 1
    @Boris: whilst I agree that TikZ has some severe limitations for drawing 3D pictures, calculating the projections by hand is not one of them. You can specify coordinates in 3D and draw some very obviously 3D pictures - take a look at my contributions on texample.net to see some, or look at the "how to draw a torus" question on this site. – Andrew Stacey Oct 30 '10 at 11:05
  • @Andrew: Your example of "smooth map" at texample.net is really cool! – Boris Bukh Oct 30 '10 at 11:44
7

Please, consider also the more elaborated package for 3D called pst-solides3d offering perspective features. I also recommand to visit syracuse for more examples [website in French]

pluton
  • 16,421
7

the task to draw "a sequence of points joined by line segments" or occasionally a surface (rendered with a colormap or a shading) can be realized by means of pgfplots. Perhaps the examples in the manual (available on the sourceforge link below) or directly on the webpage http://pgfplots.sourceforge.net/ can be used to decide if it does what you want, it is quite powerful.

Best regards

Christian

6

I wonder why nobody has mentioned pst-3dplot or tikZ-3dplot so far. The tikZ Example Gallery for 3D objects contains some interesting examples (e. g. »Seismic focal mechanism«, »Spherical polar plots«, …).