summaryrefslogtreecommitdiff
path: root/src/export.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-12-26 20:20:05 (GMT)
committerMarius Kintel <marius@kintel.net>2011-12-26 20:20:05 (GMT)
commitcde24f681580f8911ac4fe29265b169a0bac5f49 (patch)
treeb426b377e367a50b406bad51a0dbb76510278102 /src/export.cc
parent36056e27f34a6049c18e49d5f24bfbd7cc6eabf4 (diff)
parentbc3454f369a21cd689f42f5e9ec5cb316f9ebdd5 (diff)
Merge branch 'master' into buildfix
Diffstat (limited to 'src/export.cc')
-rw-r--r--src/export.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/export.cc b/src/export.cc
index 99bce98..5ce2d15 100644
--- a/src/export.cc
+++ b/src/export.cc
@@ -102,6 +102,9 @@ void export_stl(CGAL_Nef_polyhedron *root_N, std::ostream &output, QProgressDial
double ny = dn[2]*dn[3] - dn[0]*dn[5];
double nz = dn[0]*dn[4] - dn[1]*dn[3];
double nlength = sqrt(nx*nx + ny*ny + nz*nz);
+ // Avoid generating normals for polygons with zero area
+ double eps = 0.000001;
+ if (nlength < eps) nlength = 1.0;
output << " facet normal "
<< nx / nlength << " "
<< ny / nlength << " "
contact: Jan Huwald // Impressum