Add clock and it's components, paths image

This commit is contained in:
Artur Kerge 2023-07-28 18:49:13 +03:00
parent ce9fe3678d
commit 26b7ad6955
9 changed files with 147 additions and 0 deletions

BIN
24hWallClock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

30
clock.scad Normal file
View File

@ -0,0 +1,30 @@
use <part_sun.scad>;
use <part_moon.scad>;
use <part_clock_outline.scad>;
use <part_min_lines.scad>;
use <part_hour_hexagons.scad>;
D=16; // dial size in cm
$fn=180;
module face() {
difference(){
clock_circle(D);
union() {
translate([0,-D/3]) color("red") sun(D/18);
translate([0.5,D/3]) color("white") moon(D/7);
for(spot=[15:15:360]){
translate([sin(spot)*(D/6*5),cos(spot)*(D/6*5),0]) // position control with radius multiplier
color("black")
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");
}
// Hour dots (dial, radius depth)
hour_hexagons(D,4);
// Minute lines
min_lines(D);
}
}
}
face();

8
part_clock_outline.scad Normal file
View File

@ -0,0 +1,8 @@
module clock_circle(D, bool) {
difference(){
color("burlywood")
circle(D);
if (bool) circle(d=0.7);
}
}
//clock_circle(12, true);

20
part_hand_hour.scad Normal file
View File

@ -0,0 +1,20 @@
$fn=24;
width=1;
length=11;
hole=0.7;
module hand_h() {
rotate([0,0,240])
color("darkgray")
difference(){
union(){
translate([-width/2,0,0])
square([width,length]);
circle(d=width*1.2);
translate([-width/2,-length/6,0])
square([width,length/7]);
}
circle(d=hole);
}
}
hand_h();

21
part_hand_min.scad Normal file
View File

@ -0,0 +1,21 @@
$fn=24;
width=0.8;
length=13;
hole=0.7;
module hand_min() {
rotate([0,0,130])
color("gray")
difference(){
union(){
translate([-width/2,0,0])
square([width,length]);
circle(d=1);
translate([-width/2,-length/6,0])
square([width,length/7]);
}
circle(d=hole);
}
}
hand_min();

11
part_hour_hexagons.scad Normal file
View File

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

22
part_min_lines.scad Normal file
View File

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

15
part_moon.scad Normal file
View File

@ -0,0 +1,15 @@
module moon(size){
difference(){
circle(d=size,$fn=360);
translate([size/3,0,0])
circle(d=size,$fn=360);
}
}
color("blue") moon(5);
translate([-20,0,0])
color("red") moon(1);
translate([30,0,0])
color("yellow") moon(10);

20
part_sun.scad Normal file
View File

@ -0,0 +1,20 @@
$fn=24;
//size=5;
module sun(size){
color("blue");
circle(size);
for(spot=[0:30:360]){
translate([sin(spot)*(size*1.5),cos(spot)*(size*1.5),0]) // position control with radius multiplier
rotate([0,0,-spot])
square([size/5, size/2],center=true);
};
}
color("blue") sun(5);
translate([-20,0,0])
color("red") sun(1);
translate([30,0,0])
color("yello") sun(10);