Skip to content

Commit

Permalink
fix(OG-Inspector): Rename global_epsilon to GLOBAL_EPSILON (const var…
Browse files Browse the repository at this point in the history
…iable name convention)
  • Loading branch information
benoit2776 committed Jul 11, 2024
1 parent 53cecab commit 458d62e
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 49 deletions.
8 changes: 4 additions & 4 deletions bindings/python/tests/test-py-edgedcurve-colocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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():
Expand Down
6 changes: 3 additions & 3 deletions bindings/python/tests/test-py-edgedcurve-degeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions bindings/python/tests/test-py-pointset-colocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/tests/test-py-solid-colocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/tests/test-py-solid-degeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
8 changes: 4 additions & 4 deletions bindings/python/tests/test-py-surface-colocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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():
Expand Down
6 changes: 3 additions & 3 deletions bindings/python/tests/test-py-surface-degeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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])
Expand Down
4 changes: 2 additions & 2 deletions src/geode/inspector/criterion/private/colocation_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 >
Expand Down
10 changes: 5 additions & 5 deletions tests/inspector/test-edgedcurve-colocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions tests/inspector/test-edgedcurve-degeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down
10 changes: 5 additions & 5 deletions tests/inspector/test-pointset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions tests/inspector/test-solid-colocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion tests/inspector/test-solid-degeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 } );
Expand Down
10 changes: 5 additions & 5 deletions tests/inspector/test-surface-colocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions tests/inspector/test-surface-degeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 } );
Expand Down Expand Up @@ -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 } );
Expand Down

0 comments on commit 458d62e

Please sign in to comment.