Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Squared distance on AABB tree of CGAL : precondition violation

Subject: CGAL users discussion list

List archive

[cgal-discuss] Squared distance on AABB tree of CGAL : precondition violation


Chronological Thread 
  • From: Zohar <>
  • To:
  • Subject: [cgal-discuss] Squared distance on AABB tree of CGAL : precondition violation
  • Date: Mon, 7 Jul 2014 10:35:24 -0700 (PDT)

I get:

CGAL error: precondition violation!
Expression : (squared_radius >= FT(0)) & (o != COLLINEAR)
File : C:\prj-external-libs\CGAL\include\CGAL/Cartesian/Sphere_3.h
Line : 59

The problem seems to be in AABB_traversal_traits.h:

bool do_intersect(const Point& query, const Node& node) const
{
return m_traits.compare_distance_object()
(query, node.bbox(), m_closest_point) == CGAL::SMALLER;
}

where m_closest_point has NaN coordinates.

My code:
typedef CGAL::Simple_cartesian<double> Enriched_kernel;
typedef CGAL::AABB_face_graph_triangle_primitive<Mesh2> Primitive; //
Mesh2
derives from Polyhedron_3
typedef CGAL::AABB_traits<Mesh2::Kernel, Primitive> AABB_traits;
typedef CGAL::AABB_tree<AABB_traits> Tree;

Tree tree(mesh2->facets_begin(), mesh2->facets_end(), *mesh2);

double dist = sqrt(tree.squared_distance(vi->point())); // vi is a
vertex
in another poly




--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Squared-distance-on-AABB-tree-of-CGAL-precondition-violation-tp4659531.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page