diff options
author | Brad Pitcher <bradpitcher@gmail.com> | 2011-11-01 17:15:35 (GMT) |
---|---|---|
committer | Brad Pitcher <bradpitcher@gmail.com> | 2011-11-01 17:15:35 (GMT) |
commit | e2caf3726d68ff1fef63113519049abffc0563af (patch) | |
tree | 6558c6f03ccc21e7138d23861f80e8d97b09e60e /src/PolySetCGALEvaluator.cc | |
parent | 7541854212d6c1223e015faf55a6ca0657a1c184 (diff) | |
parent | cb56f700b1b0f4ae589da62a5fd1d4e368deb604 (diff) |
merge master
Diffstat (limited to 'src/PolySetCGALEvaluator.cc')
-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) { |