PuzzleBox
PuzzleBox copied to clipboard
Running with `f` option enabled causes object OpenSCAD to throw error
The error shown by OpenSCAD is as follows:
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e_below != SHalfedge_handle() File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h Line: 426
This is triggered on Part 3 (top center of the first image below) and causes the piece to not have the maze inside of it.
It is a bit odd though, the issue only occurs on the Render step, but not on the Preview step. When viewed as a Preview, the maze is properly generated.
The exact file tested is attached here. puzzlebox-4m-f-3N-3H-10b-10c-50h-1B6-0G4-1w2-2t-3z-1M-5X-0p7-0g4-7s-2r-1R333333-0D5-EMP-e-Z-1T-0y1-0Z2.zip
Not sure why openscad has an issue to be honest.
I have the same problem with the "Maze on inside" parameter. So i think somewhere there is the culprit.
I used the default parameters from your website and only included the inside setting (Without it, the file renders fine): puzzlebox-4m-i-3N-3H-10b-10c-50h-1B6-0G4-1w2-2t-3z-1M-5X-0p7-0g4-7s-2r-1R333333-e-Z-1T-0y1-0Z2
Before rendering the file:
While rendering the file, the same error occurs 2 times and one of the bodies is almost completely "deleted" and the maze of the outer body is removed:
OpenSCAD-Error: ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e_below != SHalfedge_handle() File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h Line: 426
Here the files (w/ & w/o parameter) for testing: puzzlebox-4m-i-3N-3H-10b-10c-50h-1B6-0G4-1w2-2t-3z-1M-5X-0p7-0g4-7s-2r-1R333333-e-Z-1T-0y1-0Z2.zip
Does it do the same with 6 outer sides? I wonder if the little marker for uneven sides is the clue?
For testing, I tried a 6 sided, 14 sided as well as a round base variant and all produced the same error as before in the 3rd and 4th part.
Furthermore, I increased the parts count to 6 and interestingly the error stayed in the 3rd and 4th part: puzzlebox-6m-i-3N-3H-10b-10c-50h-1B6-0G4-1w2-2t-3z-1M-5X-0p7-0g4-7s-2r-1R333333-e-Z-1T-0y1-0Z2
Renders to:
File for reference: puzzlebox-6m-i-3N-3H-10b-10c-50h-1B6-0G4-1w2-2t-3z-1M-5X-0p7-0g4-7s-2r-1R333333-e-Z-1T-0y1-0Z2.zip
It was just a thought - if anyone works out what upsets openscad, I am happy to make a change. Maybe we should send examples to the openscad project?
Sure, thanks for the idea and the great project. I have sadly no clue about Openscad (I just installed it for your model).
After a (small) bit of research, this could be due to the faces used to generate the inner maze polyhedron intersecting with other faces. AFAIK, faces should not intersect.
OK but the design is not to have anything interacting, the C code is careful to avoid that, or I thought it was. Can you see specific examples of it? It is not something daft like the walls too thin and the maze inside hitting the maze outside or something daft like that is it?
Possibly related solution: I encountered a few errors when rendering models with openscad, however I was able to get models that rendered perfectly fine after adjusting the core diameter from 10 to 11. In my case I was using alternating inside/outside maze elements and the problem appeared to be related to be related to smaller/inner parts.
No idea of the exact source of the issue, but I figured I'd mention tweaking core diameter may solve the problem for people encountering it.