PuzzleBox icon indicating copy to clipboard operation
PuzzleBox copied to clipboard

Running with `f` option enabled causes object OpenSCAD to throw error

Open JPeroutek opened this issue 3 years ago • 10 comments

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.

image

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.

image

JPeroutek avatar Dec 15 '20 20:12 JPeroutek

Not sure why openscad has an issue to be honest.

revk avatar Dec 15 '20 20:12 revk

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:

before_rendering

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

after_render

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

Chrisch3n avatar Dec 16 '20 04:12 Chrisch3n

Does it do the same with 6 outer sides? I wonder if the little marker for uneven sides is the clue?

revk avatar Dec 16 '20 05:12 revk

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

6_before_render

Renders to:

6_before_rendering

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

Chrisch3n avatar Dec 16 '20 08:12 Chrisch3n

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?

revk avatar Dec 16 '20 08:12 revk

Sure, thanks for the idea and the great project. I have sadly no clue about Openscad (I just installed it for your model).

Chrisch3n avatar Dec 16 '20 11:12 Chrisch3n

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.

JPeroutek avatar Dec 16 '20 15:12 JPeroutek

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?

revk avatar Dec 16 '20 15:12 revk

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.

fundamental avatar Dec 18 '21 20:12 fundamental