[][src]Module building_blocks_storage::func

Lattice map access traits implemented for functions and closures.

This is particularly useful for sampling from signed-distance fields.

use building_blocks_core::prelude::*;
use building_blocks_storage::prelude::*;

let sample_extent = Extent3i::from_min_and_max(PointN([-15; 3]), PointN([15; 3]));
let mut sampled_sphere = Array3::fill(sample_extent, 0.0);

copy_extent(&sample_extent, &|p: &Point3i| (p.dot(p) - 10) as f32, &mut sampled_sphere);