Welcome! Log In Create A New Profile

# how can i prevent those sliver things on substraction?

Posted by emaayan
 how can i prevent those sliver things on substraction? February 18, 2018 03:49PM Registered: 2 years ago Posts: 17
this happens on preview when i try to subtract objects
but after doing render it looks ok, i keep, have to play with offseting z or the height of object by a fraction of 0.001 or 0.0002 to make it look ok in preview as well..

 Re: how can i prevent those sliver things on substraction? February 18, 2018 04:13PM Registered: 6 years ago Posts: 14,422
You need to make sure that the object you are subtracting extends beyond the surface of the object you are subtracting it from, instead of the two surfaces coinciding. Example:

```overlap = 0.02;

difference() {
translate([0, 0, -overlap]) cylinder(r=inner_radius, h=height+2*overlap);
}
}

tube(10,8,5);```

In this code the cylinder we are subtracting extends by 'overlap' above and below the one we are subtracting it from. I always use a variable called 'overlap' for this so that it is clear in the code what adding these small amounts is for.

Edited 2 time(s). Last edit at 02/18/2018 04:14PM by dc42.

Large delta printer [miscsolutions.wordpress.com], Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
 Re: how can i prevent those sliver things on substraction? February 18, 2018 05:13PM Registered: 2 years ago Posts: 17
thanks, couldn't there be a generic method with some form of scale and resize play here?
 Re: how can i prevent those sliver things on substraction? February 19, 2018 05:41PM Registered: 2 years ago Posts: 17
well for some reason i'm still getting this, and i have no idea what's it's even called, but i can see through the walls..
 Re: how can i prevent those sliver things on substraction? February 20, 2018 12:10AM Registered: 9 years ago Posts: 5,476
the following minor changes works for me...

```module main(){

difference(){
drawHoles(manArr){
cylinder(d=holderDiameter,h=8);
}
difference(){
drawHoles(manArr){
translate([0,0,-1]) cylinder(d=cellDiameter-1,h=10);
}
}
}
}```

h of 10 is just your 8+2 translated down 1mm so 1mm protrudes top and bottom so it draws cleanly

Edited 2 time(s). Last edit at 02/20/2018 12:14AM by Dust.
 Re: how can i prevent those sliver things on substraction? February 20, 2018 01:55AM Registered: 2 years ago Posts: 17
thanks i was trying to come up with a generic module for this..
 Re: how can i prevent those sliver things on substraction? February 20, 2018 01:57AM Registered: 2 years ago Posts: 17
thanks i was trying to come up with a generic module for this..that's what the overlap module was for, i started searching and thought it was a bug in openscad
Sorry, only registered users may post in this forum.