Number of sample points
|plot::Curve2d, plot::Curve3d, plot::Polar|
|plot::Cylindrical, plot::Spherical, plot::Surface, plot::XRotate, plot::ZRotate|
UMesh, VMesh: 25
USubmesh, VSubmesh: 0
UMesh, VMesh: 15
The attributes UMesh etc. determine the number of sample points used for the numerical approximation of parameterized plot objects such as curves and surfaces.
Many plot objects have to be evaluated numerically on a discrete mesh. The attributes described on this help page serve for setting the number of sample points of the numerical mesh.
For curves in 2D and 3D given by a parametrization x(u), y(u) and, possibly, z(u) with the curve parameter u, the attribute UMesh = n creates a numerical mesh of n equidistant u values. The attribute USubmesh = m inserts additional m mesh points between each pair of adjacent points set by UMesh.
The combinations UMesh = n, USubmesh = m and UMesh = (m + 1) (n - 1) + 1, USubmesh = 0 are equivalent.
The sample points of a curve can be made visible by setting PointsVisible = TRUE.
Surface objects in 3D are parameterized by coordinate functions x(u, v), y(u, v), z(u, v) of two surface parameters u, v.
The attribute UMesh = nu sets the number nu of sample points for the first surface parameter. The attribute VMesh = nv sets the number nv of sample points for the second surface parameter. The parametrization is evaluated on a regular mesh of nu×nv values of the surface parameters u, v.
With the USubmesh, VSubmesh attributes, additional equidistant sample points can be inserted between each pair of adjacent sample points set by the UMesh, VMesh attributes.
With ULinesVisible = TRUE and VLinesVisible = TRUE, respectively, the parameter lines of the regular mesh set by the attributes UMesh, VMesh are displayed on the surface. Additonal points inserted via USubmesh, VSubmesh do not create additional parameter lines.
If adaptive sampling is enabled, further non-equidistant sample points are chosen automatically between the equidistant points of the `initial mesh' set via the UMesh, USubmesh, VMesh, VSubmesh attributes.
It is possible to use low settings of mesh parameters to achieve special effects. As an example, we draw a parametrization of a circle with just six evaluation points:
plot(plot::Curve2d([cos(t), sin(t)], t = 0..2*PI, UMesh = 6, Scaling = Constrained))
The reason we get a pentagon here and not a hexagon is that the first and the last evaluation points coincide: six points in a line means five line segments.
With UMesh = 30, the circle looks like a circle:
plot(plot::Curve2d([cos(t), sin(t)], t = 0..2*PI, UMesh = 30, Scaling = Constrained))
The default values of UMesh, VMesh do not provide a sufficient resolution for the following graphics:
plot(plot::Surface([r*cos(phi), r*sin(phi), r*phi], r = 0.. 1, phi = 0..10*PI)):
The spiral winds around the z-axis 5 times. We wish to have approximately 40 sample points per revolution, so we need to use a total of 200 sample points with respect to the angle parameter phi. The coordinate lines related to the radial parameter r are straight lines, so a very low resolution in this direction suffices:
plot(plot::Surface([r*cos(phi), r*sin(phi), r*phi], r = 0.. 1, phi = 0..10*PI, UMesh = 2, VMesh = 200)):
When refining the mesh via VSubmesh, no additional parameter lines are created:
plot(plot::Surface([r*cos(phi), r*sin(phi), r*phi], r = 0.. 1, phi = 0..10*PI, UMesh = 2, VMesh = 25, VSubmesh = 8)):