void ConstraintDelaunayTriangulation::getTriangles( TriangulatedSurface& triangulatedSurface, bool filterExteriorParts ) const { triangulatedSurface.reserve( triangulatedSurface.numTriangles() + numTriangles() ); for ( Finite_faces_iterator it = finite_faces_begin(); it != finite_faces_end(); ++it ) { if ( filterExteriorParts && ( it->info().nestingLevel % 2 == 0 ) ) { continue ; } const Coordinate& a = it->vertex( 0 )->info().original ; const Coordinate& b = it->vertex( 1 )->info().original ; const Coordinate& c = it->vertex( 2 )->info().original ; // check that vertex has an original vertex if ( a.isEmpty() || b.isEmpty() || c.isEmpty() ) { BOOST_THROW_EXCEPTION( Exception( ( boost::format( "Can't convert Triangulation to TriangulatedSurface (constraint intersection found)" ) ).str() ) ) ; } triangulatedSurface.addTriangle( new Triangle( Point( a ), Point( b ), Point( c ) ) ); } }
TriangulatedSurface ConsistentOrientationBuilder::buildTriangulatedSurface() { _makeOrientationConsistent() ; TriangulatedSurface triangulatedSurface ; for ( size_t i = 0; i < numTriangles(); i++ ) { triangulatedSurface.addTriangle( triangleN( i ) ); } return triangulatedSurface ; }
void triangulatePolygon3D( const Triangle& triangle, TriangulatedSurface& triangulatedSurface ) { /* * filter empty polygon */ if ( triangle.isEmpty() ) { return ; } triangulatedSurface.addTriangle( triangle ) ; }