From dc72cafb0e1bcfeb2b18b03e595c6a1cfb30109f Mon Sep 17 00:00:00 2001 From: Christian Hodgden Date: Wed, 24 Jul 2024 09:11:37 -0500 Subject: chess: completed rook model --- chess/demo.scad | 3 +++ chess/rook.scad | 24 +++++++++++++++++------- chess/rook.stl | Bin 0 -> 7084 bytes 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 chess/demo.scad create mode 100644 chess/rook.stl (limited to 'chess') diff --git a/chess/demo.scad b/chess/demo.scad new file mode 100644 index 0000000..fb0ed95 --- /dev/null +++ b/chess/demo.scad @@ -0,0 +1,3 @@ +rotate_extrude (angle = 90) { + square(1); +} \ No newline at end of file diff --git a/chess/rook.scad b/chess/rook.scad index b75476f..e8801dc 100644 --- a/chess/rook.scad +++ b/chess/rook.scad @@ -35,15 +35,25 @@ head_radius = 1; head_height = 1; stem_height = total_height - base_height - (head_height / 2); +// ridge_offset will set the ridges to go over the corners +ridge_offset_check = 0; +ridge_offset = ridge_offset_check * ((360/$fn)/2); + cylinder(base_height/2, r = base_radius); translate([0, 0, base_height/2]) cylinder(base_height/2, base_radius, stem_base_radius); translate([0, 0, base_height]) cylinder(stem_height, stem_base_radius, stem_radius); -translate([0, 0, total_height - head_height]) - cylinder(head_height/2, r = head_radius); -translate([0, 0, total_height - (head_height/2)]) - // I think I might try rotate_extrude - // take a differemce with an internal cylinder as well - %cylinder(head_height/2, r = head_radius); - +difference() { + translate([0, 0, total_height - head_height]) + cylinder(head_height, r = head_radius); + translate([0, 0, total_height - (head_height/4)]) { + cylinder(head_height, r = head_radius * 0.75); + // this rotation will work for $fn = 8 or 6 + for (i = [0:(($fn/2)-1)]) { + rotate([0, 0, (i * (360/($fn/2))) - ridge_offset]) + rotate_extrude(angle = 360/$fn) + square([head_radius + 0.25, head_height]); + } + } +} diff --git a/chess/rook.stl b/chess/rook.stl new file mode 100644 index 0000000..331b910 Binary files /dev/null and b/chess/rook.stl differ -- cgit v1.2.3