Skip to content
Snippets Groups Projects
Commit c5e22da9 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix STL export of quads
parent 4867ebd3
No related branches found
No related tags found
No related merge requests found
......@@ -133,8 +133,8 @@ void AddToTemporaryBoundingBox(double x, double y, double z)
temp_bb += SPoint3(x, y, z);
if(temp_bb.empty()) return;
CTX::instance()->lc = sqrt(SQU(temp_bb.max().x() - temp_bb.min().x()) +
SQU(temp_bb.max().y() - temp_bb.min().y()) +
SQU(temp_bb.max().z() - temp_bb.min().z()));
SQU(temp_bb.max().y() - temp_bb.min().y()) +
SQU(temp_bb.max().z() - temp_bb.min().z()));
if(CTX::instance()->lc == 0) CTX::instance()->lc = 1.;
// to get correct cg during interctive point creation
for(int i = 0; i < 3; i++) CTX::instance()->cg[i] = temp_bb.center()[i];
......
This diff is collapsed.
......@@ -1987,6 +1987,9 @@ Command :
| tBoundingBox tEND
{
CTX::instance()->forcedBBox = 0;
// make sure we transfer everything into GModel before computing
// the bounding box
GModel::current()->importGEOInternals();
SetBoundingBox();
}
| tBoundingBox '{' FExpr ',' FExpr ',' FExpr ',' FExpr ',' FExpr ',' FExpr '}' tEND
......
......@@ -54,7 +54,7 @@ bool PViewData::writeSTL(std::string fileName)
fprintf(fp, "facet normal %g %g %g\n", n[0], n[1], n[2]);
fprintf(fp, " outer loop\n");
fprintf(fp, " vertex %g %g %g\n", x[0], y[0], z[0]);
fprintf(fp, " vertex %g %g %g\n", x[2], y[1], z[1]);
fprintf(fp, " vertex %g %g %g\n", x[2], y[2], z[2]);
fprintf(fp, " vertex %g %g %g\n", x[3], y[3], z[3]);
fprintf(fp, " endloop\n");
fprintf(fp, "endfacet\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment