summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md40
-rwxr-xr-xscripts/linux-build-dependencies.sh46
-rwxr-xr-xscripts/release-common.sh2
-rw-r--r--scripts/setenv-linbuild.sh23
-rwxr-xr-xscripts/update-web.sh6
-rw-r--r--src/csgtermnormalizer.cc43
-rw-r--r--src/csgtermnormalizer.h11
-rw-r--r--src/lexer.l4
-rw-r--r--src/mainwin.cc10
-rw-r--r--src/openscad.cc1
-rw-r--r--src/parsersettings.cc36
-rw-r--r--src/parsersettings.h4
-rw-r--r--testdata/scad/features/import_dxf-tests.scad10
-rw-r--r--testdata/scad/features/import_stl-tests.scad4
-rw-r--r--tests/cgalcachetest.cc2
-rw-r--r--tests/cgalpngtest.cc2
-rw-r--r--tests/cgalstlsanitytest.cc2
-rw-r--r--tests/cgaltest.cc2
-rw-r--r--tests/csgtermtest.cc2
-rw-r--r--tests/csgtestcore.cc10
-rw-r--r--tests/csgtexttest.cc2
-rw-r--r--tests/dumptest.cc4
-rw-r--r--tests/echotest.cc2
-rw-r--r--tests/modulecachetest.cc2
24 files changed, 176 insertions, 94 deletions
diff --git a/README.md b/README.md
index 13fba4d..8533e0d 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
# What is OpenSCAD?
+[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=openscad&url=http://openscad.org&title=OpenSCAD&language=&tags=github&category=software)
OpenSCAD is a software for creating solid 3D CAD objects. It is free software
and available for Linux/UNIX, MS Windows and Mac OS X.
@@ -78,10 +79,10 @@ To build OpenSCAD, you need some libraries and tools. The version
numbers in brackets specify the versions which have been used for
development. Other versions may or may not work as well.
-If you're using Ubuntu, you can install these libraries from
-aptitude. If you're using Mac, there is a build script that compiles
-the libraries from source. Follow the instructions for the platform
-you're compiling on below.
+If you're using a newer version of Ubuntu, you can install these
+libraries from aptitude. If you're using Mac, or an older Linux, there
+are build scripts that download and compile the libraries from source.
+Follow the instructions for the platform you're compiling on below.
* [Qt4 (4.4 - 4.7)](http://www.qt.nokia.com/)
* [CGAL (3.6 - 3.9)](http://www.cgal.org/)
@@ -116,15 +117,34 @@ compilation process.
After that, follow the Compilation instructions below.
-### Building for Ubuntu
+### Building for newer Ubunutu
-If you have done this and want to contribute, fork the repo and
-contribute docs on how to build for windows!
+sudo apt-get install libqt4-dev libqt4-opengl-dev libxmu-dev cmake \
+ libglew1.5-dev bison flex libeigen2-dev git-core libboost-all-dev \
+ libXi-dev libcgal-dev libglut3-dev libopencsg-dev libopencsg1
+
+Check your library versions against the list above. After that, follow
+the Compilation instructions below.
+
+### Building for older Linux or without root access
+
+First, make sure that you have compiler tools (build-essential on ubuntu).
+Then after you've cloned this git repository, run the script that sets up the
+environment variables.
+
+ source ./scripts/setenv-linbuild.sh
+
+Then run the script to download & compile all the prerequisite libraries above:
+
+ ./scripts/linux-build-dependencies.sh
+
+After that, follow the Compilation instructions below.
### Building for Windows
-If you have done this and want to contribute, fork the repo and
-contribute docs on how to build for windows!
+OpenSCAD for Windows is usually cross-compiled from Linux. If you wish to
+attempt an MSVC build, please see this site:
+http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows
### Compilation
@@ -137,3 +157,5 @@ Then run make. Finally you might run 'make install' as root or simply copy the
If you had problems compiling from source, raise a new issue in the
[issue tracker on the github page](https://github.com/openscad/openscad/issues).
+The four subsections of this site can also be helpful:
+http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_OpenSCAD_from_Sources
diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh
index 9097850..aef58b9 100755
--- a/scripts/linux-build-dependencies.sh
+++ b/scripts/linux-build-dependencies.sh
@@ -7,15 +7,12 @@
# Usage: linux-build-dependencies.sh
#
# Prerequisites:
-# - curl
-# -- you can uncomment 'build_curl' at the bottom
-# -- and add $BASEDIR/bin to your PATH, i.e. in .bash_profile
+# - wget or curl
# - Qt4
-# - cmake 2.8
-# -- you can uncomment 'build_cmake' at the bottom
+# - cmake 2.8 ( force build_cmake at bottom if yours is too old )
#
-BASEDIR=$HOME
+BASEDIR=$HOME/openscad_deps
OPENSCADDIR=$PWD
SRCDIR=$BASEDIR/src
DEPLOYDIR=$BASEDIR
@@ -87,12 +84,10 @@ build_mpfr()
cd $BASEDIR/src
rm -rf mpfr-$version
if [ ! -f mpfr-$version.tar.bz2 ]; then
- curl -O http://www.mpfr.org/mpfr-current/mpfr-$version.tar.bz2
+ curl -O http://www.mpfr.org/mpfr-$version/mpfr-$version.tar.bz2
fi
tar xjf mpfr-$version.tar.bz2
cd mpfr-$version
- curl -O http://www.mpfr.org/mpfr-current/allpatches
- patch -N -Z -p1 < allpatches
mkdir build
cd build
../configure --prefix=$DEPLOYDIR --with-gmp=$DEPLOYDIR
@@ -150,6 +145,10 @@ build_glew()
tar xzf glew-$version.tgz
cd glew-$version
mkdir -p $DEPLOYDIR/lib/pkgconfig
+
+ # uncomment this kludge for Fedora 64bit
+ # sed -i s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ config/Makefile.linux
+
GLEW_DEST=$DEPLOYDIR make -j$NUMCPU
GLEW_DEST=$DEPLOYDIR make install
}
@@ -166,6 +165,10 @@ build_opencsg()
tar xzf OpenCSG-$version.tar.gz
cd OpenCSG-$version
sed -i s/example// opencsg.pro # examples might be broken without GLUT
+
+ # uncomment this kludge for Fedora 64bit
+ # sed -i s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ src/Makefile
+
qmake-qt4
make
install -v lib/* $DEPLOYDIR/lib
@@ -208,20 +211,29 @@ echo "Using srcdir:" $SRCDIR
echo "Number of CPUs for parallel builds:" $NUMCPU
mkdir -p $SRCDIR $DEPLOYDIR
-#build_curl 7.26.0
+export PATH=$BASEDIR/bin:$PATH
+export LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64:$LD_LIBRARY_PATH
+export LD_RUN_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64:$LD_RUN_PATH
+echo "PATH modified temporarily"
+echo "LD_LIBRARY_PATH modified temporarily"
+echo "LD_RUN_PATH modified temporarily"
+
+if [ ! "`command -v curl`" ]; then
+ build_curl 7.26.0
+fi
+
# NB! For cmake, also update the actual download URL in the function
-#build_cmake 2.8.8
+if [ ! "`command -v cmake`" ]; then
+ build_cmake 2.8.8
+fi
+
build_eigen 2.0.17
build_gmp 5.0.5
-build_mpfr 3.1.0
+build_mpfr 3.1.1
build_boost 1.47.0
# NB! For CGAL, also update the actual download URL in the function
build_cgal 4.0
build_glew 1.7.0
build_opencsg 1.3.2
-echo "Now do this:"
-echo "export LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64"
-echo "GLEWDIR=$DEPLOYDIR OPENSCAD_LIBRARIES=$DEPLOYDIR qmake-qt4"
-echo "make -j$NUMCPU"
-
+echo "OpenSCAD dependencies built in " $BASEDIR
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
index 80c9795..94a8634 100755
--- a/scripts/release-common.sh
+++ b/scripts/release-common.sh
@@ -186,6 +186,6 @@ case $OS in
strip openscad-$VERSION/lib/openscad/*
cp scripts/installer-linux.sh openscad-$VERSION/install.sh
chmod 755 -R openscad-$VERSION/
- tar cz openscad-$VERSION > openscad-$VERSION.x86-64.tar.gz
+ tar cz openscad-$VERSION > openscad-$VERSION.x86-$ARCH.tar.gz
;;
esac
diff --git a/scripts/setenv-linbuild.sh b/scripts/setenv-linbuild.sh
new file mode 100644
index 0000000..9719533
--- /dev/null
+++ b/scripts/setenv-linbuild.sh
@@ -0,0 +1,23 @@
+# setup env variables for building OpenSCAD against custom built
+# dependency libraries from linux-build-dependencies.sh
+
+# run this file with 'source setenv-linbuild.sh'
+
+# BASEDIR and DEPLOYDIR must be the same as in linux-build-dependencies.sh
+BASEDIR=$HOME/openscad_deps
+DEPLOYDIR=$BASEDIR
+
+export PATH=$BASEDIR/bin:$PATH
+export LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64
+export LD_RUN_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64
+export OPENSCAD_LIBRARIES=$DEPLOYDIR
+export GLEWDIR=$DEPLOYDIR
+
+echo BASEDIR: $BASEDIR
+echo DEPLOYDIR: $DEPLOYDIR
+echo PATH modified
+echo LD_LIBRARY_PATH modified
+echo LD_RUN_PATH modified
+echo OPENSCAD_LIBRARIES modified
+echo GLEWDIR modified
+
diff --git a/scripts/update-web.sh b/scripts/update-web.sh
index 9036d9b..c611d28 100755
--- a/scripts/update-web.sh
+++ b/scripts/update-web.sh
@@ -11,6 +11,8 @@ fi
if [[ $OSTYPE =~ "darwin" ]]; then
OS=MACOSX
+elif [[ $OSTYPE == "linux-gnu" ]]; then
+ OS=LINUX
fi
indexfile=../openscad.github.com/index.html
@@ -21,6 +23,10 @@ if [ -f $indexfile ]; then
file2=$2
sed -i .backup -e "s/^\(.*win-snapshot-zip.*\)\(OpenSCAD-.*\.zip\)\(.*\)\(OpenSCAD-.*zip\)\(.*$\)/\\1$file1\\3$file1\\5/" $indexfile
sed -i .backup -e "s/^\(.*win-snapshot-exe.*\)\(OpenSCAD-.*-Installer\.exe\)\(.*\)\(OpenSCAD-.*-Installer.exe\)\(.*$\)/\\1$file2\\3$file2\\5/" $indexfile
+ elif [ $OS == LINUX ]; then
+ file2=$2
+ sed -i .backup -e "s/^\(.*linux-snapshot-32.*\)\(openscad-.*-32\.tar\.gz\)\(.*\)\(openscad-.*-32\.tar\.gz\)\(.*$\)/\\1$file1\\3$file1\\5/" $indexfile
+ sed -i .backup -e "s/^\(.*linux-snapshot-64.*\)\(openscad-.*-64\.tar\.gz\)\(.*\)\(openscad-.*-64\.tar\.gz\)\(.*$\)/\\1$file2\\3$file2\\5/" $indexfile
fi
echo "Web page updated. Remember to commit and push openscad.github.com"
else
diff --git a/src/csgtermnormalizer.cc b/src/csgtermnormalizer.cc
index 6600758..e2474e9 100644
--- a/src/csgtermnormalizer.cc
+++ b/src/csgtermnormalizer.cc
@@ -5,25 +5,29 @@
/*!
NB! for e.g. empty intersections, this can normalize a tree to nothing and return NULL.
*/
-shared_ptr<CSGTerm> CSGTermNormalizer::normalize(const shared_ptr<CSGTerm> &root,
- size_t limit)
+shared_ptr<CSGTerm> CSGTermNormalizer::normalize(const shared_ptr<CSGTerm> &root)
{
shared_ptr<CSGTerm> temp = root;
while (1) {
+ this->rootnode = temp;
+ this->nodecount = 0;
shared_ptr<CSGTerm> n = normalizePass(temp);
if (!n) return n; // If normalized to nothing
if (temp == n) break;
temp = n;
- unsigned int num = count(temp);
-#ifdef DEBUG
- PRINTB("Normalize count: %d\n", num);
-#endif
- if (num > limit) {
- PRINTB("WARNING: Normalized tree is growing past %d elements. Aborting normalization.\n", limit);
- return root;
+ if (this->nodecount > this->limit) {
+ PRINTB("WARNING: Normalized tree is growing past %d elements. Aborting normalization.\n", this->limit);
+ // Clean up any partially evaluated terms
+ shared_ptr<CSGTerm> newroot = root, tmproot;
+ while (newroot != tmproot) {
+ tmproot = newroot;
+ newroot = collapse_null_terms(tmproot);
+ }
+ return newroot;
}
}
+ this->rootnode.reset();
return temp;
}
@@ -42,7 +46,11 @@ shared_ptr<CSGTerm> CSGTermNormalizer::normalizePass(shared_ptr<CSGTerm> term)
}
do {
- while (term && normalize_tail(term)) { }
+ while (term && match_and_replace(term)) { }
+ this->nodecount++;
+ if (nodecount > this->limit) {
+ return shared_ptr<CSGTerm>();
+ }
if (!term || term->type == CSGTerm::TYPE_PRIMITIVE) return term;
if (term->left) term->left = normalizePass(term->left);
} while (term->type != CSGTerm::TYPE_UNION &&
@@ -51,6 +59,11 @@ shared_ptr<CSGTerm> CSGTermNormalizer::normalizePass(shared_ptr<CSGTerm> term)
term->right = normalizePass(term->right);
// FIXME: Do we need to take into account any transformation of item here?
+ return collapse_null_terms(term);
+}
+
+shared_ptr<CSGTerm> CSGTermNormalizer::collapse_null_terms(const shared_ptr<CSGTerm> &term)
+{
if (!term->right) {
if (term->type == CSGTerm::TYPE_UNION || term->type == CSGTerm::TYPE_DIFFERENCE) return term->left;
else return term->right;
@@ -59,13 +72,14 @@ shared_ptr<CSGTerm> CSGTermNormalizer::normalizePass(shared_ptr<CSGTerm> term)
if (term->type == CSGTerm::TYPE_UNION) return term->right;
else return term->left;
}
-
return term;
}
-bool CSGTermNormalizer::normalize_tail(shared_ptr<CSGTerm> &term)
+bool CSGTermNormalizer::match_and_replace(shared_ptr<CSGTerm> &term)
{
- if (term->type == CSGTerm::TYPE_UNION || term->type == CSGTerm::TYPE_PRIMITIVE) return false;
+ if (term->type == CSGTerm::TYPE_UNION || term->type == CSGTerm::TYPE_PRIMITIVE) {
+ return false;
+ }
// Part A: The 'x . (y . z)' expressions
@@ -149,8 +163,9 @@ bool CSGTermNormalizer::normalize_tail(shared_ptr<CSGTerm> &term)
return false;
}
+// Counts all non-leaf nodes
unsigned int CSGTermNormalizer::count(const shared_ptr<CSGTerm> &term) const
{
if (!term) return 0;
- return term->type == CSGTerm::TYPE_PRIMITIVE ? 1 : 0 + count(term->left) + count(term->right);
+ return term->type == CSGTerm::TYPE_PRIMITIVE ? 0 : 1 + count(term->left) + count(term->right);
}
diff --git a/src/csgtermnormalizer.h b/src/csgtermnormalizer.h
index e5a2eca..c331f11 100644
--- a/src/csgtermnormalizer.h
+++ b/src/csgtermnormalizer.h
@@ -6,15 +6,20 @@
class CSGTermNormalizer
{
public:
- CSGTermNormalizer() {}
+ CSGTermNormalizer(size_t limit) : limit(limit) {}
~CSGTermNormalizer() {}
- shared_ptr<class CSGTerm> normalize(const shared_ptr<CSGTerm> &term, size_t limit);
+ shared_ptr<class CSGTerm> normalize(const shared_ptr<CSGTerm> &term);
private:
shared_ptr<CSGTerm> normalizePass(shared_ptr<CSGTerm> term) ;
- bool normalize_tail(shared_ptr<CSGTerm> &term);
+ bool match_and_replace(shared_ptr<CSGTerm> &term);
+ shared_ptr<CSGTerm> collapse_null_terms(const shared_ptr<CSGTerm> &term);
unsigned int count(const shared_ptr<CSGTerm> &term) const;
+
+ size_t limit;
+ size_t nodecount;
+ shared_ptr<class CSGTerm> rootnode;
};
#endif
diff --git a/src/lexer.l b/src/lexer.l
index 188046f..f939330 100644
--- a/src/lexer.l
+++ b/src/lexer.l
@@ -118,7 +118,7 @@ use[ \t\r\n>]*"<" { BEGIN(cond_use); }
else {
usepath = sourcepath() / filename;
if (!fs::exists(usepath)) {
- usepath = boosty::absolute(fs::path(get_librarydir()) / filename);
+ usepath = locate_file(filename);
}
}
/* Only accept regular files which exists */
@@ -214,7 +214,7 @@ void includefile()
fs::path finfo = dirinfo / filename;
if (!exists(finfo)) {
- finfo = fs::path(get_librarydir()) / filepath / filename;
+ finfo = locate_file((fs::path(filepath) / filename).string());
}
filepath.clear();
diff --git a/src/mainwin.cc b/src/mainwin.cc
index ecbe271..3fdee6b 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -721,9 +721,9 @@ void MainWindow::compileCSG(bool procevents)
if (procevents)
QApplication::processEvents();
- CSGTermNormalizer normalizer;
size_t normalizelimit = 2 * Preferences::inst()->getValue("advanced/openCSGLimit").toUInt();
- this->root_norm_term = normalizer.normalize(this->root_raw_term, normalizelimit);
+ CSGTermNormalizer normalizer(normalizelimit);
+ this->root_norm_term = normalizer.normalize(this->root_raw_term);
if (this->root_norm_term) {
this->root_chain = new CSGChain();
this->root_chain->import(this->root_norm_term);
@@ -743,7 +743,7 @@ void MainWindow::compileCSG(bool procevents)
highlights_chain = new CSGChain();
for (unsigned int i = 0; i < highlight_terms.size(); i++) {
- highlight_terms[i] = normalizer.normalize(highlight_terms[i], normalizelimit);
+ highlight_terms[i] = normalizer.normalize(highlight_terms[i]);
highlights_chain->import(highlight_terms[i]);
}
}
@@ -756,7 +756,7 @@ void MainWindow::compileCSG(bool procevents)
background_chain = new CSGChain();
for (unsigned int i = 0; i < background_terms.size(); i++) {
- background_terms[i] = normalizer.normalize(background_terms[i], normalizelimit);
+ background_terms[i] = normalizer.normalize(background_terms[i]);
background_chain->import(background_terms[i]);
}
}
@@ -1359,7 +1359,7 @@ void MainWindow::actionExportSTLorOFF(bool)
}
if (!this->root_N->p3->is_simple()) {
- PRINT("Object isn't a valid 2-manifold! Modify your design..");
+ PRINT("Object isn't a valid 2-manifold! Modify your design. See http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/STL_Import_and_Export");
clearCurrentOutput();
return;
}
diff --git a/src/openscad.cc b/src/openscad.cc
index 798bdec..f508b80 100644
--- a/src/openscad.cc
+++ b/src/openscad.cc
@@ -294,6 +294,7 @@ int main(int argc, char **argv)
PRINTB("Can't open file \"%s\" for export", csg_output_file);
}
else {
+ fs::current_path(fparent); // Force exported filenames to be relative to document path
fstream << tree.getString(*root_node) << "\n";
fstream.close();
}
diff --git a/src/parsersettings.cc b/src/parsersettings.cc
index 134514c..53b34f4 100644
--- a/src/parsersettings.cc
+++ b/src/parsersettings.cc
@@ -1,30 +1,42 @@
#include "parsersettings.h"
#include <boost/filesystem.hpp>
-
-using namespace boost::filesystem;
+#include <boost/foreach.hpp>
#include "boosty.h"
+#include <qglobal.h> // Needed for Q_ defines - move the offending code somewhere else
+
+namespace fs = boost::filesystem;
-std::string librarydir;
+std::vector<std::string> librarypath;
-void set_librarydir(const std::string &libdir)
+void add_librarydir(const std::string &libdir)
{
- librarydir = libdir;
+ librarypath.push_back(libdir);
}
-const std::string &get_librarydir()
+/*!
+ Searces for the given file in library paths and returns the full path if found.
+ Returns an empty path if file cannot be found.
+*/
+std::string locate_file(const std::string &filename)
{
- return librarydir;
+ BOOST_FOREACH(const std::string &dir, librarypath) {
+ fs::path usepath = fs::path(dir) / filename;
+ if (fs::exists(usepath)) return usepath.string();
+ }
+ return std::string();
}
void parser_init(const std::string &applicationpath)
{
+ // FIXME: Append paths from OPENSCADPATH before adding built-in paths
+
std::string librarydir;
- path libdir(applicationpath);
- path tmpdir;
-#ifdef __APPLE__
+ fs::path libdir(applicationpath);
+ fs::path tmpdir;
+#ifdef Q_WS_MAC
libdir /= "../Resources"; // Libraries can be bundled
if (!is_directory(libdir / "libraries")) libdir /= "../../..";
-#elif !defined(WIN32)
+#elif defined(Q_OS_UNIX)
if (is_directory(tmpdir = libdir / "../share/openscad/libraries")) {
librarydir = boosty::stringy( tmpdir );
} else if (is_directory(tmpdir = libdir / "../../share/openscad/libraries")) {
@@ -36,5 +48,5 @@ void parser_init(const std::string &applicationpath)
if (is_directory(tmpdir = libdir / "libraries")) {
librarydir = boosty::stringy( tmpdir );
}
- set_librarydir(librarydir);
+ if (!librarydir.empty()) add_librarydir(librarydir);
}
diff --git a/src/parsersettings.h b/src/parsersettings.h
index a5dc939..007aa9c 100644
--- a/src/parsersettings.h
+++ b/src/parsersettings.h
@@ -6,7 +6,7 @@
extern int parser_error_pos;
void parser_init(const std::string &applicationpath);
-void set_librarydir(const std::string &libdir);
-const std::string &get_librarydir();
+void add_librarydir(const std::string &libdir);
+std::string locate_file(const std::string &filename);
#endif
diff --git a/testdata/scad/features/import_dxf-tests.scad b/testdata/scad/features/import_dxf-tests.scad
deleted file mode 100644
index 50a5416..0000000
--- a/testdata/scad/features/import_dxf-tests.scad
+++ /dev/null
@@ -1,10 +0,0 @@
-import();
-translate([-210,0,0]) import(file="../../dxf/polygons.dxf");
-translate([-210,0,0]) import(file="../../dxf/polygons.dxf", origin=[0,110]);
-translate([-210,0,0]) import(file="../../dxf/polygons.dxf", origin=[110,110], scale=0.5);
-import(file="../../dxf/multiple-layers.dxf");
-translate([-200,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="0");
-translate([0,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="0");
-translate([200,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="noname");
-translate([0,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="Layer with a pretty long name including \\ \"special\" /'\\\\ characters");
-translate([200,0,0]) import(file="/Users/kintel/code/OpenSCAD/openscad/tests/../testdata/dxf/polygons.dxf");
diff --git a/testdata/scad/features/import_stl-tests.scad b/testdata/scad/features/import_stl-tests.scad
deleted file mode 100644
index af42e8d..0000000
--- a/testdata/scad/features/import_stl-tests.scad
+++ /dev/null
@@ -1,4 +0,0 @@
-import_stl("import.stl");
-translate([2,0,0]) import("import.stl");
-translate([4,0,0]) import("import_bin.stl");
-translate([0,2,0]) import("/Users/kintel/code/OpenSCAD/openscad/tests/../testdata/scad/features/import.stl");
diff --git a/tests/cgalcachetest.cc b/tests/cgalcachetest.cc
index 18e9efa..46e0e9a 100644
--- a/tests/cgalcachetest.cc
+++ b/tests/cgalcachetest.cc
@@ -139,7 +139,7 @@ int main(int argc, char **argv)
currentdir = boosty::stringy( fs::current_path() );
parser_init(QCoreApplication::instance()->applicationDirPath().toStdString());
- set_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
+ add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
Context root_ctx;
register_builtin(root_ctx);
diff --git a/tests/cgalpngtest.cc b/tests/cgalpngtest.cc
index 7c9684a..08e539e 100644
--- a/tests/cgalpngtest.cc
+++ b/tests/cgalpngtest.cc
@@ -112,7 +112,7 @@ int main(int argc, char **argv)
currentdir = boosty::stringy( fs::current_path() );
parser_init(QCoreApplication::instance()->applicationDirPath().toStdString());
- set_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
+ add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
Context root_ctx;
register_builtin(root_ctx);
diff --git a/tests/cgalstlsanitytest.cc b/tests/cgalstlsanitytest.cc
index 7241482..137f626 100644
--- a/tests/cgalstlsanitytest.cc
+++ b/tests/cgalstlsanitytest.cc
@@ -98,7 +98,7 @@ int main(int argc, char **argv)
currentdir = boosty::stringy( fs::current_path() );
parser_init(QCoreApplication::instance()->applicationDirPath().toStdString());
- set_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
+ add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
Context root_ctx;
register_builtin(root_ctx);
diff --git a/tests/cgaltest.cc b/tests/cgaltest.cc
index 98617a3..e4761db 100644
--- a/tests/cgaltest.cc
+++ b/tests/cgaltest.cc
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
currentdir = boosty::stringy( fs::current_path() );
parser_init(QCoreApplication::instance()->applicationDirPath().toStdString());
- set_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
+ add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
Context root_ctx;
register_builtin(root_ctx);
diff --git a/tests/csgtermtest.cc b/tests/csgtermtest.cc
index 1bd2468..e793c4a 100644
--- a/tests/csgtermtest.cc
+++ b/tests/csgtermtest.cc
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
currentdir = boosty::stringy( fs::current_path() );
parser_init(QCoreApplication::instance()->applicationDirPath().toStdString());
- set_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
+ add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
Context root_ctx;
register_builtin(root_ctx);
diff --git a/tests/csgtestcore.cc b/tests/csgtestcore.cc
index cb96940..acc7c31 100644
--- a/tests/csgtestcore.cc
+++ b/tests/csgtestcore.cc
@@ -258,7 +258,7 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)
std::string currentdir = boosty::stringy( fs::current_path() );
parser_init(QCoreApplication::instance()->applicationDirPath().toStdString());
- set_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
+ add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
Context root_ctx;
register_builtin(root_ctx);
@@ -302,8 +302,8 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)
}
// CSG normalization
- CSGTermNormalizer normalizer;
- csgInfo.root_norm_term = normalizer.normalize(root_raw_term, 5000);
+ CSGTermNormalizer normalizer(5000);
+ csgInfo.root_norm_term = normalizer.normalize(root_raw_term);
if (csgInfo.root_norm_term) {
csgInfo.root_chain = new CSGChain();
csgInfo.root_chain->import(csgInfo.root_norm_term);
@@ -319,7 +319,7 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)
csgInfo.highlights_chain = new CSGChain();
for (unsigned int i = 0; i < csgInfo.highlight_terms.size(); i++) {
- csgInfo.highlight_terms[i] = normalizer.normalize(csgInfo.highlight_terms[i], 5000);
+ csgInfo.highlight_terms[i] = normalizer.normalize(csgInfo.highlight_terms[i]);
csgInfo.highlights_chain->import(csgInfo.highlight_terms[i]);
}
}
@@ -329,7 +329,7 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)
csgInfo.background_chain = new CSGChain();
for (unsigned int i = 0; i < csgInfo.background_terms.size(); i++) {
- csgInfo.background_terms[i] = normalizer.normalize(csgInfo.background_terms[i], 5000);
+ csgInfo.background_terms[i] = normalizer.normalize(csgInfo.background_terms[i]);
csgInfo.background_chain->import(csgInfo.background_terms[i]);
}
}
diff --git a/tests/csgtexttest.cc b/tests/csgtexttest.cc
index 6e18f20..e050232 100644
--- a/tests/csgtexttest.cc
+++ b/tests/csgtexttest.cc
@@ -81,7 +81,7 @@ int main(int argc, char **argv)
currentdir = boosty::stringy( fs::current_path() );
parser_init(QCoreApplication::instance()->applicationDirPath().toStdString());
- set_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
+ add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
Context root_ctx;
register_builtin(root_ctx);
diff --git a/tests/dumptest.cc b/tests/dumptest.cc
index f923a64..6851fb1 100644
--- a/tests/dumptest.cc
+++ b/tests/dumptest.cc
@@ -84,10 +84,10 @@ int main(int argc, char **argv)
QCoreApplication app(argc, argv);
fs::path original_path = fs::current_path();
- currentdir = boosty::stringy( fs::current_path() );
+ currentdir = boosty::stringy(fs::current_path());
parser_init(QCoreApplication::instance()->applicationDirPath().toStdString());
- set_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
+ add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
Context root_ctx;
register_builtin(root_ctx);
diff --git a/tests/echotest.cc b/tests/echotest.cc
index d731ee3..bf2f4a4 100644
--- a/tests/echotest.cc
+++ b/tests/echotest.cc
@@ -89,7 +89,7 @@ int main(int argc, char **argv)
currentdir = boosty::stringy( fs::current_path() );
parser_init(QCoreApplication::instance()->applicationDirPath().toStdString());
- set_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
+ add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
Context root_ctx;
register_builtin(root_ctx);
diff --git a/tests/modulecachetest.cc b/tests/modulecachetest.cc
index 2ef7a6c..0028114 100644
--- a/tests/modulecachetest.cc
+++ b/tests/modulecachetest.cc
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
currentdir = boosty::stringy( fs::current_path() );
parser_init(QCoreApplication::instance()->applicationDirPath().toStdString());
- set_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
+ add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries"));
Context root_ctx;
register_builtin(root_ctx);
contact: Jan Huwald // Impressum