Subject: CGAL users discussion list
List archive
- From: <>
- To: cgal <>
- Subject: [cgal-discuss] Triangulation_3 input
- Date: Sun, 23 Nov 2008 14:17:31 +0000
- Importance: Normal
I'm using Delaunay_triangulation_3 to triangulate points on the surface of a unit sphere. Everything is working as it should, however when I feed this class vectors of unit length (that is, points on the surface) without "perturbing" them slightly (making them randomly slightly longer/shorter), I get CGAL precondition errors. Apparently, it's this one: template < class Gt, class Tds > Oriented_side Delaunay_triangulation_3<Gt,Tds>:: side_of_oriented_sphere(const Point &p0, const Point &p1, const Point &p2, const Point &p3, const Point &p, bool perturb) const { CGAL_triangulation_precondition( orientation(p0, p1, p2, p3) == POSITIVE ); [...] } I've looked in the documentation, and I found this: "returns POSITIVE, if s lies on the positive side of the oriented plane h defined by p, q, and r, returns NEGATIVE if s lies on the negative side of h, and returns COPLANAR if s lies on h." I don't know why exactly this is used however. Can some on explain this to me? I guess I'm getting this error because my input is degenerate? Is there any way to fix this? I'm using the following data structures: #include <CGAL/Simple_cartesian.h> #include <CGAL/Filtered_kernel.h> typedef CGAL::Filtered_kernel<CGAL::Simple_cartesian<float>> KernelFloat; #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> typedef CGAL::Exact_predicates_inexact_constructions_kernel KernelDouble; typedef KernelFloat KernelActive; #include <CGAL/Delaunay_triangulation_3.h> #include <CGAL/Triangulation_hierarchy_3.h> typedef CGAL::Triangulation_vertex_base_3<KernelActive> TVB; typedef CGAL::Triangulation_hierarchy_vertex_base_3<TVB> THVB; typedef CGAL::Triangulation_data_structure_3<THVB> TDS; typedef CGAL::Delaunay_triangulation_3<KernelActive, TDS> DT; typedef CGAL::Triangulation_hierarchy_3<DT> CGAL_Triangulation; typedef CGAL_Triangulation::Point CGAL_Point; typedef CGAL_Triangulation::Vertex_handle CGAL_VertexHandle; typedef CGAL_Triangulation::Finite_vertices_iterator CGAL_FiniteVerticesIter; typedef CGAL_Triangulation::Cell_handle CGAL_CellHandle; And my triangulation code: std::vector<CGAL_Point> pointsOnSphere; Vector3 pointOnUnitSphere; for(int n = 1; n < 61; ++n) { pointOnUnitSphere = MathUtil::getPositionOnUnitSphere_Halton(n) /*hack: * Math::RangeRandom(1, 1.0001)*/; CGAL_Point newPoint(pointOnUnitSphere.x, pointOnUnitSphere.y, pointOnUnitSphere.z); pointsOnSphere.push_back(newPoint); } triangulation.insert(pointsOnSphere.begin(), pointsOnSphere.end()); Thank you, Peter. Weer helemaal in het nieuw! Hotmail… |
- [cgal-discuss] Triangulation_3 input, pgoeleven, 11/23/2008
- Re: [cgal-discuss] Triangulation_3 input, Camille Wormser, 11/23/2008
- RE: [cgal-discuss] Triangulation_3 input, pgoeleven, 11/23/2008
- Re: [cgal-discuss] Triangulation_3 input, Olivier Devillers, 11/23/2008
- RE: [cgal-discuss] Triangulation_3 input, pgoeleven, 11/23/2008
- Re: [cgal-discuss] Triangulation_3 input, Olivier Devillers, 11/23/2008
- RE: [cgal-discuss] Triangulation_3 input, pgoeleven, 11/23/2008
- Re: [cgal-discuss] Triangulation_3 input, Camille Wormser, 11/23/2008
- RE: [cgal-discuss] Triangulation_3 input, pgoeleven, 11/23/2008
- Re: [cgal-discuss] Triangulation_3 input, Camille Wormser, 11/23/2008
- RE: [cgal-discuss] Triangulation_3 input, pgoeleven, 11/23/2008
- Re: [cgal-discuss] Triangulation_3 input, Camille Wormser, 11/23/2008
Archive powered by MHonArc 2.6.16.