Struct Cubiod
pub struct Cubiod<X, Y, Z> { /* private fields */ }Available on crate feature
plot only.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§
Trait Implementations§
§impl<X, Y, Z, DB> Drawable<DB, BackendCoordAndZ> for Cubiod<X, Y, Z>where
DB: DrawingBackend,
impl<X, Y, Z, DB> Drawable<DB, BackendCoordAndZ> for Cubiod<X, Y, Z>where
DB: DrawingBackend,
§impl<'a, X, Y, Z> PointCollection<'a, (X, Y, Z), BackendCoordAndZ> for &'a Cubiod<X, Y, Z>where
X: 'a,
Y: 'a,
Z: 'a,
impl<'a, X, Y, Z> PointCollection<'a, (X, Y, Z), BackendCoordAndZ> for &'a Cubiod<X, Y, Z>where
X: 'a,
Y: 'a,
Z: 'a,
§fn point_iter(
self,
) -> <&'a Cubiod<X, Y, Z> as PointCollection<'a, (X, Y, Z), BackendCoordAndZ>>::IntoIter
fn point_iter( self, ) -> <&'a Cubiod<X, Y, Z> as PointCollection<'a, (X, Y, Z), BackendCoordAndZ>>::IntoIter
framework to do the coordinate mapping
Auto Trait Implementations§
impl<X, Y, Z> Freeze for Cubiod<X, Y, Z>
impl<X, Y, Z> RefUnwindSafe for Cubiod<X, Y, Z>
impl<X, Y, Z> Send for Cubiod<X, Y, Z>
impl<X, Y, Z> Sync for Cubiod<X, Y, Z>
impl<X, Y, Z> Unpin for Cubiod<X, Y, Z>
impl<X, Y, Z> UnwindSafe for Cubiod<X, Y, Z>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more