aboutsummaryrefslogtreecommitdiff
path: root/chess/bishop.scad
blob: 91b9b2b4c25205111c29ee2a96a39d261c5c5921 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// 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).

use <../lib/bezier.scad>;

$fn = 8;
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 - 1;

// 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.5 * head_radius)])
	cylinder(0.5, collar_radius, 0);

// Head
control_points = [
	[0, 0],
	[0.75, 0],
	[0, 1]
];
// adjust curve_facets for low & odd $fn values
curve_facets = $fn/2;
head_curve = bezier_curve(control_points, $fn=curve_facets);

difference() {
	translate([0, 0, total_height - 2.5 * head_radius])
		scale(2.25)
			rotate([0, 0, 180])
				rotate_extrude()
					polygon(head_curve);

	// Notch
	translate([0, base_radius, 5.5])
		rotate([45, 0, -90])
			cube([base_diameter, base_diameter, 0.1]);
}

// Point
translate([0, 0, 6.75])
	sphere(0.25);