fn face_point_intersection_when_point_in_plane(&self, face_id: FaceID, point: &Vec3) -> Option<Intersection>
    {
        // Test whether the intersection point is located at the edges or vertices of the face
        for halfedge_id in self.face_halfedge_iter(face_id) {
            if let Some(intersection) = self.edge_point_intersection(halfedge_id, point) {
                return Some(intersection);
            }
        }

        // Test whether the intersection point is located inside the face
        let (a, b, c) = self.face_positions(face_id);
        let coords = barycentric(point, &a, &b, &c);
        if 0.0 < coords.0 && coords.0 < 1.0 && 0.0 < coords.1 && coords.1 < 1.0 && 0.0 < coords.2 && coords.2 < 1.0
        {
            Some(Intersection::Point {primitive: Primitive::Face(face_id), point: *point})
        }
        else {None}
    }
/// Assumes that the point lies in the plane spanned by the face
Assumes that the point lies in the plane spanned by the face
Assumes that the point lies in the plane spanned by the face
fn face_point_intersection_when_point_in_plane(&self, face_id: FaceID, point: &Vec3) -> Option<Intersection>
    {
        // Test whether the intersection point is located at the edges or vertices of the face
        for halfedge_id in self.face_halfedge_iter(face_id) {
            if let Some(intersection) = self.edge_point_intersection(halfedge_id, point) {
                return Some(intersection);
            }
        }
        // Test whether the intersection point is located inside the face
        let (a, b, c) = self.face_positions(face_id);
        let coords = barycentric(point, &a, &b, &c);
        if 0.0 < coords.0 && coords.0 < 1.0 && 0.0 < coords.1 && coords.1 < 1.0 && 0.0 < coords.2 && coords.2 < 1.0
        {
            Some(Intersection::Point {primitive: Primitive::Face(face_id), point: *point})
        }
        else {None}
    }
fn face_point_intersection_when_point_in_plane ( & self , face_id : FaceID , point : & Vec3 ) -> Option < Intersection > { // Test whether the intersection point is located at the edges or vertices of the face for halfedge_id in self . face_halfedge_iter ( face_id ) { if let Some ( intersection ) = self . edge_point_intersection ( halfedge_id , point ) { return Some ( intersection ) ; } } // Test whether the intersection point is located inside the face let ( a , b , c ) = self . face_positions ( face_id ) ; let coords = barycentric ( point , & a , & b , & c ) ; if 0.0 < coords . 0 && coords . 0 < 1.0 && 0.0 < coords . 1 && coords . 1 < 1.0 && 0.0 < coords . 2 && coords . 2 < 1.0 { Some ( Intersection :: Point { primitive : Primitive :: Face ( face_id ) , point : * point } ) } else { None } }
Assumes that the point lies in the plane spanned by the face
Assumes that the point lies in the plane spanned by the face
&self
face_id
FaceID
point
&Vec3
&self
face_id
FaceID
point
&Vec3