Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] precondition violation when intersecting a line with a sphere
Chronological Thread
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] precondition violation when intersecting a line with a sphere
- Date: Thu, 12 May 2011 19:45:55 +0200
Algebraic_kernel_for_spheres_2_3<int>
should be Algebraic_kernel_for_spheres_2_3<double>
You also should consider using an exact type.
Please read:
http://www.cgal.org/FAQ.html#inexact_NT
yanyajie wrote:
> Hi,
>
> I encounterd a precondition violation error when I was trying to find
> the intersection between a line and a sphere.
> -----------------------------------------------------------------------------------
> CGAL error: precondition violation!
> Expression : !p.degenerated()
> File :
> d:\codes\lib\cgal-3.7\include\cgal\algebraic_kernel_for_spheres\int
> ernal_functions_on_roots_and_polynomial_1_3_and_2_3.h
> Line : 212
> Explanation:
> Refer to the bug-reporting instructions at
> http://www.cgal.org/bug_report.html
> -------------------------------------------------------------------------------------
>
> I provide necessary info in the following to help reproduce the error:
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------
> typedef CGAL::Cartesian<double> K;
> typedef CGAL::Spherical_kernel_3<K,
> CGAL::Algebraic_kernel_for_spheres_2_3<int> > SphericalK;
> typedef SphericalK::Point_3 Point_3_SK;
>
> // to compute the intersection, I construct a line and a sphere using
> the spherical kernel as follows:
> CGAL::Line_3<SphericalK> line(Point_3_SK(-0.1,-0.1,-0.1),
> Point_3_SK(-0.1,-0.1,0.0));
> CGAL::Sphere_3<SphericalK> s(Point_3_SK(0, 0, 0), 0.1); // c is a Point_3
> vector<CGAL::Object> isecs;
> CGAL::intersection(line, s, std::back_inserter(isecs));
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
> The assertion error is issued from within CGAL::intersection, when it
> tries to do the confirmation,
> actually, from this function:
>
> template < class AK, class OutputIterator >
> inline
> OutputIterator
> solve(const typename AK::Polynomials_for_line_3 &p,
> const typename AK::Polynomial_for_spheres_2_3& s,
> OutputIterator res )
> {
> ...
> // we must have a line
> CGAL_kernel_precondition(!p.degenerated());
> ...
> }
>
>
> Does this failure of assertion indicates I constructed a degenerate
> line? But from the code you can see the line should be non-degenerate.
>
> Thanks if anyone can point out the problem!
>
>
> Yan.
- [cgal-discuss] precondition violation when intersecting a line with a sphere, yanyajie, 05/12/2011
- Re: [cgal-discuss] precondition violation when intersecting a line with a sphere, Sebastien Loriot (GeometryFactory), 05/12/2011
- Re: [cgal-discuss] precondition violation when intersecting a line with a sphere, yanyajie, 05/13/2011
- Re: [cgal-discuss] precondition violation when intersecting a line with a sphere, yanyajie, 05/13/2011
- Re: [cgal-discuss] precondition violation when intersecting a line with a sphere, Sebastien Loriot (GeometryFactory), 05/13/2011
- Re: [cgal-discuss] precondition violation when intersecting a line with a sphere, yanyajie, 05/13/2011
- Re: [cgal-discuss] precondition violation when intersecting a line with a sphere, yanyajie, 05/13/2011
- Re: [cgal-discuss] precondition violation when intersecting a line with a sphere, Sebastien Loriot (GeometryFactory), 05/12/2011
Archive powered by MHonArc 2.6.16.