pub fn calculate_hulls(&mut self) {
        use Axis::*;

        // Phase 1. Reset all hulls to their unjoined state, and clear all shapes.
        self.hulls.clear();
        self.shapes.clear();
        self.edge_filter.clear();
        self.vertex_filter.clear();
        for (coords, &a0) in self.atoms.as_chunk_map().iter() {
            self.hulls.insert(coords, a0.compound_hull());
        }

        // Phase 2. Join all exteriors on the positive axes first. This ensures we never repeat an
        // axis.
        for (coords, _) in self.atoms.as_chunk_map().iter() {
            let mut hulls = self.hulls.get_n_mut([
                coords,
                coords + PosX.to_offset(),
                coords + PosY.to_offset(),
                coords + PosZ.to_offset(),
            ]);

            let (h0, hs) = hulls.split_first_mut().unwrap();
            let h0 = h0.as_mut().unwrap();

            // We only need to consider these three axes (which are also the first three returned by
            // `Axis::generator()`.) Skip any which aren't actually present.
            for (maybe_hi, axis) in hs.iter_mut().zip(Axis::generator()) {
                let hi = match maybe_hi {
                    Some(hi) => hi,
                    None => continue,
                };
                h0.join_exteriors(axis, hi);
            }
        }

        // Phase 3. Recalculate shapes.
        for (coords, hull) in self.hulls.iter() {
            self.shapes.insert(coords, self.shape_cache.get_shape(hull));
        }

        // Phase 4. Populate edge filter.
        self.edge_filter
            .extend(self.hulls.iter().flat_map(|(coords, hull)| {
                hull.facets()
                    .map(move |facet| (coords, facet.translated_by(coords)))
            }));

        // Phase 5. Populate vertex filter.
        self.vertex_filter.extend(self.edge_filter.iter());
    }
/// Clear and calculate from scratch the hulls of the entire map.
Clear and calculate from scratch the hulls of the entire map.
Clear and calculate from scratch the hulls of the entire map .
pub fn calculate_hulls(&mut self) {
        use Axis::*;
        // Phase 1. Reset all hulls to their unjoined state, and clear all shapes.
        self.hulls.clear();
        self.shapes.clear();
        self.edge_filter.clear();
        self.vertex_filter.clear();
        for (coords, &a0) in self.atoms.as_chunk_map().iter() {
            self.hulls.insert(coords, a0.compound_hull());
        }
        // Phase 2. Join all exteriors on the positive axes first. This ensures we never repeat an
        // axis.
        for (coords, _) in self.atoms.as_chunk_map().iter() {
            let mut hulls = self.hulls.get_n_mut([
                coords,
                coords + PosX.to_offset(),
                coords + PosY.to_offset(),
                coords + PosZ.to_offset(),
            ]);
            let (h0, hs) = hulls.split_first_mut().unwrap();
            let h0 = h0.as_mut().unwrap();
            // We only need to consider these three axes (which are also the first three returned by
            // `Axis::generator()`.) Skip any which aren't actually present.
            for (maybe_hi, axis) in hs.iter_mut().zip(Axis::generator()) {
                let hi = match maybe_hi {
                    Some(hi) => hi,
                    None => continue,
                };
                h0.join_exteriors(axis, hi);
            }
        }
        // Phase 3. Recalculate shapes.
        for (coords, hull) in self.hulls.iter() {
            self.shapes.insert(coords, self.shape_cache.get_shape(hull));
        }
        // Phase 4. Populate edge filter.
        self.edge_filter
            .extend(self.hulls.iter().flat_map(|(coords, hull)| {
                hull.facets()
                    .map(move |facet| (coords, facet.translated_by(coords)))
            }));
        // Phase 5. Populate vertex filter.
        self.vertex_filter.extend(self.edge_filter.iter());
    }
pub fn calculate_hulls ( & mut self ) { use Axis :: * ; // Phase 1. Reset all hulls to their unjoined state, and clear all shapes. self . hulls . clear ( ) ; self . shapes . clear ( ) ; self . edge_filter . clear ( ) ; self . vertex_filter . clear ( ) ; for ( coords , & a0 ) in self . atoms . as_chunk_map ( ) . iter ( ) { self . hulls . insert ( coords , a0 . compound_hull ( ) ) ; } // Phase 2. Join all exteriors on the positive axes first. This ensures we never repeat an // axis. for ( coords , _ ) in self . atoms . as_chunk_map ( ) . iter ( ) { let mut hulls = self . hulls . get_n_mut ( [ coords , coords + PosX . to_offset ( ) , coords + PosY . to_offset ( ) , coords + PosZ . to_offset ( ) , ] ) ; let ( h0 , hs ) = hulls . split_first_mut ( ) . unwrap ( ) ; let h0 = h0 . as_mut ( ) . unwrap ( ) ; // We only need to consider these three axes (which are also the first three returned by // `Axis::generator()`.) Skip any which aren't actually present. for ( maybe_hi , axis ) in hs . iter_mut ( ) . zip ( Axis :: generator ( ) ) { let hi = match maybe_hi { Some ( hi ) => hi , None => continue , } ; h0 . join_exteriors ( axis , hi ) ; } } // Phase 3. Recalculate shapes. for ( coords , hull ) in self . hulls . iter ( ) { self . shapes . insert ( coords , self . shape_cache . get_shape ( hull ) ) ; } // Phase 4. Populate edge filter. self . edge_filter . extend ( self . hulls . iter ( ) . flat_map ( | ( coords , hull ) | { hull . facets ( ) . map ( move | facet | ( coords , facet . translated_by ( coords ) ) ) } ) ) ; // Phase 5. Populate vertex filter. self . vertex_filter . extend ( self . edge_filter . iter ( ) ) ; }
Clear and calculate from scratch the hulls of the entire map.
Clear and calculate from scratch the hulls of the entire map .
&mut self
&mut self