diff options
-rw-r--r-- | openscad.pro | 1 | ||||
-rw-r--r-- | src/boosty.h | 4 | ||||
-rw-r--r-- | src/color.cc | 5 | ||||
-rw-r--r-- | src/stl-utils.cc | 73 | ||||
-rw-r--r-- | src/transform.cc | 4 |
5 files changed, 84 insertions, 3 deletions
diff --git a/openscad.pro b/openscad.pro index 024b788..b5321cc 100644 --- a/openscad.pro +++ b/openscad.pro @@ -246,6 +246,7 @@ SOURCES += src/version_check.cc \ src/printutils.cc \ src/progress.cc \ src/parsersettings.cc \ + src/stl-utils.cc \ \ src/nodedumper.cc \ src/traverser.cc \ diff --git a/src/boosty.h b/src/boosty.h index 2e7d76b..87260ff 100644 --- a/src/boosty.h +++ b/src/boosty.h @@ -1,5 +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. #ifndef boosty_h_ #define boosty_h_ @@ -16,6 +17,7 @@ see also http://www.boost.org/doc/libs/1_48_0/libs/filesystem/v3/doc/index.htm + http://www.boost.org/doc/libs/1_45_0/libs/filesystem/v2/doc/index.htm http://www.boost.org/doc/libs/1_42_0/libs/filesystem/doc/index.htm http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/index.htm include/boost/wave/util/filesystem_compatability.hpp @@ -29,7 +31,7 @@ namespace fs = boost::filesystem; namespace boosty { -#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3 +#if BOOST_VERSION >= 104400 && BOOST_FILESYSTEM_VERSION >= 3 inline bool is_absolute( fs::path p ) { diff --git a/src/color.cc b/src/color.cc index 4220396..acca652 100644 --- a/src/color.cc +++ b/src/color.cc @@ -64,8 +64,11 @@ AbstractNode *ColorModule::evaluate(const Context *ctx, const ModuleInstantiatio Value v = c.lookup_variable("c"); if (v.type() == Value::VECTOR) { - for (size_t i = 0; i < 4; i++) + for (size_t i = 0; i < 4; i++) { node->color[i] = i < v.toVector().size() ? v.toVector()[i].toDouble() : 1.0; + if (node->color[i] > 1) + PRINTB_NOCACHE("WARNING: color() expects numbers between 0.0 and 1.0. Value of %.1f is too large.", node->color[i]); + } } else if (v.type() == Value::STRING) { std::string colorname = v.toString(); boost::algorithm::to_lower(colorname); diff --git a/src/stl-utils.cc b/src/stl-utils.cc new file mode 100644 index 0000000..790fd17 --- /dev/null +++ b/src/stl-utils.cc @@ -0,0 +1,73 @@ +#if defined(__APPLE__) && defined(__GNUC__) + +#include <iostream> + +// Workarounds for symbols that are missing from Leopard stdlibc++.dylib. +_GLIBCXX_BEGIN_NAMESPACE(std) +// From ostream_insert.h +template ostream& __ostream_insert(ostream&, const char*, streamsize); + +#ifdef _GLIBCXX_USE_WCHAR_T + template wostream& __ostream_insert(wostream&, const wchar_t*, streamsize); +#endif + +// From ostream.tcc +template ostream& ostream::_M_insert(long); +template ostream& ostream::_M_insert(unsigned long); +template ostream& ostream::_M_insert(bool); +#ifdef _GLIBCXX_USE_LONG_LONG + template ostream& ostream::_M_insert(long long); + template ostream& ostream::_M_insert(unsigned long long); +#endif +template ostream& ostream::_M_insert(double); +template ostream& ostream::_M_insert(long double); +template ostream& ostream::_M_insert(const void*); + +#ifdef _GLIBCXX_USE_WCHAR_T + template wostream& wostream::_M_insert(long); + template wostream& wostream::_M_insert(unsigned long); + template wostream& wostream::_M_insert(bool); + #ifdef _GLIBCXX_USE_LONG_LONG + template wostream& wostream::_M_insert(long long); + template wostream& wostream::_M_insert(unsigned long long); + #endif + template wostream& wostream::_M_insert(double); + template wostream& wostream::_M_insert(long double); + template wostream& wostream::_M_insert(const void*); +#endif + + +// From istream.tcc +template istream& istream::_M_extract(unsigned short&); +template istream& istream::_M_extract(unsigned int&); +template istream& istream::_M_extract(long&); +template istream& istream::_M_extract(unsigned long&); +template istream& istream::_M_extract(bool&); +#ifdef _GLIBCXX_USE_LONG_LONG + template istream& istream::_M_extract(long long&); + template istream& istream::_M_extract(unsigned long long&); +#endif +template istream& istream::_M_extract(float&); +template istream& istream::_M_extract(double&); +template istream& istream::_M_extract(long double&); +template istream& istream::_M_extract(void*&); + +#ifdef _GLIBCXX_USE_WCHAR_T + template wistream& wistream::_M_extract(unsigned short&); + template wistream& wistream::_M_extract(unsigned int&); + template wistream& wistream::_M_extract(long&); + template wistream& wistream::_M_extract(unsigned long&); + template wistream& wistream::_M_extract(bool&); + #ifdef _GLIBCXX_USE_LONG_LONG + template wistream& wistream::_M_extract(long long&); + template wistream& wistream::_M_extract(unsigned long long&); + #endif + template wistream& wistream::_M_extract(float&); + template wistream& wistream::_M_extract(double&); + template wistream& wistream::_M_extract(long double&); + template wistream& wistream::_M_extract(void*&); +#endif + +_GLIBCXX_END_NAMESPACE + +#endif diff --git a/src/transform.cc b/src/transform.cc index 5b71346..0f678c5 100644 --- a/src/transform.cc +++ b/src/transform.cc @@ -98,7 +98,9 @@ AbstractNode *TransformModule::evaluate(const Context *ctx, const ModuleInstanti Value val_a = c.lookup_variable("a"); if (val_a.type() == Value::VECTOR) { - Eigen::AngleAxisd rotx, roty, rotz; + Eigen::AngleAxisd rotx(0, Vector3d::UnitX()); + Eigen::AngleAxisd roty(0, Vector3d::UnitY()); + Eigen::AngleAxisd rotz(0, Vector3d::UnitZ()); double a; if (val_a.toVector().size() > 0) { val_a.toVector()[0].getDouble(a); |