Merge pull request #5725 from afabri/Kernel_23-bugfix_for_5522-GF

Kernel_23: Fix Non_zero_dimension
This commit is contained in:
Laurent Rineau 2021-05-27 19:12:07 +02:00
commit 50343e9a5f
2 changed files with 11 additions and 1 deletions

View File

@ -53,7 +53,7 @@ namespace CommonKernelFunctors {
return 0;
} else if(certainly_not(is_zero(vec.y()))){
return 1;
}else if(certainly_not(is_zero(vec.y()))){
}else if(certainly_not(is_zero(vec.z()))){
return 2;
}

View File

@ -27,6 +27,8 @@ _test_fct_vector_3(const R& )
typedef typename R::RT RT;
typedef typename R::FT FT;
typedef typename R::Non_zero_dimension_3 Non_zero_dimension_3;
RT n0( 0 );
RT n1( 12 );
RT n2( -4 );
@ -43,6 +45,8 @@ _test_fct_vector_3(const R& )
CGAL::Vector_3<R> v0(CGAL::NULL_VECTOR); // ( 0, 0, 0)
CGAL::Vector_3<R> v001(n0,n0,n1); // ( 0, 0, 12)
CGAL::Vector_3<R> v011(n0,n1,n1); // ( 0, 12, 12)
CGAL::Vector_3<R> v1(n1, n2, n3, n4); // ( 6,-2, 3)
CGAL::Vector_3<R> v2(n5, n6, n7, n8); // ( 3,-6,12)
CGAL::Vector_3<R> v3(n5, n10, n9); // ( 9,-8,15)
@ -53,6 +57,12 @@ _test_fct_vector_3(const R& )
CGAL::Vector_3<R> v11(-n6, n11,-n12, n8);// ( 6, 8, -18)
CGAL::Vector_3<R> v12(n1, n2, -n3, n4); // ( 6,-2, -3)
Non_zero_dimension_3 nzd;
assert( nzd(v0) == -1 );
assert( nzd(v001) == 2 );
assert( nzd(v011) == 1 );
assert( nzd(v1) == 0 );
assert( orientation(v0, v0, v0) == CGAL::COPLANAR );
assert( orientation(v1, v1, v1) == CGAL::COPLANAR );
assert( orientation(v1, v1, v2) == CGAL::COPLANAR );