Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@iamwilhelm
Created February 7, 2012 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamwilhelm/1762579 to your computer and use it in GitHub Desktop.
Save iamwilhelm/1762579 to your computer and use it in GitHub Desktop.
module rook_battlement(height, radius) {
neck_radius = radius;
battlement_radius = 1.4 * radius;
inner_battlement_radius = 0.6 * battlement_radius;
cylinder(0.2 * height, neck_radius, battlement_radius);
translate([0, 0, 0.2 * height]) {
difference() {
// the battlement
cylinder(0.8 * height, battlement_radius, battlement_radius);
// cut out the loopholes
for (i = [0:5]) {
rotate(a = [0, 0, i * 360 / 6])
translate([-1.5, 0, 0.5 * height])
cube([3, 10, 4]);
}
// cut out circular space at top
translate([0, 0, 0.5 * height]) {
cylinder(height, inner_battlement_radius, inner_battlement_radius);
sphere(inner_battlement_radius);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment