pub fn find_on_plane_xz(&self, y: f64) -> Result<HashSet<usize>, StrError> {
        // check
        if self.ndim != 3 {
            return Err("this works in 3D only");
        }

        // find containers near the plane
        let nearest_containers = self.containers_near_plane(1, y);

        // find container points near the plane
        let mut ids = HashSet::new();
        for index in nearest_containers {
            let container = self.containers.get(&index).unwrap();
            for item in container.values() {
                let distance = f64::abs(item.x[1] - y);
                if f64::abs(distance) <= self.radius_tol {
                    ids.insert(item.id.clone());
                }
            }
        }
        Ok(ids)
    }
/// Find points on the x-z plane (3D only)
///
/// # Input
///
/// `y` -- the plane passes through `y`
///
/// # Output
///
/// Returns the ids of points.
///
/// # Note
///
/// This works in 3D only.
Find points on the x-z plane (3D only)
Find points on the x - z plane ( 3D only )
pub fn find_on_plane_xz(&self, y: f64) -> Result<HashSet<usize>, StrError> {
        // check
        if self.ndim != 3 {
            return Err("this works in 3D only");
        }
        // find containers near the plane
        let nearest_containers = self.containers_near_plane(1, y);
        // find container points near the plane
        let mut ids = HashSet::new();
        for index in nearest_containers {
            let container = self.containers.get(&index).unwrap();
            for item in container.values() {
                let distance = f64::abs(item.x[1] - y);
                if f64::abs(distance) <= self.radius_tol {
                    ids.insert(item.id.clone());
                }
            }
        }
        Ok(ids)
    }
pub fn find_on_plane_xz ( & self , y : f64 ) -> Result < HashSet < usize > , StrError > { // check if self . ndim != 3 { return Err ( " " ) ; } // find containers near the plane let nearest_containers = self . containers_near_plane ( 1 , y ) ; // find container points near the plane let mut ids = HashSet :: new ( ) ; for index in nearest_containers { let container = self . containers . get ( & index ) . unwrap ( ) ; for item in container . values ( ) { let distance = f64 :: abs ( item . x [ 1 ] - y ) ; if f64 :: abs ( distance ) <= self . radius_tol { ids . insert ( item . id . clone ( ) ) ; } } } Ok ( ids ) }
Find points on the x-z plane (3D only)
Find points on the x - z plane ( 3D only )
&self
y
f64
&self
y
f64
input
`y` -- the plane passes through `y`
` y ` -- the plane passes through ` y `
output
Returns the ids of points.
Returns the ids of points .
note
This works in 3D only.
This works in 3D only .