- add the extra height nodes to the cgal triangulation
- enable cgal triangulation
This commit is contained in:
parent
f3da89af8a
commit
85ad4573ec
2 changed files with 12 additions and 5 deletions
|
@ -51,8 +51,7 @@
|
|||
|
||||
using std::string;
|
||||
|
||||
//double gSnap = 0.00000001; // approx 1 mm
|
||||
double gSnap = 0.0000002; // approx 2 cm
|
||||
double gSnap = 0.00000001; // approx 1 mm
|
||||
|
||||
static const double cover_size = 1.0 / 120.0;
|
||||
static const double half_cover_size = cover_size * 0.5;
|
||||
|
@ -1853,7 +1852,7 @@ void TGConstruct::TesselatePolys( void )
|
|||
": id = " << id );
|
||||
|
||||
// TGPolygon tri = polygon_tesselate_alt_with_extra( poly, poly_extra, false );
|
||||
TGPolygon tri = polygon_tesselate_alt_with_extra( poly, poly_extra, false );
|
||||
TGPolygon tri = polygon_tesselate_alt_with_extra_cgal( poly, poly_extra, false );
|
||||
|
||||
// ensure all added nodes are accounted for
|
||||
for (int k=0; k< tri.contours(); k++) {
|
||||
|
|
|
@ -114,7 +114,15 @@ TGPolygon polygon_tesselate_alt_with_extra_cgal( TGPolygon &p, const point_list&
|
|||
return result;
|
||||
}
|
||||
|
||||
// insert each polygon into the triangulation
|
||||
// First, insert the extra points
|
||||
std::vector<Point> points;
|
||||
points.reserve(extra_nodes.size());
|
||||
for (unsigned int n = 0; n < extra_nodes.size(); n++) {
|
||||
points.push_back( Point(extra_nodes[n].x(), extra_nodes[n].y()) );
|
||||
}
|
||||
cdt.insert(points.begin(), points.end());
|
||||
|
||||
// then insert each polygon as a constraint into the triangulation
|
||||
for (int c = 0; c < p.contours(); c++) {
|
||||
point_list contour = p.get_contour( c );
|
||||
Polygon_2 poly;
|
||||
|
|
Loading…
Reference in a new issue