Triangle3d

Type Alias Triangle3d 

Source
pub type Triangle3d<T> = Triangle<T, U3>;

Aliased Type§

pub struct Triangle3d<T>(pub [OPoint<T, Const<3>>; 3]);

Tuple Fields§

§0: [OPoint<T, Const<3>>; 3]

Implementations§

Source§

impl<T> Triangle3d<T>
where T: Real,

Source

pub fn normal_dir(&self) -> Vector3<T>

Returns a vector normal to the triangle. The vector is not normalized.

Source

pub fn normal(&self) -> Vector3<T>

Source

pub fn orientation(&self) -> Orientation

TODO: Remove this. It makes no sense for 3D.

Source

pub fn signed_area(&self) -> T

TODO: Remove this. It makes no sense for 3D (moreover, the current implementation gives the non-negative ara in any case).

Source

pub fn area(&self) -> T

Source

pub fn point_orientation(&self, point: &Point3<T>) -> OrientationTestResult

Determines the orientation of a point with respect to the plane containing the triangle.

This is the common “orientation test” used in computational geometry. The test returns a value whose sign is the same as dot(n, x - x0), where x0 is the projection of the point onto the triangle plane.

Note that at the moment, this implementation is NOT robust (in the sense of exact/robust geometric predicates).

Source§

impl<T: Real> Triangle3d<T>

Source

pub fn compute_solid_angle(&self, p: &Point3<T>) -> T

Compute the solid angle to the given point.

Trait Implementations§

Source§

impl<'a, T: Real> ConvexPolygon3d<'a, T> for Triangle3d<T>

Source§

fn num_vertices(&self) -> usize

Source§

fn get_vertex(&self, index: usize) -> Option<OPoint<T, U3>>

Source§

fn compute_plane(&self) -> Option<Plane<T>>
where T: Real,

Source§

fn compute_half_space(&self) -> Option<HalfSpace<T>>
where T: Real,

Source§

fn compute_area_vector(&self) -> Vector3<T>
where T: Real,

Computes a vector normal to the polygon (oriented outwards w.r.t. a counter-clockwise orientation), whose absolute magnitude is the area of the polygon. Read more
Source§

fn compute_normal(&self) -> Vector3<T>
where T: Real,

Computes an outwards-facing normalized vector perpendicular to the polygon.
Source§

fn closest_point(&self, point: &Point3<T>) -> PolygonClosestPoint<T, U3>
where T: Real,

Source§

impl<T> Distance<T, OPoint<T, Const<3>>> for Triangle3d<T>
where T: Real,

Source§

fn distance(&self, point: &OPoint<T, U3>) -> T

Source§

fn distance_bound(&self, query_geometry: &QueryGeometry) -> [T; 2]

Returns an interval [l, u] for the distance d, such that d is contained in [l, u].