-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the tikz-3dtools wiki!
This library can be distributed under the LPPL 1-3c license.
The purpose of this experimental library is to add a couple of additional 3d features to TikZ. There are already some 3d features in the 3d
and perspective
libraries as well as additional packages such as tikz-3dplot
and tikz-3dplot-circleofsphere
. The feature that is specific to this library is that it stores and uses the third component of coordinates. That is, traditionally TikZ works with the two coordinates that specify the location on the screen, and throws the third component away. However, the third component is instrumental to judge whether one object is in front or behind another object, to compute the 3d angle between two lines (rather than the angle between the projections), distances and intersections in 3d. However, unlike the perspective
library, 3dtools
only supports orthographic projections.
The cleanest way to arrive at a comprehensive set of 3d features would be if the maintainers of TikZ would change the behavior of TikZ to not throw away the third component. This change would actually not be major efforts, and would give users access to many interesting features. (Of course, making shapes compatible with 3d is major efforts, see here for examples.) However, this is something the author of this experimental library here cannot influence. If this ever happens, this library will become largely obsolete.
For the time being, this library uses the coordinates that were used to declare a point, which are stored in \tikz@dcl@coord@<name>
, where is the name of the shape. This method has many loose ends, most importantly the shape does not remember what the unit vectors were when it was declared. In principle it is possible to modify TikZ so as to change this, but this would make the library even less reliable. So, for the time being a switch to "physical" coordinates is part of the library, which records the dreibein, but the current implementation only works in some rather narrow scenarios. See section 1.4 of the manual for more details.
The library contains a number of predefined shapes, for which the visible and hidden stretches get discriminated. These shapes can be viewed from arbitrary angles. Most of them are taken from posts on topanswers. They have, for the most part, not thoroughly been tested, so there can be unfortunate surprises when using them. See section 1.5 of the manual for more details.
The library can be installed by copying the library to a location in which TeX can find it. This location could be the same directory as the one in which the main TeX file is located, or somewhere else in the TeX input path collection. Under Linux or Mac, you can find this set via
echo $TEXINPUTS
and can append directories in your profile file.