1 \section{The object \texttt{geode}}
3 \subsection{Mathematical presentation}
5 Some excellent tutorials about geodes and their duals are available on the following websites:
7 \centerline{\url{http://fr.wikipedia.org/wiki/G\%C3\%A9ode}}
8 %I was not sure whether you meant ``geode'' so I looked up this url. Wikipedia indicated that there is no article about this.
10 The parametrisation of a geode complies with that given on the website:
13 \centerline{\url{http://hypo.ge-dip.etat-ge.ch/www/math/html/amch104.html}}
15 ``\textit{We can define a geode with two parameters: a number $N$ indicating the type of the initial polyhedron ($N = 3$ for the tetrahedron, $N = 4$ for the octahedron and $N = 5$ for the icosahedron) and a number $n$ indicating the number of divisions along the edge's length.}''
18 The article \textit{Indexing the Sphere with the Hierarchical Triangular Mesh} describes a method that allows us to obtain a representation of geodes:
21 \centerline{\url{http://research.microsoft.com/research/pubs/view.aspx?msr_tr_id=MSR-TR-2005-123}}
23 \subsection{Construction with pst-solides3d}
25 Two approaches are possible to generate a geode or its dual:
26 either via \verb+\codejps+, or via the objects of
29 For a geode, the codes
31 \codejps{N n newgeode drawsolid**}
35 \psSolid[object=geode,ngrid=N n]
37 are equivalent. And for its dual, the codes
39 \codejps{N n newdualgeode drawsolid**}
43 \psSolid[object=geode,dualreg,ngrid=N n]
48 \subsection{Some examples of geodes and their duals}
50 \begin{LTXexample}[width=6cm]
51 \begin{pspicture}(-3,-3)(3,3)
52 \psset{viewpoint=50 -20 30 rtp2xyz,Decran=100}
53 \psSolid[object=geode,
55 %\codejps{5 0 newgeode drawsolid**}
56 \psframe*(-2,-2.8)(2,-2.2)
57 \rput(0,-2.5){\textcolor{white}{\textsf{N=5 n=0}}}
60 \begin{LTXexample}[width=6cm]
61 \begin{pspicture}(-3,-3)(3,3)
62 \psset{viewpoint=50 -20 30 rtp2xyz,Decran=100}
63 \psSolid[object=geode,
66 %\codejps{5 0 newdualgeode drawsolid**}
67 \psframe*(-2,-2.8)(2,-2.2)
68 \rput(0,-2.5){\textcolor{white}{\textsf{N=5 n=0}}}
72 \begin{LTXexample}[width=6cm]
73 \begin{pspicture}(-3,-3)(3,3)
74 \psset{viewpoint=50 -20 30 rtp2xyz,Decran=100}
75 \psSolid[object=geode,
77 %\codejps{5 1 newgeode drawsolid**}
78 \psframe*(-2,-2.8)(2,-2.2)
79 \rput(0,-2.5){\textcolor{white}{\textsf{N=5 n=1}}}
82 \begin{LTXexample}[width=6cm]
83 \begin{pspicture}(-3,-3)(3,3)
84 \psset{viewpoint=50 -20 30 rtp2xyz,Decran=100}
85 \psSolid[object=geode,
88 %\codejps{5 1 newdualgeode drawsolid**}
89 \psframe*(-2,-2.8)(2,-2.2)
90 \rput(0,-2.5){\textcolor{white}{\textsf{N=5 n=1}}}
94 \subsection{The parameters of the \Index{geodes}}
96 The radius of the sphere is fixed at 1, so to vary the dimensions of the
97 geodes one plays around with one or the other of the two following parameters:
99 \item The unit: \verb+\psset{unit=2}+
100 \item The position of the screen:
101 \texttt{\Lkeyword{viewpoint}=50 -20 30},\texttt{\Lkeyword{Decran}=100}, if the distance to the screen
102 is twice as far as the distance to the viewer, one scales the scenery by a factor of two.
105 \encadre{Within \textit{jps}, the setup for the geode is \textbackslash{}codejps\{\textbf{N n newgeode}\} and
106 for its dual it is \textbackslash{}codejps\{\textbf{N n
109 \encadre{With \Lcs{psSolid}, the parameters $N$ and $n$ are transmitted via the argument \Lkeyword{ngrid}}
111 The color and \Index{transparency} options are available for the geodes as well.
113 \begin{LTXexample}[width=7cm]
114 \psset{viewpoint=50 -20 30 rtp2xyz,Decran=150}
115 \begin{pspicture}(-3.5,-3.5)(3.5,3.5)
116 \psset{linewidth=2pt}
118 /geode42{4 2 newdualgeode} def
124 dup (orange) inputcolors
125 dup [.1 .9] solidputhuecolors} def
131 \subsection{Advice for a `fast' construction of a geode}
133 The calculation time for the geodes and their duals depends on the number of divisions of an edge
134 (the second parameter $n$) and will increase rapidly with $n$
135 which is really uncomfortable, because one has to wait more or less patiently, until
136 the result of the transformation \Cadre{dvips->ps2pdf} is ready.
138 As happens for all other solids, it is possible to save the calculation in external files,
139 which then saves calculation time when one has to make a test run of colours or view point.
141 We have to operate in two stages:
143 \subsubsection{Backup the parameters of the geodes in a \texttt{\Index{.dat}} file}
146 \documentclass{article}
147 \usepackage{pst-solides3d}
151 dup {[.5 .6]} exec solidputhuecolors
152 (geodedual44) writesolidfile
156 \Cadre{LaTeX->dvips->GSview (Windows)ou gv (Linux)}
158 The last operation will generate 4 files:
160 \item \texttt{geodedual44-couleurs.dat} $\rightarrow$ the colors of the faces;
161 \item \texttt{geodedual44-faces.dat} $\rightarrow$ the list of the faces;
162 \item \texttt{geodedual44-sommets.dat} $\rightarrow$ the list of the vertices;
163 \item \texttt{geodedual44-io.dat} $\rightarrow$ the number of the faces and vertices.
166 \encadre{By default, under Windows and Linux, the security of files on the hard drive is activated and doesn't allow you to write on the drive.
167 To deactivate that security option, more or less temporarily, here the two corresponding procedures:
171 \item[Linux:] Advice from Jean-Michel \textsc{Sarlat}: the simplest will be to use GhostScript directly, within the console. As there is no image to wait for:
173 \$$>$ gs -dNOSAFER monfichier.ps quit.ps
174 \item[Windows:] Within the menu \texttt{Options}, the option
175 \textsf{Security of files} must be unchecked.
178 \subsubsection{Reading the data and drawing the geode}
180 %% \begin{LTXexample}[pos=t]
182 %% \psset{lightsrc=10 0 10,SphericalCoor=true,viewpoint=50 -20 30,Decran=100}
183 %% \begin{pspicture}(-2,-2)(2,2)
184 %% \psframe(-2,-2)(2,2)
185 %% \psSolid[object=datfile,file=./geodedual44]
189 The advantage of this method becomes even more evident when one compares the compilation of two files producing the same result by different methods:
191 The file \texttt{geode42\_direct.tex} calculates the solid and its view. The file \texttt{geode42\_precalcul.tex} uses the file
192 \texttt{.dat} including the precalculated data of the file
193 \texttt{calc\_geode42.tex}. These three files are included in the distribution.
195 \subsection{Some other examples}
196 You will find numerous other examples of geodes on the website:
198 \centerline{\url{http://melusine.eu.org/lab/bpst/pst-solides3d/geodes}}