fix minute and hour mark alignments, update svg

Hour marks were off, now fixed
This commit is contained in:
Artur Kerge 2023-07-29 21:23:34 +00:00
parent 6cc72a3b79
commit 060f74cb3c
5 changed files with 156 additions and 1963 deletions

View File

@ -1,30 +1,32 @@
use <part_sun.scad>; use <part_sun.scad>;
use <part_moon.scad>; use <part_moon.scad>;
use <part_clock_outline.scad>; use <part_clock_outline.scad>;
use <part_min_lines.scad>; use <part_min_lines.scad>;
use <part_hour_hexagons.scad>; use <part_hour_hexagons.scad>;
D=16; // dial size in cm D=130; // dial radius in mm
$fn=180; $fn=180;
module face() { module face() {
difference(){ difference(){
clock_outline(D); clock_outline(D);
union() { union() {
translate([0,-D/3]) color("red") sun(D/18); translate([0,-D/3]) color("red") sun(D/18);
translate([0.5,D/3]) color("white") moon(D/7); translate([0.5,D/3]) color("white") moon(D/7);
for(spot=[15:15:360]){ for(spot=[15:15:360]){
translate([sin(spot)*(D/6*5),cos(spot)*(D/6*5),0]) // position control with radius multiplier translate([sin(spot)*(D/6*5),cos(spot)*(D/6*5),0]) // position control with radius multiplier
color("black") color("black")
rotate([0,0,180]) // sets 12 on top by rotating the dial rotate([0,0,180]) // sets 12 on top by rotating the dial
text(str(spot/15), size = D/10, halign = "center", valign = "center", font = "Isonorm:style=Regular"); text(str(spot/15), size = D/10, halign = "center", valign = "center", font = "Isonorm:style=Regular");
} }
// Hour dots (dial, radius depth) // Hour dots (dial, radius depth)
hour_hexagons(D,4); hour_hexagons(D,4);
// Minute lines // Minute lines
min_lines(D); min_lines(D);
} }
} }
} }
difference() {
face(); circle(D);
face();
}

1973
clock.svg

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 199 KiB

View File

@ -1,8 +1,9 @@
module clock_outline(D) { $fn=180;
difference(){ module clock_outline(R) {
color("burlywood") difference(){
circle(D); color("orange")
circle(d=0.7); circle(R);
} circle(d=7.8); // hole for clockwork stem
} }
//clock_circle(12); }
clock_outline(130);

View File

@ -1,11 +1,11 @@
module hour_hexagons(D,spacing) { module hour_hexagons(D,spacing) {
for(dot=[0:15:360]){ for(dot=[0:15:360]){
$fn=6; $fn=6;
translate([sin(dot)*(D/6*spacing),cos(dot)*(D/6*spacing),0]) translate([sin(dot)*(D/6*spacing),cos(dot)*(D/6*spacing),0])
color("black") color("black")
rotate([0,0,30-dot]) rotate([0,0,30-dot])
circle(D/24); circle(d=7.6); // width of the hour hand
} }
} }
//D=130;
hour_hexagons(16,4.5); //hour_hexagons(D,4.5);

View File

@ -1,22 +1,23 @@
module min_lines(D) { module min_lines(D) {
divisor = 60; divisor=60;
len=D/20; len=D/20;
Dist=D-len; Dist=D-len;
for(dot=[0:6:360]){ for(dot=[0:6:360]){
translate([sin(dot)*Dist,cos(dot)*Dist,0]) translate([sin(dot)*Dist,cos(dot)*Dist,0])
color("black") color("black")
rotate([0,0,-dot]) // negative z rotates towards outer circle rotate([0,0,-dot]) // negative z rotates towards outer circle
if (dot % 90 == 0){ if (dot % 90 == 0){
divisor = 30; divisor = 30;
translate([0,-0.3,0]) translate([0,D/divisor,0]) // h
square([D/divisor,D/divisor*3], center=false); square([D/divisor,D/divisor*4], center=true);
} }
else { else {
divisor = 60; divisor = 60;
square([D/divisor,D/divisor*3], center=false); translate([0,D/divisor*2,0]) // min
} square([D/divisor,D/divisor*4], center=true);
} }
} }
}
min_lines(16);
min_lines(240);