How to draw 3D convex hull using Tikz/pgf ?
For example, if we want to plot the following pyramid or Tetrahedron using Tikz/pgf ?
Say,the vertices are (1,1,1), (1,−1,−1), (−1,1,−1), (−1,−1,1).
However I have looked up the following code:
\pgfplotsset{width=7cm,compat=1.3}
\begin{tikzpicture}
\begin{axis}
% We have `plotdata/first3d.dat' with
% ---------
% 0 0 0.8
% 1 0 0.56
% 2 0 0.5
% 3 0 0.75
%
% 0 1 0.6
% 1 1 0.3
% 2 1 0.21
% 3 1 0.3
%
% 0 2 0.68
% 1 2 0.22
% 2 2 0.25
% 3 2 0.4
%
% 0 3 0.7
% 1 3 0.5
% 2 3 0.58
% 3 3 0.9
% -> yields a 4x4 matrix:
\addplot3[surf] file {plotdata/first3d.dat};
\end{axis}
\end{tikzpicture}
giving the following convex hull
But the above code showing error and nor compiling in my latex editor.
are there other way/other codes to draw convex hull using Tikz/pgf ?
help me at least to draw the tetrahedron