@@ -69,8 +69,8 @@ TEST(Smooth, RefineQuads) {
6969TEST (Smooth, TruncatedCone) {
7070 Manifold cone = Manifold::Cylinder (5 , 10 , 5 , 12 );
7171 Manifold smooth = cone.SmoothOut ().RefineToLength (0.5 ).CalculateNormals (0 );
72- EXPECT_NEAR (smooth.Volume (), 1158.61 , 0.01 );
73- EXPECT_NEAR (smooth.SurfaceArea (), 768.12 , 0.01 );
72+ EXPECT_NEAR (smooth.Volume (), 1163.53 , 0.01 );
73+ EXPECT_NEAR (smooth.SurfaceArea (), 769.33 , 0.01 );
7474 CheckGL (smooth, false );
7575
7676 Manifold smooth1 = cone.SmoothOut (180 , 1 ).RefineToLength (0.5 );
@@ -90,16 +90,16 @@ TEST(Smooth, ToLength) {
9090 Manifold smooth =
9191 cone.AsOriginal ().Simplify ().SmoothOut (180 ).RefineToLength (0.1 );
9292 ExpectMeshes (smooth, {{85250 , 170496 }});
93- EXPECT_NEAR (smooth.Volume (), 4505 , 1 );
94- EXPECT_NEAR (smooth.SurfaceArea (), 1337 , 1 );
93+ EXPECT_NEAR (smooth.Volume (), 4570 , 1 );
94+ EXPECT_NEAR (smooth.SurfaceArea (), 1348 , 1 );
9595
9696 MeshGL out = smooth.CalculateCurvature (-1 , 0 ).GetMeshGL ();
9797 float maxMeanCurvature = 0 ;
9898 for (size_t i = 3 ; i < out.vertProperties .size (); i += 4 ) {
9999 maxMeanCurvature =
100100 std::max (maxMeanCurvature, std::abs (out.vertProperties [i]));
101101 }
102- EXPECT_NEAR (maxMeanCurvature, 2.32 , 0.01 );
102+ EXPECT_NEAR (maxMeanCurvature, 1.63 , 0.01 );
103103
104104 if (options.exportModels ) WriteTestOBJ (" smoothToLength.obj" , smooth);
105105}
@@ -213,11 +213,11 @@ TEST(Smooth, MissingNormals) {
213213}
214214
215215TEST (Smooth, MissingNormalsCone) {
216- Manifold cone = Manifold::Cylinder (10 , 10 , 0 , 5 ).CalculateNormals (0 );
216+ Manifold cone = Manifold::Cylinder (10 , 10 , 0 , 5 ).CalculateNormals (0 , 60 );
217217 Manifold diff = cone - Manifold::Cube (vec3 (10 ), true ).Translate ({0 , 0 , 10 });
218218 Manifold out = diff.SmoothByNormals (0 ).Refine (20 );
219- EXPECT_NEAR (out.Volume (), 1092 , 1 );
220- EXPECT_NEAR (out.SurfaceArea (), 748 , 1 );
219+ EXPECT_NEAR (out.Volume (), 1009 , 1 );
220+ EXPECT_NEAR (out.SurfaceArea (), 736 , 1 );
221221 if (options.exportModels ) WriteTestOBJ (" missingNormalsCone.obj" , out);
222222}
223223
@@ -383,48 +383,6 @@ TEST(Smooth, Torus) {
383383}
384384#endif
385385
386- TEST (Smooth, SineSurface) {
387- Manifold surface =
388- Manifold::LevelSet (
389- [](vec3 p) {
390- double mid = la::sin (p.x ) + la::sin (p.y );
391- return (p.z > mid - 0.5 && p.z < mid + 0.5 ) ? 1.0 : -1.0 ;
392- },
393- {vec3 (-2 * kPi + 0.2 ), vec3 (0 * kPi - 0.2 )}, 1 )
394- .Simplify ();
395-
396- Manifold smoothed =
397- surface.CalculateNormals (0 , 50 ).SmoothByNormals (0 ).Refine (8 );
398- EXPECT_NEAR (smoothed.Volume (), 8.07 , 0.01 );
399- EXPECT_NEAR (smoothed.SurfaceArea (), 30.87 , 0.01 );
400- EXPECT_EQ (smoothed.Genus (), 0 );
401- EXPECT_NEAR (smoothed.TrimByPlane ({0 , 1 , 1 }, -3.19487 ).Volume (),
402- smoothed.Volume (), 1e-5 );
403-
404- Manifold smoothed1 = surface.SmoothOut (50 ).Refine (8 );
405- EXPECT_FLOAT_EQ (smoothed1.Volume (), smoothed.Volume ());
406- EXPECT_FLOAT_EQ (smoothed1.SurfaceArea (), smoothed.SurfaceArea ());
407- EXPECT_EQ (smoothed1.Genus (), 0 );
408- EXPECT_NEAR (smoothed1.TrimByPlane ({0 , 1 , 1 }, -3.19487 ).Volume (),
409- smoothed1.Volume (), 1e-5 );
410-
411- Manifold smoothed2 = surface.SmoothOut (180 , 1 ).Refine (8 );
412- EXPECT_NEAR (smoothed2.Volume (), 8.95 , 0.01 );
413- EXPECT_NEAR (smoothed2.SurfaceArea (), 33.35 , 0.01 );
414- EXPECT_EQ (smoothed2.Genus (), 0 );
415- EXPECT_NEAR (smoothed2.TrimByPlane ({0 , 1 , 1 }, -3.19487 ).Volume (),
416- smoothed2.Volume (), 1e-3 );
417-
418- Manifold smoothed3 = surface.SmoothOut (50 , 0.5 ).Refine (8 );
419- EXPECT_NEAR (smoothed3.Volume (), 8.38 , 0.01 );
420- EXPECT_NEAR (smoothed3.SurfaceArea (), 31.55 , 0.02 );
421- EXPECT_EQ (smoothed3.Genus (), 0 );
422- EXPECT_NEAR (smoothed3.TrimByPlane ({0 , 1 , 1 }, -3.19487 ).Volume (),
423- smoothed3.Volume (), 1e-5 );
424-
425- if (options.exportModels ) WriteTestOBJ (" smoothSineSurface.obj" , smoothed);
426- }
427-
428386TEST (Smooth, SDF ) {
429387 const double r = 10 ;
430388 const double extra = 2 ;
0 commit comments