From 458d62e8babfeab35cc3fda5b758fb726692720c Mon Sep 17 00:00:00 2001 From: benoitTHEBAULT Date: Thu, 11 Jul 2024 09:09:45 +0200 Subject: [PATCH] fix(OG-Inspector): Rename global_epsilon to GLOBAL_EPSILON (const variable name convention) --- bindings/python/tests/test-py-edgedcurve-colocation.py | 8 ++++---- .../python/tests/test-py-edgedcurve-degeneration.py | 6 +++--- bindings/python/tests/test-py-pointset-colocation.py | 8 ++++---- bindings/python/tests/test-py-solid-colocation.py | 4 ++-- bindings/python/tests/test-py-solid-degeneration.py | 2 +- bindings/python/tests/test-py-surface-colocation.py | 8 ++++---- bindings/python/tests/test-py-surface-degeneration.py | 6 +++--- .../inspector/criterion/private/colocation_impl.cpp | 4 ++-- .../inspector/criterion/private/degeneration_impl.cpp | 2 +- tests/inspector/test-edgedcurve-colocation.cpp | 10 +++++----- tests/inspector/test-edgedcurve-degeneration.cpp | 6 +++--- tests/inspector/test-pointset.cpp | 10 +++++----- tests/inspector/test-solid-colocation.cpp | 6 +++--- tests/inspector/test-solid-degeneration.cpp | 2 +- tests/inspector/test-surface-colocation.cpp | 10 +++++----- tests/inspector/test-surface-degeneration.cpp | 6 +++--- 16 files changed, 49 insertions(+), 49 deletions(-) diff --git a/bindings/python/tests/test-py-edgedcurve-colocation.py b/bindings/python/tests/test-py-edgedcurve-colocation.py index a7549f35..54f50ada 100644 --- a/bindings/python/tests/test-py-edgedcurve-colocation.py +++ b/bindings/python/tests/test-py-edgedcurve-colocation.py @@ -56,8 +56,8 @@ def check_colocation2D(): builder.set_point(2, geode.Point2D([0., 0.])) builder.set_point(3, geode.Point2D([2., 0.])) builder.set_point(4, geode.Point2D([1., 4.])) - builder.set_point(5, geode.Point2D([2., geode.global_epsilon / 2])) - builder.set_point(6, geode.Point2D([geode.global_epsilon / 1.1, 2.])) + builder.set_point(5, geode.Point2D([2., geode.GLOBAL_EPSILON / 2])) + builder.set_point(6, geode.Point2D([geode.GLOBAL_EPSILON / 1.1, 2.])) colocation_inspector = inspector.EdgedCurveColocation2D(curve) if not colocation_inspector.mesh_has_colocated_points(): @@ -103,8 +103,8 @@ def check_colocation3D(): builder.set_point(3, geode.Point3D([2., 0., 0.])) builder.set_point(4, geode.Point3D([1., 4., 3.])) builder.set_point( - 5, geode.Point3D([2., geode.global_epsilon / 2, geode.global_epsilon / 2])) - builder.set_point(6, geode.Point3D([geode.global_epsilon / 1.1, 2., 1.])) + 5, geode.Point3D([2., geode.GLOBAL_EPSILON / 2, geode.GLOBAL_EPSILON / 2])) + builder.set_point(6, geode.Point3D([geode.GLOBAL_EPSILON / 1.1, 2., 1.])) colocation_inspector = inspector.EdgedCurveColocation3D(curve) if not colocation_inspector.mesh_has_colocated_points(): diff --git a/bindings/python/tests/test-py-edgedcurve-degeneration.py b/bindings/python/tests/test-py-edgedcurve-degeneration.py index ac7c2282..f5c02f04 100644 --- a/bindings/python/tests/test-py-edgedcurve-degeneration.py +++ b/bindings/python/tests/test-py-edgedcurve-degeneration.py @@ -56,7 +56,7 @@ def check_degeneration_by_colocalisation2D(): builder.create_vertices(3) builder.set_point(0, geode.Point2D([0., 2.])) builder.set_point(1, geode.Point2D([2., 0.])) - builder.set_point(2, geode.Point2D([2., geode.global_epsilon / 2])) + builder.set_point(2, geode.Point2D([2., geode.GLOBAL_EPSILON / 2])) builder.create_edge_with_vertices(0, 1) builder.create_edge_with_vertices(0, 2) @@ -99,8 +99,8 @@ def check_degeneration_by_colocalisation3D(): builder.create_vertices(3) builder.set_point(0, geode.Point3D([0., 2., 0.])) builder.set_point(1, geode.Point3D([2., 0., 0.5])) - builder.set_point(2, geode.Point3D([2., geode.global_epsilon / 2, - 0.5 + geode.global_epsilon / 2])) + builder.set_point(2, geode.Point3D([2., geode.GLOBAL_EPSILON / 2, + 0.5 + geode.GLOBAL_EPSILON / 2])) builder.create_edge_with_vertices(0, 1) builder.create_edge_with_vertices(0, 2) diff --git a/bindings/python/tests/test-py-pointset-colocation.py b/bindings/python/tests/test-py-pointset-colocation.py index 6b29e55a..38ee9961 100644 --- a/bindings/python/tests/test-py-pointset-colocation.py +++ b/bindings/python/tests/test-py-pointset-colocation.py @@ -57,8 +57,8 @@ def check_colocation2D(): builder.set_point(2, geode.Point2D([0., 0.])) builder.set_point(3, geode.Point2D([2., 0.])) builder.set_point(4, geode.Point2D([1., 4.])) - builder.set_point(5, geode.Point2D([2., geode.global_epsilon / 2])) - builder.set_point(6, geode.Point2D([geode.global_epsilon / 1.1, 2.])) + builder.set_point(5, geode.Point2D([2., geode.GLOBAL_EPSILON / 2])) + builder.set_point(6, geode.Point2D([geode.GLOBAL_EPSILON / 1.1, 2.])) colocation_inspector = inspector.PointSetColocation2D(pointset) if not colocation_inspector.mesh_has_colocated_points(): @@ -104,8 +104,8 @@ def check_colocation3D(): builder.set_point(3, geode.Point3D([2., 0., 0.])) builder.set_point(4, geode.Point3D([1., 4., 3.])) builder.set_point( - 5, geode.Point3D([2., geode.global_epsilon / 2, geode.global_epsilon / 2])) - builder.set_point(6, geode.Point3D([geode.global_epsilon / 1.1, 2., 1.])) + 5, geode.Point3D([2., geode.GLOBAL_EPSILON / 2, geode.GLOBAL_EPSILON / 2])) + builder.set_point(6, geode.Point3D([geode.GLOBAL_EPSILON / 1.1, 2., 1.])) colocation_inspector = inspector.PointSetColocation3D(pointset) if not colocation_inspector.mesh_has_colocated_points(): diff --git a/bindings/python/tests/test-py-solid-colocation.py b/bindings/python/tests/test-py-solid-colocation.py index 4c778876..a28c2dbe 100644 --- a/bindings/python/tests/test-py-solid-colocation.py +++ b/bindings/python/tests/test-py-solid-colocation.py @@ -58,9 +58,9 @@ def check_colocation(): builder.set_point(3, geode.Point3D([5., 2., 0.])) builder.set_point(4, geode.Point3D([1., 4., 3.])) builder.set_point(5, - geode.Point3D([5., 2. + geode.global_epsilon / 2, geode.global_epsilon / 2])) + geode.Point3D([5., 2. + geode.GLOBAL_EPSILON / 2, geode.GLOBAL_EPSILON / 2])) builder.set_point(6, geode.Point3D( - [5. + geode.global_epsilon / 1.1, 2., 1.])) + [5. + geode.GLOBAL_EPSILON / 1.1, 2., 1.])) colocation_inspector = inspector.SolidMeshColocation3D(solid) if not colocation_inspector.mesh_has_colocated_points(): diff --git a/bindings/python/tests/test-py-solid-degeneration.py b/bindings/python/tests/test-py-solid-degeneration.py index 8bd58a0a..7ec27b7d 100644 --- a/bindings/python/tests/test-py-solid-degeneration.py +++ b/bindings/python/tests/test-py-solid-degeneration.py @@ -59,7 +59,7 @@ def check_degeneration_by_colocalisation(): builder.set_point(1, geode.Point3D([3., 3., 0.])) builder.set_point(2, geode.Point3D([-0.5, 4., -1.])) builder.set_point(3, geode.Point3D([1., 3., 3.])) - builder.set_point(4, geode.Point3D([3., 3., -geode.global_epsilon / 2])) + builder.set_point(4, geode.Point3D([3., 3., -geode.GLOBAL_EPSILON / 2])) builder.create_tetrahedron([0, 1, 3, 2]) builder.create_tetrahedron([0, 1, 4, 2]) diff --git a/bindings/python/tests/test-py-surface-colocation.py b/bindings/python/tests/test-py-surface-colocation.py index 47072bd0..85ea33be 100644 --- a/bindings/python/tests/test-py-surface-colocation.py +++ b/bindings/python/tests/test-py-surface-colocation.py @@ -56,8 +56,8 @@ def check_colocation2D(): builder.set_point(2, geode.Point2D([0., 0.])) builder.set_point(3, geode.Point2D([2., 0.])) builder.set_point(4, geode.Point2D([1., 4.])) - builder.set_point(5, geode.Point2D([2., geode.global_epsilon / 2])) - builder.set_point(6, geode.Point2D([geode.global_epsilon / 1.1, 2.])) + builder.set_point(5, geode.Point2D([2., geode.GLOBAL_EPSILON / 2])) + builder.set_point(6, geode.Point2D([geode.GLOBAL_EPSILON / 1.1, 2.])) colocation_inspector = inspector.SurfaceMeshColocation2D(surface) if not colocation_inspector.mesh_has_colocated_points(): @@ -103,8 +103,8 @@ def check_colocation3D(): builder.set_point(3, geode.Point3D([2., 0., 0.])) builder.set_point(4, geode.Point3D([1., 4., 3.])) builder.set_point( - 5, geode.Point3D([2., geode.global_epsilon / 2, geode.global_epsilon / 2])) - builder.set_point(6, geode.Point3D([geode.global_epsilon / 1.1, 2., 1.])) + 5, geode.Point3D([2., geode.GLOBAL_EPSILON / 2, geode.GLOBAL_EPSILON / 2])) + builder.set_point(6, geode.Point3D([geode.GLOBAL_EPSILON / 1.1, 2., 1.])) colocation_inspector = inspector.SurfaceMeshColocation3D(surface) if not colocation_inspector.mesh_has_colocated_points(): diff --git a/bindings/python/tests/test-py-surface-degeneration.py b/bindings/python/tests/test-py-surface-degeneration.py index 5ae369d5..440d4d80 100644 --- a/bindings/python/tests/test-py-surface-degeneration.py +++ b/bindings/python/tests/test-py-surface-degeneration.py @@ -57,7 +57,7 @@ def check_degeneration_by_colocalisation2D(): builder.set_point(0, geode.Point2D([0., 2.])) builder.set_point(1, geode.Point2D([2., 0.])) builder.set_point(2, geode.Point2D([1., 4.])) - builder.set_point(3, geode.Point2D([2., geode.global_epsilon / 2])) + builder.set_point(3, geode.Point2D([2., geode.GLOBAL_EPSILON / 2])) builder.create_triangle([0, 1, 2]) builder.create_triangle([2, 1, 3]) @@ -124,8 +124,8 @@ def check_degeneration_by_colocalisation3D(): builder.set_point(0, geode.Point3D([0., 2., 0.])) builder.set_point(1, geode.Point3D([2., 0., 0.5])) builder.set_point(2, geode.Point3D([1., 4., 1.])) - builder.set_point(3, geode.Point3D([2., geode.global_epsilon / 2, - 0.5 + geode.global_epsilon / 2])) + builder.set_point(3, geode.Point3D([2., geode.GLOBAL_EPSILON / 2, + 0.5 + geode.GLOBAL_EPSILON / 2])) builder.create_triangle([0, 1, 2]) builder.create_triangle([2, 1, 3]) diff --git a/src/geode/inspector/criterion/private/colocation_impl.cpp b/src/geode/inspector/criterion/private/colocation_impl.cpp index 3c034e4f..ec956324 100644 --- a/src/geode/inspector/criterion/private/colocation_impl.cpp +++ b/src/geode/inspector/criterion/private/colocation_impl.cpp @@ -110,7 +110,7 @@ namespace geode ColocationImpl< dimension, Mesh >::mesh_has_colocated_points() const { return mesh_points_colocated_info< dimension, Mesh >( - mesh_, global_epsilon ) + mesh_, GLOBAL_EPSILON ) .nb_colocated_points() > 0; } @@ -121,7 +121,7 @@ namespace geode { const auto colocated_points_indices = ::colocated_points_groups< dimension, Mesh >( - mesh_, global_epsilon ); + mesh_, GLOBAL_EPSILON ); return colocated_points_indices; } diff --git a/src/geode/inspector/criterion/private/degeneration_impl.cpp b/src/geode/inspector/criterion/private/degeneration_impl.cpp index 3ba5b6d5..48b50275 100644 --- a/src/geode/inspector/criterion/private/degeneration_impl.cpp +++ b/src/geode/inspector/criterion/private/degeneration_impl.cpp @@ -94,7 +94,7 @@ namespace geode mesh_.edges().edge_vertices( edge_index ); const auto p1 = mesh_.point( edge_vertices[0] ); const auto p2 = mesh_.point( edge_vertices[1] ); - return point_point_distance( p1, p2 ) < global_epsilon; + return point_point_distance( p1, p2 ) < GLOBAL_EPSILON; } template < class MeshType > diff --git a/tests/inspector/test-edgedcurve-colocation.cpp b/tests/inspector/test-edgedcurve-colocation.cpp index e895fbd7..514c287a 100644 --- a/tests/inspector/test-edgedcurve-colocation.cpp +++ b/tests/inspector/test-edgedcurve-colocation.cpp @@ -59,9 +59,9 @@ void check_colocation2D() builder->set_point( 3, geode::Point2D{ { 2., 0. } } ); builder->set_point( 4, geode::Point2D{ { 1., 4. } } ); builder->set_point( - 5, geode::Point2D{ { 2., geode::global_epsilon / 2 } } ); + 5, geode::Point2D{ { 2., geode::GLOBAL_EPSILON / 2 } } ); builder->set_point( - 6, geode::Point2D{ { geode::global_epsilon / 1.1, 2. } } ); + 6, geode::Point2D{ { geode::GLOBAL_EPSILON / 1.1, 2. } } ); const geode::EdgedCurveColocation2D colocation_inspector{ *curve }; OPENGEODE_EXCEPTION( colocation_inspector.mesh_has_colocated_points(), @@ -117,10 +117,10 @@ void check_colocation3D() builder->set_point( 2, geode::Point3D{ { 0., 0., 0. } } ); builder->set_point( 3, geode::Point3D{ { 2., 0., 0. } } ); builder->set_point( 4, geode::Point3D{ { 1., 4., 3. } } ); - builder->set_point( 5, geode::Point3D{ { 2., geode::global_epsilon / 2, - geode::global_epsilon / 2 } } ); + builder->set_point( 5, geode::Point3D{ { 2., geode::GLOBAL_EPSILON / 2, + geode::GLOBAL_EPSILON / 2 } } ); builder->set_point( - 6, geode::Point3D{ { geode::global_epsilon / 1.1, 2., 1. } } ); + 6, geode::Point3D{ { geode::GLOBAL_EPSILON / 1.1, 2., 1. } } ); const geode::EdgedCurveColocation3D colocation_inspector{ *curve }; OPENGEODE_EXCEPTION( colocation_inspector.mesh_has_colocated_points(), diff --git a/tests/inspector/test-edgedcurve-degeneration.cpp b/tests/inspector/test-edgedcurve-degeneration.cpp index 5e720a9f..39898281 100644 --- a/tests/inspector/test-edgedcurve-degeneration.cpp +++ b/tests/inspector/test-edgedcurve-degeneration.cpp @@ -59,7 +59,7 @@ void check_degeneration_by_colocalisation2D() builder->set_point( 0, geode::Point2D{ { 0., 2. } } ); builder->set_point( 1, geode::Point2D{ { 2., 0. } } ); builder->set_point( - 2, geode::Point2D{ { 2., geode::global_epsilon / 2 } } ); + 2, geode::Point2D{ { 2., geode::GLOBAL_EPSILON / 2 } } ); builder->create_edge( 0, 1 ); builder->create_edge( 0, 2 ); @@ -104,8 +104,8 @@ void check_degeneration_by_colocalisation3D() builder->create_vertices( 3 ); builder->set_point( 0, geode::Point3D{ { 0., 2., 0. } } ); builder->set_point( 1, geode::Point3D{ { 2., 0., 0.5 } } ); - builder->set_point( 2, geode::Point3D{ { 2., geode::global_epsilon / 2, - 0.5 + geode::global_epsilon / 2 } } ); + builder->set_point( 2, geode::Point3D{ { 2., geode::GLOBAL_EPSILON / 2, + 0.5 + geode::GLOBAL_EPSILON / 2 } } ); builder->create_edge( 0, 1 ); builder->create_edge( 0, 2 ); diff --git a/tests/inspector/test-pointset.cpp b/tests/inspector/test-pointset.cpp index 68460742..6557fe92 100644 --- a/tests/inspector/test-pointset.cpp +++ b/tests/inspector/test-pointset.cpp @@ -58,9 +58,9 @@ void check_colocation2D() builder->set_point( 3, geode::Point2D{ { 2., 0. } } ); builder->set_point( 4, geode::Point2D{ { 1., 4. } } ); builder->set_point( - 5, geode::Point2D{ { 2., geode::global_epsilon / 2 } } ); + 5, geode::Point2D{ { 2., geode::GLOBAL_EPSILON / 2 } } ); builder->set_point( - 6, geode::Point2D{ { geode::global_epsilon / 1.1, 2. } } ); + 6, geode::Point2D{ { geode::GLOBAL_EPSILON / 1.1, 2. } } ); const geode::PointSetInspector2D inspector{ *pointset }; OPENGEODE_EXCEPTION( inspector.mesh_has_colocated_points(), @@ -113,10 +113,10 @@ void check_colocation3D() builder->set_point( 2, geode::Point3D{ { 0., 0., 0. } } ); builder->set_point( 3, geode::Point3D{ { 2., 0., 0. } } ); builder->set_point( 4, geode::Point3D{ { 1., 4., 3. } } ); - builder->set_point( 5, geode::Point3D{ { 2., geode::global_epsilon / 2, - geode::global_epsilon / 2 } } ); + builder->set_point( 5, geode::Point3D{ { 2., geode::GLOBAL_EPSILON / 2, + geode::GLOBAL_EPSILON / 2 } } ); builder->set_point( - 6, geode::Point3D{ { geode::global_epsilon / 1.1, 2., 1. } } ); + 6, geode::Point3D{ { geode::GLOBAL_EPSILON / 1.1, 2., 1. } } ); const geode::PointSetInspector3D inspector{ *pointset }; OPENGEODE_EXCEPTION( inspector.mesh_has_colocated_points(), diff --git a/tests/inspector/test-solid-colocation.cpp b/tests/inspector/test-solid-colocation.cpp index a973425c..92f10c1b 100644 --- a/tests/inspector/test-solid-colocation.cpp +++ b/tests/inspector/test-solid-colocation.cpp @@ -59,10 +59,10 @@ void check_colocation() builder->set_point( 2, geode::Point3D{ { 0.5, 0., 0.5 } } ); builder->set_point( 3, geode::Point3D{ { 5., 2., 0. } } ); builder->set_point( 4, geode::Point3D{ { 1., 4., 3. } } ); - builder->set_point( 5, geode::Point3D{ { 5., 2. + geode::global_epsilon / 2, - geode::global_epsilon / 2 } } ); + builder->set_point( 5, geode::Point3D{ { 5., 2. + geode::GLOBAL_EPSILON / 2, + geode::GLOBAL_EPSILON / 2 } } ); builder->set_point( - 6, geode::Point3D{ { 5. + geode::global_epsilon / 1.1, 2., 1. } } ); + 6, geode::Point3D{ { 5. + geode::GLOBAL_EPSILON / 1.1, 2., 1. } } ); const geode::SolidMeshColocation3D colocation_inspector{ *solid }; OPENGEODE_EXCEPTION( colocation_inspector.mesh_has_colocated_points(), diff --git a/tests/inspector/test-solid-degeneration.cpp b/tests/inspector/test-solid-degeneration.cpp index 1bac9dba..388391b3 100644 --- a/tests/inspector/test-solid-degeneration.cpp +++ b/tests/inspector/test-solid-degeneration.cpp @@ -63,7 +63,7 @@ void check_degeneration_by_colocalisation() builder->set_point( 2, geode::Point3D{ { -0.5, 4., -1. } } ); builder->set_point( 3, geode::Point3D{ { 1., 3., 3. } } ); builder->set_point( - 4, geode::Point3D{ { 3., 3., -geode::global_epsilon / 2 } } ); + 4, geode::Point3D{ { 3., 3., -geode::GLOBAL_EPSILON / 2 } } ); builder->create_tetrahedron( { 0, 1, 3, 2 } ); builder->create_tetrahedron( { 0, 1, 4, 2 } ); diff --git a/tests/inspector/test-surface-colocation.cpp b/tests/inspector/test-surface-colocation.cpp index 6647264e..1ee6daaf 100644 --- a/tests/inspector/test-surface-colocation.cpp +++ b/tests/inspector/test-surface-colocation.cpp @@ -59,9 +59,9 @@ void check_colocation2D() builder->set_point( 3, geode::Point2D{ { 2., 0. } } ); builder->set_point( 4, geode::Point2D{ { 1., 4. } } ); builder->set_point( - 5, geode::Point2D{ { 2., geode::global_epsilon / 2 } } ); + 5, geode::Point2D{ { 2., geode::GLOBAL_EPSILON / 2 } } ); builder->set_point( - 6, geode::Point2D{ { geode::global_epsilon / 1.1, 2. } } ); + 6, geode::Point2D{ { geode::GLOBAL_EPSILON / 1.1, 2. } } ); const geode::SurfaceMeshColocation2D colocation_inspector{ *surface }; OPENGEODE_EXCEPTION( colocation_inspector.mesh_has_colocated_points(), @@ -117,10 +117,10 @@ void check_colocation3D() builder->set_point( 2, geode::Point3D{ { 0., 0., 0. } } ); builder->set_point( 3, geode::Point3D{ { 2., 0., 0. } } ); builder->set_point( 4, geode::Point3D{ { 1., 4., 3. } } ); - builder->set_point( 5, geode::Point3D{ { 2., geode::global_epsilon / 2, - geode::global_epsilon / 2 } } ); + builder->set_point( 5, geode::Point3D{ { 2., geode::GLOBAL_EPSILON / 2, + geode::GLOBAL_EPSILON / 2 } } ); builder->set_point( - 6, geode::Point3D{ { geode::global_epsilon / 1.1, 2., 1. } } ); + 6, geode::Point3D{ { geode::GLOBAL_EPSILON / 1.1, 2., 1. } } ); const geode::SurfaceMeshColocation3D colocation_inspector{ *surface }; OPENGEODE_EXCEPTION( colocation_inspector.mesh_has_colocated_points(), diff --git a/tests/inspector/test-surface-degeneration.cpp b/tests/inspector/test-surface-degeneration.cpp index 14901b21..315684d0 100644 --- a/tests/inspector/test-surface-degeneration.cpp +++ b/tests/inspector/test-surface-degeneration.cpp @@ -61,7 +61,7 @@ void check_degeneration_by_colocalisation2D() builder->set_point( 1, geode::Point2D{ { 2., 0. } } ); builder->set_point( 2, geode::Point2D{ { 1., 4. } } ); builder->set_point( - 3, geode::Point2D{ { 2., geode::global_epsilon / 2 } } ); + 3, geode::Point2D{ { 2., geode::GLOBAL_EPSILON / 2 } } ); builder->create_triangle( { 0, 1, 2 } ); builder->create_triangle( { 2, 1, 3 } ); @@ -130,8 +130,8 @@ void check_degeneration_by_colocalisation3D() builder->set_point( 0, geode::Point3D{ { 0., 2., 0. } } ); builder->set_point( 1, geode::Point3D{ { 2., 0., 0.5 } } ); builder->set_point( 2, geode::Point3D{ { 1., 4., 1. } } ); - builder->set_point( 3, geode::Point3D{ { 2., geode::global_epsilon / 2, - 0.5 + geode::global_epsilon / 2 } } ); + builder->set_point( 3, geode::Point3D{ { 2., geode::GLOBAL_EPSILON / 2, + 0.5 + geode::GLOBAL_EPSILON / 2 } } ); builder->create_triangle( { 0, 1, 2 } ); builder->create_triangle( { 2, 1, 3 } );