- xmin = xmax = nodes[n1][0];
- ymin = ymax = nodes[n1][1];
- zmin = zmax = nodes[n1][2];
-
- if ( nodes[n2][0] < xmin ) { xmin = nodes[n2][0]; }
- if ( nodes[n2][0] > xmax ) { xmax = nodes[n2][0]; }
- if ( nodes[n2][1] < ymin ) { ymin = nodes[n2][1]; }
- if ( nodes[n2][1] > ymax ) { ymax = nodes[n2][1]; }
- if ( nodes[n2][2] < zmin ) { zmin = nodes[n2][2]; }
- if ( nodes[n2][2] > zmax ) { zmax = nodes[n2][2]; }
-
- if ( nodes[n3][0] < xmin ) { xmin = nodes[n3][0]; }
- if ( nodes[n3][0] > xmax ) { xmax = nodes[n3][0]; }
- if ( nodes[n3][1] < ymin ) { ymin = nodes[n3][1]; }
- if ( nodes[n3][1] > ymax ) { ymax = nodes[n3][1]; }
- if ( nodes[n3][2] < zmin ) { zmin = nodes[n3][2]; }
- if ( nodes[n3][2] > zmax ) { zmax = nodes[n3][2]; }
-
- x = (xmin + xmax) / 2.0;
- y = (ymin + ymax) / 2.0;
- z = (zmin + zmax) / 2.0;
+ xmin = xmax = nodes[n1].x();
+ ymin = ymax = nodes[n1].y();
+ zmin = zmax = nodes[n1].z();
+
+ if ( nodes[n2].x() < xmin ) { xmin = nodes[n2].x(); }
+ if ( nodes[n2].x() > xmax ) { xmax = nodes[n2].x(); }
+ if ( nodes[n2].y() < ymin ) { ymin = nodes[n2].y(); }
+ if ( nodes[n2].y() > ymax ) { ymax = nodes[n2].y(); }
+ if ( nodes[n2].z() < zmin ) { zmin = nodes[n2].z(); }
+ if ( nodes[n2].z() > zmax ) { zmax = nodes[n2].z(); }
+
+ if ( nodes[n3].x() < xmin ) { xmin = nodes[n3].x(); }
+ if ( nodes[n3].x() > xmax ) { xmax = nodes[n3].x(); }
+ if ( nodes[n3].y() < ymin ) { ymin = nodes[n3].y(); }
+ if ( nodes[n3].y() > ymax ) { ymax = nodes[n3].y(); }
+ if ( nodes[n3].z() < zmin ) { zmin = nodes[n3].z(); }
+ if ( nodes[n3].z() > zmax ) { zmax = nodes[n3].z(); }
+
+ p = Point3D( (xmin + xmax) / 2.0,
+ (ymin + ymax) / 2.0,
+ (zmin + zmax) / 2.0 );