pub(crate) fn new(mesh: &Mesh, extract: Extract) -> (Option<MapEdge2dToCells>, Option<MapFaceToCells>, Features) {
        assert!(mesh.ndim >= 2 && mesh.ndim <= 3);
        let two_dim = if mesh.ndim == 2 { true } else { false };
        let do_rods_and_shells = match extract {
            Extract::All => true,
            Extract::Boundary => true,
            Extract::Interior => false,
        };
        let (edges, faces, mut features) = if two_dim {
            let edges = algorithms::extract_all_2d_edges(mesh);
            let features = algorithms::extract_features_2d(mesh, &edges, extract);
            (Some(edges), None, features)
        } else {
            let faces = algorithms::extract_all_faces(mesh);
            let features = algorithms::extract_features_3d(mesh, &faces, extract);
            (None, Some(faces), features)
        };
        if do_rods_and_shells {
            algorithms::extract_rods_and_shells(mesh, &mut features);
        }
        (edges, faces, features)
    }
/// Extracts features
///
/// **Notes:**
///
/// 1. This function is to be used by [Region] and not by the end-user.
/// 2. The points of rods or shells are only extracted when either the All or Boundary option is selected.
///
/// # Panics
///
/// 1. This function works in 2D or 3D only; otherwise, it will panic.
/// 2. This function will panic if the mesh data is invalid,
///    e.g., the cell points array doesn't contain enough points or the indices are incorrect
/// 3. You may want to call [check_all()] to capture (some) errors
Extracts features
Notes.

1. This function is to be used by [Region] and not by the end-user.
2. The points of rods or shells are only extracted when either the All or Boundary option is selected.
Extracts features Notes . 1 . This function is to be used by [ Region ] and not by the end - user . 2 . The points of rods or shells are only extracted when either the All or Boundary option is selected .
pub(crate) fn new(mesh: &Mesh, extract: Extract) -> (Option<MapEdge2dToCells>, Option<MapFaceToCells>, Features) {
        assert!(mesh.ndim >= 2 && mesh.ndim <= 3);
        let two_dim = if mesh.ndim == 2 { true } else { false };
        let do_rods_and_shells = match extract {
            Extract::All => true,
            Extract::Boundary => true,
            Extract::Interior => false,
        };
        let (edges, faces, mut features) = if two_dim {
            let edges = algorithms::extract_all_2d_edges(mesh);
            let features = algorithms::extract_features_2d(mesh, &edges, extract);
            (Some(edges), None, features)
        } else {
            let faces = algorithms::extract_all_faces(mesh);
            let features = algorithms::extract_features_3d(mesh, &faces, extract);
            (None, Some(faces), features)
        };
        if do_rods_and_shells {
            algorithms::extract_rods_and_shells(mesh, &mut features);
        }
        (edges, faces, features)
    }
pub ( crate ) fn new ( mesh : & Mesh , extract : Extract ) -> ( Option < MapEdge2dToCells > , Option < MapFaceToCells > , Features ) { assert ! ( mesh ndim 2 mesh ndim 3 ) ; let two_dim = if mesh . ndim == 2 { true } else { false } ; let do_rods_and_shells = match extract { Extract :: All => true , Extract :: Boundary => true , Extract :: Interior => false , } ; let ( edges , faces , mut features ) = if two_dim { let edges = algorithms :: extract_all_2d_edges ( mesh ) ; let features = algorithms :: extract_features_2d ( mesh , & edges , extract ) ; ( Some ( edges ) , None , features ) } else { let faces = algorithms :: extract_all_faces ( mesh ) ; let features = algorithms :: extract_features_3d ( mesh , & faces , extract ) ; ( None , Some ( faces ) , features ) } ; if do_rods_and_shells { algorithms :: extract_rods_and_shells ( mesh , & mut features ) ; } ( edges , faces , features ) }
Extracts features
Notes:
Extracts features Notes :
mesh
&Mesh
extract
Extract
mesh
&Mesh
extract
Extract
panics
1. This function works in 2D or 3D only; otherwise, it will panic.
2. This function will panic if the mesh data is invalid,
e.g., the cell points array doesn't contain enough points or the indices are incorrect
3. You may want to call [check_all()] to capture (some) errors
1 . This function works in 2D or 3D only ; otherwise it will panic . 2 . This function will panic if the mesh data is invalid e . g . the cell points array doesn ' t contain enough points or the indices are incorrect 3 . You may want to call [ check_all () ] to capture ( some ) errors