src/Utilities/pointOnPolygon.cc
//------------------------------------------------------------------------------
// 3D: Check a polygon as a set of coplanar vertices
//------------------------------------------------------------------------------
Check a polygon as a set of coplanar vertices
Check a polygon as a set of coplanar vertices
bool pointOnPolygon(const Dim<3>::Vector& p,
                    const vector<Dim<3>::Vector>& vertices,
                    const vector<unsigned>& ipoints,
                    const double tol) {
  const unsigned n = ipoints.size();
  for (unsigned i = 0; i < n; ++i) {
    const unsigned j = (i + 1) % n;
    if (between(vertices[ipoints[i]], vertices[ipoints[j]], p, tol)) return true;
  }
  return false;
}
bool pointOnPolygon ( const Dim < 3 > :: Vector & p , const vector < Dim < 3 > :: Vector > & vertices , const vector < unsigned > & ipoints , const double tol ) { const unsigned n = ipoints . size ( ) ; for ( unsigned i = 0 ; i < n ; ++ i ) { const unsigned j = ( i + 1 ) % n ; if ( between ( vertices [ ipoints [ i ] ] , vertices [ ipoints [ j ] ] , p , tol ) ) return true ; } return false ; }
3D: Check a polygon as a set of coplanar vertices
3D : Check a polygon as a set of coplanar vertices