discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] if(false) returns empty object in RC3, breaks code from 2019.05

JB
Jordan Brown
Sat, Dec 26, 2020 6:39 PM

On 12/25/2020 12:38 PM, Jordan Brown wrote:

An intersection or difference of a cube or other solid, that yields
nothing, is not ignored.

Correction:  I swear that I tested that, but today I test it and 2019.05
does ignore such an empty set.

This yields two cubes:

module nothing1() {
}

module nothing2() {
    intersection() {
        cube();
        translate([10,0,0]) cube();
    }
}

intersection() {
    cube();
    nothing1();
}

translate([20,0,0]) {
    intersection() {
        cube();
        nothing2();
    }
}
On 12/25/2020 12:38 PM, Jordan Brown wrote: > An intersection or difference of a cube or other solid, that yields > nothing, is *not* ignored. Correction:  I swear that I tested that, but today I test it and 2019.05 *does* ignore such an empty set. This yields two cubes: module nothing1() { } module nothing2() { intersection() { cube(); translate([10,0,0]) cube(); } } intersection() { cube(); nothing1(); } translate([20,0,0]) { intersection() { cube(); nothing2(); } }