summaryrefslogtreecommitdiff
path: root/src/PolySetCGALEvaluator.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-10-27 13:23:55 (GMT)
committerMarius Kintel <marius@kintel.net>2011-10-27 13:23:55 (GMT)
commit6b8fd15ff79ae90682992ee045f92f28b136c34a (patch)
treeff66d8be0f4bf2c7bf18e527b42c3e9a34d98f79 /src/PolySetCGALEvaluator.cc
parent7c606d36b01ede3625a6b863cd1b7df0b551135a (diff)
Improved quality of linear_extrude with twist by forcing all quads to be tessellated the same direction
Diffstat (limited to 'src/PolySetCGALEvaluator.cc')
-rw-r--r--src/PolySetCGALEvaluator.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc
index 7f62d0a..190d75a 100644
--- a/src/PolySetCGALEvaluator.cc
+++ b/src/PolySetCGALEvaluator.cc
@@ -181,6 +181,7 @@ cant_project_non_simple_polyhedron:
static void add_slice(PolySet *ps, const DxfData &dxf, DxfData::Path &path, double rot1, double rot2, double h1, double h2)
{
+ bool splitfirst = sin(rot2 - rot1) >= 0.0;
for (size_t j = 1; j < path.indices.size(); j++)
{
int k = j - 1;
@@ -197,10 +198,7 @@ static void add_slice(PolySet *ps, const DxfData &dxf, DxfData::Path &path, doub
double kx2 = dxf.points[path.indices[k]][0] * cos(rot2*M_PI/180) + dxf.points[path.indices[k]][1] * sin(rot2*M_PI/180);
double ky2 = dxf.points[path.indices[k]][0] * -sin(rot2*M_PI/180) + dxf.points[path.indices[k]][1] * cos(rot2*M_PI/180);
- double dia1_len_sq = (jy1-ky2)*(jy1-ky2) + (jx1-kx2)*(jx1-kx2);
- double dia2_len_sq = (jy2-ky1)*(jy2-ky1) + (jx2-kx1)*(jx2-kx1);
-
- if (dia1_len_sq > dia2_len_sq)
+ if (splitfirst)
{
ps->append_poly();
if (path.is_inner) {
contact: Jan Huwald // Impressum