Mohammed
Mohammed

Reputation: 2699

How to floor objects in OpenSCAD (make it flush on the Z axis for 3d printing)

If you want to 3D print something, then you have to make sure that your object is on the positive side of all axis. You can't have an object going through the negative Z axis otherwise it will not be proper on the printer bed ( I think). So how can I cut the extra part that goes beyond the Z axis?

Upvotes: 2

Views: 645

Answers (4)

Joe Eifert
Joe Eifert

Reputation: 1387

I wrote myself a module for this purpose.

module cut_off_bottom(max_size = 100)
{
    difference(){
        children();
        translate([-0.5 * max_size, -0.5 * max_size, -max_size])
            cube([max_size, max_size, max_size]);
    }
}

It's pretty self-explanatory. You can also increase your default max object size if you want.

Call it as follows:

cut_off_bottom() yourobject;

Upvotes: 1

Torleif Ceder
Torleif Ceder

Reputation: 11

If you mean cut off the bottom, one generic way to do that is:

cutOutBottom(MAX_HEIGHT=20) sphere(10);
 
module cutOutBottom(MAX_HEIGHT) {
  intersection()
  {
     children();
     
     linear_extrude(MAX_HEIGHT)  
     projection()
     children();
  }    
}

Upvotes: 1

George Menoutis
George Menoutis

Reputation: 7250

I find this question strange. Regardless of openSCAD functionalities, the slicer should allow you to align your object with the print floor, or even lay it down to a surface of your choice, or even manually "submerge" it benerath the print floor to only print a part of it.

Upvotes: 3

Mohammed
Mohammed

Reputation: 2699

I found that a good way to do it is to create a box and make it start at the zero Z-axis height and it goes the negative Z axis height. Then if you difference it from your object the extra part that went beyond the Z axis will get flush against the Z plane.

difference(){
rock_with_hole();
// This is to floor the object at the floor (z axis plane is the floor)
translate([0,0,-flooring]){
    cube([200, 200,flooring]);

    }
}

enter image description here

enter image description here

enter image description hereFinal product

Upvotes: 0

Related Questions