Skip to content

Commit e10ce05

Browse files
committed
fix tests
1 parent 5717033 commit e10ce05

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/geode/mesh/helpers/ray_tracing.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,14 @@ namespace geode
473473
{
474474
continue;
475475
}
476-
auto distance = point_point_distance( origin_, point );
477476
if( Vector3D{ origin_, point }.dot( segment_.direction() )
478477
< 0 )
479478
{
480-
distance *= -1.;
479+
ray_edge_distance *= -1.;
481480
}
482481
std::lock_guard< std::mutex > lock{ mutex_ };
483-
results_.emplace_back( polygon_id, distance, result.second,
484-
std::move( point ) );
482+
results_.emplace_back( polygon_id, ray_edge_distance,
483+
result.second, std::move( point ) );
485484
}
486485
const auto [distance, __, triangle_point] =
487486
segment_triangle_distance( segment_, triangle );

tests/mesh/test-ray-tracing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <geode/mesh/core/surface_mesh.hpp>
3131
#include <geode/mesh/helpers/aabb_surface_helpers.hpp>
3232
#include <geode/mesh/helpers/ray_tracing.hpp>
33+
#include <geode/mesh/io/triangulated_surface_output.hpp>
3334

3435
#include <geode/tests/common.hpp>
3536

@@ -99,7 +100,6 @@ void test_ray_parallel()
99100
builder->create_point( geode::Point3D{ { -1, 1, 0 } } );
100101
builder->create_point( geode::Point3D{ { -2, 0, 0 } } );
101102
builder->create_polygon( { 0, 1, 2 } );
102-
103103
const auto aabb = geode::create_aabb_tree( *mesh );
104104
const geode::Vector3D direction{ { -1, 0, 0 } };
105105
const geode::Point3D origin{ { 0, 0, 0 } };
@@ -111,7 +111,7 @@ void test_ray_parallel()
111111
OPENGEODE_EXCEPTION(
112112
result->polygon == 0, "[Test] Ray edge wrong polygon" );
113113
OPENGEODE_EXCEPTION(
114-
result->distance == 1, "[Test] Ray edge wrong distance" );
114+
result->distance == 0, "[Test] Ray edge wrong distance" );
115115
}
116116

117117
void test()

0 commit comments

Comments
 (0)