Colormap for implicit_plot3d and parametric_plot3d (#12212)
jvkersch
The class below is based on some code from sage.plot.plot3d.plot3d and allows for a texture attribute of a surface to be varied gradually. The precise way in which the attribute varies can be specified by means of a scalar function, the most straightforward ones being projection onto the x, y, or z-axis. In this way, it is possible to apply a colormap to a surface, to create partially translucent objects, or to color in surfaces in a variety of ways (for instance, to visualize Gaussian curvature).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.0 4.0 |
0.25 0.25 |
|
|
|
|
|
|
(x, y, z) (x, y, z) |
|
|
x^2 - y^2 + z x^2 - y^2 + z |
|
|
-4.0 -4.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|