Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Bug with the plane function has_on?
- Date: Wed, 1 Apr 2020 18:33:32 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:n1BY4BUJUbO4KszagGisNY8kqLfV8LGtZVwlr6E/grcLSJyIuqrYZR2Pt8tkgFKBZ4jH8fUM07OQ6P+wHzFYqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aLDykalEwfri9WtOKzpf/6+fn8JLaZ0BEhSG2fKhpBBSwtwTY8McM0qV4LaNkgCDEqHJTZ+VbwytMIkiSmAq0pui9+5tu7z5Blfsq68laQOSwN/AjSbtCDTM6dWUxzMLuvBjHCwCI4y1PAS0tjhNUDl2dv1nBVZDrv36n7rMhihnfBtX/SPUPYRrn971iEUa6hyIONjp/+2bS2JQp0fBr5Sm5rhk6+Lb6JYGYMP0kI/HYdNIeAHVbB4NfC3EHDYS7YI8CSeEGOLQA9tivlx41tRK7QDKUKqbqwz5MiGXx2PRjgeskGADCmgcnGoBXvQ==
You have to use a kernel with exact predicates like CGAL::Exact_predicates_inexact_constructions_kernel instead of CGAL::Simple_cartesian<double>.
More details why here:
https://www.cgal.org/FAQ.html#inexact_NT
Sebastien.
On 4/1/20 6:11 PM, xiaojin wrote:
In my program, I have
#include <CGAL/Simple_cartesian.h>
typedef CGAL::Simple_cartesian<double> K;
typedef K::FT FT;
typedef K::Ray_3 Ray;
typedef K::Line_3 Line;
typedef K::Point_3 Point;
typedef K::Segment_3 Segment;
typedef K::Triangle_3 Triangle;
typedef K::Plane_3 Plane;
#include <QMainWindow>
int main(int argc, char *argv[])
{
Point p0(0.103835, -0.0921626, -2.2133);
Point p1(0.165068, -0.0411001, -2.28194);
Point p2(0.0954547, -0.0170658, -2.23422);
Plane plane(p0, p1, p2);
std::cout << plane.has_on(p0) << std::endl;
std::cout << plane.has_on(p1) << std::endl;
std::cout << plane.has_on(p2) << std::endl;
}
the result is
0
1
1
but the correct result should be:
1
1
1
And is I change the Kernel K as
typedef CGAL::Simple_cartesian<float> K
the result is correct.
So what's the problem? Is there a bug?
--
Sent from: http://cgal-discuss.949826.n4.nabble.com/
- [cgal-discuss] Bug with the plane function has_on?, xiaojin, 04/01/2020
- Re: [cgal-discuss] Bug with the plane function has_on?, Sebastien Loriot (GeometryFactory), 04/01/2020
- Re: [cgal-discuss] Bug with the plane function has_on?, xiaojin, 04/01/2020
- Re: [cgal-discuss] Bug with the plane function has_on?, Sebastien Loriot (GeometryFactory), 04/01/2020
- Re: [cgal-discuss] Bug with the plane function has_on?, xiaojin, 04/01/2020
- Re: [cgal-discuss] Bug with the plane function has_on?, Sebastien Loriot (GeometryFactory), 04/01/2020
Archive powered by MHonArc 2.6.18.