Skip to content

Commit

Permalink
fix(Clean): some cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
BotellaA authored Mar 31, 2020
1 parent 52fe1fc commit c617cdb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
1 change: 0 additions & 1 deletion include/geode/geometry/point.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#pragma once

#include <array>
#include <cmath>
#include <iostream>

#include <bitsery/bitsery.h>
Expand Down
9 changes: 0 additions & 9 deletions src/geode/geometry/distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ namespace geode
auto det = std::fabs( a00 * a11 - a01 * a01 );
auto s = a01 * b1 - a11 * b0;
auto t = a01 * b0 - a00 * b1;
// DEBUG( a00 );
// DEBUG( a01 );
// DEBUG( a11 );
// DEBUG( b0 );
// DEBUG( b1 );
// DEBUG( c );
// DEBUG( det );
// DEBUG( s );
// DEBUG( t );
double sqrDistance;

if( s + t <= det )
Expand Down
18 changes: 0 additions & 18 deletions tests/geometry/test-distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,6 @@ void test_point_triangle_distance_3d()
const geode::Point3D q10{ { 0.75, 0.25, 10.0 } };
std::tie( distance, closest_point ) =
geode::point_triangle_distance( q10, triangle3D );
SDEBUG( closest_point );
DEBUG( distance );
const geode::Point3D result_q10{ { 0.75, 0.25, 0.0 } };
OPENGEODE_EXCEPTION( std::fabs( distance - 10 ) < geode::global_epsilon
&& closest_point == result_q10,
Expand All @@ -313,54 +311,38 @@ void test_point_triangle_distance_3d()
const geode::Point3D q11{ { 2.0, 0.5, 0.0 } };
std::tie( distance, closest_point ) =
geode::point_triangle_distance( q11, triangle3D );
SDEBUG( closest_point );
DEBUG( distance );
const geode::Point3D result_q11{ { 1.0, 0.5, 0.0 } };
OPENGEODE_EXCEPTION( std::fabs( distance - 1 ) < geode::global_epsilon
&& closest_point == result_q11,
"[Test] Wrong result for point_triangle_distance with query Point3D "
"q11" );

DEBUG( "======" );
const geode::Point3D q12{ { -1.0, 2.0, 0.0 } };
std::tie( distance, closest_point ) =
geode::point_triangle_distance( q12, triangle3D );
SDEBUG( closest_point );
DEBUG( distance );
DEBUG( std::sqrt( 1.5 * 1.5 * 2 ) );
const geode::Point3D result_q12{ { 0.5, 0.5, 0.0 } };
OPENGEODE_EXCEPTION(
distance == std::sqrt( 1.5 * 1.5 * 2 ) && closest_point == result_q12,
"[Test] Wrong result for point_triangle_distance with query Point3D "
"q12" );

DEBUG( "======" );
const geode::Point3D q13{ { -2.0, 1.0, 0.0 } };
std::tie( distance, closest_point ) =
geode::point_triangle_distance( q13, triangle3D );
SDEBUG( closest_point );
DEBUG( distance );
// const geode::Point3D result_q12{ { 1.0, 0.5, 0.0 } };
OPENGEODE_EXCEPTION(
std::fabs( distance - std::sqrt( 5 ) ) < geode::global_epsilon
&& closest_point == a,
"[Test] Wrong result for point_triangle_distance with query Point3D "
"q13" );

DEBUG( "=====" );
const geode::Point3D q14{ { 0.5, 2.0, 0.0 } };
std::tie( distance, closest_point ) =
geode::point_triangle_distance( q14, triangle3D );
SDEBUG( closest_point );
DEBUG( distance );
// const geode::Point3D result_q12{ { 1.0, 0.5, 0.0 } };
OPENGEODE_EXCEPTION(
std::fabs( distance - std::sqrt( 1.25 ) ) < geode::global_epsilon
&& closest_point == c,
"[Test] Wrong result for point_triangle_distance with query Point3D "
"q13" );

// exit( 1 );
}

void test_point_triangle_distance()
Expand Down

0 comments on commit c617cdb

Please sign in to comment.