solid_layers.scad 1.0 KB

123456789101112131415161718192021222324
  1. // Used to generate a modifier mesh to do something every few layers.
  2. // Load into OpenSCAD, tweak the variables below, export as STL and load as
  3. // a modifier mesh. Then change settings for the modifier mesh.
  4. // Written by Joseph Lenox; in public domain.
  5. layer_height = 0.3; // set to layer height in slic3r for "best" results.
  6. number_of_solid_layers = 2;
  7. N = 4; // N > number_of_solid_layers or else the whole thing will be solid
  8. model_height = 300.0;
  9. model_width = 300.0; // these two should be at least as big as the model
  10. model_depth = 300.0; // but bigger isn't a problem
  11. initial_offset=0; // don't generate below this
  12. position_on_bed=[0,0,0]; // in case you need to move it around
  13. // don't touch below unless you know what you are doing.
  14. simple_layers = round(model_height/layer_height);
  15. translate(position_on_bed)
  16. for (i = [initial_offset:N:simple_layers]) {
  17. translate([0,0,i*layer_height])
  18. translate([0,0,(layer_height*number_of_solid_layers)/2])
  19. cube([model_width,model_depth,layer_height*number_of_solid_layers], center=true);
  20. }