summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/AboutDialog.h3
-rw-r--r--src/AboutDialog.html218
-rw-r--r--src/CGALEvaluator.cc99
-rw-r--r--src/CGALRenderer.cc11
-rw-r--r--src/CGAL_Nef_polyhedron.cc5
-rw-r--r--src/CGAL_Nef_polyhedron.h7
-rw-r--r--src/MainWindow.ui2
-rw-r--r--src/OpenCSGWarningDialog.cc4
-rw-r--r--src/PolySetCGALEvaluator.cc28
-rw-r--r--src/boosty.h6
-rw-r--r--src/mainwin.cc56
-rw-r--r--src/openscad.cc15
-rw-r--r--src/polyset.cc6
-rw-r--r--src/polyset.h15
-rw-r--r--src/version_check.h11
15 files changed, 292 insertions, 194 deletions
diff --git a/src/AboutDialog.h b/src/AboutDialog.h
index 1ae6533..2211e63 100644
--- a/src/AboutDialog.h
+++ b/src/AboutDialog.h
@@ -16,6 +16,9 @@ public:
this->aboutText->setOpenExternalLinks(true);
QUrl flattr_qurl(":icons/flattr.png" );
this->aboutText->loadResource( QTextDocument::ImageResource, flattr_qurl );
+ QString tmp = this->aboutText->toHtml();
+ tmp.replace("__VERSION__",QString(TOSTRING(OPENSCAD_VERSION)));
+ this->aboutText->setHtml(tmp);
}
};
diff --git a/src/AboutDialog.html b/src/AboutDialog.html
index e2a6264..0eee1cb 100644
--- a/src/AboutDialog.html
+++ b/src/AboutDialog.html
@@ -1,77 +1,143 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://flattr.com/submit/auto?user_id=openscad&amp;url=http://openscad.org&amp;title=OpenSCAD&amp;language=&amp;tags=github&amp;category=software"><img src=":icons/flattr.png" /></a></p>
-<p align="right" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.openscad.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">OpenSCAD</span></a><span style=" font-size:10pt;"> is Copyright (C) 2009-2012 </span><a href="https://github.com/kintel"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Marius Kintel </span></a><span style=" font-size:10pt;"> &lt;marius@kintel.net&gt; and </span><a href="http://clifford.at"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Clifford Wolf</span></a><span style=" font-size:10pt;"> &lt;clifford@clifford.at&gt;</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">License</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; font-weight:600;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Please visit this link for a copy of the license: </span><a href="http://www.gnu.org/licenses/gpl-2.0.html"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">GPL 2.0</span></a></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">Tools &amp; Libraries used</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; font-weight:600;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gmplib.org/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">GNU GMP</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.mpfr.org/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">GNU MPFR</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.cgal.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">CGAL</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://eigen.tuxfamily.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Eigen2</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.opencsg.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">OpenCSG</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.opengl.org/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">OpenGL</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://glew.sourceforge.net"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">GLEW</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://qt.nokia.com"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Qt Toolkit</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.boost.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Boost</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.gnu.org/software/bison/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Bison</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://flex.sourceforge.net/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Flex</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.cmake.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">CMake</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://lodev.org/lodepng/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">LodePNG</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.mingw.org/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">MingW</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.mxe.cc"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">MXE</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.linux.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Linux</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.apple.com/osx/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Mac OSX</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.stroustrup.com/C++.html"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">C++</span></a><span style=" font-size:10pt; font-weight:600;">, </span><a href="http://gcc.gnu.org/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">GCC</span></a><span style=" font-size:10pt; font-weight:600;">, </span><a href="http://clang.llvm.org/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">clang</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.python.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">python</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://nsis.sourceforge.net/Main_Page"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Nullsoft installer</span></a></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">Acknowledgements</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.github.com/openscad"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">OpenSCAD Github Project</span></a><span style=" font-size:10pt;"> members (public):</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/kintel"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Marius Kintel </span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://clifford.at"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Clifford Wolf</span></a><span style=" font-size:10pt;"> </span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.github.com/GilesBathgate"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Giles Bathgate</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/brad"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Brad Pitcher</span></a></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.debian.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Debian </span></a><span style=" font-family:'Ubuntu'; font-size:11pt;">maintainer:</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://christian.amsuess.com/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Christian M. Amsüss</span></a></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">Patches:</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/meta23"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">meta23</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/jasonblewis"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">jasonblewis</span></a><span style=" font-family:'Ubuntu'; font-size:11pt;"> </span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/gregjurman"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">gregjurman</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/brianolson"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">brianolson</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/tjhowse"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">tjhowse</span></a><span style=" font-family:'Ubuntu'; font-size:11pt;"> </span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/logxen"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">logxen</span></a><span style=" font-family:'Ubuntu'; font-size:11pt;"> (Mark A Cooper)</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/iamwilhelm"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">iamwilhelm</span></a><span style=" font-family:'Ubuntu'; font-size:11pt;"> (Wil Chung)</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/clothbot"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">clothbot</span></a><span style=" font-family:'Ubuntu'; font-size:11pt;"> (Andrew Plumb)</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/colah"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">colah</span></a><span style=" font-family:'Ubuntu'; font-size:11pt;"> (Christopher Olah)</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;"> </span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">Bug reports:</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;"> </span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">nop head, Triffid Hunter, Len Trigg, </span><span style=" font-family:'Ubuntu'; font-size:11pt;">Kliment Yanev, Christian Siefkes, Whosawhatsis, MichaelAtOz, mrhdias, ibyte8bits, Koen Kooi, Tomas Mudrunka, knuds, cadr, mshearn, Hans L, Brett Sutton, hmnapier, Eero af Heurlin, caliston, 5263, ghost, 42loop, uniqx, Michael Thomson, Michael Ivko, Pierre Doucet, myglc2, Alan Cox, Peter Falke, Michael Ambrus, Gordon Wrigley, Ed Nisley, Stony Smith, Pasca Andrei, David Goodenough, William A Adams ... and many others</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt; font-style:italic;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">Hosting &amp; resources</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.github.com"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Github</span></a><span style=" font-size:10pt;"> source repository</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://rocklinux.net/pipermail/openscad/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Rock Linux</span></a><span style=" font-size:10pt;"> mailing list</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.thingiverse.com"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Thingiverse</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;"> </span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://guerby.org/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Laurent Guerby</span></a><span style=" font-size:10pt;"> and the </span><a href="http://gcc.gnu.org/wiki/CompileFarm"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">GCC Compile Farm,</span></a><span style=" font-size:10pt;"> with </span><a href="http://osuosl.org/"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">OSUOSL,</span></a><span style=" font-size:10pt;"> </span><a href="http://www.ibm.com"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">IBM</span></a><span style=" font-size:10pt;">, </span><a href="http://www.irill.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">IRILL,</span></a><span style=" font-size:10pt;"> </span><a href="http://www.intel.com"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">Intel</span></a><span style=" font-size:10pt;">, </span><a href="http://www.fsffrance.org"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">FSF France,</span></a><span style=" font-size:10pt;"> and </span><a href="http://www.amd.com"><span style=" font-family:'Ubuntu'; font-size:11pt; text-decoration: underline; color:#0000ff;">AMD</span></a><span style=" font-size:10pt;">.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">Apologies to anyone accidentally left out. </span></p></body></html>
+
+<html>
+
+<!-- Please note that Qt's TextBrowser renders things slightly unusually, so
+ a normal browser alone is not a sufficient test. Just edit this file and rerun
+ make to do your testing. -->
+
+<head>
+ <meta name="qrichtext" content="1" />
+</head>
+
+
+<body style="font-family:'Arial'; font-size:13pt;">
+
+<p>
+<a align=right href="https://flattr.com/submit/auto?user_id=openscad&amp;url=http://openscad.org&amp;title=OpenSCAD&amp;language=&amp;tags=github&amp;category=software"><img align=right src=":icons/flattr.png" /></a>
+</p>
+
+<p>
+<a href="http://www.openscad.org">OpenSCAD</a> version __VERSION__
+</p>
+
+<p>
+Copyright (C) 2009-2013 <a href="https://github.com/kintel">Marius Kintel</a> &lt;marius@kintel.net&gt; and <a href="http://clifford.at">Clifford Wolf</a> &lt;clifford@clifford.at&gt;
+</p>
+
+<p>
+<b>License</b>
+</p>
+
+<p>
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+</p>
+<p>
+Please visit this link for a copy of the license: <a href="http://www.gnu.org/licenses/gpl-2.0.html">GPL 2.0</a>
+</p>
+<p>
+<b>Tools &amp; Libraries used</b>
+</p>
+
+<lu>
+<li><a href="http://gmplib.org/">GNU GMP</a>
+<li><a href="http://www.mpfr.org/">GNU MPFR</a>
+<li><a href="http://www.cgal.org">CGAL</a>
+<li><a href="http://eigen.tuxfamily.org">Eigen2</a>
+<li><a href="http://www.opencsg.org">OpenCSG</a>
+<li><a href="http://www.opengl.org/">OpenGL</a>
+<li><a href="http://glew.sourceforge.net">GLEW</a>
+<li><a href="http://qt.nokia.com">Qt Toolkit</a>
+<li><a href="http://www.boost.org">Boost</a>
+<li><a href="http://www.gnu.org/software/bison/">Bison</a>
+<li><a href="http://flex.sourceforge.net/">Flex</a>
+<li><a href="http://www.cmake.org">CMake</a>
+<li><a href="http://www.mingw.org/">MingW</a>
+<li><a href="http://lodev.org/lodepng/">LodePNG</a>
+<li><a href="http://www.mxe.cc">MXE</a>
+<li><a href="http://www.linux.org">Linux</a>
+<li><a href="http://www.apple.com/osx/">Mac OSX</a>
+<li><a href="http://www.stroustrup.com/C++.html">C++</a>, <a href="http://gcc.gnu.org/">GCC</a>, <a href="http://clang.llvm.org/">clang</a>
+<li><a href="http://www.python.org">python</a>
+<li><a href="http://nsis.sourceforge.net/Main_Page">Nullsoft installer</a>
+</lu>
+</p>
+
+<p>
+<b>Acknowledgements</b>
+</p>
+
+<p>
+<b>OpenSCAD Github Project members (public)</b>
+</p>
+
+<lu>
+<li><a href="https://github.com/kintel">Marius Kintel </a>
+<li><a href="http://clifford.at">Clifford Wolf</a>
+<li><a href="http://www.github.com/GilesBathgate">Giles Bathgate</a>
+<li><a href="https://github.com/brad">Brad Pitcher</a>
+<li><a href="https://github.com/donbright">Don Bright</a>
+</lu>
+
+<p>
+<b><a href="http://www.debian.org">Debian</a> maintainer:</b>
+ <a href="http://christian.amsuess.com/">Christian M. Amsuess</a>
+</p>
+
+<p>
+<b>Patches</b>
+</p>
+
+<lu>
+<li><a href="https://github.com/meta23">meta23</a>
+<li><a href="https://github.com/jasonblewis">jasonblewis</a>
+<li><a href="https://github.com/gregjurman">gregjurman</a>
+<li><a href="https://github.com/brianolson">brianolson</a>
+<li><a href="https://github.com/tjhowse">tjhowse</a>
+<li><a href="https://github.com/logxen">logxen</a>
+<li><a href="https://github.com/iamwilhelm">iamwilhelm</a>
+<li><a href="https://github.com/clothbot">clothbot</a>
+<li><a href="https://github.com/colah">colah</a>
+</lu>
+
+
+<p>
+<b>Mailing list, bug reports, testing, contribs, &c</b>
+</p>
+
+nop head, Triffid Hunter, Len Trigg, Kliment Yanev, Christian Siefkes,
+Andrew Plumb, Whosawhatsis, MichaelAtOz, Tony Buser, mrhdias,
+ibyte8bits, Koen Kooi, Tomas Mudrunka, knuds, cadr, mshearn, Hans L,
+Brett Sutton, hmnapier, Eero af Heurlin, caliston, 5263, ghost, 42loop,
+uniqx, Michael Thomson, Michael Ivko, Pierre Doucet, myglc2, Alan Cox,
+Peter Falke, Michael Ambrus, Gordon Wrigley, Ed Nisley, Stony Smith,
+Pasca Andrei, David Goodenough, William A Adams, mrrobinson, 1i7,
+benhowes ... and many others
+
+<p>
+<b>Hosting &amp; resources</b>
+</p>
+
+<lu>
+<li><a href="http://www.github.com">Github</a>
+<li><a href="http://rocklinux.net/pipermail/openscad/">Rock Linux</a>
+<li><a href="http://www.thingiverse.com">Thingiverse</a>
+</lu>
+
+<p>
+<a href="http://guerby.org/">Laurent Guerby</a> and the
+<a href="http://gcc.gnu.org/wiki/CompileFarm">GCC Compile Farm,</a> with
+<a href="http://osuosl.org/">OSUOSL,</a> <a href="http://www.irill.org">IRILL,</a>
+<a href="http://www.fsffrance.org">FSF France,</a> <a href="http://www.amd.com">AMD</a>,
+<a href="http://www.intel.com">Intel</a>, <a href="http://www.ibm.com">IBM</a>, &c.
+</p>
+
+<p>
+Apologies to anyone left out. Please file an issue on OpenSCAD's github if you know of someone who belongs here.
+</p>
+
+</body>
+</html>
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc
index 5e16892..4deb3b3 100644
--- a/src/CGALEvaluator.cc
+++ b/src/CGALEvaluator.cc
@@ -61,14 +61,16 @@ void CGALEvaluator::process(CGAL_Nef_polyhedron &target, const CGAL_Nef_polyhedr
if (target.dim != 2 && target.dim != 3) {
assert(false && "Dimension of Nef polyhedron must be 2 or 3");
}
- if (src.empty()) return; // Empty polyhedron. This can happen for e.g. square([0,0])
+ if (src.isEmpty()) return; // Empty polyhedron. This can happen for e.g. square([0,0])
+ if (target.isEmpty() && op != CGE_UNION) return; // empty op <something> => empty
if (target.dim != src.dim) return; // If someone tries to e.g. union 2d and 3d objects
CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
try {
switch (op) {
case CGE_UNION:
- target += src;
+ if (target.isEmpty()) target = src.copy();
+ else target += src;
break;
case CGE_INTERSECTION:
target *= src;
@@ -110,7 +112,8 @@ CGAL_Nef_polyhedron CGALEvaluator::applyToChildren(const AbstractNode &node, CGA
if (!isCached(*chnode)) {
CGALCache::instance()->insert(this->tree.getIdString(*chnode), chN);
}
- if (N.empty()) N = chN.copy();
+ // Initialize N on first iteration with first expected geometric object
+ if (N.isNull() && !N.isEmpty()) N = chN.copy();
else process(N, chN, op);
chnode->progress_report();
@@ -130,6 +133,7 @@ CGAL_Nef_polyhedron CGALEvaluator::applyHull(const CgaladvNode &node)
const CGAL_Nef_polyhedron &chN = item.second;
// FIXME: Don't use deep access to modinst members
if (chnode->modinst->isBackground()) continue;
+ if (chN.dim == 0) continue; // Ignore object with dimension 0 (e.g. echo)
if (dim == 0) {
dim = chN.dim;
}
@@ -244,7 +248,6 @@ Response CGALEvaluator::visit(State &state, const TransformNode &node)
if (!isCached(node)) {
// First union all children
N = applyToChildren(node, CGE_UNION);
-
if ( matrix_contains_infinity( node.matrix ) || matrix_contains_nan( node.matrix ) ) {
// due to the way parse/eval works we can't currently distinguish between NaN and Inf
PRINT("Warning: Transformation matrix contains Not-a-Number and/or Infinity - removing object.");
@@ -252,51 +255,53 @@ Response CGALEvaluator::visit(State &state, const TransformNode &node)
}
// Then apply transform
- // If there is no geometry under the transform, N will be empty and of dim 0,
- // just just silently ignore such nodes
- if (N.dim == 2) {
- // Unfortunately CGAL provides no transform method for CGAL_Nef_polyhedron2
- // objects. So we convert in to our internal 2d data format, transform it,
- // tesselate it and create a new CGAL_Nef_polyhedron2 from it.. What a hack!
-
- Eigen::Matrix2f testmat;
- testmat << node.matrix(0,0), node.matrix(0,1), node.matrix(1,0), node.matrix(1,1);
- if (testmat.determinant() == 0) {
- PRINT("Warning: Scaling a 2D object with 0 - removing object");
- N.reset();
- }
- else {
- CGAL_Aff_transformation2 t(
- node.matrix(0,0), node.matrix(0,1), node.matrix(0,3),
- node.matrix(1,0), node.matrix(1,1), node.matrix(1,3), node.matrix(3,3));
+ // If there is no geometry under the transform, N will be empty
+ // just silently ignore such nodes
+ if (!N.isNull()) {
+ if (N.dim == 2) {
+ // Unfortunately CGAL provides no transform method for CGAL_Nef_polyhedron2
+ // objects. So we convert in to our internal 2d data format, transform it,
+ // tesselate it and create a new CGAL_Nef_polyhedron2 from it.. What a hack!
- DxfData *dd = N.convertToDxfData();
- for (size_t i=0; i < dd->points.size(); i++) {
- CGAL_Kernel2::Point_2 p = CGAL_Kernel2::Point_2(dd->points[i][0], dd->points[i][1]);
- p = t.transform(p);
- dd->points[i][0] = to_double(p.x());
- dd->points[i][1] = to_double(p.y());
+ Eigen::Matrix2f testmat;
+ testmat << node.matrix(0,0), node.matrix(0,1), node.matrix(1,0), node.matrix(1,1);
+ if (testmat.determinant() == 0) {
+ PRINT("Warning: Scaling a 2D object with 0 - removing object");
+ N.reset();
+ }
+ else {
+ CGAL_Aff_transformation2 t(
+ node.matrix(0,0), node.matrix(0,1), node.matrix(0,3),
+ node.matrix(1,0), node.matrix(1,1), node.matrix(1,3), node.matrix(3,3));
+
+ DxfData *dd = N.convertToDxfData();
+ for (size_t i=0; i < dd->points.size(); i++) {
+ CGAL_Kernel2::Point_2 p = CGAL_Kernel2::Point_2(dd->points[i][0], dd->points[i][1]);
+ p = t.transform(p);
+ dd->points[i][0] = to_double(p.x());
+ dd->points[i][1] = to_double(p.y());
+ }
+
+ PolySet ps;
+ ps.is2d = true;
+ dxf_tesselate(&ps, *dd, 0, true, false, 0);
+
+ N = evaluateCGALMesh(ps);
+ delete dd;
}
-
- PolySet ps;
- ps.is2d = true;
- dxf_tesselate(&ps, *dd, 0, true, false, 0);
-
- N = evaluateCGALMesh(ps);
- delete dd;
- }
- }
- else if (N.dim == 3) {
- if (node.matrix.matrix().determinant() == 0) {
- PRINT("Warning: Scaling a 3D object with 0 - removing object");
- N.reset();
}
- else {
- CGAL_Aff_transformation t(
- node.matrix(0,0), node.matrix(0,1), node.matrix(0,2), node.matrix(0,3),
- node.matrix(1,0), node.matrix(1,1), node.matrix(1,2), node.matrix(1,3),
- node.matrix(2,0), node.matrix(2,1), node.matrix(2,2), node.matrix(2,3), node.matrix(3,3));
- N.p3->transform(t);
+ else if (N.dim == 3) {
+ if (node.matrix.matrix().determinant() == 0) {
+ PRINT("Warning: Scaling a 3D object with 0 - removing object");
+ N.reset();
+ }
+ else {
+ CGAL_Aff_transformation t(
+ node.matrix(0,0), node.matrix(0,1), node.matrix(0,2), node.matrix(0,3),
+ node.matrix(1,0), node.matrix(1,1), node.matrix(1,2), node.matrix(1,3),
+ node.matrix(2,0), node.matrix(2,1), node.matrix(2,2), node.matrix(2,3), node.matrix(3,3));
+ N.p3->transform(t);
+ }
}
}
}
@@ -387,7 +392,7 @@ void CGALEvaluator::addToParent(const State &state, const AbstractNode &node, co
CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps)
{
- if (ps.empty()) return CGAL_Nef_polyhedron();
+ if (ps.empty()) return CGAL_Nef_polyhedron(ps.is2d ? 2 : 3);
if (ps.is2d)
{
diff --git a/src/CGALRenderer.cc b/src/CGALRenderer.cc
index adf1217..4357e44 100644
--- a/src/CGALRenderer.cc
+++ b/src/CGALRenderer.cc
@@ -43,7 +43,11 @@
CGALRenderer::CGALRenderer(const CGAL_Nef_polyhedron &root) : root(root)
{
- if (root.dim == 2) {
+ if (this->root.isNull()) {
+ this->polyhedron = NULL;
+ this->polyset = NULL;
+ }
+ else if (root.dim == 2) {
DxfData *dd = root.convertToDxfData();
this->polyhedron = NULL;
this->polyset = new PolySet();
@@ -67,10 +71,6 @@ CGALRenderer::CGALRenderer(const CGAL_Nef_polyhedron &root) : root(root)
CGAL::OGL::Nef3_Converter<CGAL_Nef_polyhedron3>::convert_to_OGLPolyhedron(*this->root.p3, this->polyhedron);
this->polyhedron->init();
}
- else {
- this->polyhedron = NULL;
- this->polyset = NULL;
- }
}
CGALRenderer::~CGALRenderer()
@@ -81,6 +81,7 @@ CGALRenderer::~CGALRenderer()
void CGALRenderer::draw(bool showfaces, bool showedges) const
{
+ if (this->root.isNull()) return;
if (this->root.dim == 2) {
// Draw 2D polygons
glDisable(GL_LIGHTING);
diff --git a/src/CGAL_Nef_polyhedron.cc b/src/CGAL_Nef_polyhedron.cc
index ad2e4e2..8906595 100644
--- a/src/CGAL_Nef_polyhedron.cc
+++ b/src/CGAL_Nef_polyhedron.cc
@@ -61,7 +61,7 @@ CGAL_Nef_polyhedron &CGAL_Nef_polyhedron::minkowski(const CGAL_Nef_polyhedron &o
int CGAL_Nef_polyhedron::weight() const
{
- if (this->empty()) return 0;
+ if (this->isNull()) return 0;
size_t memsize = sizeof(CGAL_Nef_polyhedron);
if (this->dim == 2) {
@@ -84,8 +84,7 @@ int CGAL_Nef_polyhedron::weight() const
*/
PolySet *CGAL_Nef_polyhedron::convertToPolyset()
{
- if (this->empty())
- return new PolySet();
+ if (this->isNull()) return new PolySet();
PolySet *ps = NULL;
if (this->dim == 2) {
ps = new PolySet();
diff --git a/src/CGAL_Nef_polyhedron.h b/src/CGAL_Nef_polyhedron.h
index e8c505b..d949a2a 100644
--- a/src/CGAL_Nef_polyhedron.h
+++ b/src/CGAL_Nef_polyhedron.h
@@ -8,12 +8,15 @@
class CGAL_Nef_polyhedron
{
public:
- CGAL_Nef_polyhedron() : dim(0) {}
+ CGAL_Nef_polyhedron(int dim = 0) : dim(dim) {}
CGAL_Nef_polyhedron(CGAL_Nef_polyhedron2 *p);
CGAL_Nef_polyhedron(CGAL_Nef_polyhedron3 *p);
~CGAL_Nef_polyhedron() {}
- bool empty() const { return (dim == 0 || (!p2 && !p3)); }
+ // Empty means it is a geometric node which has zero area/volume
+ bool isEmpty() const { return (dim > 0 && !p2 && !p3); }
+ // Null means the node doesn't contain any geometry (for whatever reason)
+ bool isNull() const { return !p2 && !p3; }
void reset() { dim=0; p2.reset(); p3.reset(); }
CGAL_Nef_polyhedron &operator+=(const CGAL_Nef_polyhedron &other);
CGAL_Nef_polyhedron &operator*=(const CGAL_Nef_polyhedron &other);
diff --git a/src/MainWindow.ui b/src/MainWindow.ui
index 13bb226..f71ac96 100644
--- a/src/MainWindow.ui
+++ b/src/MainWindow.ui
@@ -217,7 +217,7 @@
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
- <string>Help</string>
+ <string>&amp;Help</string>
</property>
<addaction name="helpActionAbout"/>
<addaction name="helpActionHomepage"/>
diff --git a/src/OpenCSGWarningDialog.cc b/src/OpenCSGWarningDialog.cc
index 5648576..926a55b 100644
--- a/src/OpenCSGWarningDialog.cc
+++ b/src/OpenCSGWarningDialog.cc
@@ -8,12 +8,12 @@ OpenCSGWarningDialog::OpenCSGWarningDialog(QWidget*)
connect(this->showBox, SIGNAL(toggled(bool)),
Preferences::inst()->openCSGWarningBox, SLOT(setChecked(bool)));
connect(this->showBox, SIGNAL(toggled(bool)),
- Preferences::inst(), SLOT(openCSGWarningChanged(bool)));
+ Preferences::inst(), SLOT(on_openCSGWarningBox_toggled(bool)));
connect(this->enableOpenCSGBox, SIGNAL(toggled(bool)),
Preferences::inst()->enableOpenCSGBox, SLOT(setChecked(bool)));
connect(this->enableOpenCSGBox, SIGNAL(toggled(bool)),
- Preferences::inst(), SLOT(enableOpenCSGChanged(bool)));
+ Preferences::inst(), SLOT(on_enableOpenCSGBox_toggled(bool)));
}
void OpenCSGWarningDialog::setText(const QString &text)
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc
index 8e08e19..224e657 100644
--- a/src/PolySetCGALEvaluator.cc
+++ b/src/PolySetCGALEvaluator.cc
@@ -134,11 +134,11 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node)
if (v->modinst->isBackground()) continue;
CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(*v);
if (N.dim == 3) {
- if (sum.empty()) sum = N.copy();
+ if (sum.isNull()) sum = N.copy();
else sum += N;
}
}
- if (sum.empty()) return NULL;
+ if (sum.isNull()) return NULL;
if (!sum.p3->is_simple()) {
if (!node.cut_mode) {
PRINT("WARNING: Body of projection(cut = false) isn't valid 2-manifold! Modify your design..");
@@ -149,7 +149,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node)
//std::cout << sum.dump();
//std::cout.flush();
- CGAL_Nef_polyhedron nef_poly;
+ CGAL_Nef_polyhedron nef_poly(2);
if (node.cut_mode) {
CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
@@ -180,7 +180,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node)
}
}
- if ( sum.p3->is_empty() ) {
+ if (sum.p3->is_empty()) {
CGAL::set_error_behaviour(old_behaviour);
PRINT("WARNING: projection() failed.");
return NULL;
@@ -204,7 +204,6 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node)
log << "<!-- volume end. -->\n";
}
nef_poly.p2 = zremover.output_nefpoly2d;
- nef_poly.dim = 2;
} catch (const CGAL::Failure_exception &e) {
PRINTB("CGAL error in projection node while flattening: %s", e.what());
}
@@ -284,8 +283,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node)
plist.push_back(p);
}
// FIXME: Should the CGAL_Nef_polyhedron2 be cached?
- if (nef_poly.empty()) {
- nef_poly.dim = 2;
+ if (nef_poly.isEmpty()) {
nef_poly.p2.reset(new CGAL_Nef_polyhedron2(plist.begin(), plist.end(), CGAL_Nef_polyhedron2::INCLUDED));
}
else {
@@ -385,18 +383,18 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const LinearExtrudeNode &node)
BOOST_FOREACH (AbstractNode * v, node.getChildren()) {
if (v->modinst->isBackground()) continue;
CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(*v);
- if (!N.empty()) {
+ if (!N.isNull()) {
if (N.dim != 2) {
PRINT("ERROR: linear_extrude() is not defined for 3D child objects!");
}
else {
- if (sum.empty()) sum = N.copy();
+ if (sum.isNull()) sum = N.copy();
else sum += N;
}
}
}
- if (sum.empty()) return NULL;
+ if (sum.isNull()) return NULL;
dxf = sum.convertToDxfData();;
} else {
dxf = new DxfData(node.fn, node.fs, node.fa, node.filename, node.layername, node.origin_x, node.origin_y, node.scale);
@@ -485,18 +483,18 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const RotateExtrudeNode &node)
BOOST_FOREACH (AbstractNode * v, node.getChildren()) {
if (v->modinst->isBackground()) continue;
CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(*v);
- if (!N.empty()) {
+ if (!N.isNull()) {
if (N.dim != 2) {
PRINT("ERROR: rotate_extrude() is not defined for 3D child objects!");
}
else {
- if (sum.empty()) sum = N.copy();
+ if (sum.isNull()) sum = N.copy();
else sum += N;
}
}
}
- if (sum.empty()) return NULL;
+ if (sum.isNull()) return NULL;
dxf = sum.convertToDxfData();
} else {
dxf = new DxfData(node.fn, node.fs, node.fa, node.filename, node.layername, node.origin_x, node.origin_y, node.scale);
@@ -511,7 +509,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const CgaladvNode &node)
{
CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(node);
PolySet *ps = NULL;
- if (!N.empty()) {
+ if (!N.isNull()) {
ps = N.convertToPolyset();
if (ps) ps->convexity = node.convexity;
}
@@ -523,7 +521,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const RenderNode &node)
{
CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(node);
PolySet *ps = NULL;
- if (!N.empty()) {
+ if (!N.isNull()) {
if (N.dim == 3 && !N.p3->is_simple()) {
PRINT("WARNING: Body of render() isn't valid 2-manifold!");
}
diff --git a/src/boosty.h b/src/boosty.h
index 87260ff..6ec417a 100644
--- a/src/boosty.h
+++ b/src/boosty.h
@@ -1,6 +1,6 @@
-// boosty.h copyright 2012 don bright. released under the GPL 2, or later,
-// as described in the file named 'COPYING' in OpenSCAD's project root.
-// permission is given to Marius Kintel & Clifford Wolf to change this license.
+// boosty.h by don bright 2012. Copyright assigned to Marius Kintel and
+// Clifford Wolf 2012. Released under the GPL 2, or later, as described in
+// the file named 'COPYING' in OpenSCAD's project root.
#ifndef boosty_h_
#define boosty_h_
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 4b0df70..dde6761 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -588,7 +588,9 @@ void MainWindow::refreshDocument()
this->fileName.toStdString() % file.errorString().toStdString());
}
else {
- QString text = QTextStream(&file).readAll();
+ QTextStream reader(&file);
+ reader.setCodec("UTF-8");
+ QString text = reader.readAll();
PRINTB("Loaded design '%s'.", this->fileName.toStdString());
editor->setPlainText(text);
}
@@ -900,7 +902,9 @@ void MainWindow::actionSave()
PRINTB("Failed to open file for writing: %s (%s)", this->fileName.toStdString() % file.errorString().toStdString());
}
else {
- QTextStream(&file) << this->editor->toPlainText();
+ QTextStream writer(&file);
+ writer.setCodec("UTF-8");
+ writer << this->editor->toPlainText();
PRINTB("Saved design '%s'.", this->fileName.toStdString());
this->editor->setContentModified(false);
}
@@ -1232,35 +1236,37 @@ void MainWindow::actionRenderCGALDone(CGAL_Nef_polyhedron *root_N)
PolySetCache::instance()->print();
CGALCache::instance()->print();
- if (root_N->dim == 2) {
- PRINT(" Top level object is a 2D object:");
- PRINTB(" Empty: %6s", (root_N->p2->is_empty() ? "yes" : "no"));
- PRINTB(" Plane: %6s", (root_N->p2->is_plane() ? "yes" : "no"));
- PRINTB(" Vertices: %6d", root_N->p2->explorer().number_of_vertices());
- PRINTB(" Halfedges: %6d", root_N->p2->explorer().number_of_halfedges());
- PRINTB(" Edges: %6d", root_N->p2->explorer().number_of_edges());
- PRINTB(" Faces: %6d", root_N->p2->explorer().number_of_faces());
- PRINTB(" FaceCycles: %6d", root_N->p2->explorer().number_of_face_cycles());
- PRINTB(" ConnComp: %6d", root_N->p2->explorer().number_of_connected_components());
- }
-
- if (root_N->dim == 3) {
- PRINT(" Top level object is a 3D object:");
- PRINTB(" Simple: %6s", (root_N->p3->is_simple() ? "yes" : "no"));
- PRINTB(" Valid: %6s", (root_N->p3->is_valid() ? "yes" : "no"));
- PRINTB(" Vertices: %6d", root_N->p3->number_of_vertices());
- PRINTB(" Halfedges: %6d", root_N->p3->number_of_halfedges());
- PRINTB(" Edges: %6d", root_N->p3->number_of_edges());
- PRINTB(" Halffacets: %6d", root_N->p3->number_of_halffacets());
- PRINTB(" Facets: %6d", root_N->p3->number_of_facets());
- PRINTB(" Volumes: %6d", root_N->p3->number_of_volumes());
+ if (!root_N->isNull()) {
+ if (root_N->dim == 2) {
+ PRINT(" Top level object is a 2D object:");
+ PRINTB(" Empty: %6s", (root_N->p2->is_empty() ? "yes" : "no"));
+ PRINTB(" Plane: %6s", (root_N->p2->is_plane() ? "yes" : "no"));
+ PRINTB(" Vertices: %6d", root_N->p2->explorer().number_of_vertices());
+ PRINTB(" Halfedges: %6d", root_N->p2->explorer().number_of_halfedges());
+ PRINTB(" Edges: %6d", root_N->p2->explorer().number_of_edges());
+ PRINTB(" Faces: %6d", root_N->p2->explorer().number_of_faces());
+ PRINTB(" FaceCycles: %6d", root_N->p2->explorer().number_of_face_cycles());
+ PRINTB(" ConnComp: %6d", root_N->p2->explorer().number_of_connected_components());
+ }
+
+ if (root_N->dim == 3) {
+ PRINT(" Top level object is a 3D object:");
+ PRINTB(" Simple: %6s", (root_N->p3->is_simple() ? "yes" : "no"));
+ PRINTB(" Valid: %6s", (root_N->p3->is_valid() ? "yes" : "no"));
+ PRINTB(" Vertices: %6d", root_N->p3->number_of_vertices());
+ PRINTB(" Halfedges: %6d", root_N->p3->number_of_halfedges());
+ PRINTB(" Edges: %6d", root_N->p3->number_of_edges());
+ PRINTB(" Halffacets: %6d", root_N->p3->number_of_halffacets());
+ PRINTB(" Facets: %6d", root_N->p3->number_of_facets());
+ PRINTB(" Volumes: %6d", root_N->p3->number_of_volumes());
+ }
}
int s = this->progresswidget->elapsedTime() / 1000;
PRINTB("Total rendering time: %d hours, %d minutes, %d seconds", (s / (60*60)) % ((s / 60) % 60) % (s % 60));
this->root_N = root_N;
- if (!this->root_N->empty()) {
+ if (!this->root_N->isNull()) {
this->cgalRenderer = new CGALRenderer(*this->root_N);
// Go to CGAL view mode
if (viewActionCGALGrid->isChecked()) {
diff --git a/src/openscad.cc b/src/openscad.cc
index df7adb3..472b5d4 100644
--- a/src/openscad.cc
+++ b/src/openscad.cc
@@ -304,8 +304,19 @@ int main(int argc, char **argv)
fs::current_path(original_path);
if (deps_output_file) {
- if (!write_deps(deps_output_file,
- stl_output_file ? stl_output_file : off_output_file)) {
+ std::string deps_out( deps_output_file );
+ std::string geom_out;
+ if ( stl_output_file ) geom_out = std::string(stl_output_file);
+ else if ( off_output_file ) geom_out = std::string(off_output_file);
+ else if ( dxf_output_file ) geom_out = std::string(dxf_output_file);
+ else {
+ PRINTB("Output file:%s\n",output_file);
+ PRINT("Sorry, don't know how to write deps for that file type. Exiting\n");
+ exit(1);
+ }
+ int result = write_deps( deps_out, geom_out );
+ if ( !result ) {
+ PRINT("error writing deps");
exit(1);
}
}
diff --git a/src/polyset.cc b/src/polyset.cc
index b412f5f..e601585 100644
--- a/src/polyset.cc
+++ b/src/polyset.cc
@@ -157,7 +157,8 @@ void PolySet::render_surface(csgmode_e csgmode, const Transform3d &m, GLint *sha
}
#endif /* ENABLE_OPENCSG */
if (this->is2d) {
- double zbase = csgmode;
+ // Render 2D objects 1mm thick, but differences slightly larger
+ double zbase = 1 + (csgmode & CSGMODE_DIFFERENCE_FLAG) * 0.1;
glBegin(GL_TRIANGLES);
for (double z = -zbase/2; z < zbase; z += zbase)
{
@@ -248,7 +249,8 @@ void PolySet::render_edges(csgmode_e csgmode) const
{
glDisable(GL_LIGHTING);
if (this->is2d) {
- double zbase = csgmode;
+ // Render 2D objects 1mm thick, but differences slightly larger
+ double zbase = 1 + (csgmode & CSGMODE_DIFFERENCE_FLAG) * 0.1;
for (double z = -zbase/2; z < zbase; z += zbase)
{
for (size_t i = 0; i < borders.size(); i++) {
diff --git a/src/polyset.h b/src/polyset.h
index 4ca57bf..6626f79 100644
--- a/src/polyset.h
+++ b/src/polyset.h
@@ -29,14 +29,15 @@ public:
BoundingBox getBoundingBox() const;
+#define CSGMODE_DIFFERENCE_FLAG 0x10
enum csgmode_e {
- CSGMODE_NONE,
- CSGMODE_NORMAL = 1,
- CSGMODE_DIFFERENCE = 2,
- CSGMODE_BACKGROUND = 11,
- CSGMODE_BACKGROUND_DIFFERENCE = 12,
- CSGMODE_HIGHLIGHT = 21,
- CSGMODE_HIGHLIGHT_DIFFERENCE = 22
+ CSGMODE_NONE = 0x00,
+ CSGMODE_NORMAL = 0x01,
+ CSGMODE_DIFFERENCE = CSGMODE_NORMAL | CSGMODE_DIFFERENCE_FLAG,
+ CSGMODE_BACKGROUND = 0x02,
+ CSGMODE_BACKGROUND_DIFFERENCE = CSGMODE_BACKGROUND | CSGMODE_DIFFERENCE_FLAG,
+ CSGMODE_HIGHLIGHT = 0x03,
+ CSGMODE_HIGHLIGHT_DIFFERENCE = CSGMODE_HIGHLIGHT | CSGMODE_DIFFERENCE_FLAG
};
void render_surface(csgmode_e csgmode, const Transform3d &m, GLint *shaderinfo = NULL) const;
diff --git a/src/version_check.h b/src/version_check.h
index a9556e9..b6a63ab 100644
--- a/src/version_check.h
+++ b/src/version_check.h
@@ -1,12 +1,12 @@
-// version_check.h copyright 2012 don bright. released under the GPL 2, or
-// later, as described in the file named 'COPYING' in OpenSCAD's project root.
-// permission to change this license is given to Marius Kintel & Clifford Wolf
+// version_check.h by don bright 2012. Copyright assigned to Marius Kintel and
+// Clifford Wolf 2012. Released under the GPL 2, or later, as described in
+// the file named 'COPYING' in OpenSCAD's project root.
/* This file will check versions of libraries at compile time. If they
are too old, the user will be warned. If the user wishes to force
compilation, they can run
- qmake CONFIG=skip-version-check
+ qmake CONFIG+=skip-version-check
Otherwise they will be guided to README.md and an -build-dependencies script.
@@ -66,6 +66,9 @@ a time, to avoid confusion.
#warning "."
#warning "."
#warning "======================="
+#ifdef __clang__
+#error For Clang to work, CGAL must be >= 4.0.2
+#endif
#endif // CGAL_VERSION_NR < 10400010000
#endif //ENABLE_CGAL
contact: Jan Huwald // Impressum