Introduction
A surface can display any 2D set of 3D points. It can also display a scalar field defined on such a 2D set of 3D points as a color field on the surface. The surface may be defined on an arbitrary (x(u,v),y(u,v), z(u,v)) lattice.
Providing the surface with data
The rules for providing data to the surface and the rules regarding the limits and color palette properties are strictly the same as for the scalar map.
-
colordata
- By default, the color of the surface is obtained by mapping the z coordinates onto the color palette. You may optionally supply a matrix (with the same sizes as zdata) as the surface's colordata property: colordata will define the color of the surface. This is how you represent the value of a scalar field that is defined on the surface.
-
usecolordata
- You can choose not to use a color palette by setting the usecolordata property of the surface to false.
|
|
Graphic options for the surface
-
legend frame
- The legend frame property lets you choose where the color scale should be displayed. Set it to {0, 0, 0, 0} to suppress the color scale.
-
orientation
- By default the outer faces or the faces pointing upwards (whichever makes sense) are more shiny, the inner faces or the faces pointing upwards are more dull. To invert this behavior change the orientation property (default: true) to false.
- drawmode, draw palette
- You can have a surface drawn filled or wired by setting its drawmode property to 1 or 2.
You can have the color palette drawn or not by setting the draw palette property.
- specular color, emission color, ambiant color, diffused color, specular pen color, emission pen color, ambiant pen color, diffused pen color and shininess
- You can change the material color properties of the surface by settings its following properties: specular color, emission color, ambiant color, diffused color, specular pen color, emission pen color, ambiant pen color, diffused pen color and shininess. In particular, you may want to lower the specular color if your surface reflects the light too much. Ambiant and diffused colors are in fact defined by the color data, except if the usecolordata property is set to false.
- pbc1, pbc2
- The boolean parameters pbc1 and pbc2 of the surface define periodic boundary conditions. You may want to set them to true when defining closed surfaces like cylinders or tores.
set at1 to creatematrix "x" ncols 50 nrows 50 range {0, 2 * pi * (1 - 1 / 50)}
set at2 to creatematrix "y" ncols 50 nrows 50 range {0, 2 * pi * (1 - 1 / 50)}
set r to addlist (cos at2) with 3
set x to multlist (cos at1) with r
set y to multlist (sin at1) with r
set z to sin at2
set w to make new graphic window with properties {name:"Torus", never save:true}
set v to make new view3D at w with properties {name:"Torus", resolution:144}
set s to make new surface at v with properties {pbc1:true, pbc2:true, color palette:"Rainbow", xdata:ArrayToMatrix(x, 50, 50), ydata:ArrayToMatrix(y, 50, 50), zdata:ArrayToMatrix(z, 50, 50)}
|