summaryrefslogtreecommitdiff
path: root/src/PolySetCGALEvaluator.cc
diff options
context:
space:
mode:
authorDavid Eccles (gringer) <github@gringer.org>2013-12-06 00:14:09 (GMT)
committerMarius Kintel <marius@kintel.net>2013-12-06 05:39:48 (GMT)
commite3317ecc64659ae8be2a7b02d4df17dad6d875db (patch)
tree5ac61166fb1d867d2c6aeedd916ef0844ad939eb /src/PolySetCGALEvaluator.cc
parent38a342215970396a5590281cd66d0ca9c9ab7e98 (diff)
Fail if any polygon points for rotate_extrude are less than 0
Diffstat (limited to 'src/PolySetCGALEvaluator.cc')
-rw-r--r--src/PolySetCGALEvaluator.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc
index bc9206f..e5eba2b 100644
--- a/src/PolySetCGALEvaluator.cc
+++ b/src/PolySetCGALEvaluator.cc
@@ -457,7 +457,13 @@ PolySet *PolySetCGALEvaluator::rotateDxfData(const RotateExtrudeNode &node, DxfD
{
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];
+ if(point_x < 0){
+ PRINT("ERROR: all points for rotate_extrude() must have non-negative X coordinates");
+ PRINT((boost::format("[Point %d on path %d has X coordinate %f]") % j % i % point_x).str());
+ return NULL;
+ }
+ max_x = fmax(max_x, point_x);
}
int fragments = get_fragments_from_r(max_x, node.fn, node.fs, node.fa);
contact: Jan Huwald // Impressum