From 6744ac0965465d7ce33902c68b4262fe920b6cfc Mon Sep 17 00:00:00 2001
From: Christian Hodgden <chrhodgden@gmail.com>
Date: Tue, 30 Jul 2024 13:28:14 -0500
Subject: chess: completed bishop model

---
 ATTRIBUTIONS.md   |   2 ++
 chess/bishop.scad |  33 ++++++++++++++++++++++++++-------
 chess/bishop.stl  | Bin 0 -> 16684 bytes
 chess/demo.scad   |  17 +++++------------
 4 files changed, 33 insertions(+), 19 deletions(-)
 create mode 100644 chess/bishop.stl

diff --git a/ATTRIBUTIONS.md b/ATTRIBUTIONS.md
index d906d62..801fcba 100644
--- a/ATTRIBUTIONS.md
+++ b/ATTRIBUTIONS.md
@@ -10,6 +10,8 @@
 
 [Rook](./chess/rook.stl) - Created by [Christian Hodgden](https://chrhodgden.github.io) [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)
 
+[Bishop](./chess/bishop.stl) - Created by [Christian Hodgden](https://chrhodgden.github.io) [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)
+
 [Runner](./supports/runner.stl) - Created by [Christian Hodgden](https://chrhodgden.github.io) [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)
 
 
diff --git a/chess/bishop.scad b/chess/bishop.scad
index 07667e1..c2824f6 100644
--- a/chess/bishop.scad
+++ b/chess/bishop.scad
@@ -16,7 +16,9 @@
 // 	- 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;
+use <../lib/bezier.scad>;
+
+$fn = 8;
 total_height = 7;
 base_diameter = total_height / 2;
 base_radius = base_diameter / 2;
@@ -24,7 +26,7 @@ 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;
+stem_height = total_height - base_height - head_radius - 1;
 
 // collar_check enables collar
 collar_check = 1;
@@ -40,15 +42,32 @@ translate([0, 0, base_height])
 	cylinder(stem_height, stem_base_radius, stem_radius);
 
 // Collar
-translate([0, 0, total_height - (2 * head_radius)])
+translate([0, 0, total_height - (2.5 * head_radius)])
 	cylinder(0.5, collar_radius, 0);
 
 // Head
+ctrl_points = [
+	[0, 0],
+	[0.75, 0],
+	[0, 1]
+];
+head_curve = bezier_curve(ctrl_points);
 
-%translate([0, 0, total_height - head_radius])
-	sphere(head_radius);
+difference() {
+	translate([0, 0, total_height - 2.5 * head_radius])
+		scale(2.25)
+			// trying to fix odd-poly skewing
+			// rotate([0, 0, 60])
+				rotate_extrude(angle = 360)
+					polygon(head_curve);
 
-translate([0, 0, total_height - head_radius])
-	cylinder(head_radius, head_radius, 0);
+	// Notch
+	translate([-2.5, 0, 5.5])
+		rotate([45, 0, 0])
+			cube([5, 5, 0.1]);
+}
 
+// Point
+translate([0, 0, 6.75])
+	sphere(0.25);
 
diff --git a/chess/bishop.stl b/chess/bishop.stl
new file mode 100644
index 0000000..5764ae4
Binary files /dev/null and b/chess/bishop.stl differ
diff --git a/chess/demo.scad b/chess/demo.scad
index 682dc34..223b5ba 100644
--- a/chess/demo.scad
+++ b/chess/demo.scad
@@ -1,23 +1,16 @@
 
 use <../lib/bezier.scad>;
 
-$fn = 8;
+$fn = 100;
 
 p0 = [0, 0];
-p1 = [10, 0];
-pb = [1, 5];
-pn = [0, 10];
+p1 = [0.5, 0.5];
+pn = [1, 0];
 
 p_set_1 = [p0, p1, pn];
-p_set_2 = [p0, p1, pb, pn];
 
-points_list_p1 = bezier_curve(p_set_1);
-points_list_p2 = bezier_curve(p_set_2);
+points_list_p1 = bezier_curve(p_set_1, $fn=$fn);
 
 translate([0, 0, 0])
-	rotate_extrude(angle = 360)
+	//rotate_extrude(angle = 360)
 		polygon(points_list_p1);
-
-translate([20, 0, 0])
-	rotate_extrude(angle = 360)
-		polygon(points_list_p2);
-- 
cgit v1.2.3