// call vertex, facet, and edge drop methods on input Triangle t bool MillingCutter::dropCutter(CLPoint &cl, const Triangle &t) const { bool facet, vertex, edge; /* // alternative ordering of the tests: if (cl.below(t)) vertexDrop(cl,t); // optimisation: if we are now above the triangle we don't need facet and edge if ( cl.below(t) ) { facetDrop(cl,t); edgeDrop(cl,t); }*/ if (cl.below(t)) { facet = facetDrop(cl,t); if (!facet) { vertex = vertexDrop(cl,t); if ( cl.below(t) ) { edge = edgeDrop(cl,t); } } } return ( facet || vertex || edge ); }
// call vertex, facet, and edge drop methods on input Triangle t bool MillingCutter::dropCutter(CLPoint &cl, const Triangle &t) const { bool facet, vertex, edge; /* // alternative ordering of the tests: if (cl.below(t)) vertexDrop(cl,t); // optimisation: if we are now above the triangle we don't need facet and edge if ( cl.below(t) ) { facetDrop(cl,t); edgeDrop(cl,t); }*/ if (cl.below(t)) { facet = facetDrop(cl,t); // if we make contact with the facet... if (!facet) { // ...then we will not hit an edge/vertex, so don't check for that vertex = vertexDrop(cl,t); if ( cl.below(t) ) { edge = edgeDrop(cl,t); } } } return ( facet || vertex || edge ); }
// use OpenMP to share work between threads void PointDropCutter::pointDropCutter1(CLPoint& clp) { nCalls = 0; int calls=0; std::list<Triangle>* tris; //tris=new std::list<Triangle>(); tris = root->search_cutter_overlap( cutter, &clp ); std::list<Triangle>::iterator it; for( it=tris->begin(); it!=tris->end() ; ++it) { // loop over found triangles if ( cutter->overlaps(clp,*it) ) { // cutter overlap triangle? check if (clp.below(*it)) { cutter->dropCutter(clp,*it); ++calls; } } } delete( tris ); nCalls = calls; return; }