summaryrefslogtreecommitdiff
path: root/tests/cgalpngtest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cgalpngtest.cc')
-rw-r--r--tests/cgalpngtest.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/cgalpngtest.cc b/tests/cgalpngtest.cc
index 447df45..fee44e8 100644
--- a/tests/cgalpngtest.cc
+++ b/tests/cgalpngtest.cc
@@ -23,6 +23,10 @@
*
*/
+#ifdef _MSC_VER
+#define EIGEN_DONT_ALIGN
+#endif
+
#include "myqhash.h"
#include "openscad.h"
#include "node.h"
@@ -47,7 +51,9 @@
#include <QDir>
#include <QSet>
#include <QTextStream>
+#ifndef _MSC_VER
#include <getopt.h>
+#endif
#include <iostream>
#include <assert.h>
#include <sstream>
@@ -182,7 +188,7 @@ int main(int argc, char **argv)
try {
csgInfo.glview = new OffscreenView(512,512);
} catch (int error) {
- fprintf(stderr,"Can't create OpenGL OffscreenView. exiting.\n");
+ fprintf(stderr,"Can't create OpenGL OffscreenView. Code: %i. Exiting.\n", error);
exit(1);
}
@@ -211,19 +217,21 @@ int main(int argc, char **argv)
CGALRenderer cgalRenderer(N);
- BoundingBox bbox;
+/* Eigen::AlignedBox<double, 3> bbox;
if (cgalRenderer.polyhedron) {
CGAL::Bbox_3 cgalbbox = cgalRenderer.polyhedron->bbox();
bbox = BoundingBox(Vector3d(cgalbbox.xmin(), cgalbbox.ymin(), cgalbbox.zmin()),
- Vector3d(cgalbbox.xmax(), cgalbbox.ymax(), cgalbbox.zmax()));
+ Vector3d(cgalbbox.xmax(), cgalbbox.ymax(), cgalbbox.zmax()));
}
else if (cgalRenderer.polyset) {
bbox = cgalRenderer.polyset->getBoundingBox();
}
+
Vector3d center = (bbox.min() + bbox.max()) / 2;
double radius = (bbox.max() - bbox.min()).norm() / 2;
-
-
+*/
+ Vector3d center(0,0,0);
+ double radius = 5.0;
Vector3d cameradir(1, 1, -0.5);
Vector3d camerapos = center - radius*2*cameradir;
csgInfo.glview->setCamera(camerapos, center);
contact: Jan Huwald // Impressum