diff --git a/plotters/src/element/basic_shapes_3d.rs b/plotters/src/element/basic_shapes_3d.rs index 97b15e62..dd95a828 100644 --- a/plotters/src/element/basic_shapes_3d.rs +++ b/plotters/src/element/basic_shapes_3d.rs @@ -14,25 +14,25 @@ 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(); +let cuboid = Cuboid::new([(0.,0.,0.), (3.,2.,1.)], BLUE.mix(0.2), BLUE); +chart_context.draw_series(std::iter::once(cuboid)).unwrap(); ``` The result is a semi-transparent cuboid with blue edges: ![](https://cdn.jsdelivr.net/gh/facorread/plotters-doc-data@b6703f7/apidoc/cuboid.svg) */ -pub struct Cubiod { +pub struct Cuboid { face_style: ShapeStyle, edge_style: ShapeStyle, vert: [(X, Y, Z); 8], } -impl Cubiod { +impl Cuboid { /** Creates a cuboid. - See [`Cubiod`] for more information and examples. + See [`Cuboid`] for more information and examples. */ #[allow(clippy::redundant_clone)] pub fn new, ES: Into>( @@ -58,7 +58,7 @@ impl Cubiod { } impl<'a, X: 'a, Y: 'a, Z: 'a> PointCollection<'a, (X, Y, Z), BackendCoordAndZ> - for &'a Cubiod + for &'a Cuboid { type Point = &'a (X, Y, Z); type IntoIter = &'a [(X, Y, Z)]; @@ -67,7 +67,7 @@ impl<'a, X: 'a, Y: 'a, Z: 'a> PointCollection<'a, (X, Y, Z), BackendCoordAndZ> } } -impl Drawable for Cubiod { +impl Drawable for Cuboid { fn draw>( &self, points: I, diff --git a/plotters/src/element/mod.rs b/plotters/src/element/mod.rs index 921b2c0f..df9a62ae 100644 --- a/plotters/src/element/mod.rs +++ b/plotters/src/element/mod.rs @@ -276,7 +276,7 @@ impl CoordMapper for BackendCoordOnly { /** Used for 3d coordinate transformations. -See [`Cubiod`] for more information and an example. +See [`Cuboid`] for more information and an example. */ pub struct BackendCoordAndZ; diff --git a/plotters/src/lib.rs b/plotters/src/lib.rs index 230c679f..d099db9a 100644 --- a/plotters/src/lib.rs +++ b/plotters/src/lib.rs @@ -871,7 +871,7 @@ pub mod prelude { // Elements pub use crate::element::{ - Circle, Cross, Cubiod, DynElement, EmptyElement, IntoDynElement, MultiLineText, + Circle, Cross, Cuboid, DynElement, EmptyElement, IntoDynElement, MultiLineText, PathElement, Pie, Pixel, Polygon, Rectangle, Text, TriangleMarker, };