#include ".\jitteringstlsdfable.h" using namespace SDF; JitteringStlSdfAble::~JitteringStlSdfAble(void) { if(this->jit != NULL) { delete this->jit; } } SdfValue JitteringStlSdfAble::calc_sdf_from_pt( const Point &from ) const { //--------------------------------- // First, try the given from-point //--------------------------------- SdfValue sdf = StlSdfAble::calc_sdf_from_pt(from); //--------------------------------- // But if we can't classify this one accurately, it's time to jitter! //--------------------------------- while(sdf.dist_class == SDF::DONT_KNOW) { // Jitter the point and try again const Point &jitd = this->jit->jitter(from); //__LOG__("got DK for sdf: " << sdf); //__LOG__("jittering point " << from << " into " << jitd ); cout << "."; sdf = StlSdfAble::calc_sdf_from_pt(jitd); } return sdf; }