@@ -68,7 +68,7 @@ pub fn marching_cubes<R: Real, L: MarchingCubesLevelSet<R>>(
6868 for local_point_index in 0 ..8 {
6969 let point = cell
7070 . global_point_index_of ( local_point_index)
71- . ok_or ( anyhow ! ( "Missing point!" ) ) ?;
71+ . ok_or_else ( || anyhow ! ( "Missing point!" ) ) ?;
7272 let coords = grid. point_coordinates ( & point) ;
7373
7474 match level_set. evaluate_sign ( & coords) {
@@ -84,7 +84,7 @@ pub fn marching_cubes<R: Real, L: MarchingCubesLevelSet<R>>(
8484 for ( v_idx, local_edge_index) in triangle. iter ( ) . copied ( ) . enumerate ( ) {
8585 let edge = cell
8686 . global_edge_index_of ( local_edge_index as usize )
87- . ok_or ( anyhow ! ( "Missing edge!" ) ) ?;
87+ . ok_or_else ( || anyhow ! ( "Missing edge!" ) ) ?;
8888 let vertex_index = * edge_to_vertex. entry ( edge) . or_insert_with ( || {
8989 let vertex_index = vertices. len ( ) ;
9090
@@ -117,7 +117,7 @@ pub fn marching_cubes<R: Real, L: MarchingCubesLevelSet<R>>(
117117}
118118
119119/// Wrapper for an SDF from sdfu
120- pub struct SdfuLevelSet < S : sdfu :: SDF < f32 , Vec3 > > {
120+ pub struct SdfuLevelSet < S : SDF < f32 , Vec3 > > {
121121 sdf : S ,
122122}
123123
@@ -128,7 +128,7 @@ fn vec_na_to_uv(vec: &Vector3<f32>) -> Vec3 {
128128
129129impl < S > MarchingCubesLevelSet < f32 > for SdfuLevelSet < S >
130130where
131- S : sdfu :: SDF < f32 , Vec3 > ,
131+ S : SDF < f32 , Vec3 > ,
132132{
133133 fn is_region_supported ( & self , aabb : & Aabb3d < f32 > ) -> bool {
134134 let min = aabb. min ( ) ;
@@ -160,7 +160,7 @@ where
160160}
161161
162162/// Builds an example level set function to reconstruct
163- fn example_level_set ( ) -> SdfuLevelSet < impl sdfu :: SDF < f32 , Vec3 > > {
163+ fn example_level_set ( ) -> SdfuLevelSet < impl SDF < f32 , Vec3 > > {
164164 let sdf = sdfu:: Sphere :: new ( 0.5f32 )
165165 . union_smooth (
166166 sdfu:: Sphere :: new ( 0.3 ) . translate ( Vec3 :: new ( -0.3 , 0.3 , 0.0 ) ) ,
0 commit comments