cgal icon indicating copy to clipboard operation
cgal copied to clipboard

Incorrect tetra-tri intersection

Open sloriot opened this issue 3 years ago • 2 comments

Code to reproduce the issue:

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>

typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef K::Point_3 Point_3;
typedef K::Triangle_3 Triangle_3;
typedef K::Tetrahedron_3 Tetrahedron_3;

int main()
{
  Triangle_3 tri(Point_3(0.191630, -0.331630, -0.370000),
                 Point_3(-0.124185, -0.385815, -0.185000),
                 Point_3(-0.0700000, -0.0700000, 0.00000));

  Tetrahedron_3 tet(Point_3(0, -1, 0),
                    Point_3(-1, 0, 0),
                    Point_3(0, 0, 0),
                    Point_3(0, 0, -1));


  auto res = CGAL::intersection(tri,tet);

  assert(res != boost::none);
  const std::vector<Point_3> *vps =
                  boost::get<std::vector<Point_3>>(&*res);
  assert(vps!=nullptr);
}

Screenshot from 2022-08-01 08-21-00

Extracted from that thread on cgal-discuss

sloriot avatar Aug 01 '22 06:08 sloriot

@fdrmrc https://github.com/CGAL/cgal/pull/6779 fixed the issue for me. Could you give it a try and let us know?

sloriot avatar Aug 01 '22 12:08 sloriot

I confirm that this patch fixes my issue! Thanks a lot @sloriot

fdrmrc avatar Aug 01 '22 13:08 fdrmrc

Fixed by the merge of https://github.com/CGAL/cgal/pull/6779.

lrineau avatar Sep 13 '22 10:09 lrineau