Skip to content
Snippets Groups Projects
Commit 785d7b21 authored by Tristan Carrier Baudouin's avatar Tristan Carrier Baudouin
Browse files

Lloyd smoothing

parent 8a0ab49f
No related branches found
No related tags found
No related merge requests found
......@@ -420,9 +420,6 @@ smoothing::smoothing(int param1,int param2){
void smoothing::optimize_face(GFace* gf){
std::set<MVertex*> all;
//do not optimize face if it has a compound
if(gf->getCompound()) return;
// get all the points of the face ...
for (unsigned int i = 0; i < gf->getNumMeshElements(); i++){
MElement *e = gf->getMeshElement(i);
......@@ -603,7 +600,7 @@ void smoothing::optimize_model(){
for(it=model->firstFace();it!=model->lastFace();it++)
{
gf = *it;
if(gf->getNumMeshElements()>0 /*&& gf->tag()==114*/ /*&& gf->geomType()==GEntity::CompoundSurface*/){
if(gf->getNumMeshElements()>0 && !gf->getCompound() /*&& gf->geomType()==GEntity::CompoundSurface*/){
optimize_face(gf);
//recombineIntoQuads(gf,1,1);
}
......@@ -1235,14 +1232,14 @@ void lpcvt::print_voronoi1(){
p1 = v1.get_point();
p2 = v2.get_point();
p3 = v3.get_point();
//print_segment(p2,p3,file);
metric m = it->get_metric(); //Modification
double h = it->get_h(0,0); //Modification
double x = (p1.x() + p2.x() + p3.x())/3.0; //Modification
double y = (p1.y() + p2.y() + p3.y())/3.0; //Modification
double k = 0.4; //Modification
print_segment(SPoint2(x,y),SPoint2(x+k*h*m.get_a(),y+k*h*m.get_b()),file); //Modification
print_segment(SPoint2(x,y),SPoint2(x+k*h*m.get_c(),y+k*h*m.get_d()),file); //Modification
print_segment(p2,p3,file);
//metric m = it->get_metric(); //Modification
//double h = it->get_h(0,0); //Modification
//double x = (p1.x() + p2.x() + p3.x())/3.0; //Modification
//double y = (p1.y() + p2.y() + p3.y())/3.0; //Modification
//double k = 0.4; //Modification
//print_segment(SPoint2(x,y),SPoint2(x+k*h*m.get_a(),y+k*h*m.get_b()),file); //Modification
//print_segment(SPoint2(x,y),SPoint2(x+k*h*m.get_c(),y+k*h*m.get_d()),file); //Modification
}
file << "};\n";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment