BelfrySCAD / BOSL2

The Belfry OpenScad Library, v2.0. An OpenSCAD library of shapes, masks, and manipulators to make working with OpenSCAD easier. BETA
https://github.com/BelfrySCAD/BOSL2/wiki
BSD 2-Clause "Simplified" License
1.01k stars 115 forks source link

[BUG] Every VNF fails FACE_ISECT check in vnf_validate() #1432

Closed pipatron closed 6 months ago

pipatron commented 6 months ago

I couldn't figure out why my VNFs misbehaved so I tried simplifying until they passed vnf_validate(…,check_isects=true) but after a while I realized it was impossible:

include <BOSL2/std.scad>
vnf = cube(10);
echo(v=vnf[0]);
echo(f=vnf[1]);
vnf_validate(vnf,check_isects=true);
Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
ECHO: v = [[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0], [0, 0, 10], [10, 0, 10], [10, 10, 10], [0, 10, 10]]
ECHO: f = [[0, 1, 2], [0, 2, 3], [0, 4, 5], [0, 5, 1], [1, 5, 6], [1, 6, 2], [2, 6, 7], [2, 7, 3], [3, 7, 4], [3, 4, 0], [6, 4, 7], [6, 5, 4]]
ECHO: "ERROR FACE_ISECT (brown): Faces intersect at [[0, 0, 0]]"
ECHO: "ERROR FACE_ISECT (brown): Faces intersect at [[0, 0, 10]]"
ECHO: "ERROR FACE_ISECT (brown): Faces intersect at [[0, 10, 0]]"
ECHO: "ERROR FACE_ISECT (brown): Faces intersect at [[0, 10, 0]]"
ECHO: "ERROR FACE_ISECT (brown): Faces intersect at [[10, 10, 0]]"
ECHO: "ERROR FACE_ISECT (brown): Faces intersect at [[10, 10, 10]]"
ECHO: "ERROR FACE_ISECT (brown): Faces intersect at [[10, 0, 0]]"
ECHO: "ERROR FACE_ISECT (brown): Faces intersect at [[10, 10, 0]]"
ECHO: "ERROR FACE_ISECT (brown): Faces intersect at [[10, 10, 10]]"
Compiling design (CSG Products generation)...
Geometries in cache: 641
Geometry cache size in bytes: 16998928
CGAL Polyhedrons in cache: 19
CGAL cache size in bytes: 31932776
Compiling design (CSG Products normalization)...
Normalized tree has 10 elements!
Compile and preview finished.
Total rendering time: 0:00:00.538

vnf_validate

OpenSCAD version 2024.05.19.nightly (git 8a890a9) BOSL2 7d69589478d880152c718e2f03319aa47dcc6564

Either I'm not understanding VNFs correctly or there's something wrong with the test!

adrianVmariano commented 6 months ago

That looks like a bug. I don't know that I've ever used isect=true because that's not the sort of vnf faults I look for.