0
저는 CGAL의 Constrained Delaunay Triangulation을 사용하여 2D 폴리곤을 삼각 측량하려고합니다. 그러나이 프로그램은이 런타임 오류를 일으키고 있습니다.CGAL :: Constrained_Delaunay_triangulation_2를 사용하여 폴리곤 삼각 측량
~ what() : CGAL 오류 : 선행 조건 위반! EXPR! VAA = VBB 파일 : /usr/include/CGAL/Constrained_triangulation_2.h 라인이 :. 463이 프로그램은 예기치 않게 완료 ~
누군가이 될 수있는 것을 알고 있나요?
이것은 CPP 파일입니다
void CTriangulation3D::loadFeaturePoints(std::list<Point3DTexturable*> tlist){
//Loads Triangulation from points of tlist (closed polygon with no hole)
std::list<Point3DTexturable*>::iterator it;
Point3DTexturable *q;
for (it = tlist.begin(); it != tlist.end() ; it++){
q = *it;
polygon.push_back(CPoint(q->getX(), q->getZ()));
}
if (polygon.is_empty()) return;
//Tries to load triangulation and close a polygon using insert_constraint. Runtime error appears on the first call to insert_constraints
CVertex_handle v_prev = T.insert(*CGAL::cpp11::prev(polygon.vertices_end()));
for (Polygon_2::Vertex_iterator vit = polygon.vertices_begin(); vit != polygon.vertices_end(); ++vit){
CVertex_handle vh = T.insert(*vit);
T.insert_constraint(vh,v_prev);
v_prev=vh;
}
}
다음은 선언하고, 또한 부정확 한 구조로하고 정확한 조건
#ifndef CTRIANGULATION3D_H
#define CTRIANGULATION3D_H
#include "Point3DTexturable.h"
#include "Triangle.h"
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_face_base_with_info_2.h>
#include <CGAL/Triangulation_hierarchy_2.h>
#include <CGAL/Polygon_2.h>
#include <iostream>
typedef CGAL::Exact_predicates_exact_constructions_kernel Ke;
typedef CGAL::Triangulation_vertex_base_with_info_2<double,Ke> Vbc;
typedef CGAL::Triangulation_hierarchy_vertex_base_2<Vbc> Vbhc;
typedef CGAL::Constrained_triangulation_face_base_2<Ke> Fb;
typedef CGAL::Triangulation_data_structure_2<Vbhc,Fb> TDS;
typedef CGAL::Exact_intersections_tag Itag;
typedef CGAL::Constrained_Delaunay_triangulation_2<Ke, TDS, Itag> CDT;
typedef CGAL::Triangulation_hierarchy_2<CDT> Dhh;
typedef CDT::Point CPoint;
typedef Dhh::Finite_faces_iterator CFinite_faces_iterator;
typedef Dhh::Vertex_handle CVertex_handle;
typedef Dhh::Face_handle CFace_handle;
typedef CGAL::Polygon_2<Ke> Polygon_2;
class CTriangulation3D{
public:
Dhh T;
std::list<double> lheight;
std::list<Triangle> triangles;
Polygon_2 polygon;
CTriangulation3D(std::list<Point3DTexturable*> tlist);
std::list<Triangle*> getTriangleList();
void loadIterationTriangulation();
void loadFeaturePoints(std::list<Point3DTexturable*> tlist);
};
#endif // CTRIANGULATION3D_H
감사와 시도!
실제로 첫 번째 제약 조건을 표시 할 때 오류가 발생합니다. – user3666771
동일한 끝 점이있는 제약 조건을 삽입하려고한다는 메시지가 표시됩니다. 즉, 꼭짓점이 동일합니다. – sloriot