mirror of https://github.com/vitalif/openscad
bugfix: Don't crash when giving 3D vectors or number to a parameter which expects 2d vectors
git-svn-id: http://svn.clifford.at/openscad/trunk@558 b57f626f-c46c-0410-a088-ec61d464b74cstl_dim
parent
5244ea6a76
commit
0057a2992a
|
@ -30,6 +30,7 @@
|
|||
#include "dxfdata.h"
|
||||
#include "dxftess.h"
|
||||
#include "builtin.h"
|
||||
#include "printutils.h"
|
||||
|
||||
enum primitive_type_e {
|
||||
CUBE,
|
||||
|
@ -465,8 +466,12 @@ sphere_next_r2:
|
|||
DxfData dd;
|
||||
|
||||
for (int i=0; i<points.vec.size(); i++) {
|
||||
double x = points.vec[i]->vec[0]->num;
|
||||
double y = points.vec[i]->vec[1]->num;
|
||||
double x,y;
|
||||
if (!points.vec[i]->getv2(x, y)) {
|
||||
PRINTF("ERROR: Unable to convert point at index %d to a vec2 of numbers", i);
|
||||
// FIXME: Return NULL and make sure this is checked by all callers?
|
||||
return p;
|
||||
}
|
||||
dd.points.append(DxfData::Point(x, y));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue