///
/// Find the [intersection](crate::mesh::intersection::Intersection) between the given face and line piece.
/// If the face is not intersected by the line piece, None is returned.
///
/// Note: Intersections, where the line piece is in the plane spanned by the face, are not yet fully handled.
///


Intersections, where the line piece is in the plane spanned by the face, are not yet fully handled.
Intersections where the line piece is in the plane spanned by the face are not yet fully handled .
pub fn face_line_piece_intersection(&self, face_id: FaceID, point0: &Vec3, point1: &Vec3) -> Option<Intersection>
    {
        let p = self.vertex_position(self.walker_from_face(face_id).vertex_id().unwrap());
        let n = self.face_direction(face_id);
        plane_line_piece_intersection(&point0, &point1, &p, &n).and_then(|intersection| {
            match intersection {
                PlaneLinepieceIntersectionResult::LineInPlane => {
                    let intersection0 = self.face_point_intersection_when_point_in_plane(face_id, point0);
                    let intersection1 = self.face_point_intersection_when_point_in_plane(face_id, point1);
                    if let Some(Intersection::Point {point: p0, primitive: primitive0}) = intersection0 {
                        if let Some(Intersection::Point {point: p1, primitive: primitive1}) = intersection1 {
                            Some(Intersection::LinePiece {primitive0, primitive1, point0: p0, point1: p1})
                        }
                        else {
                            intersection0 // TODO: Should return a Intersection::LinePiece instead of a Intersection::Point
                        }
                    }
                    else {
                        intersection1 // TODO: Should return a Intersection::LinePiece instead of a Intersection::Point
                    }
                    // TODO: Handle case where the line piece intersects the face, but the end points are both outside
                },
                PlaneLinepieceIntersectionResult::P0InPlane => {
                    self.face_point_intersection_when_point_in_plane(face_id, point0)
                },
                PlaneLinepieceIntersectionResult::P1InPlane => {
                    self.face_point_intersection_when_point_in_plane(face_id, point1)
                },
                PlaneLinepieceIntersectionResult::Intersection(point) => {
                    self.face_point_intersection_when_point_in_plane(face_id, &point)
                }
            }
        })
    }
pub fn face_line_piece_intersection ( & self , face_id : FaceID , point0 : & Vec3 , point1 : & Vec3 ) -> Option < Intersection > { let p = self . vertex_position ( self . walker_from_face ( face_id ) . vertex_id ( ) . unwrap ( ) ) ; let n = self . face_direction ( face_id ) ; plane_line_piece_intersection ( & point0 , & point1 , & p , & n ) . and_then ( | intersection | { match intersection { PlaneLinepieceIntersectionResult :: LineInPlane => { let intersection0 = self . face_point_intersection_when_point_in_plane ( face_id , point0 ) ; let intersection1 = self . face_point_intersection_when_point_in_plane ( face_id , point1 ) ; if let Some ( Intersection :: Point { point : p0 , primitive : primitive0 } ) = intersection0 { if let Some ( Intersection :: Point { point : p1 , primitive : primitive1 } ) = intersection1 { Some ( Intersection :: LinePiece { primitive0 , primitive1 , point0 : p0 , point1 : p1 } ) } else { intersection0 // TODO: Should return a Intersection::LinePiece instead of a Intersection::Point } } else { intersection1 // TODO: Should return a Intersection::LinePiece instead of a Intersection::Point } // TODO: Handle case where the line piece intersects the face, but the end points are both outside } , PlaneLinepieceIntersectionResult :: P0InPlane => { self . face_point_intersection_when_point_in_plane ( face_id , point0 ) } , PlaneLinepieceIntersectionResult :: P1InPlane => { self . face_point_intersection_when_point_in_plane ( face_id , point1 ) } , PlaneLinepieceIntersectionResult :: Intersection ( point ) => { self . face_point_intersection_when_point_in_plane ( face_id , & point ) } } } ) }
Find the [intersection](crate::mesh::intersection::Intersection) between the given face and line piece.
Find the [ intersection ] ( crate :: mesh :: intersection :: Intersection ) between the given face and line piece .
&self
face_id
FaceID
point0
&Vec3
point1
&Vec3