Skip to content

Mesh

The Julia field drawn as a wireframe whose edges are coloured by height. The faces are filled with the background colour, so that they hide the parts of the mesh behind them.

Mesh

The figure above is live, drawn in the browser by the same engine that draws the viewer: drag it to pan, and click it to zoom with the wheel. Download the PDF for the vector figure that IronLAB exports, or read how to embed a figure of your own.

Source

The figure is built by the following code. Its data comes from the functions on the data helpers page.

use ironlab::prelude::*;

use crate::fields::*;

pub const TITLE: &str = "Mesh";
pub const DESCRIPTION: &str = "The Julia field drawn as a wireframe whose edges are coloured by height. The faces are \
     filled with the background colour, so that they hide the parts of the mesh behind them.";

pub fn figure() -> Figure {
    let (x, y, z) = julia_grid(31);

    let mut fig = Figure::new()
        .size_mm(160.0, 100.0)
        .title(r"Mesh of $\ln(1 + |z_3|)$")
        .label("surface")
        .label("colormap")
        .label("depth")
        .label("wireframe")
        .parameter("dimensionality", "3D")
        .parameter("artists", 1)
        .parameter("data_points", 1023)
        .parameter("has_legend", false);
    let mut ax = fig.axes3(0, 0);
    ax.mesh(&x, &y, &z).edge_width(0.6);
    ax.colormap(Colormap::Plasma)
        .xlabel("$x$")
        .ylabel("$y$")
        .zlabel(r"$\ln(1 + |z_3|)$")
        .view(-50.0, 35.0);
    fig
}

Back to the gallery