Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------
- // Game Piece
- // Keith Olson
- // CC 2020
- // OpenSCAD
- //--------------------------------
- // OpenSCAD uses millimeters (mm) for units.
- // Distance functions are both for conversion and to state plainly that a number is a
- // measurement, not just a value.
- // Fractions are interpreted as formulas: '1 3/4' = '1+3/4' = 1.75
- function mm(x = 1) = x;
- function cm(x = 1) = x * 10;
- function inches(x = 1) = x * 25.40000;
- function feet(x = 1) = x * 25.40000 * 12;
- $fn=120; // (Circles are divided in $fn line segments.)
- height = mm(25.40); // inches( 1 );
- head_dia = mm( 6.40); // inches( 1/ 4);
- neck_dia = mm( 3.40); // inches( 5/32);
- neck_len = mm(15.80); // inches( 5/ 8);
- neck_top = mm(19.52); // inches( 3/ 4);
- shldr_dia = mm( 7.60); // inches( 1/ 4);
- base_dia = mm(15.80); // inches( 5/ 8);
- base_ht = mm( 3.80); // inches( 5/32);
- edge_rad = mm( 1.00); // inches( 1/16);
- head_pos = height - head_dia/2;
- shoulder_rad_pos = ((shldr_dia - neck_dia) * edge_rad) / neck_len;
- echo(inches(1/16));
- echo(neck_len);
- echo(shoulder_rad_pos,edge_rad);
- game_piece();
- module game_piece(piece_style = "std", scale = 1/1)
- {
- rotate_extrude()
- union()
- {
- difference()
- {
- union()
- {
- polygon([[ 0, 0],
- [ base_dia/2, 0],
- [ base_dia/2, base_ht],
- [ shldr_dia/2, base_ht],
- [ neck_dia/2, neck_top],
- [ 0, neck_top]]);
- translate([0, head_pos, 0])// color("green")
- circle(d = head_dia);
- translate([shldr_dia/2, base_ht, 0])// color("yellow")
- square(edge_rad * 2 - shoulder_rad_pos, center = true);
- }
- union()
- {
- translate([-base_dia, -height, 0])
- square([base_dia, height * 2]);
- translate([base_dia/2 - edge_rad, base_ht - edge_rad, 0]) // 1.5]) color("blue")
- square(edge_rad+5);
- translate([shldr_dia/2 + edge_rad - shoulder_rad_pos/2 + 0.01, base_ht + edge_rad, 0]) // 0.5]) color("blue",0.5)
- circle(edge_rad);
- }
- }
- translate([base_dia/2 - edge_rad, base_ht - edge_rad, 0]) // 0.5]) color("orange")
- circle(edge_rad);
- }
- }
- //*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement