Examples

A tapered foot with a short pin, to push into a board’s mounting hole.

The pin has an under chamfer, so a foot printed in flexible filament slopes in and out of the hole rather than catching on a step.

Source: examples/pcb_feet_tpu.scad
// A tapered foot with a short pin, to push into a board's mounting hole.
// The pin has an under chamfer, so a foot printed in flexible filament slopes in and
// out of the hole rather than catching on a step.
use <../snapfit.scad>;

/* [Foot] */
// Foot diameter at the floor (mm)
foot_d = 10; // [6:1:20]
// Foot height (mm)
foot_h = 3; // [1:0.5:10]

/* [Pin] */
// Pin column diameter: the board hole's size (mm)
dia = 4.5; // [2:0.25:6]
// How much wider the head is than the column (mm)
lip = 1.5; // [0.5:0.1:3]
// Column height: the board's thickness (mm)
col_h = 2; // [0.8:0.1:5]
// Angle of the cone under the head (degrees)
chamfer = 45; // [20:5:70]

/* [Hidden] */
$fn = 64;

cylinder(d1 = foot_d, d2 = foot_d * 0.7, h = foot_h);
translate([0, 0, foot_h]) snapfit(dia, lip, col_h, 0.1, 0.7, under_chamfer_angle = chamfer);

examples/pcb_feet_tpu.scad on GitHub

A disc with a pin on top and a hole underneath, so copies stack.

Seated, each copy rests on the foot of the one below, 10 mm higher.

Source: examples/self_connecting_snap.scad
// A disc with a pin on top and a hole underneath, so copies stack.
// Seated, each copy rests on the foot of the one below, 10 mm higher.
use <../snapfit.scad>;

/* [Disc] */
// Disc diameter (mm)
w = 10; // [6:1:30]
// Disc height (mm)
h = 5; // [2:0.5:15]

/* [Pin] */
// Pin column diameter (mm)
dia = 3; // [2:0.25:8]
// How much wider the head is than the column (mm)
lip = 0.75; // [0.25:0.05:2]
// Clearance around the head in the hole (mm)
neg_tol = 0.5; // [0.1:0.05:1]
// Gap between the foot and the head: the plate the head snaps past (mm)
thickness = 1; // [0.5:0.1:3]

/* [Hidden] */
col_h = dia * 2;
$fn = 64;

difference() {
  union() {
    cylinder(d = w, h = h, center = true);
    translate([0, 0, h / 2]) snapfit(dia, lip, col_h, 0.1, 0.7, thickness = thickness);
  }
  translate([0, 0, -h / 2 - 0.1]) snapfit_neg(dia, lip, col_h, neg_tol, 0.7, thickness = thickness);
}

examples/self_connecting_snap.scad on GitHub

Two self-connecting discs snapped together, cut in half to show the pin in its hole.

For looking at, not printing.

Source: examples/stacked_pair.scad
// Two self-connecting discs snapped together, cut in half to show the pin in its hole.
// For looking at, not printing.
use <../snapfit.scad>;

w = 10;
h = 5;
dia = 3;
lip = 0.75;
col_h = dia * 2;
neg_tol = 0.5;
thickness = 1;
$fn = 64;

module disc() {
  difference() {
    union() {
      cylinder(d = w, h = h, center = true);
      translate([0, 0, h / 2]) snapfit(dia, lip, col_h, 0.1, 0.7, thickness = thickness);
    }
    translate([0, 0, -h / 2 - 0.1]) snapfit_neg(dia, lip, col_h, neg_tol, 0.7, thickness = thickness);
  }
}

// Seated: the upper disc rests on the lower one's foot.
seat = h + col_h - thickness;

difference() {
  union() {
    disc();
    translate([0, 0, seat]) disc();
  }
  // Keep the half behind the y = 0 plane, so the front shows the section.
  translate([-w, -2 * w, -h]) cube([2 * w, 2 * w, 3 * h + seat + 10]);
}

examples/stacked_pair.scad on GitHub


This site uses Just the Docs, a documentation theme for Jekyll.