Examples
The tray
An open tray for two 80 mm cubes, with 1.6 mm walls and a 1.2 mm floor.
Source: examples/example_base_shell_simple.scad
// The tray
// An open tray for two 80 mm cubes, with 1.6 mm walls and a 1.2 mm floor.
use <../base_shell.scad>;
// ---- Example Usage ----
// A tray for two 80 mm cubes: 1.6 mm walls, a 1.2 mm floor, 4.8 mm tall.
plate_dim_example = 80;
cube_count_example = 2;
fit_example = 0.8;
wall_example = 1.6;
floor_example = 1.2;
height_example = 4.8;
panel_th_example = 1.4;
connector_th_example = 2.0;
base_shell(
plate_size=plate_dim_example,
cube_count=cube_count_example,
connector_thickness=connector_th_example,
panel_thickness=panel_th_example,
wall_thickness=wall_example,
floor_thickness=floor_example,
height=height_example,
fit_allowance=fit_example
);
examples/example_base_shell_simple.scad on GitHub
The four connectors
One each of the sleeve-corner, sleeve, corner and edge connectors.
Source: examples/example_connectors.scad
// The four connectors
// One each of the sleeve-corner, sleeve, corner and edge connectors.
use <../connectors.scad>;
// ===============================================================
// Example layout showing all four connector types
// ===============================================================
// Select which part to render, or "all" to see all four
render_part = "all"; // "all", "sleeve", "corner", "sleeve-corner", "edge"
// Parameters for all parts
dim_ex = 20; // right triangle leg length
thickness_ex = 2; // plate extrusion thickness
plate_thickness_ex = 1.4; // small ledge/board support
hole_dia_ex = 1.7; // M2 self-tapping pilot; 2.2-2.4 to clear an M2 for a nut
hole_offset = 5;
// Derived parameters
corner_hole_loc_ex = [hole_offset + plate_thickness_ex, hole_offset + plate_thickness_ex]; // local hole position for corner pieces
flat_hole_loc_ex = [hole_offset, hole_offset + plate_thickness_ex]; // local hole position for flat pieces (no extra plate offset on x)
// Translation offset to separate parts when rendering all
translate_dim_ex = (render_part == "all") ? dim_ex : 0;
if (render_part == "all" || render_part == "sleeve-corner")
translate([translate_dim_ex * 0, 0, 0]) color("red")
sleeve_corner_connector(dim_ex, thickness_ex, plate_thickness_ex, hole_dia_ex, corner_hole_loc_ex);
if (render_part == "all" || render_part == "sleeve")
translate([translate_dim_ex * 3, 0, 0]) color("green")
sleeve_connector(dim_ex, thickness_ex, plate_thickness_ex, hole_dia_ex, flat_hole_loc_ex);
if (render_part == "all" || render_part == "corner")
translate([0, translate_dim_ex * 3, 0]) color("blue")
corner_connector(dim_ex, thickness_ex, plate_thickness_ex, hole_dia_ex, corner_hole_loc_ex);
if (render_part == "all" || render_part == "edge")
translate([translate_dim_ex * 3, translate_dim_ex * 3, 0]) color("purple")
edge_connector(dim_ex, thickness_ex, hole_dia_ex, flat_hole_loc_ex);
examples/example_connectors.scad on GitHub
Planning a box from cubes
A cluster of 40 mm cubes with a panel on every exposed face, and no connectors.
Source: examples/example_cube_cluster.scad
// Planning a box from cubes
// A cluster of 40 mm cubes with a panel on every exposed face, and no connectors.
include <../cube_cluster.scad>
dim = 40;
th = 1.2;
cubes = [
[0, 0, 0],
[1, 0, 0],
[1, 1, 0],
[2, 1, 0],
[1, 1, 1],
[1, 2, 1],
[0, 2, 1],
[0, 2, 2],
];
cube_cluster(dim, th, cubes);
examples/example_cube_cluster.scad on GitHub
A two-cube box
Every part of a 160 x 80 x 80 mm box of 80 mm panels, laid out to print: 12 connectors and the tray.
Source: examples/example_two_cube_box.scad
// A two-cube box
// Every part of a 160 x 80 x 80 mm box of 80 mm panels, laid out to print: 12 connectors and the tray.
use <../connectors.scad>;
use <../base_shell.scad>;
// ===============================================================
// Every part of a two-cube box of 80 mm panels, laid out to print
//
// The box is two 80 mm cubes end to end, 160 x 80 x 80 mm: two
// panels on each long side, one on each end, two on top as a lid
// that lifts off, standing in a tray. It takes 12 connectors and
// 32 M2 screws, one per triangular plate:
//
// sleeve-corner 4 top corners 3 screws each
// corner 4 bottom corners, into the tray 2 screws each
// sleeve 2 top edge, where the panels meet 4 screws each
// edge 2 bottom of each long side, where the panels meet
// 2 screws each
// ===============================================================
part = "all"; // "all", "connectors", "tray"
// Connectors
dim = 20; // right triangle leg length
thickness = 2; // plate thickness
plate_thickness = 1.4; // ledge the panel edge seats against
hole_dia = 1.7; // M2 self-tapping pilot; untested, see README
hole_offset = 5; // panel's holes, in from its edges
corner_hole_loc = [hole_offset + plate_thickness, hole_offset + plate_thickness];
flat_hole_loc = [hole_offset, hole_offset + plate_thickness];
// Tray
plate_size = 80;
cube_count = 2;
wall_thickness = 1.6;
floor_thickness = 1.2;
tray_height = 4.8;
fit_allowance = 0.8;
pitch = 3 * dim; // spacing between parts on the plate
// Each part below is moved so its lowest point sits on z = 0.
if (part == "all" || part == "connectors") {
for (i = [0:3])
translate([i * pitch, 0, 0])
sleeve_corner_connector(dim, thickness, plate_thickness, hole_dia, corner_hole_loc);
for (i = [0:3])
translate([i * pitch, pitch, -thickness])
corner_connector(dim, thickness, plate_thickness, hole_dia, corner_hole_loc);
for (i = [0:1])
translate([i * pitch, 2 * pitch, thickness])
sleeve_connector(dim, thickness, plate_thickness, hole_dia, flat_hole_loc);
for (i = [0:1])
translate([(i + 2) * pitch, 2 * pitch, 0])
edge_connector(dim, thickness, hole_dia, flat_hole_loc);
}
if (part == "all" || part == "tray")
translate([0, -pitch - plate_size, tray_height / 2])
base_shell(
plate_size=plate_size,
cube_count=cube_count,
connector_thickness=thickness,
panel_thickness=plate_thickness,
wall_thickness=wall_thickness,
floor_thickness=floor_thickness,
height=tray_height,
fit_allowance=fit_allowance
);