Make the point computation more CGAL like

This commit is contained in:
Le-Jeng Shiue 2006-03-08 06:10:58 +00:00
parent 204495706b
commit 5b35530823
1 changed files with 8 additions and 9 deletions

View File

@ -87,13 +87,12 @@ public:
void facet_node(Facet_handle facet, Point& pt) { void facet_node(Facet_handle facet, Point& pt) {
Halfedge_around_facet_circulator hcir = facet->facet_begin(); Halfedge_around_facet_circulator hcir = facet->facet_begin();
int n = 0; int n = 0;
FT p[] = {0,0,0}; Point p(0,0,0);
do { do {
Point t = hcir->vertex()->point(); p = p + (hcir->vertex()->point() - ORIGIN);
p[0] += t[0], p[1] += t[1], p[2] += t[2];
++n; ++n;
} while (++hcir != facet->facet_begin()); } while (++hcir != facet->facet_begin());
pt = Point(p[0]/n, p[1]/n, p[2]/n); pt = ORIGIN + (p - ORIGIN)/FT(n);
} }
// //
void edge_node(Halfedge_handle edge, Point& pt) { void edge_node(Halfedge_handle edge, Point& pt) {