Subject: CGAL users discussion list
List archive
Re: Re: [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?
Chronological Thread
- From: "Laurent Rineau (CGAL/GeometryFactory)" <>
- To:
- Subject: Re: Re: [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?
- Date: Mon, 18 Feb 2013 16:53:10 +0100
- Organization: GeometryFactory
Le vendredi 08 février 2013 11:41:11 Jeffrey Bush a écrit :
> I was hoping to do something while still using doubles, which is why I went
> for Exact_predicates_inexact_constructions_kernel. I just tried
> Exact_predicates_exact_**constructions_kernel like you suggested, but I get
> the following exception:
>
> CGAL error: assertion violation!
> Expression : !(i>s)
> File : C:\CGAL\CGAL-4.1\include\CGAL/Interval_nt.h
> Line : 90
> Explanation: Variable used before being initialized (or CGAL bug)
> Refer to the bug-reporting instructions at
> http://www.cgal.org/bug_report.html
>
> The stack trace is:
> CrossSectionCGAL.exe!CGAL::Interval_nt<0>::Interval_nt<0>(double i,
> double s) Line 94 C++
[...]
> CrossSectionCGAL.exe!CGAL::Polyhedron_3<CGAL::Epeck,CGAL::Polyhedron_items_
> 3,CGAL::HalfedgeDS_default,std::allocator<int>
> >::inside_out_geometry(CGAL::Boolean_tag<1> __formal) Line 1474 C++
> >
> > CrossSectionCGAL.exe!CGAL::Polyhedron_3<CGAL::Epeck,CGAL::Polyhedron_items
> > _3,CGAL::HalfedgeDS_default,std::allocator<int>>
> >::inside_out() Line 1482 C++
Hi Jeff,
I have understood what happened to you. The most common instanciation of the
Polyhedron_3 template has a member in each facet to store the equation of the
plane of the facet. *But* that plane is not initialized. See for example the
following section of the manual for a way to initialize the planes.
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Polyhedron/Chapter_main.html#Subsection_25.3.4
As your stack trace shows, you call the function Polyhedron_3::inside_out().
That function is "smart" enough to take care of the planes that are stores in
the facets of the polyhedron. But those planes are not initialized!
When the kernel of the polyhedron is
CGAL::Exact_predicates_exact_constructions_kernel, then the number type is a
special representation (called CGAL::Lazy_exact_nt that carries among other
things an approximation of the number, as an interval (a CGAL::Interval_nt).
In the case of the uninitialized planes, the numbers stores in the planes are
the non-initialized ones. And a non-initialized CGAL::Interval_nt object is a
non-valid (empty) interval [1, 0]. In the computation, there is a check that
the interval is valid, and that is that check that fails, at line 90 of
<CGAL/Interval_nt.h>.
I will discuss with other CGAL developers, to decide if that is a bug we can
deal with.
Anyway, in your case, I would recommend that you use
CGAL::Exact_predicates_inexact_constructions, and do not expect that the
compute intersection is exactly on the the plane.
--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/
- [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?, Jeffrey Bush, 02/08/2013
- Re: [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?, Sebastien Loriot (GeometryFactory), 02/08/2013
- Re: [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?, Jeffrey Bush, 02/08/2013
- Re: [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?, Sebastien Loriot (GeometryFactory), 02/11/2013
- Re: Re: [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?, Laurent Rineau (CGAL/GeometryFactory), 02/18/2013
- Re: [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?, Jeffrey Bush, 02/08/2013
- Re: [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?, Laurent Rineau (CGAL/GeometryFactory), 02/18/2013
- Re: [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?, Sebastien Loriot (GeometryFactory), 02/08/2013
Archive powered by MHonArc 2.6.18.