refine dist in Minkowski (fix isosurface bugs)

This commit is contained in:
JamesEMcclure 2020-06-27 07:56:53 -04:00
parent a16d82bac0
commit 3dd7ba5936
2 changed files with 13 additions and 6 deletions

View File

@ -137,6 +137,7 @@ void Minkowski::MeasureObject(){
}
}
CalcDist(distance,id,*Dm);
Eikonal(distance, id, *Dm, 10, {true, true, true});
ComputeScalar(distance,0.0);
}

View File

@ -388,16 +388,22 @@ void iso_surface(const Array<double>&Field, const double isovalue)
auto P1 = object.vertex.coords(object.halfedge.v1(e1));
auto P2 = object.vertex.coords(object.halfedge.v1(e2));
auto P3 = object.vertex.coords(object.halfedge.v1(e3));
P1.x += 1.0*i; P1.y += 1.0*j; P1.z +=1.0*k;
P2.x += 1.0*i; P2.y += 1.0*j; P2.z +=1.0*k;
P3.x += 1.0*i; P3.y += 1.0*j; P3.z +=1.0*k;
fprintf(TRIANGLES,"vertex %f %f %f\n",P1.x,P1.y,P1.z);
fprintf(TRIANGLES,"vertex %f %f %f\n",P2.x,P2.y,P2.z);
fprintf(TRIANGLES,"vertex %f %f %f\n",P3.x,P3.y,P3.z);
auto Normal = object.TriNormal(e1);
// P1.x += 1.0*i; P1.y += 1.0*j; P1.z +=1.0*k;
//P2.x += 1.0*i; P2.y += 1.0*j; P2.z +=1.0*k;
//P3.x += 1.0*i; P3.y += 1.0*j; P3.z +=1.0*k;
fprintf(TRIANGLES,"facet normal %f %f %f\n",Normal.x,Normal.y,Normal.z);
fprintf(TRIANGLES," outer loop\n");
fprintf(TRIANGLES," vertex %f %f %f\n",P1.x,P1.y,P1.z);
fprintf(TRIANGLES," vertex %f %f %f\n",P2.x,P2.y,P2.z);
fprintf(TRIANGLES," vertex %f %f %f\n",P3.x,P3.y,P3.z);
fprintf(TRIANGLES," endloop\n");
fprintf(TRIANGLES,"endfacet\n");
}
}
}
}
fprintf(TRIANGLES,"endsolid isosurface\n");
fclose(TRIANGLES);
}