pub struct Cubiod<X, Y, Z> { /* private fields */ }
Expand description

Represents a cuboid, a six-faced solid.

Examples

use plotters::prelude::*;
let drawing_area = SVGBackend::new("cuboid.svg", (300, 200)).into_drawing_area();
drawing_area.fill(&WHITE).unwrap();
let mut chart_builder = ChartBuilder::on(&drawing_area);
let mut chart_context = chart_builder.margin(20).build_cartesian_3d(0.0..3.5, 0.0..2.5, 0.0..1.5).unwrap();
chart_context.configure_axes().x_labels(4).y_labels(3).z_labels(2).draw().unwrap();
let cubiod = Cubiod::new([(0.,0.,0.), (3.,2.,1.)], BLUE.mix(0.2), BLUE);
chart_context.draw_series(std::iter::once(cubiod)).unwrap();

The result is a semi-transparent cuboid with blue edges:

Implementations

Creates a cuboid.

See Cubiod for more information and examples.

Trait Implementations

Actually draws the element. The key points is already translated into the image coordinate and can be used by DC directly Read more

The item in point iterator

The point iterator

framework to do the coordinate mapping

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.