From 01103c44c04a10c2f1a507f6d318abd041f22437 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Wed, 4 Jan 2012 23:19:19 +0100 Subject: Added BBEdit/TextWrangler syntax highlighting module by Mike Thomson diff --git a/contrib/BBEdit-TextWrangler.txt b/contrib/BBEdit-TextWrangler.txt new file mode 100644 index 0000000..e15a980 --- /dev/null +++ b/contrib/BBEdit-TextWrangler.txt @@ -0,0 +1,5 @@ +BBEdit: +Install OpenSCAD.plist into ~/Library/Application Support/BBEdit/Language Modules + +TextWrangler: +Install OpenSCAD.plist into ~/Library/Application Support/TextWrangler/Language Modules diff --git a/contrib/OpenSCAD.plist b/contrib/OpenSCAD.plist new file mode 100644 index 0000000..2f8860c --- /dev/null +++ b/contrib/OpenSCAD.plist @@ -0,0 +1,119 @@ + + + + + BBEditDocumentType + CodelessLanguageModule + BBLMCanSpellCheckCodeRuns + + BBLMColorsSyntax + + BBLMIsCaseSensitive + + BBLMKeywordList + + ! + # + $fa + $fn + $fs + $t + % + * + assign + center + circle + color + cube + cylinder + difference + echo + for + function + hull + if + import_dxf + import_stl + include + intersection + intersection_for + linear_extrude + minkowski + mirror + module + multmatrix + polygon + polyhedron + projection + render + rotate + rotate_extrude + scale + sphere + square + str + surface + translate + union + use + + BBLMLanguageCode + Oscd + BBLMLanguageDisplayName + OpenSCAD + BBLMScansFunctions + + BBLMSuffixMap + + + BBLMLanguageSuffix + .scad + + + BBLMSupportsTextCompletion + + Language Features + + Close Block Comments + */ + Close Parameter Lists + ) + Close Statement Blocks + } + Close Strings 1 + " + Close Strings 2 + ' + End-of-line Ends Strings 1 + + End-of-line Ends Strings 2 + + Escape Char in Strings 1 + + Escape Char in Strings 2 + + Identifier and Keyword Characters + !$%*0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz + Open Block Comments + /* + Open Line Comments + // + Open Parameter Lists + ( + Open Statement Blocks + { + Open Strings 1 + " + Open Strings 2 + ' + Prefix for Functions + function + Prefix for Procedures + module + Terminator for Prototypes 1 + + Terminator for Prototypes 2 + + + + -- cgit v0.10.1 From 9495f11be0c8b36801016f881733d7b6617d184a Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 5 Jan 2012 00:00:29 +0100 Subject: Added Linux desktop icon and .desktop file from chrysn diff --git a/icons/icon-alpha.png b/icons/icon-alpha.png index 67b6e63..192e5f1 100644 Binary files a/icons/icon-alpha.png and b/icons/icon-alpha.png differ diff --git a/icons/icon.png b/icons/icon.png index 7912038..837ead9 100644 Binary files a/icons/icon.png and b/icons/icon.png differ diff --git a/icons/mask.png b/icons/mask.png index eea1027..15ce869 100644 Binary files a/icons/mask.png and b/icons/mask.png differ diff --git a/icons/openscad.desktop b/icons/openscad.desktop new file mode 100644 index 0000000..07df5aa --- /dev/null +++ b/icons/openscad.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=OpenSCAD +Icon=openscad +Exec=openscad %f +Categories=Graphics;3DGraphics;Engineering; diff --git a/icons/openscad.png b/icons/openscad.png new file mode 100644 index 0000000..192e5f1 Binary files /dev/null and b/icons/openscad.png differ diff --git a/openscad.pro b/openscad.pro index b26122a..e980085 100644 --- a/openscad.pro +++ b/openscad.pro @@ -294,3 +294,11 @@ INSTALLS += examples libraries.path = $$PREFIX/share/openscad/libraries/ libraries.files = libraries/* INSTALLS += libraries + +applications.path = $$PREFIX/share/applications +applications.files = icons/openscad.desktop +INSTALLS += applications + +icons.path = $$PREFIX/share/pixmaps +icons.files = icons/openscad.png +INSTALLS += icons -- cgit v0.10.1 From 1acfe4e10be18c18762764c280fa07464c7a0a6c Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 5 Jan 2012 00:20:11 +0100 Subject: Added some recent bugfixes diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 295f6f4..59bb54b 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,6 +1,10 @@ OpenSCAD 2012.XX ================ +Bugfixes: +o use'ing an non-existing file sometimes crashed under Windows +o Better font handling: Ensure a monospace font is chosen as default + Deprecations: o The old include syntax "" without the include keyword is no longer supported and will cause a syntax error. -- cgit v0.10.1 From a7bb2229dc4a36b272fc60bb8244c125efef0032 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Wed, 4 Jan 2012 19:53:46 -0600 Subject: Use Qt's fontfind algorithm for default, so that QFontComboBox works properly diff --git a/src/Preferences.cc b/src/Preferences.cc index 4c43f2d..e05106b 100644 --- a/src/Preferences.cc +++ b/src/Preferences.cc @@ -47,16 +47,24 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent) // Setup default settings this->defaultmap["3dview/colorscheme"] = this->colorSchemeChooser->currentItem()->text(); + this->defaultmap["advanced/opencsg_show_warning"] = true; + this->defaultmap["advanced/enable_opencsg_opengl1x"] = true; + + // Setup default font (Try to use a nice monospace font) + QString fontfamily; #ifdef Q_WS_X11 - this->defaultmap["editor/fontfamily"] = "Mono"; + fontfamily = "Mono"; #elif defined (Q_WS_WIN) - this->defaultmap["editor/fontfamily"] = "Console"; + fontfamily = "Console"; #elif defined (Q_WS_MAC) - this->defaultmap["editor/fontfamily"] = "Monaco"; + fontfamily = "Monaco"; #endif + QFont font; + font.setStyleHint(QFont::TypeWriter); + font.setFamily(fontfamily); // this runs Qt's font matching algorithm + QString found_family(QFontInfo(font).family()); + this->defaultmap["editor/fontfamily"] = found_family; this->defaultmap["editor/fontsize"] = 12; - this->defaultmap["advanced/opencsg_show_warning"] = true; - this->defaultmap["advanced/enable_opencsg_opengl1x"] = true; // Toolbar QActionGroup *group = new QActionGroup(this); -- cgit v0.10.1 From c3a2dfcf47d3a88723dfcaa81ce35363a0d41b20 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Fri, 6 Jan 2012 18:56:03 -0600 Subject: fix typo in path to CMingw-cross-env.cmake in instructions diff --git a/tests/CMingw-cross-env.cmake b/tests/CMingw-cross-env.cmake index 09ec1d1..7dd2a05 100644 --- a/tests/CMingw-cross-env.cmake +++ b/tests/CMingw-cross-env.cmake @@ -10,7 +10,7 @@ # http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Cross-compiling_for_Windows_on_Linux_or_Mac_OS_X # - cross-compile openscad.exe, to verify your installation works properly. # - cd openscad/tests && mkdir build-mingw32 && cd build-mingw32 -# - cmake .. -DCMAKE_TOOLCHAIN_FILE=CMingw-cross-env.cmake \ +# - cmake .. -DCMAKE_TOOLCHAIN_FILE=../CMingw-cross-env.cmake \ # -DMINGW_CROSS_ENV_DIR= # - make should proceed as normal. # - now run 'ctest' on your *nix machine. -- cgit v0.10.1 From 7af27e183817181ec60b59b1d3270abd5f43f072 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sat, 7 Jan 2012 07:15:49 -0600 Subject: add CMAKE_RC_COMPILER to fix bug report by Brad Pitcher diff --git a/tests/CMingw-cross-env.cmake b/tests/CMingw-cross-env.cmake index 7dd2a05..7063be4 100644 --- a/tests/CMingw-cross-env.cmake +++ b/tests/CMingw-cross-env.cmake @@ -78,6 +78,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_C_COMPILER ${MINGW_CROSS_ENV_DIR}/usr/bin/i686-pc-mingw32-gcc) set(CMAKE_CXX_COMPILER ${MINGW_CROSS_ENV_DIR}/usr/bin/i686-pc-mingw32-g++) +set(CMAKE_RC_COMPILER ${MINGW_CROSS_ENV_DIR}/usr/bin/i686-pc-mingw32-windres) set(QT_QMAKE_EXECUTABLE ${MINGW_CROSS_ENV_DIR}/usr/bin/i686-pc-mingw32-qmake) set(PKG_CONFIG_EXECUTABLE ${MINGW_CROSS_ENV_DIR}/usr/bin/i686-pc-mingw32-pkg-config) set(CMAKE_BUILD_TYPE RelWithDebInfo) -- cgit v0.10.1 From 1ff36169651f78e4810e1c2f5f5a19dc6c30a00d Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sun, 8 Jan 2012 04:42:24 +0100 Subject: Drop possibly corrupt polyhedron after a minkowski error diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index a6b2f06..cc1c749 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -86,6 +86,11 @@ void CGALEvaluator::process(CGAL_Nef_polyhedron &target, const CGAL_Nef_polyhedr // union && difference assert triggered by testdata/scad/bugs/rotate-diff-nonmanifold-crash.scad std::string opstr = op == CGE_UNION ? "union" : op == CGE_INTERSECTION ? "intersection" : op == CGE_DIFFERENCE ? "difference" : op == CGE_MINKOWSKI ? "minkowski" : "UNKNOWN"; PRINTF("CGAL error in CGAL_Nef_polyhedron's %s operator: %s", opstr.c_str(), e.what()); + + // Minkowski errors can result in corrupt polyhedrons + if (op == CGE_MINKOWSKI) { + target = src; + } } CGAL::set_error_behaviour(old_behaviour); } -- cgit v0.10.1 From e20a7c261a9671d05d1cd4cea7334f2051123dfa Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sun, 8 Jan 2012 13:27:31 +0100 Subject: Added test model causing a minkowski assert with a subsequent corrupt polyhedron diff --git a/testdata/scad/bugs/minkowski-crash.scad b/testdata/scad/bugs/minkowski-crash.scad new file mode 100644 index 0000000..46419ba --- /dev/null +++ b/testdata/scad/bugs/minkowski-crash.scad @@ -0,0 +1,26 @@ +/* + Originally reported by nop head 20120107: + This causes a CGAL assertion in minkowski on some platforms and CGAL versions: + o CGAL-3.6, 3.8 Linux + o Windows (OpenSCAD-2011.12 binaries) + + The problem is that minkowski leaves the target polyhedron in a corrupt state + causing a crash. This is worked around in CGALEvaluator::process(). + + CGAL-3.9 appears to just process forever. +*/ +$fn = 30; +minkowski() { + union() { + cube([10, 10, 10], center=true); + + cylinder(r=2, h=15, center=true); + + rotate([90, 0, 0]) + cylinder(r=2, h=15, center=true); + + rotate([0, 90, 0]) + cylinder(r=2, h=15, center=true); + } + sphere(3); +} -- cgit v0.10.1 From a5d3086dda34525c0a2529bb778590ff4f88e6db Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sun, 8 Jan 2012 13:41:33 +0100 Subject: Mentioned confusing error reporting with errors in included files diff --git a/doc/TODO.txt b/doc/TODO.txt index 8f6d257..9479e69 100644 --- a/doc/TODO.txt +++ b/doc/TODO.txt @@ -175,10 +175,12 @@ o Misc - Is there a reason why modules like echo, empty if, empty for loop returns an empty AbstractNode instead of being ignored? - Dependency tracking of libraries (USE'd modules) isn't implemented. See Mail from nophead 20110823. -o Grammar +o Grammar/Parser - dim->name -> dim->label - A random(seed) function - linear_extrude()/rotate_extrude(): Cumbersome names? -> (extrude, revolve, lathe, sweep ?) + - If a compile error occurs in an included file, line numbers are global + and doesn't say in which file the error occurred. o Hollow donut problem When extruding a 2D CSG tree (e.g. a polygon with a hole), the hole information is lost when performing the extrusion. For linear -- cgit v0.10.1 From e271e958dcb09bfa2e02866e87a88a12c7464f91 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sun, 8 Jan 2012 18:30:22 +0100 Subject: Force test output to fixed notation, otherwise the clamping will give wrong results for output in scientific notation diff --git a/src/value.cc b/src/value.cc index 5ea766c..1dcfa98 100644 --- a/src/value.cc +++ b/src/value.cc @@ -369,6 +369,7 @@ std::string Value::toString() const { std::stringstream tmp; tmp.precision(16); + tmp.setf(std::ios_base::fixed); tmp << this->num; std::string tmpstr = tmp.str(); if (tmpstr.size() > 16) tmpstr.erase(16); -- cgit v0.10.1 From c08f3afbbb76948f3c142dfac57d6663c0d102b3 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sun, 8 Jan 2012 18:31:09 +0100 Subject: bugfix: Infinite loop in deg2rad/rad2deg when giving it an inf number, e.g. 1/0. Reported by Triffid Hunter. diff --git a/src/func.cc b/src/func.cc index 1138173..6686cb9 100644 --- a/src/func.cc +++ b/src/func.cc @@ -96,24 +96,14 @@ std::string BuiltinFunction::dump(const std::string &indent, const std::string & return dump.str(); } -static double deg2rad(double x) +static inline double deg2rad(double x) { - while (x < 0.0) - x += 360.0; - while (x >= 360.0) - x -= 360.0; - x = x * M_PI * 2.0 / 360.0; - return x; + return x * M_PI / 180.0; } -static double rad2deg(double x) +static inline double rad2deg(double x) { - x = x * 360.0 / (M_PI * 2.0); - while (x < 0.0) - x += 360.0; - while (x >= 360.0) - x -= 360.0; - return x; + return x * 180.0 / M_PI; } Value builtin_abs(const Context *, const std::vector&, const std::vector &args) -- cgit v0.10.1 From f3e6e8168bac6b14383d1d321de7dcf122e0b7de Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sun, 8 Jan 2012 18:34:17 +0100 Subject: Added notes about two recent bugfixes diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 59bb54b..e025d9b 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -4,6 +4,8 @@ OpenSCAD 2012.XX Bugfixes: 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 Deprecations: o The old include syntax "" without the include keyword is no -- cgit v0.10.1