d2-sbasis.cpp revision fe0f7ac550d0d5bde816a0f6a6dd346d17dbc84c
#include "d2.h"
/* One would think that we would include d2-sbasis.h, however,
* you cannot actually include it in anything - only d2 may import it.
* This is due to the trickinesses of template submatching. */
namespace Geom {
}
}
}
}
//TODO: Is this sensical? shouldn't it be like pythagorean or something?
}
for(unsigned i = 0; i < x.size(); i++)
return ret;
}
for(unsigned d = 0; d < 2; d++) {
for(unsigned i = 0; i < a.size(); i++)
}
return ret;
}
if (M.empty()) return M;
for (unsigned i=0; i<M.size(); i++){
}
return result;
}
}
return result;
}
for (unsigned i=0; i<a.size(); i++){
}
return result;
}
for (unsigned i = 0; i < a.size(); i++) {
}
return result;
}
/* Replaced by remove_short_cuts in piecewise.h
//this recursively removes the shortest cut interval until none is shorter than tol.
//TODO: code this in a more efficient way!
Piecewise<D2<SBasis> > remove_short_cuts(Piecewise<D2<SBasis> > const &f, double tol){
double min = tol;
unsigned idx = f.size();
for(unsigned i=0; i<f.size(); i++){
idx = int(i);
}
}
if (idx==f.size()){
return f;
}
if (f.size()==1) {
//removing this seg would result in an empty pw<d2<sb>>...
return f;
}
Piecewise<D2<SBasis> > new_f=f;
for (int dim=0; dim<2; dim++){
double v = Hat(f.segs.at(idx)[dim][0]);
//TODO: what about closed curves?
new_f.segs.at(idx-1)[dim][0][1] = v;
new_f.segs.at(idx+1)[dim][0][0] = v;
}
new_f.cuts.at(idx+1) = t;
return remove_short_cuts(new_f, tol);
}
*/
//if tol>0, only force continuity where the jump is smaller than tol.
double tol,
bool closed){
if (f.size()==0) return f;
}
}
}
return result;
}
}