[OpenSCAD] Unexpected behavior of difference()

GeorgeFlorian georgeflorian12 at gmail.com
Mon Jul 22 06:17:20 EDT 2019


Hello !

I am trying to make a screw hole inside a box lid.

The screw hole:

*module lid_screw_hole() {
    difference() {
        color("pink") cylinder(h=14,d=8,center=false);
        color("blue") cylinder(h=14,d=6,center=false);
    }
}*

And the lid:

*module plain_lid() {
translate([box_side-empty_space+10,0,0]) {
    color("red") plain_box(box_side-empty_space, box_side, 4); 
    
    difference() {
        translate([wall,wall,0]) {
            color("green") plain_box(box_side-empty_space-(wall*2),
box_side-(wall*2), 14);
        }
        translate([wall*2,wall*2,0]) {
            color("yellow") plain_box(box_side-empty_space-(wall*2)*2,
box_side-(wall*2)*2, 14);
        }    
    }
}
}*


Naturally, I wanted to make a difference out of these two modules but
something strange happens:

*difference() {
    plain_lid();
    translate([182, wall+2, 0]) lid_screw_hole();
}*

</file/t2610/openscad1.png> 

Making a *union()* doesn't help either. It just puts them together with no
actual hole inside the cylinder.

Any thoughts ?



--
Sent from: http://forum.openscad.org/



More information about the Discuss mailing list