summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/primitives.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/primitives.cc b/src/primitives.cc
index 0808261..1856cbc 100644
--- a/src/primitives.cc
+++ b/src/primitives.cc
@@ -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));
}
contact: Jan Huwald // Impressum