summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--RELEASE_NOTES2
-rw-r--r--doc/TODO.txt9
-rw-r--r--src/CGALEvaluator.cc5
-rw-r--r--src/OpenCSGWarningDialog.cc2
-rw-r--r--src/PolySetCGALEvaluator.cc11
-rw-r--r--src/csgtermnormalizer.cc4
-rw-r--r--src/glview.cc24
-rw-r--r--src/mainwin.cc7
9 files changed, 31 insertions, 34 deletions
diff --git a/.gitignore b/.gitignore
index a1db306..50dace1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@ parser_yacc.h
/tmp
/OpenSCAD.app
*/#*#
+/openscad
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 1a10b10..32f3788 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -15,7 +15,7 @@ o use'ing an non-existing file sometimes crashed under Windows
o Better font handling: Ensure a monospace font is chosen as default
o Division by zero caused hang in some cases (e.g. sin(1/0))
o Larger minkowski operations sometimes caused a crash after a CGAL assert was thrown
-o Fixed crashes in shared_ptr.hpp (or similar places) due to a cache management bug
+o Fixed crashes in shared_ptr.hpp (or similar places) due bugs in cache management and CSG normalization
o scale() with a scale factor of zero could cause a crash
o Fixed a number of issues related to use/include
o Providing an unknown parameter on the cmd-line caused a crash
diff --git a/doc/TODO.txt b/doc/TODO.txt
index 5bb66af..8fc9be8 100644
--- a/doc/TODO.txt
+++ b/doc/TODO.txt
@@ -1,6 +1,6 @@
-BUGS
-----
+BUGS (FIXME: Verify and move these to github)
+---------------------------------------------
o Some invalid DXF data gets pass the import checks and breaks the tessing code
o Tesselation via GLU sometimes produces strange results
o Export STL: Exports existing CGAL model even though the current model is changed, but not CGAL rendered
@@ -8,8 +8,8 @@ o Look into the polygon winding and rotate_extrude() problem reported by Britton
o CGAL Aff_transformation_3 doesn't support non-affine transformations (non-aff-matrix.scad)
o 2D union of polygons with a touching vertex doesn't work. see testdata/scad/bugs/polygon-touch.scad
-STL Import BUGS
----------------
+STL Import BUGS (FIXME: Verify and move these to github)
+--------------------------------------------------------
Using STL-imported models is tricky and triggers multiple issues:
(these all fail with the usual "Illegal polygonal object" error)
@@ -117,7 +117,6 @@ OpenCSG-related
---------------
o OpenCSG rendering: Coincident surfaces causes z-buffer fighting. Is this somehow
avoidable tuning the depth tests in OpenCSG?
-o Make the 10.000 element OpenCSG limit configurable (Preferences) ?
o When specifying a transparency with the color() statement,
the object is not sorted and will be rendered wrongly
o Bug: Using the background operator (%) on the only object in a scene triggers a
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc
index 0e849a8..46f4cfa 100644
--- a/src/CGALEvaluator.cc
+++ b/src/CGALEvaluator.cc
@@ -43,11 +43,8 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const AbstractNode &node)
Traverser evaluate(*this, node, Traverser::PRE_AND_POSTFIX);
evaluate.execute();
return this->root;
- assert(this->visitedchildren.empty());
- }
- else {
- return CGALCache::instance()->get(this->tree.getIdString(node));
}
+ return CGALCache::instance()->get(this->tree.getIdString(node));
}
bool CGALEvaluator::isCached(const AbstractNode &node) const
diff --git a/src/OpenCSGWarningDialog.cc b/src/OpenCSGWarningDialog.cc
index fdaaa50..5648576 100644
--- a/src/OpenCSGWarningDialog.cc
+++ b/src/OpenCSGWarningDialog.cc
@@ -1,7 +1,7 @@
#include "OpenCSGWarningDialog.h"
#include "Preferences.h"
-OpenCSGWarningDialog::OpenCSGWarningDialog(QWidget *parent)
+OpenCSGWarningDialog::OpenCSGWarningDialog(QWidget*)
{
setupUi(this);
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc
index 6ed1ab4..1cc6b16 100644
--- a/src/PolySetCGALEvaluator.cc
+++ b/src/PolySetCGALEvaluator.cc
@@ -454,15 +454,10 @@ PolySet *PolySetCGALEvaluator::rotateDxfData(const RotateExtrudeNode &node, DxfD
}
for (int j = 0; j < fragments; j++) {
- double a = (j*2*M_PI) / fragments;
+ double a = (j*2*M_PI) / fragments - M_PI/2; // start on the X axis
for (size_t k = 0; k < dxf.paths[i].indices.size(); k++) {
- if (dxf.points[dxf.paths[i].indices[k]][0] == 0) {
- points[j][k][0] = 0;
- points[j][k][1] = 0;
- } else {
- points[j][k][0] = dxf.points[dxf.paths[i].indices[k]][0] * sin(a);
- points[j][k][1] = dxf.points[dxf.paths[i].indices[k]][0] * cos(a);
- }
+ points[j][k][0] = dxf.points[dxf.paths[i].indices[k]][0] * sin(a);
+ points[j][k][1] = dxf.points[dxf.paths[i].indices[k]][0] * cos(a);
points[j][k][2] = dxf.points[dxf.paths[i].indices[k]][1];
}
}
diff --git a/src/csgtermnormalizer.cc b/src/csgtermnormalizer.cc
index b4bfa4c..6600758 100644
--- a/src/csgtermnormalizer.cc
+++ b/src/csgtermnormalizer.cc
@@ -46,8 +46,8 @@ shared_ptr<CSGTerm> CSGTermNormalizer::normalizePass(shared_ptr<CSGTerm> term)
if (!term || term->type == CSGTerm::TYPE_PRIMITIVE) return term;
if (term->left) term->left = normalizePass(term->left);
} while (term->type != CSGTerm::TYPE_UNION &&
- (term->right && term->right->type != CSGTerm::TYPE_PRIMITIVE ||
- term->left && term->left->type == CSGTerm::TYPE_UNION));
+ ((term->right && term->right->type != CSGTerm::TYPE_PRIMITIVE) ||
+ (term->left && term->left->type == CSGTerm::TYPE_UNION)));
term->right = normalizePass(term->right);
// FIXME: Do we need to take into account any transformation of item here?
diff --git a/src/glview.cc b/src/glview.cc
index 0f9ec5b..12657b8 100644
--- a/src/glview.cc
+++ b/src/glview.cc
@@ -393,8 +393,6 @@ void GLView::paintGL()
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)
@@ -412,6 +410,8 @@ void GLView::paintGL()
glEnd();
}
+ glTranslated(object_trans_x, object_trans_y, object_trans_z);
+
// Large gray axis cross inline with the model
// FIXME: This is always gray - adjust color to keep contrast with background
if (showaxes)
@@ -589,14 +589,21 @@ void GLView::mouseMoveEvent(QMouseEvent *event)
normalizeAngle(object_rot_y);
normalizeAngle(object_rot_z);
} else {
- // Right button pans
- // Shift-right zooms
+ // Right button pans in the xz plane
+ // Middle button pans in the xy plane
+ // Shift-right and Shift-middle zooms
if ((QApplication::keyboardModifiers() & Qt::ShiftModifier) != 0) {
viewer_distance += (GLdouble)dy;
} else {
double mx = +(dx) * viewer_distance/1000;
- double my = -(dy) * viewer_distance/1000;
+ double mz = -(dy) * viewer_distance/1000;
+
+ double my = 0;
+ if (event->buttons() & Qt::MiddleButton) {
+ my = mz;
+ mz = 0;
+ }
Matrix3d aax, aay, aaz, tm3;
aax = Eigen::AngleAxisd(-(object_rot_x/180) * M_PI, Vector3d::UnitX());
@@ -612,15 +619,10 @@ void GLView::mouseMoveEvent(QMouseEvent *event)
Matrix4d vec;
vec <<
0, 0, 0, mx,
- 0, 0, 0, 0,
0, 0, 0, my,
+ 0, 0, 0, mz,
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);
diff --git a/src/mainwin.cc b/src/mainwin.cc
index daea6e3..30e1a17 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -95,6 +95,10 @@
#endif // ENABLE_CGAL
+#ifndef OPENCSG_VERSION_STRING
+#define OPENCSG_VERSION_STRING "unknown, <1.3.2"
+#endif
+
// Global application state
unsigned int GuiLocker::gui_locked = 0;
@@ -1031,8 +1035,7 @@ bool MainWindow::compileTopLevelDocument(bool reload)
{
bool shouldcompiletoplevel = !reload;
- if (reload &&
- (fileChangedOnDisk() && checkEditorModified()) ||
+ if ((reload && fileChangedOnDisk() && checkEditorModified()) ||
includesChanged()) {
shouldcompiletoplevel = true;
refreshDocument();
contact: Jan Huwald // Impressum