diff options
author | Marius Kintel <marius@kintel.net> | 2011-10-27 13:24:12 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-10-27 13:24:12 (GMT) |
commit | d06e72a7256133464d599a9bfaaae0e74a8d9f9c (patch) | |
tree | 28821b621e4889676edb1bbc28b90372c325228c /src | |
parent | cb4986ec5df6a9fea790657c8a28ea0576c17194 (diff) | |
parent | 6b8fd15ff79ae90682992ee045f92f28b136c34a (diff) |
Merge branch 'master' into visitortests
Diffstat (limited to 'src')
-rw-r--r-- | src/PolySetCGALEvaluator.cc | 6 |
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) { |