plot::Surface3d
-- graphical
primitive for a three-dimensional surface plotplot::Surface3d
([x, y, z], u = a..b, v =
c..d)
represents a plot of the surface defined by (u,v)
-> (x(u,v); y(u,v); z(u,v)) with (u,v) in [a,b] x
[c,d].
plot::Surface3d([x, y, z], u = a..b, v = c..d <, option1,
option2...>)
x, y, z |
- | arithmetical expressions in u and
v |
u, v |
- | identifiers |
a, b, c, d |
- | arithmetical expressions |
option1, option2, ... |
- | plot option(s) of the form OptionName =
value |
plot::Curve3d
,
plot::Function3d
,
RGB
plot::Surface3d
represent
graphical primitives for three-dimensional surfaces that can be
displayed via plot(...)
, or used with other graphical
primitives of the plot
library.plot::Surface3d
has type
"graphprim"
, i.e., if o
is such an object,
then the result of type(o)
is the string
"graphprim"
.option1
, option2
... are specified
by equations OptionName = value
. The following table gives
an overview of the available options:
OptionName |
admissible values | default value |
Color | [Flat] , [Flat, [r,g,b]] , [Height] , [Height, [r,g,b], [R,G,B]] , [Function, f] |
[Height] |
Grid | [ integer] |
[20,20] |
LineStyle | SolidLines, DashedLines | SolidLines |
LineWidth | positive integers | 1 |
PointStyle | Circles, FilledCircles, FilledSquares, Squares | FilledSquares |
PointWidth | positive integers | 30 |
Smoothness | [ integer] |
[0] |
Style | [Points] |
[ColorPatches, |
[WireFrame, Mesh] |
AndMesh] |
|
[WireFrame, ULine] |
||
[WireFrame, VLine] |
||
[HiddenLine, Mesh] |
||
[HiddenLine, ULine] |
||
[HiddenLine, VLine] |
||
[ColorPatches, Only] |
||
[ColorPatches, AndMesh] |
||
[ColorPatches, AndULine] |
||
[ColorPatches, AndVLine] |
||
[Transparent, Only] |
||
[Transparent, AndMesh] |
||
[Transparent, AndULine] |
||
[Transparent, AndVLine] |
||
Title | strings | |
TitlePosition | [x, y] |
|
plot3d
for further
details on each option.Scene options for the parameters
option1
, option2
... are not allowed! One may
pass scene options to the call of plot
, or use plot::Scene
to create an object
representing a graphical scene. Cf. example 1.
::
.
Each attribute has the property ``read'', i.e., the value of an
attribute attr
of a graphical primitive o
can
be read with o::attr
. If the attribute also has the
``write'' property, then the value of the attribute can be changed with
o::attr := new_value
.
The following attributes are available for a surface primitive:
attribute | values | properties |
options |
A table of plot options of the surface primitive. Note
that if you change the value of this attribute, the entries of the
assigned table are not checked to be valid plot options for surface
primitives. Invalid entries lead to runtime errors.
The initial value of this attribute is the table stored under the
domain entry |
read/write |
plotdata |
List of the plot data of the surface primitive in a
plot3d conforming
syntax (see the method "getPlotdata" below). Note that the
value of this attribute should only be used if the attribute
refreshPlotdata has the value FALSE (see
below). |
read |
range1 |
The first parameter of the surface and its range in
the form ident1 = a..b . The initial value is the parameter
u = a..b . |
read/write |
range2 |
The second parameter of the surface and its range in
the form ident2 = c..d . The initial value is the parameter
v = c..d . |
read/write |
refreshPlotdata |
A boolean value which signals whether the plot data of
the surface primitive must be (re-)build with the method
"getPlotdata" (see below). If its value is
FALSE , then the plot data of the surface primitive is
stored in the attribute plotdata . The initial value is
TRUE . See the help page of plot::Curve2d for an example. |
read/write |
term |
The term of the surface in form of a list of three
arithmetical expressions. The initial value is the parameter [x,
y, z] . |
read/write |
plot::Function3d
about working with
attributes.An object of plot::Surface3d
consists of three
operands. The first operand is the list [x, y, z]
. The
second operand is the first parameter of the surface and its range in
the form u = a..b
, and the third one is the second
parameter of the surface and its range in the form v =
c..d
.
Operands of a surface primitive can be accessed either using the
system function op
, the
index operator [ ]
, or
using the attributes described above. For example, if
surface
is such an object, then the calls
op(surface,1)
, surface[1]
and
surface::term
return the list [x, y, z]
.
Via surface[1] := [x_new, y_new, z_new]
or
surface::term := [x_new, y_new, z_new
, the parametrization
of a surface plot can be changed.
See the methods "op"
, "_index"
,
"set_index"
and "slot"
below.
Use the slot operator ::
to get or set plot options of
such objects afterwards, i.e., when they have been created. For
example, if surface
is such an object, then
surface::Color := RGB::Red
changes the color of the
surface primitive surface
to red.
Evaluating an object of type plot::Surface3d
returns
itself.
Calling an object of plot::Surface3d
as a function
yields the object itself, regardless of the arguments. The arguments
are not evaluated.
is a table of plot options for surface primitives and their default
values. Each entry has the form OptionName =
default_value
.
When an object of the domain plot::Surface3d
is
created, then a copy of this table is stored under the attribute
options
(see the table of attributes above), where those
options are added and replaced, respectively, which are given by the
(optional) parameters option1
, option2
... of
the creating call (see ``Creating Elements'' above).
Plot options, which are not contained in the table stored under the
attribute options
will not be included in the plot data of
the object created by the method "getPlotdata"
(see
below).
For those options, the corresponding default value either is set by
a graphical scene, if the option also
exists as a scene option (such as the option PointWidth), or it is internally set by the function
plot3d
which is used to
plot the object. See the table of plot options above, which gives a
summary of the available plot options for function primitives and their
default values.
See the examples of the help page of plot::Function3d
.
To change the default value of some plot options, the option name
and its default value may be added to the table
"defaultOptions"
, or replaced by a new value,
respectively.
is a set of the available option names for plots of three-dimensional surfaces.
_index(dom surface, positive integer i)
i
th operand of surface
. See
``Operands'' above for a description of the operands of
surface
. If i
is greater
than 3, then FAIL
is returned._index
, i.e., one may use it in the
form surface[i]
, or in functional notation
_index(surface, i)
.dimension(dom surface)
getPlotdata(dom surface)
surface
in a plot3d
conforming syntax, i.e., it
has the form [Mode = Surface, [...], ...]
.
For example, with s :=
plot::Function3d::getPlotdata(surface)
the call
plot3d(s[1])
gives a plot of surface
.
options
(see the table of attributes above). For any other
plot option not contained in this table, the corresponding default
value set by the function plot3d
for surfaces is used when
plotting the object.plotdata
of surface
.refreshPlotdata
of surface
to
FALSE
.plot::Scene
to build the plot data of
the graphical scene.nops(dom surface)
nops
, i.e., one may use it in the form
nops(surface)
.op(dom surface, positive
integer i)
i
th operand of function
. See
``Operands'' above for a description of the operands of
surface
. If i
is greater
than 3, then FAIL
is returned.op
, i.e., one may use it in the form
op(surface, i)
.set_index(dom surface, positive integer i, any val)
i
th operand of surface
by
the value val
. See ``Operands'' above for a description of
the operands of surface
.i
is greater than 3, or if
val
is not an admissible value for the i
th
operand, then a warning message is issued. In this case the call of
this method has no effect on the object surface
.refreshPlotdata
of surface
to
TRUE
.slot(dom surface, string slotname)
slotname
of
surface
. slotname
may either be the name of
an attribute or the name of a plot option. See the tables of available
plot options and attributes above.slotname
is the name of a plot option, but the
option is not contained in the table stored under the attribute
options
, then FAIL
is returned.
If slotname
is an invalid attribute or option, then an
error message is issued.
slot
, i.e., one may use it in the form
surface::slotname_id
(here, slotname_id
must
be the identifier corresponding to the string slotname
),
or in functional notation slot(surface, slotname)
.slot(dom surface, string slotname, any val)
slotname
to the value val
.slotname
, or if val
is not an admissible
value for slotname
, then a warning message is issued. In
this case, the value of slotname
remains unchanged.slot
, i.e., one may use it in the form
surface::slotname_id := val
(here,
slotname_id
must be the identifier corresponding to the
string slotname
), or in functional notation
slot(surface, slotname, val)
.refreshPlotdata
of
surface
is set to TRUE
.checkOption(equation OptionName =
value)
OptionName
is a known plot
option for surface primitives (see the table of available plot options
above), and value
is an admissible value for this
option.[TRUE, OptionName,
newValue]
is returned. Note that the value of the option could
have been converted into an admissible format. Thus,
newValue
must be used as the value of the option
OptionName
instead of value
.[FALSE, error_msg]
is returned.
The string error_msg
is a description of the located
problem, which can be passed, for example, to the system function
error
to raise a
user-specified exception.copy(dom surface)
surface
.plot::copy
. See its help page for
details.modify(dom surface, equation(s) Name1 = value1...)
surface
and changes the
slots Name1
... of this copy to the new values
value1
...Name1
... must be names of attributes
or plot options of the domain plot::Surface3d
. Otherwise a
warning message is issued, and the slot remains unchanged. Also, if one
of the values value1
... is not an admissible value for the
corresponding attribute or plot option, respectively, the change of the
slot is ignored.
See the tables of available options and attributes above.
refreshPlotdata
of the copy of surface
to
TRUE
.plot::modify
.print(dom surface)
plot::Surface3d([x, y, z], u = a..b, v = c..d)
. It is used
to print objects of plot::Surface3d
to the screen.print
for details.The following call returns an object representing a plot of the surface defined by (u,v) -> (u, sin(v), cos(v)) with (u,v) in [0,2*PI] x [-1,1]:
>> s1 := plot::Surface3d( [u, sin(v), cos(v)], u = 0..2*PI, v = -1..1 )
plot::Surface3d([u, sin(v), cos(v)], u = 0..2 PI, v = -1..1)
To plot this surface in a graphical scene, call:
>> plot(s1)
Plot options of the surface can be given as additional parameters in the creating call, such as displaying the graph as an opaque object together with the parameter lines:
>> s2 := plot::Surface3d( [u, sin(v), cos(v)], u = 0..2*PI, v = -1..1, Style = [HiddenLine, Mesh] )
plot::Surface3d([u, sin(v), cos(v)], u = 0..2 PI, v = -1..1)
>> plot(s2)
To change default values of some scene options, pass the
scene options to the call of plot
as additional arguments. For
example, to change the style of the axes:
>> plot(s2, Axes = Corner)
See the help page of plot::Scene
for available scene
options.
Please refer to the examples of the help page of plot::Function3d
about working with
options and attributes.