Type Definition fenris_geometry::Triangle3d
source · pub type Triangle3d<T> = Triangle<T, U3>;
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.