From cae91b57cf839ee7b8902ca8b47efd1dd6875121 Mon Sep 17 00:00:00 2001 From: don Date: Fri, 16 Dec 2011 21:49:26 -0600 Subject: improve OPENSCAD_LIBRARIES for use on freebsd diff --git a/openscad.pro b/openscad.pro index ac4200e..60870be 100644 --- a/openscad.pro +++ b/openscad.pro @@ -40,8 +40,8 @@ INCLUDEPATH += src # Used when manually installing 3rd party libraries OPENSCAD_LIBDIR = $$(OPENSCAD_LIBRARIES) !isEmpty(OPENSCAD_LIBDIR) { - QMAKE_INCDIR += $$OPENSCAD_LIBDIR/include - QMAKE_LIBDIR += $$OPENSCAD_LIBDIR/lib + INCLUDEPATH = $$OPENSCAD_LIBDIR/include $$INCLUDEPATH + QMAKE_LIBDIR = $$OPENSCAD_LIBDIR/lib $$QMAKE_LIBDIR } else { macx { -- cgit v0.10.1 From 52655b3b5f910fbdd8f6eddbf222bb2b18633f59 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sat, 17 Dec 2011 13:17:11 -0600 Subject: -fno-strict-aliasing fix for GCC bug & link to wikibooks build instructions. diff --git a/doc/testing.txt b/doc/testing.txt index 67d14ba..4623a96 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -96,3 +96,9 @@ log as well as your sysinfo.txt file, as well as running 'ldd' against your binaries, to make sure that the proper versions of libraries are getting compiled and linked with the test binaries. +7. Other issues + +The OpenSCAD User Manual has a section on buildling. Check there for updates: + +http://en.wikibooks.org/wiki/OpenSCAD_User_Manual + diff --git a/openscad.pro b/openscad.pro index e38251a..ac49807 100644 --- a/openscad.pro +++ b/openscad.pro @@ -8,6 +8,10 @@ # OPENCSGDIR # OPENSCAD_LIBRARIES # +# Please see the 'Buildling' sections of the OpenSCAD user manual +# for updated tips & workarounds. +# +# http://en.wikibooks.org/wiki/OpenSCAD_User_Manual isEmpty(QT_VERSION) { error("Please use qmake for Qt 4 (probably qmake-qt4)") @@ -82,6 +86,11 @@ linux*:exists(/usr/lib64/libGLU*)|linux*:exists(/usr/lib/libGLU*) { LIBS += -lGLU } +# See Dec 2011 OpenSCAD mailing list, re: CGAL/GCC bugs. +*g++* { + QMAKE_CXXFLAGS *= -fno-strict-aliasing +} + CONFIG(mingw-cross-env) { include(mingw-cross-env.pri) } -- cgit v0.10.1 From 3763f373b24902e494946611980b3759fba790ff Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sat, 17 Dec 2011 17:32:17 -0600 Subject: add no-strict-aliasing to cmake of regression tests, fixing CGAL/GCC bugs diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 986076e..8f3f81f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -13,6 +13,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") # Build debug build as default if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") endif() if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") -- cgit v0.10.1 From 696c174b9133eda8a485f11dbc8a44d1674e5cba Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sat, 17 Dec 2011 18:17:13 -0600 Subject: make it so test_pretty_print by default only shows failed tests diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py index 6fdc663..e377201 100755 --- a/tests/test_pretty_print.py +++ b/tests/test_pretty_print.py @@ -249,8 +249,8 @@ TESTLOG passed_tests = filter(lambda x: x.passed, tests) failed_tests = filter(lambda x: not x.passed, tests) - tests_to_report = tests - if failed_only: tests_to_report = failed_tests + tests_to_report = failed_tests + if include_passed: tests_to_report = tests try: percent = str(int(100.0*len(passed_tests) / len(tests))) except ZeroDivisionError: percent = 'n/a' @@ -317,8 +317,8 @@ def tohtml(wiki_rootpath, startdate, tests, enddate, sysinfo, sysid, makefiles): try: percent = str(int(100.0*len(passed_tests) / len(tests))) except ZeroDivisionError: percent = 'n/a' - tests_to_report = tests - if failed_only: tests_to_report = failed_tests + tests_to_report = failed_tests + if include_passed: tests_to_report = tests s='' @@ -495,7 +495,7 @@ maxretry = 10 if bool(os.getenv("TEST_GENERATE")): sys.exit(0) -failed_only = False -if '--failed-only' in sys.argv: failed_only = True +include_passed = False +if '--include-passed' in sys.argv: include_passed = True main() -- cgit v0.10.1 From 1a01aff2002d935129d499046fd4079f84b8f2bb Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sun, 18 Dec 2011 13:03:12 -0600 Subject: fix zoomed-in panning (per Triffid Hunter bug report) diff --git a/src/glview.cc b/src/glview.cc index c96fe01..fb69f27 100644 --- a/src/glview.cc +++ b/src/glview.cc @@ -594,8 +594,8 @@ void GLView::mouseMoveEvent(QMouseEvent *event) if ((QApplication::keyboardModifiers() & Qt::ShiftModifier) != 0) { viewer_distance += (GLdouble)dy; } else { - object_trans_x += dx; - object_trans_z -= dy; + object_trans_x += dx * viewer_distance/1000; + object_trans_z -= dy * viewer_distance/1000; } } updateGL(); -- cgit v0.10.1 From fb28bc857649c2cab57476007e60827d7140c6f8 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sun, 18 Dec 2011 13:04:26 -0600 Subject: initialize variables in glview.cc diff --git a/src/glview.cc b/src/glview.cc index fb69f27..0c8394a 100644 --- a/src/glview.cc +++ b/src/glview.cc @@ -500,6 +500,7 @@ void GLView::paintGL() // FIXME: This was an attempt to keep contrast with background, but is suboptimal // (e.g. nearly invisible against a gray background). int r,g,b; + r=g=b=0; // bgcol.getRgb(&r, &g, &b); glColor3d((255.0-r)/255.0, (255.0-g)/255.0, (255.0-b)/255.0); glBegin(GL_LINES); -- cgit v0.10.1 From 541db676ee079eef7a6614cdd991514bf0c8ff52 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sun, 18 Dec 2011 13:17:24 -0600 Subject: make view rotation work like 2011.06 release. (per Triffid Hunter bug rpt) diff --git a/src/glview.cc b/src/glview.cc index 0c8394a..1dcddb7 100644 --- a/src/glview.cc +++ b/src/glview.cc @@ -388,12 +388,12 @@ void GLView::paintGL() gluLookAt(0.0, -viewer_distance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0); - glTranslated(object_trans_x, object_trans_y, object_trans_z); - glRotated(object_rot_x, 1.0, 0.0, 0.0); glRotated(object_rot_y, 0.0, 1.0, 0.0); glRotated(object_rot_z, 0.0, 0.0, 1.0); + glTranslated(object_trans_x, object_trans_y, object_trans_z); + // FIXME: Crosshairs and axes are lighted, this doesn't make sense and causes them // to change color based on view orientation. if (showcrosshairs) -- cgit v0.10.1 From c2d94835b0fab1455c2e9ac290abfa80e5a9b09b Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sun, 18 Dec 2011 15:55:12 -0600 Subject: translate old style viewport mouse drag into Eigen math (see T. Hunter bug rpt) diff --git a/src/glview.cc b/src/glview.cc index 1dcddb7..59a56d6 100644 --- a/src/glview.cc +++ b/src/glview.cc @@ -58,6 +58,8 @@ #define FAR_FAR_AWAY 100000.0 +#include + GLView::GLView(QWidget *parent) : QGLWidget(parent), renderer(NULL) { init(); @@ -558,7 +560,6 @@ void GLView::mousePressEvent(QMouseEvent *event) setFocus(); } - void GLView::normalizeAngle(GLdouble& angle) { while(angle < 0) @@ -595,8 +596,37 @@ void GLView::mouseMoveEvent(QMouseEvent *event) if ((QApplication::keyboardModifiers() & Qt::ShiftModifier) != 0) { viewer_distance += (GLdouble)dy; } else { - object_trans_x += dx * viewer_distance/1000; - object_trans_z -= dy * viewer_distance/1000; + + double mx = +(dx) * viewer_distance/1000; + double my = -(dy) * viewer_distance/1000; + + Eigen::Matrix3d aax, aay, aaz, tm3; + aax = Eigen::AngleAxisd(-(object_rot_x/180) * M_PI,Eigen::Vector3d::UnitX()); + aay = Eigen::AngleAxisd(-(object_rot_y/180) * M_PI,Eigen::Vector3d::UnitY()); + aaz = Eigen::AngleAxisd(-(object_rot_z/180) * M_PI,Eigen::Vector3d::UnitZ()); + tm3 = Eigen::Matrix3d::Identity(); + tm3 = aaz * (aay * (aax * tm3)); + + Eigen::Matrix4d tm; + tm = Eigen::Matrix4d::Identity(); + for (int i=0;i<3;i++) for (int j=0;j<3;j++) tm(j,i)=tm3(j,i); + + Eigen::Matrix4d vec; + vec << + 0, 0, 0, mx, + 0, 0, 0, 0, + 0, 0, 0, my, + 0, 0, 0, 1 + ; + if ((QApplication::keyboardModifiers() & Qt::ShiftModifier) != 0) { + vec(0,3) = 0; + vec(1,3) = my; + vec(2,3) = 0; + } + tm = tm * vec; + object_trans_x += tm(0,3); + object_trans_y += tm(1,3); + object_trans_z += tm(2,3); } } updateGL(); -- cgit v0.10.1