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,
impl<T> Triangle3d<T>where
T: Real,
Sourcepub fn normal_dir(&self) -> Vector3<T>
pub fn normal_dir(&self) -> Vector3<T>
Returns a vector normal to the triangle. The vector is not normalized.
pub fn normal(&self) -> Vector3<T>
Sourcepub fn orientation(&self) -> Orientation
pub fn orientation(&self) -> Orientation
TODO: Remove this. It makes no sense for 3D.
Sourcepub fn signed_area(&self) -> T
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).
pub fn area(&self) -> T
Sourcepub fn point_orientation(&self, point: &Point3<T>) -> OrientationTestResult
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>
impl<T: Real> Triangle3d<T>
Sourcepub fn compute_solid_angle(&self, p: &Point3<T>) -> T
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>
impl<'a, T: Real> ConvexPolygon3d<'a, T> for Triangle3d<T>
fn num_vertices(&self) -> usize
fn get_vertex(&self, index: usize) -> Option<OPoint<T, U3>>
fn compute_plane(&self) -> Option<Plane<T>>where
T: Real,
fn compute_half_space(&self) -> Option<HalfSpace<T>>where
T: Real,
Source§fn compute_area_vector(&self) -> Vector3<T>where
T: Real,
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,
fn compute_normal(&self) -> Vector3<T>where
T: Real,
Computes an outwards-facing normalized vector perpendicular to the polygon.