diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2013-12-15 21:32:06 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2013-12-15 21:32:06 (GMT) |
commit | 3b3ef44f6636affef8138f4c8b7dec1333f50377 (patch) | |
tree | 977698cc6d2d56775f140967792ad637db03490f /src/PolySetCGALEvaluator.cc | |
parent | 5271b345bc755f37e98d7f497f6686d34990fa5c (diff) | |
parent | c7cea0082e427f3c53985845f05e8737873c8a25 (diff) |
Merge branch 'master' of github.com:openscad/openscad into planar
Conflicts:
src/CGAL_Nef_polyhedron.cc
tests/CMakeLists.txt
Diffstat (limited to 'src/PolySetCGALEvaluator.cc')
-rw-r--r-- | src/PolySetCGALEvaluator.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc index bc9206f..a2d896d 100644 --- a/src/PolySetCGALEvaluator.cc +++ b/src/PolySetCGALEvaluator.cc @@ -455,12 +455,21 @@ PolySet *PolySetCGALEvaluator::rotateDxfData(const RotateExtrudeNode &node, DxfD for (size_t i = 0; i < dxf.paths.size(); i++) { + double min_x = 0; double max_x = 0; for (size_t j = 0; j < dxf.paths[i].indices.size(); j++) { - max_x = fmax(max_x, dxf.points[dxf.paths[i].indices[j]][0]); + double point_x = dxf.points[dxf.paths[i].indices[j]][0]; + min_x = fmin(min_x, point_x); + max_x = fmax(max_x, point_x); + + if ((max_x - min_x) > max_x && (max_x - min_x) > fabs(min_x)) { + PRINTB("ERROR: all points for rotate_extrude() must have the same X coordinate sign (range is %.2f -> %.2f)", min_x % max_x); + delete ps; + return NULL; + } } - int fragments = get_fragments_from_r(max_x, node.fn, node.fs, node.fa); + int fragments = get_fragments_from_r(max_x-min_x, node.fn, node.fs, node.fa); double ***points; points = new double**[fragments]; |