Skip to main content

SupportMapping

Trait SupportMapping 

Source
pub trait SupportMapping<V> {
    // Required method
    fn support_mapping(&self, n: &V) -> V;
}
Expand description

Find the point on a shape that is the furthest in a given direction.

§Example

use hoomd_geometry::{SupportMapping, shape::Hypercuboid};

let cuboid = Hypercuboid {
    edge_lengths: [3.0.try_into()?, 2.0.try_into()?],
};

let upper_right = cuboid.support_mapping(&[1.0, 1.0].into());
let lower_right = cuboid.support_mapping(&[1.0, -1.0].into());

assert_eq!(upper_right, [1.5, 1.0].into());
assert_eq!(lower_right, [1.5, -1.0].into());

Required Methods§

Source

fn support_mapping(&self, n: &V) -> V

Return the furthest extent of a shape in the direction of n.

Implementors§

Source§

impl SupportMapping<Cartesian<2>> for ConvexSurfaceMesh2d

Source§

impl SupportMapping<Cartesian<3>> for Simplex3

Source§

impl<S, V> SupportMapping<V> for Sphero<S>
where S: SupportMapping<V>, V: InnerProduct,

Source§

impl<V, S> SupportMapping<V> for Convex<S>
where S: SupportMapping<V>,

Source§

impl<const N: usize> SupportMapping<Cartesian<N>> for Capsule<N>

Source§

impl<const N: usize> SupportMapping<Cartesian<N>> for Hypercuboid<N>

Source§

impl<const N: usize> SupportMapping<Cartesian<N>> for Hyperellipsoid<N>

Source§

impl<const N: usize, V: InnerProduct> SupportMapping<V> for Hypersphere<N>

Source§

impl<const N: usize, const MAX_VERTICES: usize> SupportMapping<Cartesian<N>> for ConvexPolytope<N, MAX_VERTICES>