Skip to Content.
Sympa Menu

cgal-discuss - Polytope_distance_d error

Subject: CGAL users discussion list

List archive

Polytope_distance_d error


Chronological Thread 
  • From: MiTcX <>
  • To:
  • Subject: Polytope_distance_d error
  • Date: Sat, 09 Jun 2007 17:53:35 +0200

hi all,

i've a little problem when i try to compute the Polytope_distance_d
between two polygons.
here is my code :

struct Kernel : public CGAL::Cartesian<float> {};
typedef CGAL::Optimisation_d_traits_2<Kernel>
TraitsPolytope;
typedef CGAL::Polytope_distance_d<TraitsPolytope>
Polytope_distance;
typedef Kernel::Point_2
Point_2;
typedef CGAL::Polygon_2<Kernel>
Polygon_2;


Polygon_2 p;
p.push_back(Point_2(444,607));
p.push_back(Point_2(445,97));
p.push_back(Point_2(448,92));
p.push_back(Point_2(449,610));
Polygon_2 p1;
p1.push_back(Point_2(212,91));
p1.push_back(Point_2(448,92));
p1.push_back(Point_2(445,97));
p1.push_back(Point_2(213,96));

Polytope_distance dist2(p.vertices_begin(),
p.vertices_end(),p1.vertices_begin(),p1.vertices_end());

std::cout<< "dist : "<<dist2.squared_distance()<<std::endl;

very simple, but i get this after execution :

| col=1 )
.....
basis-inverse check: failed ( row=4 | col=3 )
CGAL error: assertion violation!
Expr: nu <= et0
File: /usr/include/CGAL/QP_solver.h
Line: 1603
Explanation:nu <= et0 violated -- is your D matrix positive semidefinite?
*** Process aborted ***


i check my polygons, but they are convex... i don't understand the
problem, do i use the good way to compute this distance ?
thank's

Julien.



Archive powered by MHonArc 2.6.16.

Top of Page