1 \section{Parameterised surfaces
}
3 \subsection{The method
}
5 The parameterised
\Index{surfaces
} are setup as $
[x(u,v),y(u,v),z(u,v)
]$ and administered thanks to the macro
\Lcs{psSolid
} by the option
6 \texttt{\Lkeyword{object
}=
\Lkeyval{surfaceparametree
}} and defined either in
\textit{Reverse Polish Notation
}(
\textit{RPN
}):
10 \defFunction{shell
}(u,v)
{1.2 v exp u Sin dup mul v Cos mul mul
}% x(u,v)
11 {1.2 v exp u Sin dup mul v Sin mul mul
}% y(u,v)
12 {1.2 v exp u Sin u Cos mul mul
} % z(u,v)
15 or in
\textit{algebraic notation
}:
18 \defFunction[algebraic
]{shell
}(u,v)
{1.2^v*(sin(u)^
2*cos(v))
}% x(u,v)
19 {1.2^v*(sin(u)^
2*sin(v))
}% y(u,v)
20 {1.2^v*(sin(u)*cos(u))
} % z(u,v)
23 The range for the values of $u$ and $v$ are defined within the option
24 \texttt{\Lkeyword{range
}=$
\mathtt{u_
{min
}}$ $
\mathtt{u_
{max
}}$ $
\mathtt{v_
{min
}}$
%$
27 The drawing of the function is activated with
28 \texttt{\Lkeyword{function
}=name
}, this name is implied when the parametric equations are written:
29 \verb+
\defFunction{name
}...+
31 Any other choice of $u$ and $v$ are accepted. Let's remind that the argument of
32 \texttt{Sin
} and
\texttt{Cos
} must be in radians those of
\texttt{sin
} and
33 \texttt{cos
} in degrees if
\textit{RPN
} is used. Within the algebraic notation, the argument is in radians.
36 \subsection{Example
1: a
\Index{sea shell
}}
37 \newcommand\quadrillage{%
38 \psset{linecolor=
{[cmyk
]{1,
0,
1,
0.5}}}\green
39 \multido{\ix=-
4+
1}{9}{%
40 \psPoint(
\ix\space,
4,-
3)
{X1
}
41 \psPoint(
\ix\space,
4 .2 add,-
3)
{X2
}
43 \uput[-
120](X1)
{\small\ix}}
44 \multido{\iy=-
4+
1}{9}{%
45 \psPoint(-
4,
\iy\space,-
3)
{Y1
}
46 \psPoint(-
4 .2 sub,
\iy\space,-
3)
{Y2
}
48 \uput[0](Y1)
{\small\iy}}
49 \multido{\iz=-
3+
1}{7}{%
50 \psPoint(
4,
4,
\iz\space)
{Z1
}
51 \psPoint(
4,
4 .2 add,
\iz\space)
{Z2
}
53 \uput[l
](Z1)
{\small\iz}}
54 \psPoint(
0,
4 0.5 add,-
3)
{X0
}
56 \psPoint(-
4 .5 sub,
0,-
3)
{Y0
}
58 \begin{LTXexample
}[width=
7.8cm
]
60 \begin{pspicture
}(-
5.5,-
6)(
4.5,
4)
61 \psframe*(-
5.5,-
6)(
4.5,
4)
62 \psset[pst-solides3d
]{viewpoint=
20 120 30 rtp2xyz,
63 Decran=
15,lightsrc=-
10 15 10}
65 \psSolid[object=grille,base=-
4 4 -
4 4,
66 action=draw*,linecolor=
{[cmyk
]{1,
0,
1,
0.5}}]
68 \defFunction{shell
}(u,v)
69 {1.2 v exp u Sin dup mul v Cos mul mul
}
70 {1.2 v exp u Sin dup mul v Sin mul mul
}
71 {1.2 v exp u Sin u Cos mul mul
}
72 \psSolid[object=surfaceparametree,
73 linecolor=
{[cmyk
]{1,
0,
1,
0.5}},
74 base=
0 pi pi
4 div neg
5 pi mul
2 div,
75 fillcolor=yellow!
50,incolor=green!
50,
76 function=shell,linewidth=
0.5\pslinewidth,ngrid=
25]%
77 \psSolid[object=parallelepiped,a=
8,b=
8,c=
6,
78 action=draw,linecolor=
{[cmyk
]{1,
0,
1,
0.5}}]%
83 \begin{LTXexample
}[width=
7.8cm
]
85 \begin{pspicture
}(-
5,-
4)(
5,
6)
87 \psset[pst-solides3d
]{viewpoint=
20 20 -
10 rtp2xyz,
88 Decran=
15,lightsrc=
5 10 2}
90 \psSolid[object=grille,base=-
4 4 -
4 4,
91 action=draw*,linecolor=red
](
0,
0,-
3)
92 \defFunction[algebraic
]{shell
}(u,v)
93 {1.21^v*(sin(u)*cos(u))
}
94 {1.21^v*(sin(u)^
2*sin(v))
}
95 {1.21^v*(sin(u)^
2*cos(v))
}
96 %% \defFunction{shell}(u,v)
97 %% {1.2 v exp u Sin u Cos mul mul}
98 %% {1.2 v exp u Sin dup mul v Sin mul mul}
99 %% {1.2 v exp u Sin dup mul v Cos mul mul}
100 \psSolid[object=surfaceparametree,
101 linecolor=
{[cmyk
]{1,
0,
1,
0.5}},
102 base=
0 pi pi
4 div neg
5 pi mul
2 div,
103 fillcolor=green!
50,incolor=yellow!
50,
104 function=shell,linewidth=
0.5\pslinewidth,
107 \gridIIID[Zmin=-
3,Zmax=
4,linecolor=white,
114 \subsection{Example
2: a
\Index{helix
}}
115 \begin{LTXexample
}[width=
5.5cm
]
117 \begin{pspicture
}(-
3,-
4)(
3,
6)
118 \psset[pst-solides3d
]{viewpoint=
20 10 2,Decran=
20,
120 % Parametric Surfaces
121 \defFunction{helix
}(u,v)
122 {1 .4 v Cos mul sub u Cos mul
2 mul
}
123 {1 .4 v Cos mul sub u Sin mul
2 mul
}
124 {.4 v Sin mul u
.3 mul add
}
125 \psSolid[object=surfaceparametree,linewidth=
0.5\pslinewidth,
126 base=-
10 10 0 6.28,fillcolor=yellow!
50,incolor=green!
50,
129 \gridIIID[Zmin=-
3,Zmax=
3](-
2,
2)(-
2,
2)
134 \subsection{Example
3: a
\Index{cone
}}
135 \begin{LTXexample
}[width=
10cm
]
137 \begin{pspicture
}(-
9,-
7)(
10,
12)
138 \psframe*(-
9,-
7)(
10,
12)
139 \psset[pst-solides3d
]{
141 Decran=
50,lightsrc=
20 10 5}
143 object=grille,base=-
2 2 -
2 2,
144 linecolor=white
](
0,
0,-
2)
145 % Parametric Surfaces
146 \defFunction{cone
}(u,v)
147 {u v Cos mul
}{u v Sin mul
}{u
}
148 \psSolid[object=surfaceparametree,
149 base=-
2 2 0 2 pi mul,
151 incolor=green!
50,function=cone,
152 linewidth=
0.5\pslinewidth,
154 \psset{linecolor=white
}\white
155 \gridIIID[Zmin=-
2,Zmax=
2]
161 \subsection{An advised website
}
162 You will find on the website:
164 \centerline{\url{http://k3dsurf.sourceforge.net/
}}
166 an excellent software to represent surfaces with numerous examples of parameterised surfaces and others.