Skip to content


Subversion checkout URL

You can clone with
Download ZIP


boost >1.47 causing regression test failures #174

donbright opened this Issue · 8 comments

2 participants


322/462 Testing: opencsgtest_polygon-holes-touch322/462 Testing: opencsgtest_polygon-holes-touch
322/462 Test: opencsgtest_polygon-holes-touch
Command: "/usr/bin/python" "/home/donb/openscad/tests/" "--comparator=" "-c" "/usr/bin/convert" "-s" "png" "/home/donb/openscad/tests/bin150/opencsgtest" "/home/donb/openscad/tests/../testdata/scad/dxf/polygon-holes-touch.scad"
Directory: /home/donb/openscad/tests/bin150
"opencsgtest_polygon-holes-touch" start time: Aug 14 04:14 CEST


Error output: WARNING: Duplicate vertex found during Tessellation. Render may be incorrect.
sorry, this triangulation does not deal with
intersecting constraints
CGAL error in dxf_tesselate(): CGAL ERROR: assertion violation!
Expr: false
File: /home/donb/openscad_deps150/include/CGAL/Constrained_triangulation_2.h
Line: 623
Normalized CSG tree has 1 elements

ImageMagick image comparison: /usr/bin/convert -alpha Off -compose difference -composite -threshold 10% -morphology Erode Square -format %[fx:whmean] info:
expected image: /home/donb/openscad/tests/regression/opencsgtest/polygon-holes-touch-expected.png

actual image: /home/donb/openscad/tests/bin150/opencsgtest-output/polygon-holes-touch-actual.png
35816 pixel errors
Imagemagick return 0 output: 35816

Analysis so far:

as i posted to the mailing list, this error occurs with any boost > 1.47, regardless (apparently) of compiler or version of CGAL.

tested with gcc 4.4, 4.6, and clang 3.0, as well as cgal 3.9 and 4.02

Step one is to analyze the 'touching' tests, namely the file ./polygon-holes-touch.scad

isolating down to the section in '' which imports DXF files. the dxf_tessellate here is barfing.

doing a dump() of the DxfData structure, immediately before tesselation, reveals the following:

boost 1.50:
num points: 104
num paths: 2
num dims: 0

boost 1.47:
num points: 104
num paths: 3
num dims: 0

Analysis reveals that OpenSCAD compiled with boost 1.48 and boost 1.47 have the same point data, but the paths are different. 1.47 log has a short path, a long path, and a short path. while 1.48 only has two paths, a long one and a short one. the points in the paths are different as well.

This would lead me next to investigate DxfData, specifically it's constructor, which appears to be responsible for creating the paths.


I noticed this a while back and intuitively I blamed CGAL for behaving differently with boost 1.48+.
I didn't dig further though..


ok this is getting rather humorous.

by dumping this->points and this->lines it is revealed that they are identical between the two compilations.

however, if you try to dump the order that these lines and points are processed during the 'extract closed path' section of the code, you will see that they are processing the lines+points in a completely different order.

different order?

then we get to this piece of code.

  typedef boost::unordered_map<int, int> LineMap;
  LineMap enabled_lines;
  for (size_t i = 0; i < lines.size(); i++) {
    enabled_lines[i] = i;

Note that if you change this to the following:

  typedef std::map<int, int> LineMap;
  LineMap enabled_lines;
  for (size_t i = 0; i < lines.size(); i++) {
    enabled_lines[i] = i;

cgalpngtest will work on boost 1.50.0 just like it did on boost 1.47.0.

perhaps boost unordered map is not exactly unordered in older versions of boost, 'hiding' this problem until 1.48 or so?

we can see similar questions here:

the main problem with the 'fix' is that

  ctest -C All -R touch 

still shows that opencsgtest and throwntogether test are still failing. will continue to dig.


turns out i just forgot to recompile the test binaries. we are back to 99% passing now with boost 1.50.0.

there is one problem. it is Example 9. The alpha level for some reason is much less 'transparent' when using boost 1.50.0 . i will open a separate issue and prepare a pull to fix this issue. thanks.


Hm, somehow, boost > 1.47 has another issue on Mac OS X (on Lion using gcc-llvm-4.2.1):

g++ -c -pipe -fno-strict-aliasing -frounding-math -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DOPENSCAD_VERSION=2012.08.16 -DOPENSCAD_YEAR=2012.0 -DOPENSCAD_MONTH=08.0 -DOPENSCAD_DAY=16.0 -DDEBUG -DENABLE_MDI -DUSE_PROGRESSWIDGET -DENABLE_CGAL -DENABLE_OPENCSG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.8/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I../libraries/install/include/eigen2 -I../libraries/install/include -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/Library/Frameworks/QtOpenGL.framework/Versions/4/Headers -I/usr/include/QtOpenGL -I/usr/include -Isrc -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -Iobjects -Iobjects -F/Library/Frameworks -o objects/handle_dep.o src/
In file included from ../libraries/install/include/boost/unordered/detail/emplace_args.hpp:16,
from ../libraries/install/include/boost/unordered/detail/allocator_helpers.hpp:19,
from ../libraries/install/include/boost/unordered/unordered_set.hpp:19,
from ../libraries/install/include/boost/unordered_set.hpp:17,
from src/
../libraries/install/include/boost/unordered/detail/fwd.hpp:132: error: ‘rebind_wrap’ in namespace ‘boost::unordered_detail’ does not name a type
../libraries/install/include/boost/unordered/detail/fwd.hpp:132: error: expected unqualified-id before ‘<’ token
../libraries/install/include/boost/unordered/detail/fwd.hpp:134: error: ‘bucket_allocator’ has not been declared

Anyway, that's another issue, but I posted here just in case you have an idea :)


does clang work on Lion? i think you may have told me before but i am sorry i have forgotten and lost that communication...


Lion's development tools use clang as default, but eigen2 doesn't compile with clang.
We might upgrade to eigen3 though.

@donbright donbright referenced this issue from a commit
@donbright donbright initial rework to enable eigen3 per issue #174.
1. enable eigen3 in qmake build system
2. convert Transform3d and cwise() per the eigen2->eigen3 porting faq online
3. get rid of 'using namespace boost::filesystem' as it conflicts with eigen3
@donbright donbright referenced this issue

Eigen3 #183


Boost 1.50 works ok now on Mac OS X as well - closing this

@kintel kintel closed this


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.