That bug has been detected by a warning:
https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-4.10-Ic-16/Intersections_3/TestReport_lrineau_Ubuntu-latest-GCC6-CXX1z.gz
```
/mnt/testsuite/include/CGAL/Intersections_3/intersection_3_1_impl.h: In function 'typename CGAL::Intersection_traits<K, typename K::Plane_3, typename K::Segment_3>::result_type CGAL::internal::intersection(const typename K::Plane_3&, const typename K::Segment_3&, const K&) [with K = CGAL::Simple_cartesian<CGAL::Gmpq>]':
/mnt/testsuite/include/CGAL/Intersections_3/intersection_3_1_impl.h:1105:13: warning: this statement may fall through [-Wimplicit-fallthrough]
}
^
/mnt/testsuite/include/CGAL/Intersections_3/intersection_3_1_impl.h:1107:9: note: here
case ON_NEGATIVE_SIDE:
^~~~
/mnt/testsuite/include/CGAL/Intersections_3/intersection_3_1_impl.h:1071:9: warning: this statement may fall through [-Wimplicit-fallthrough]
switch (target_side) {
^~~~~~
/mnt/testsuite/include/CGAL/Intersections_3/intersection_3_1_impl.h:1090:5: note: here
case ON_NEGATIVE_SIDE:
^~~~
```
Now, the incorrect fallthrough is replaced by the return of the empty
set.
The warning was:
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:353:9: warning: variable 'b' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if( (px == qx) || // <=> (dmin == 0)
^~~~~~~~~~
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:408:12: note: in instantiation of function template specialization 'CGAL::internal::do_intersect_bbox_segment_aux<float, true, true, false>' requested here
return do_intersect_bbox_segment_aux<FT, true, true, false>(
^
[...]/include/CGAL/Kernel/function_objects.h:2052:14: note: in instantiation of function template specialization 'CGAL::internal::do_intersect<CGAL::Simple_cartesian<float> >' requested here
{ return internal::do_intersect(t1, t2, K()); }
^
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:428:10: note: in instantiation of function template specialization 'CGAL::CommonKernelFunctors::Do_intersect_3<CGAL::Simple_cartesian<float> >::operator()<CGAL::Segment_3<CGAL::Simple_cartesian<float>>, CGAL::Bbox_3>' requested here
return typename K::Do_intersect_3()(segment, bbox);
^
[...]/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/test/Intersections_3/bbox_other_do_intersect_test.cpp:67:12: note: in instantiation of function template specialization 'CGAL::do_intersect<CGAL::Simple_cartesian<float> >' requested here
bool b = CGAL::do_intersect(t,bbox);
^
[...]/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/test/Intersections_3/bbox_other_do_intersect_test.cpp:416:12: note: in instantiation of function template specialization 'test_aux<CGAL::Segment_3<CGAL::Simple_cartesian<float>> >' requested here
bool b = test_aux(s12,"s12",bbox,false);
^
[...]/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/test/Intersections_3/bbox_other_do_intersect_test.cpp:665:12: note: in instantiation of function template specialization 'test<CGAL::Simple_cartesian<float> >' requested here
bool b = test<K>(exact_predicates) &&
^
[...]/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/test/Intersections_3/bbox_other_do_intersect_test.cpp:678:7: note: in instantiation of function template specialization 'test_kernel<CGAL::Simple_cartesian<float> >' requested here
b = test_kernel<CGAL::Simple_cartesian<float> >(false);
^
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:360:25: note: uninitialized use occurs here
if(is_indeterminate(b)) return b; // Note that the default-constructed
^
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:353:9: note: remove the '||' if its condition is always false
if( (px == qx) || // <=> (dmin == 0)
^~~~~~~~~~~~~
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:351:23: note: initialize the variable 'b' to silence this warning
Is_greater_value b;
^
= false
AABB_tree documentation, Intersections_3 and Arrangement_on_surface_2.
The merge also introduced a regression for a bug fixed in R68387 which
fixed a bug in Triangle_3 Segment_3 intersections. The relevant
testcase is in triangle_other_intersection_test.cpp.
to be able to known whether the endpoint of the ray lies inside the
plane of the triangle. The running time is the public do_intersect function
should remain the same.
When FT is Interval_nt, it is better that the
Do_intersect_bbox_segment_aux_is_greater returns a Uncertain<bool> instead
of a bool. That can delay the conversion of Uncertain<bool> to bool, and
hence better perf.
Followup to previous commit.
I have managed to transform most of the tests to simple comparison of input
coordinates. That will ease the writing of static filters. Only six
determinant signs have to be exactly determined.
Freie Universitaet Berlin (Germany), Martin-Luther-University Halle-Wittenberg
(Germany) and RISC Linz (Austria) as they transfer the copyright to other
sites.
created at r56349 and last modifications at r56671
modification in r56464 requires that the function point() of triangle returns a const ref
to the triangle point. This has already been done in the trunk at r56954.
Details:
*For Bbox_3 plane_3 intersection:
For floating point arithmetic everything is ok,
but in the presence of floating point filters
things start getting slightly more complicated.
The supporting plane/bbox test uses
the orientation of the normal of the plane
for finding two corners of the cube for a
sidedness test.
For planes parallel to the xy, xz, yz plane
this immediatly leads to problems.
We introduce CGAL::Uncertain, etc in order
to avoid switching to an exact arithmetic
as long as possible.
*For Bbox_3 triangle_3:
Idem. Fine with floating point or exact type
but get into troubles with interval arithmetic when one
triangle boundary is collinear with an axis.
Remember that the implementation is based on the
separating axis theorem. Amongst axis tested, the
one discribed by the cross product of the triangle boundary
and the bbox boundary is tested. In the case they are collinear
this directly fail.
To handle this we added a small part testing whether the triangle
has one boundary collinear to an axis to avoid this situation.
Also, The "underlying" code has been factorized using the swap function.
and update accordingly include directives. Update testsuite
remove unneed CMakeLists.txt from AABBtree testsuite
Remove Triangle_3_Plane_3 intersection from AABB_tree (I define it in Intersections_3 some days ago, thus a conflict)
in the case when the segment is coplanar with the triangle plane
and the segment is on the supporting line of one triangle segments.
The case when the intersection is reduced to a point was not handled.
by namespace CGAL { and } //namespace CGAL. in all .h and .cpp files
in a directory.
Apply it to all packages in the trunk
Remove macro definition from the config.h file.
- Use K::Bool_type, K::Orientation... instead of bool, CGAL::Orientation...
- More functions around Uncertain<> : make_certain(), extract_singleton(),
possible conversions tightenning.
Many conversions still remain, e.g. for switch and if statements, &&, ||...