Commit Graph

542 Commits

Author SHA1 Message Date
Sébastien Loriot b682c47c56 Merge remote-tracking branch 'cgal/5.5.x-branch' into HEAD 2024-08-26 15:22:53 +02:00
Sebastien Loriot 9dea168da5
Fix for Line_3 Ray_3 do_intersect (#8398)
## Summary of Changes

Some non intersection is wrongfully detected as an intersection for the
Line_3 Ray_3 combination. Here is an illustration:


![image](https://github.com/user-attachments/assets/f18fd662-5ad6-4a01-9a49-a8d0c62cf7fe)

The base code is :
```cpp
  if(!do_intersect(l, r.supporting_line()))
    return false;

  typename K::Coplanar_orientation_3 pred = k.coplanar_orientation_3_object();
  CGAL::Orientation p0p1s = pred(l.point(0), l.point(1), r.source());
  if(p0p1s == COLLINEAR)
    return true;

  CGAL::Orientation stp0 = pred(r.source(), r.second_point(), l.point(0));
  if(stp0 == COLLINEAR)
    return Ray_3_has_on_collinear_Point_3(r,l.point(0),k);

  return (p0p1s != stp0);
```

The supporting line of the ray intersects the line, and then nothing is
collinear, so we check L0,L1,R1 vs R0,R1,L0, which are of opposite sign
so there is an intersection... but there is none.

This check is very similar to what is done in Ray_3-Ray_3, where it is
correct.

I did a naive fix for now: without loss of generality we can go to the
configuration below


![image](https://github.com/user-attachments/assets/5f004941-7f58-4bf3-8416-7dc2144a891f)

and so we have an intersection as long as the ray "points" in the other
slab wrt to the line. And so, in coplanar orientation checks, if the
orientation L0,L1,R0 differs from L0, L1, (L0 + (R1-R0)).

I feel like I could probably skip at least a translation by having
something like Coplanar_orientation(P3, P3, P3, V3), and maybe even
more...

## Release Management

* Affected package(s): `Intersections_3`
* Issue(s) solved (if any): -
* Feature/Small Feature (if any): -
* License and copyright ownership: no change
2024-08-26 15:21:21 +02:00
Sébastien Loriot ca2907fbfc avoid creating degenerate planes 2024-08-20 10:09:23 +02:00
Mael Rouxel-Labbé c1e5926e70 Add new Intersection_3 test cases 2024-08-06 10:36:09 +02:00
Mael Rouxel-Labbé 37eb0eaa17 Tentative fix for L3R3 do_intersect 2024-08-06 10:36:02 +02:00
Sébastien Loriot ee1fa58406 Merge remote-tracking branch 'cgal/5.5.x-branch' 2023-12-18 13:31:06 +01:00
Sébastien Loriot 6dca71b428 ease conflict resolution 2023-12-07 10:19:36 +01:00
Sébastien Loriot 2574a13557 restore the optional as it is used by Polyhedral_envelope 2023-12-07 10:12:53 +01:00
Sébastien Loriot d9d2dfc876 remove unused type definition 2023-12-07 09:59:24 +01:00
Sébastien Loriot 0ebc2bee42 remove the optional 2023-12-06 14:17:24 +01:00
Sébastien Loriot 4ecc6671dc increase precision of the result 2023-12-06 12:42:00 +01:00
Laurent Rineau 294f5b7652 Add missing header
CGAL-5.5.x latest test results are completely broken.

https://cgal.geometryfactory.com/CGAL/testsuite/results-5.5.4-I-166.shtml

That is not due to any code change (there was none since the previous testsuite for 5.5.x). The error are due to Boost 1.84. Probably something change in the includes of Boost. The error is about `boost::prior`.  The header `<boost/next_prior.hpp>` must be included.
2023-09-25 10:16:50 +02:00
Laurent Rineau d3cbf432ec Merge pull request #7201 from GilesBathgate/General-remove_boost_lexical_string_cast-GilesBathgate
Replace use of boost::lexical_cast<std::string> with std::to_string
2023-02-02 10:58:17 +01:00
Laurent Rineau be124f5111 Merge pull request #7208 from MaelRL/Intersections_3-Set_but_unused-GF
Fix set-but-not-used warning
2023-02-02 10:58:13 +01:00
Laurent Rineau b42afc582b Merge pull request #7208 from MaelRL/Intersections_3-Set_but_unused-GF
Fix set-but-not-used warning
2023-02-02 10:57:11 +01:00
Laurent Rineau 8a6b583780 Merge pull request #6880 from soesau/PMP-tests_only_for_epeck-soesau
Pmp tests only for epeck
2023-01-27 21:02:26 +01:00
Mael Rouxel-Labbé c17c14ff7a Fix set-but-not-used warning 2023-01-24 10:55:29 +01:00
Giles Bathgate 22b069720a Replace use of lexical_cast<std::string> with std::to_string
use std::prev in Plane_3_Triangle_3_intersection.h do to lack of
implicit header include.
2023-01-15 17:23:04 +00:00
Mael 0ff7882997
Merge branch 'master' into feature/bug_documentation_spell_20221113 2022-12-06 22:21:06 +01:00
Laurent Rineau e8ec440859 Merge branch 'master' into Kernel-Compare_distance_3_RT_FT__always_Filtered_predicate_RT_FT-GF
# Conflicts:
#	STL_Extension/doc/STL_Extension/CGAL/Concurrent_compact_container.h
2022-12-05 14:51:31 +01:00
Laurent Rineau 67b5c791e9 Merge pull request #7075 from MaelRL/CGAL-Fix_some_links-GF
Update some links + https
2022-12-05 12:22:06 +01:00
Laurent Rineau 2f92fdded4 Merge pull request #7082 from MaelRL/Intersections_3-L3_bug-GF
Fix Line_3-Tet_3 intersection test
2022-12-05 12:21:56 +01:00
Laurent Rineau 3135821001 Merge pull request #7082 from MaelRL/Intersections_3-L3_bug-GF
Fix Line_3-Tet_3 intersection test
2022-12-05 11:57:11 +01:00
Mael da0b13699c
Merge branch 'master' into Kernel-Compare_distance_3_RT_FT__always_Filtered_predicate_RT_FT-GF 2022-12-02 23:19:29 +01:00
Mael Rouxel-Labbé 87960efc48 Fix Line_3 Tet_3 intersection test
The construction of the line is only valid if the tet is well oriented
2022-11-24 12:41:05 +01:00
Mael Rouxel-Labbé b5c21e1f5d Http -> https + update some dead links 2022-11-23 18:54:37 +01:00
Mael Rouxel-Labbé 517f4db59d Hide some ifs behind assertion_code macros 2022-11-22 12:35:54 +01:00
Mael Rouxel-Labbé a758101038 Remove some useless includes 2022-11-22 12:35:44 +01:00
Mael Rouxel-Labbé 8ba0b41f51 Drive-by cleaning 2022-11-22 12:35:10 +01:00
Mael Rouxel-Labbé 3a4e230ac7 Do_intersect_23 should return K::Boolean
Returning bool also created an issue because compilers could not figure out
how to convert from Needs_FT<Uncertain<bool> > to bool
2022-11-22 12:22:42 +01:00
albert-github 45478184de spelling corrections
Some spelling corrections (Directories starting with `E`-` L`),
some backward work
some forward work
2022-11-15 13:39:40 +01:00
Sven Oesau cd3d7528ec intersection is only validated for exact construction kernels 2022-10-01 16:08:26 +02:00
Laurent Rineau 743de32052 Merge pull request #6779 from sloriot/Intersections_3-better_tetra_tri
Simpler implementation of Tet vs. Tri intersection
2022-09-13 12:33:08 +02:00
Laurent Rineau 0141404f4d Merge pull request #6809 from lrineau/Filtered_kernel-fix__do_intersect__Bbox_3__Triangle_3__static_filters-GF
Fix static filter of Do_intersect_3(Bbox_3,Triangle_3)
2022-09-13 12:33:03 +02:00
Laurent Rineau 4bc403857d Merge pull request #6779 from sloriot/Intersections_3-better_tetra_tri
Simpler implementation of Tet vs. Tri intersection
2022-09-13 12:32:22 +02:00
Laurent Rineau ad2a07e653 Merge pull request #6809 from lrineau/Filtered_kernel-fix__do_intersect__Bbox_3__Triangle_3__static_filters-GF
Fix static filter of Do_intersect_3(Bbox_3,Triangle_3)
2022-09-13 12:32:20 +02:00
Laurent Rineau e93011ae2a Merge pull request #6779 from sloriot/Intersections_3-better_tetra_tri
Simpler implementation of Tet vs. Tri intersection
2022-09-13 12:31:37 +02:00
Sebastien Loriot d896940470
Cosmetic changes
Co-authored-by: Mael <mael.rouxel.labbe@geometryfactory.com>
2022-09-07 16:08:58 +02:00
Mael Rouxel-Labbé bc9aa692c3 Add a few more tests to Tr-Tet 2022-09-07 16:00:59 +02:00
Sébastien Loriot f0f01b70ba remove trailing whitespace 2022-09-07 08:44:42 +02:00
Andreas Fabri 550e4306c8 Add triangles completelty to the left of the bbox parallel/projection on face inside, projection on face intersects 2022-08-25 13:09:18 +01:00
Laurent Rineau c61e3a978b Fix typo size/side 2022-08-24 16:18:26 +02:00
Sébastien Loriot bf6e2a2929 remove unused typedefs 2022-08-02 07:34:55 +02:00
Sébastien Loriot 77a50cfd7c compute it once 2022-08-02 07:34:55 +02:00
Sébastien Loriot 5d32639dc0 fix comment 2022-08-02 07:34:55 +02:00
Sébastien Loriot 2193551f42 precompute plane vertex indices 2022-08-02 07:34:54 +02:00
Sébastien Loriot eaffbfb886 add new test from issue 2022-08-02 07:34:54 +02:00
Sébastien Loriot 5c10048d3e add a bitset to track planes containing polygon points
used to avoid computing points and use input tetrahedron vertex
+workaound for kernels with inexact constructions
2022-08-02 07:34:54 +02:00
Sébastien Loriot 445be90c04 update triangle (permutation) 2022-08-02 07:34:54 +02:00
Sébastien Loriot bf89c548fd simplify Tetra/triangle intersection computation
Testsuite fails for Kernel with non-exact contructions
2022-08-02 07:34:54 +02:00