pub struct Ring<P>where
P: Primitive2d,{
pub outer_shape: P,
pub inner_shape: P,
}Expand description
A 2D shape representing the ring version of a base shape.
The inner_shape forms the “hollow” of the outer_shape.
The resulting shapes are rings or hollow shapes. For example, a circle becomes an annulus.
§Warning
The outer_shape must contain the inner_shape for the generated meshes to be accurate.
If there are vertices in the inner_shape that escape the outer_shape
(for example, if the inner_shape is in fact larger),
it may result in incorrect geometries.
Fields§
§outer_shape: PThe outer shape
inner_shape: PThe inner shape (the same shape of a different size)
Implementations§
Source§impl<P> Ring<P>where
P: Primitive2d,
impl<P> Ring<P>where
P: Primitive2d,
Sourcepub const fn new(outer_shape: P, inner_shape: P) -> Ring<P>
pub const fn new(outer_shape: P, inner_shape: P) -> Ring<P>
Create a new Ring from a given outer_shape and inner_shape.
If the primitive implements Inset and you would like a uniform thickness, consider using ToRing::to_ring
Trait Implementations§
Source§impl<P> Bounded2d for Ring<P>where
P: Bounded2d + Primitive2d,
impl<P> Bounded2d for Ring<P>where
P: Bounded2d + Primitive2d,
Source§fn aabb_2d(&self, isometry: impl Into<Isometry2d>) -> Aabb2d
fn aabb_2d(&self, isometry: impl Into<Isometry2d>) -> Aabb2d
Get an axis-aligned bounding box for the shape translated and rotated by the given isometry.
Source§fn bounding_circle(&self, isometry: impl Into<Isometry2d>) -> BoundingCircle
fn bounding_circle(&self, isometry: impl Into<Isometry2d>) -> BoundingCircle
Get a bounding circle for the shape translated and rotated by the given isometry.
Source§impl<T> BoundedExtrusion for Ring<T>where
T: BoundedExtrusion,
impl<T> BoundedExtrusion for Ring<T>where
T: BoundedExtrusion,
Source§fn extrusion_aabb_3d(
&self,
half_depth: f32,
isometry: impl Into<Isometry3d>,
) -> Aabb3d
fn extrusion_aabb_3d( &self, half_depth: f32, isometry: impl Into<Isometry3d>, ) -> Aabb3d
Get an axis-aligned bounding box for an extrusion with this shape as a base and the given
half_depth, transformed by the given translation and rotation.Source§fn extrusion_bounding_sphere(
&self,
half_depth: f32,
isometry: impl Into<Isometry3d>,
) -> BoundingSphere
fn extrusion_bounding_sphere( &self, half_depth: f32, isometry: impl Into<Isometry3d>, ) -> BoundingSphere
Get a bounding sphere for an extrusion of the
base_shape with the given half_depth with the given translation and rotationSource§impl<P> Measured2d for Ring<P>where
P: Primitive2d + Measured2d,
impl<P> Measured2d for Ring<P>where
P: Primitive2d + Measured2d,
impl<P> Copy for Ring<P>where
P: Copy + Primitive2d,
impl<T> Primitive2d for Ring<T>where
T: Primitive2d,
impl<P> StructuralPartialEq for Ring<P>where
P: Primitive2d,
Auto Trait Implementations§
impl<P> Freeze for Ring<P>where
P: Freeze,
impl<P> RefUnwindSafe for Ring<P>where
P: RefUnwindSafe,
impl<P> Send for Ring<P>where
P: Send,
impl<P> Sync for Ring<P>where
P: Sync,
impl<P> Unpin for Ring<P>where
P: Unpin,
impl<P> UnwindSafe for Ring<P>where
P: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.