aboutsummaryrefslogtreecommitdiff
path: root/chess
diff options
context:
space:
mode:
authorChristian Hodgden <chrhodgden@gmail.com>2024-07-24 13:34:30 -0500
committerChristian Hodgden <chrhodgden@gmail.com>2024-07-24 13:34:30 -0500
commitb00c5d4717d819dd73986bf16db9adafc0b02053 (patch)
treed0e5bba63153248f9857c0bfaaee7e93532e55b0 /chess
parent242fc6ec06da9da708702e50a694c0a4cff1e391 (diff)
chess - started bishop model
Diffstat (limited to 'chess')
-rw-r--r--chess/bishop.scad54
-rw-r--r--chess/demo.scad35
2 files changed, 86 insertions, 3 deletions
diff --git a/chess/bishop.scad b/chess/bishop.scad
new file mode 100644
index 0000000..07667e1
--- /dev/null
+++ b/chess/bishop.scad
@@ -0,0 +1,54 @@
+
+// FIDE Standards have some flexibility
+// https://www.fide.com/FIDE/handbook/Standards_of_Chess_Equipment_and_tournament_venue.pdf
+// FIDE Handbook C.02.2.2 Height,weight,proportions
+// - King – 9.5 cm,
+// - Queen – 8.5 cm,
+// - Bishop – 7 cm,
+// - Knight – 6 cm,
+// - Rook – 5.5 cm and
+// - Pawn – 5 cm.
+// - The diameter of the piece's base should measure 40- 50% of its height.
+// - These dimensions may differ up to 10% from the above recommendation,
+// - but the order (e.g. King is higher than Queen etc.) must be kept.
+// We are going to transgress C.02.2.3
+// FIDE Handbook C.02.3.2 Size of the square and the board
+// - The side of the square should measure 5 to 6 cm.
+// - Referring to 2.2 the side of a square should be at least twice the diameter of a pawn’s base (it means four paws on one square).
+
+$fn = 100;
+total_height = 7;
+base_diameter = total_height / 2;
+base_radius = base_diameter / 2;
+base_height = 1;
+stem_radius = base_radius / 4;
+stem_base_radius = base_radius / 2;
+head_radius = 1;
+stem_height = total_height - base_height - head_radius;
+
+// collar_check enables collar
+collar_check = 1;
+collar_radius = head_radius * collar_check;
+
+// Base
+cylinder(base_height/2, base_radius, base_radius);
+translate([0, 0, base_height/2])
+ cylinder(base_height, base_radius, 0);
+
+// Stem
+translate([0, 0, base_height])
+ cylinder(stem_height, stem_base_radius, stem_radius);
+
+// Collar
+translate([0, 0, total_height - (2 * head_radius)])
+ cylinder(0.5, collar_radius, 0);
+
+// Head
+
+%translate([0, 0, total_height - head_radius])
+ sphere(head_radius);
+
+translate([0, 0, total_height - head_radius])
+ cylinder(head_radius, head_radius, 0);
+
+
diff --git a/chess/demo.scad b/chess/demo.scad
index fb0ed95..341da35 100644
--- a/chess/demo.scad
+++ b/chess/demo.scad
@@ -1,3 +1,32 @@
-rotate_extrude (angle = 90) {
- square(1);
-} \ No newline at end of file
+// https://youtu.be/tOx5UI8GGns
+
+$fn = 8;
+
+function bezier_3(p0, p1, p2, t) =
+ (( 1 - t) ^ 2) * p0
+ + 2 * (1 - t) * t * p1
+ + (t ^ 2) * p2;
+
+function bezier_4(p0, p1, p2, p3, t) =
+ (( 1 - t) ^ 3) * p0
+ + 3 * ((1 - t) ^ 2) * t * p1
+ + 3 * (1 - t) * (t ^ 2) * p2
+ + (t ^ 3) * p3;
+
+p0 = [0, 0];
+p1 = [10, 0];
+p2 = [0, 10];
+p3 = [0, 5];
+
+points = $fn;
+
+points_list = [for (i=[0:points]) bezier_3(p0, p1, p2, i/points)];
+
+rotate_extrude(angle = 360)
+ polygon(points_list);
+
+points_list_2 = [for (i=[0:points]) bezier_4(p0, p1, p3, p2, i/points)];
+
+translate([20, 0, 0])
+ rotate_extrude(angle = 360)
+ polygon(points_list_2);