2 //*************************************************************//
3 // [EN] --- DIGITAL SUNDIAL
4 // [FR] --- CADRAN SOLAIRE NUMERIQUE
5 //*************************************************************//
8 // website: www.mojoptix.com
9 // Email: julldozer@mojoptix.com
10 // Date: 13 october 2015
11 // License: Creative Commons CC-BY (Attribution)
13 //*************************************************************//
14 // Optimized by Margu on 24 november 2015
15 //*************************************************************//
17 // [EN] The episode #001 of the video podcast Mojoptix describes this sundial in details:
18 // http://www.mojoptix.com/fr/2015/10/12/ep-001-cadran-solaire-numerique
22 // [FR] L'episode #001 du podcast video mojoptix decrit ce cadran solaire en detail:
23 // http://www.mojoptix.com/fr/2015/10/12/ep-001-cadran-solaire-numerique
26 //*************************************************************//
29 // Choose what you want to print/display:
31 // 2: the central connector piece
32 // 3: the top part of the lid
33 // 4: the bottom part of the lid
34 // 10: display everything
37 FLAG_northern_hemisphere = 1; // set to 1 for Northen Hemisphere, set to 0 for Southern Hemisphere
39 FLAG_gnomon_brim = 0; // Add a brim to the gnomon
40 FLAG_bottom_lid_support = 1; // Add some support structure for the lid teeth
44 /* ************************************************************************/
45 /* PARAMETERS *************************************************************/
46 /*************************************************************************/
47 epsilon_thickness = 0.02; // used to ensure openscad is not confused by almost identical surfaces
49 gnomon_brim_thickness = 0.3;
50 gnomon_brim_width = 10;
51 gnomon_brim_gap = 0.1;
53 FLAG_mirror_x_characters = 1; // set to 0 if viewing directly the characters on the blocks, set to 1 if viewing their reflection of a surface
55 gnomon_radius = 30; // (change at your own risks !)
57 pixel_size_x = gnomon_radius*8.0/40.0;
58 pixel_size_y = gnomon_radius*1.0/40.0;
59 pixel_pitch_x = gnomon_radius*10.0/40.0;
60 pixel_pitch_y = gnomon_radius*10.0/40.0;
62 grid_pixel_depth = 0.1;
64 nn = 40.0/gnomon_radius;
66 /* ************************************************************************/
67 /* FONT *******************************************************************/
68 /* ************************************************************************/
69 /* index in the array 0 1 2 3 4 5 6 7 8 9 10 11 12
70 Characters: 0 1 2 3 4 5 6 7 8 9 : {full white} {full dark}
72 1st coordinate in the array: the index in the array (see above)
73 2nd coordinate in the array: the Y (!!) coordinate
74 3nd coordinate in the array: the X coordinate
76 font_nb_pixel_x = 4; // 4 pixels wide
77 font_nb_pixel_y = 6; // 6 pixels high
80 [0,1,1,0], //index 0: character "0"
87 [0,1,0,0], //index 1: character "1"
94 [0,1,1,0], //index 2: character "2"
101 [0,1,1,0], //index 3: character "3"
108 [1,0,0,1], //index 4: character "4"
115 [1,1,1,1], //index 5: character "5"
122 [0,1,1,1], //index 6: character "6"
129 [1,1,1,1], //index 7: character "7"
136 [0,1,1,0], //index 8: character "8"
143 [0,1,1,0], //index 9: character "9"
150 [0,0,0,0], //index 10: character ":"
157 [1,1,1,1], //index 11: character {full white}
164 [0,0,0,0], //index 12: character {full dark}
171 // Added by Margu : we add some "characters" to display the transitions
172 // "0"-"1" transition character has pixels lit only if both corresponding digits are lit (boolean And operation)
175 [0,1,0,0], //index 13: character {"0" to "1" transition}
182 [0,1,0,0], //index 14: character {"1" to "2" transition}
189 [0,1,1,0], //index 15: character {"2" to "3" transition}
196 [0,0,0,0], //index 16: character {"3" to "4" transition}
203 [1,0,0,1], //index 17: character {"4" to "5" transition}
210 [0,1,1,1], //index 18: character {"5" to "6" transition}
217 [0,1,1,1], //index 19: character {"6" to "7" transition}
224 [1,1,1,1], //index 20: character {"7" to "8" transition}
225 [0,0,0,1], // not used, so wrong values !!!
231 [0,1,1,0], //index 20: character {"8" to "9" transition}
232 [1,0,0,1], // not used, so wrong values !!!
238 [0,1,1,0], //index 22: character {"9" to "0" transition}
245 [0,1,1,0], //index 23: character {"0" to "2" transition}
252 [0,0,0,0], //index 24: character {"2" to "4" transition}
259 [0,0,0,0], //index 25: character {"4" to "0" transition}
269 /* ************************************************************************/
270 /* MODULES ****************************************************************/
271 /* ************************************************************************/
273 /* ************************************************************************/
274 module extrude_pixel(direction_angle_x,direction_angle_y, pixel_wall_angle_x, pixel_wall_angle_y) {
275 /* Extrude a pixel in a given direction.
277 direction_angle_x: extrusion angle (from the normal to the pixel) in the x direction
278 direction_angle_y: extrusion angle (from the normal to the pixel) in the y direction
279 Return a (positive) solid that can then be substracted from another solid
280 (Origin at the center of the base pixel)
283 top_pixel_location_z = 2*gnomon_radius; // ie: somewhere outside the gnomon
284 // top_pixel_location_x = top_pixel_location_z * tan(direction_angle_x);
285 // top_pixel_location_y = top_pixel_location_z * tan(direction_angle_y);
286 top_pixel_size_x = pixel_size_x +2*top_pixel_location_z*tan(pixel_wall_angle_x); // account for the non_vertical pixel walls
287 top_pixel_size_y = pixel_size_y +2*top_pixel_location_z*tan(pixel_wall_angle_y);
288 // build (positive) geometry: extrude vertically then rotate
289 union() { rotate([direction_angle_y,direction_angle_x,0]) // rotate the whole extrusion in the chosen direction
291 rotate([-direction_angle_y,-direction_angle_x,0]) // derotate the base pixel (to keep it flat at the bottom)
292 cube([pixel_size_x,pixel_size_y,epsilon_thickness], center=true);
293 translate([0,0,top_pixel_location_z])
294 cube([top_pixel_size_x, top_pixel_size_y,epsilon_thickness], center=true);
300 /* ************************************************************************/
301 module extrude_character(font_index, direction_angle_x, direction_angle_y, pixel_wall_angle_x, pixel_wall_angle_y) {
302 /* Extrude a (pixelated) character in a given direction:
304 font_index: the index of the character in the font array
305 direction_angle_x: extrusion angle (from the normal to the pixel) in the x direction
306 direction_angle_y: extrusion angle (from the normal to the pixel) in the y direction
307 Return a (positive) solid that can then be substracted from another solid
308 (Origin at the center of the base character)
310 for (tx=[0:(font_nb_pixel_x-1)]){
311 for (ty=[0:(font_nb_pixel_y-1)]){
312 if(FLAG_mirror_x_characters==0) { // Note: y is the 2nd coordinate, x is the 3rd (see definition of the Font)
313 if(font_char[font_index][ty][tx]==1) {
314 translate([(tx-(font_nb_pixel_x-1)/2)*pixel_pitch_x, (ty-(font_nb_pixel_y-1)/2)*pixel_pitch_y,0]){
315 extrude_pixel(direction_angle_x,direction_angle_y, pixel_wall_angle_x, pixel_wall_angle_y);
319 else { // mirror the characters across x
320 if(font_char[font_index][ty][font_nb_pixel_x-1-tx]==1) {
321 translate([(tx-(font_nb_pixel_x-1)/2)*pixel_pitch_x, (ty-(font_nb_pixel_y-1)/2)*pixel_pitch_y,0]){
322 extrude_pixel(direction_angle_x,direction_angle_y, pixel_wall_angle_x, pixel_wall_angle_y);
331 /* ************************************************************************/
332 module build_create_pixel_grid(pixel_depth, ID_column_OFF=[]) {
333 /* Create a grid where each intersection row/column is a potential pixel
335 pixel_depth: the depth of the pixel grid
336 ID_column_OFF: list all the columns that should be left OFF (eg not built), exemple: [0,1]
337 Return a (positive) solid that can then be substracted from another solid
338 (Origin at the center of the base character)
340 if (len(ID_column_OFF)<font_nb_pixel_x) {
342 cube([(font_nb_pixel_x+1)*pixel_pitch_x,(font_nb_pixel_y)*pixel_pitch_y,pixel_depth*3], center=true); // the column imprint only goes from the bottom to the top row
345 for (tx=[0:(font_nb_pixel_x-1)]){
346 FLAG_draw_this_column = len( search(tx, ID_column_OFF) ) == 0;
347 if (FLAG_draw_this_column ){
348 translate([(tx-(font_nb_pixel_x-1)/2)*pixel_pitch_x, 0,pixel_depth/2])
349 // cube([pixel_size_x,gnomon_radius*3,pixel_depth+epsilon_thickness], center=true);
350 cube([0.1,gnomon_radius*3,pixel_depth], center=true);
358 for (ty=[0:(font_nb_pixel_y-1)]){
359 translate([0, (ty-(font_nb_pixel_y-1)/2)*pixel_pitch_y,pixel_depth/2])
360 // cube([gnomon_radius*30,1.5*pixel_size_y,pixel_depth+epsilon_thickness], center=true);
361 cube([gnomon_radius*30,0.1,pixel_depth], center=true);
366 /* ************************************************************************/
367 module build_block(gnomon_thickness, char_list, char_angle_x, char_angle_y, pixel_wall_angle_x, pixel_wall_angle_y) {
368 /* Build a block with a set of characters */
370 // Build The gnomon shape
372 translate([0,0,gnomon_radius/2])
373 cube([gnomon_thickness,2*gnomon_radius,gnomon_radius], center=true);
375 rotate([90,0,90]) cylinder(r=gnomon_radius, h=gnomon_thickness, center=true, $fn=100);
378 // Carve the light guides for each number
379 for (ti = [0:(len(char_list)-1)]){
380 extrude_character(char_list[ti],char_angle_x[ti],char_angle_y[ti], pixel_wall_angle_x, pixel_wall_angle_y);
384 if (FLAG_gnomon_brim == 1) {
387 cube([gnomon_thickness, gnomon_radius*2+gnomon_brim_width*2, gnomon_brim_thickness],center=true);
388 cube([10*gnomon_thickness, gnomon_radius*2+gnomon_brim_gap*2, 10*gnomon_brim_thickness],center=true);
393 /* ************************************************************************/
394 module build_spacer_block(gnomon_thickness) {
395 /* Build a spacer block*/
400 translate([0,0,gnomon_radius/2])
401 cube([gnomon_thickness+epsilon_thickness,2*gnomon_radius,gnomon_radius], center=true);
403 rotate([90,0,90]) cylinder(r=gnomon_radius, h=gnomon_thickness+epsilon_thickness, center=true, $fn=100);
406 build_create_pixel_grid(grid_pixel_depth, ID_column_OFF=[0,1,2,3,4]);
410 if (FLAG_gnomon_brim == 1) {
413 cube([gnomon_thickness, gnomon_radius*2+gnomon_brim_width*2, gnomon_brim_thickness],center=true);
414 cube([10*gnomon_thickness, gnomon_radius*2+gnomon_brim_gap*2, 10*gnomon_brim_thickness],center=true);
421 /* ************************************************************************/
422 module build_round_top_block() {
423 gnomon_thickness = gnomon_radius;
424 /* Build a round top block*/
427 translate([0,0,gnomon_radius/2])
428 cube([gnomon_thickness,2*gnomon_radius,gnomon_radius], center=true);
429 translate([gnomon_radius/2,0,0])
430 scale([0.3,1,1]) sphere(r=gnomon_radius, center=true, $fn=100);
435 if (FLAG_gnomon_brim == 1) {
438 translate([0.35*gnomon_thickness-gnomon_brim_width/2,0,0]) cube([0.3*gnomon_thickness+gnomon_brim_width, gnomon_radius*2+gnomon_brim_width*2, gnomon_brim_thickness],center=true);
439 translate([gnomon_radius/2,0,0])
441 scale([0.3,1,1]) sphere(r=gnomon_radius, center=true, $fn=100);
442 sphere(r=gnomon_brim_gap, center=true, $fn=10);
448 /* ************************************************************************/
449 module Block_hours_tens() {
451 gnomon_thickness = gnomon_radius*45.0/40.0; //45;
452 pixel_wall_angle_x = 0; // [degrees] angle of the walls along the x direction
453 pixel_wall_angle_y = 6.0; // [degrees] angle of the walls along the y direction
455 /* char_angle_x = [0,0,0,0,0,0,0];
456 char_angle_y = [-45,-30,-15,0,15,30,45];
457 char_list = [1,1,1,1,1,1,1];
460 // We add intermediate angles (-37, -22, -15, -8, 8, 15, 22, 37) to display transition characters thus removing not needed material.
461 // Because there is no need to make a dark transition for pixels which remain lit
462 char_angle_x = [0,0,0,0,0,0,0,0,0,0,0,0,0];
463 char_angle_y = [ -45,-37, -30, -22, -15, -8, 0, 8, 15, 22, 30, 38, 45];
464 char_list = [1,1,1,1,1,1,1,1,1,1,1,1,1];
466 build_block(gnomon_thickness, char_list, char_angle_x, char_angle_y, pixel_wall_angle_x, pixel_wall_angle_y);
467 build_create_pixel_grid(grid_pixel_depth, ID_column_OFF=[]);
471 /* ************************************************************************/
472 module Block_hours_units() {
474 gnomon_thickness = gnomon_radius*45.0/40.0; //45;
475 pixel_wall_angle_x = 0; // [degrees] angle of the walls along the x direction
476 pixel_wall_angle_y = 6.0; // [degrees] angle of the walls along the y direction
479 // We add intermediate angles (-37, -22, -15, -8, 8, 15, 22, 37) to display transition characters thus removing not needed material.
480 // Because there is no need to make a dark transition for pixels which remain lit
481 char_angle_x = [0,0,0,0,0,0,0,0,0,0,0,0,0];
482 char_angle_y = [-45,-38,-30, -22, -15,-8,0,8,15,22,30,38,45];
483 char_list = [0,13,1,14,2,15,3,16,4,17,5,18,6];
486 build_block(gnomon_thickness, char_list, char_angle_x, char_angle_y, pixel_wall_angle_x, pixel_wall_angle_y);
487 build_create_pixel_grid(grid_pixel_depth, ID_column_OFF=[]);
491 /* ************************************************************************/
492 module Block_minutes_tens() {
494 gnomon_thickness = gnomon_radius*45.0/40.0; //45;
495 pixel_wall_angle_x = 0; // [degrees] angle of the walls along the x direction
496 pixel_wall_angle_y = 1.0; // [degrees] angle of the walls along the y direction
499 // We add intermediate angles (-48, -43, -38, -22, -15, -8, 8, 15, 22, 38, 43, 48) to display transition characters thus removing not needed material.
500 // Because there is no need to make a dark transition for pixels which remain lit
501 char_angle_x = [0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 0];
502 char_angle_y = [-50,-48,-45,-43,-40,-38, -35,-33,-30,-28,-25,-23, -20,-18,-15,-13,-10,-8, -5,-3,0,3,5,8, 10,13,15,18,20,23, 25,28,30,33,35,38, 40];
503 char_list = [0,23,2,24,4,25,0,23,2,24,4,25,0,23,2,24,4,25,0,23,2,24,4,25,0,23,2,24,4,25,0,23,2,24,4,25, 0];
506 build_block(gnomon_thickness, char_list, char_angle_x, char_angle_y, pixel_wall_angle_x, pixel_wall_angle_y);
507 build_create_pixel_grid(grid_pixel_depth, ID_column_OFF=[]);
511 /* ************************************************************************/
512 module Block_minutes_units() {
514 gnomon_thickness = gnomon_radius*45.0/40.0; //45;
515 pixel_wall_angle_x = 0; // [degrees] angle of the walls along the x direction
516 pixel_wall_angle_y = 8.0; // [degrees] angle of the walls along the y direction
519 char_angle_x = [0,0,0,0,0,0,0];
520 char_angle_y = [-45,-30,-15,0,15,30,45];
521 char_list = [0,0,0,0,0,0,0];
524 build_block(gnomon_thickness, char_list, char_angle_x, char_angle_y, pixel_wall_angle_x, pixel_wall_angle_y);
525 build_create_pixel_grid(grid_pixel_depth, ID_column_OFF=[]);
529 /* ************************************************************************/
530 module Block_semicolon() {
532 gnomon_thickness = gnomon_radius*25.0/40.0; //25;
533 pixel_wall_angle_x = 0; // [degrees] angle of the walls along the x direction
534 pixel_wall_angle_y = 8.0; // [degrees] angle of the walls along the y direction
537 char_angle_x = [0,0,0,0,0,0,0];
538 char_angle_y = [-45,-30,-15,0,15,30,45];
539 char_list = [10,10,10,10,10,10,10];
542 build_block(gnomon_thickness, char_list, char_angle_x, char_angle_y, pixel_wall_angle_x, pixel_wall_angle_y);
543 build_create_pixel_grid(grid_pixel_depth, ID_column_OFF=[3]);
547 /* ************************************************************************/
548 module Block_rotating_base_upper() {
549 /* Build the upper part of the rotating base */
550 gnomon_thickness = gnomon_radius;
551 Screw_hole_diameter = 6.5;
552 Nut_width_blocking = 8.8+1.3;
553 Nut_width_non_blocking = 11.2;
554 Washer_Diameter = 11.9;
555 Washer_thickness = 1.3;
558 // Build The gnomon shape
561 translate([0,0,gnomon_radius/2])
562 cube([2/3*gnomon_thickness,2*gnomon_radius,gnomon_radius], center=true);
564 rotate([90,0,90]) cylinder(r=gnomon_radius, h=gnomon_thickness, center=true, $fn=100);
567 // The negative space for the screw, nut and washer
568 translate([0,0,Washer_Diameter/2+3])
569 rotate([90,0,90]) cylinder(r=Screw_hole_diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
570 translate([gnomon_thickness*(0.45-1/3),0,Washer_Diameter/2+3])
571 rotate([90,0,90]) cylinder(r=Washer_Diameter/2+4, h=Washer_thickness+2, center=true, $fn=100);
572 translate([gnomon_thickness*(0.45-1/3),0,0])
573 cube([Washer_thickness+2,Washer_Diameter+8, 2*(Washer_Diameter/2+3)], center=true);
574 translate([gnomon_thickness*(0.4-2/3),0,0])
575 cube([gnomon_thickness*0.8+1,Nut_width_blocking, 2*(Washer_Diameter/2+3)], center=true);
577 translate([gnomon_thickness*(0.45-2/3),0,Washer_Diameter/2+3])
578 cube([gnomon_thickness, 2*(Nut_width_non_blocking/2+1), 2*(Nut_width_non_blocking/2+1)],center=true);
579 translate([gnomon_thickness*(0.45-2/3),0,Washer_Diameter/2+3-epsilon_thickness])
580 cube([gnomon_thickness*2/3+1,Nut_width_blocking, gnomon_radius], center=true);
582 translate([gnomon_thickness*(0.45-2/3),0,0])
583 cube([gnomon_thickness*2/3+1,Nut_width_blocking+1, 1], center=true);
588 if (FLAG_gnomon_brim == 1) {
591 translate([gnomon_brim_width/2,0,0,]) cube([2/3*gnomon_thickness+gnomon_brim_width, gnomon_radius*2+gnomon_brim_width*2, gnomon_brim_thickness],center=true);
592 translate([-2/3*gnomon_thickness/2,0,0,]) cube([2*2/3*gnomon_thickness+gnomon_brim_gap*2, gnomon_radius*2+gnomon_brim_gap*2, 10*gnomon_brim_thickness],center=true);
597 /* ************************************************************************/
598 module Block_rotating_base_mid() {
599 /* Build the mid part of the rotating base */
600 gnomon_thickness = 1.3*gnomon_radius;
601 Screw_hole_diameter = 6.5;
602 Nut_width_blocking = 8.8;
603 Nut_width_non_blocking = 11.2;
604 Washer_Diameter = 11.9;
605 Washer_thickness = 1.3;
608 // The connection to the gnomon
613 translate([0,0,gnomon_radius/2])
614 cube([gnomon_thickness,2*gnomon_radius,gnomon_radius], center=true);
616 rotate([90,0,90]) cylinder(r=gnomon_radius, h=gnomon_thickness, center=true, $fn=100);
618 // The connection to the base
620 translate([gnomon_thickness*(1-(1-0.7)/2.0),0,gnomon_radius/2])
621 cube([gnomon_thickness*0.7, 0.8*gnomon_radius, gnomon_radius], center=true);
622 translate([gnomon_thickness/2.0+gnomon_radius,0,0])
623 rotate([90,0,90]) cylinder(r=gnomon_radius, h=2*gnomon_thickness, center=true, $fn=100);
627 // The negative space for the screw and washer
628 translate([0,0,Washer_Diameter/2+3])
629 rotate([90,0,90]) cylinder(r=Screw_hole_diameter/2, h=20*gnomon_thickness, center=true, $fn=100);
630 translate([gnomon_thickness*(0.5-4/8),0,Washer_Diameter/2+2.5])
631 cube([gnomon_thickness*(6/8), 2*(Washer_Diameter/2+2), 2*(Washer_Diameter/2+3)],center=true);
632 translate([gnomon_thickness*(0.5-4/8),0,Washer_Diameter+4])
633 rotate([90,0,0]) scale([0.37,0.2,1]) cylinder(r=gnomon_thickness, h=2*(Washer_Diameter/2+2), center=true, $fn=100);
634 translate([gnomon_thickness,0,gnomon_radius/2.0])
635 rotate([90,0,0]) cylinder(r=Screw_hole_diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
636 /* // Small cut to reduce warping issues
637 translate([gnomon_thickness,0,gnomon_radius])
638 cube([1,2*gnomon_thickness,gnomon_radius], center=true);
648 /* ************************************************************************/
649 module Block_jar_lid_top() {
650 gnomon_thickness = 2*gnomon_radius;
651 Screw_hole_diameter = 6.5;
652 Nut_width_blocking = 8.8;
653 Nut_width_non_blocking = 11.2;
654 Washer_Diameter = 11.9;
655 Washer_thickness = 1.3;
656 Base_Wall_thickness = 3.0;
657 box_width = gnomon_radius*4;
658 box_length = gnomon_radius*4;
659 box_height = gnomon_radius*2;
661 Connector_x_offset = 10+5;
667 translate([0,0,gnomon_radius/2.0])
668 rotate([90,0,0]) cylinder(r=gnomon_radius/2.0*1.2, h=gnomon_thickness*0.65, center=true, $fn=100);
669 translate([Connector_x_offset,0,-0.75*gnomon_radius/2.0-Base_Wall_thickness/2]) rotate([0,0,0]) cylinder(r=Base_diameter/2 ,h=Base_Wall_thickness, center=true, $fn=100);
671 // Space to rotate the gnomon
672 translate([0,0,gnomon_radius/2.0])
673 rotate([90,0,0]) cylinder(r=gnomon_radius*0.7, h=0.8*gnomon_radius+2*epsilon_thickness, center=true, $fn=100);
674 translate([-gnomon_thickness*10,0,9.94*gnomon_radius])
675 cube([gnomon_thickness*20, 0.8*gnomon_radius+2*epsilon_thickness, 20*gnomon_radius], center=true);
676 translate([-gnomon_thickness*10,0,-0.06*gnomon_radius])
677 rotate([0,90,0]) scale([0.3,1,1]) cylinder(r=0.4*gnomon_radius, h=gnomon_thickness*20, center=true, $fn=100);
678 translate([gnomon_thickness*10,0,0.65*gnomon_radius])
679 rotate([0,90,0]) scale([1.5,1,1]) cylinder(r=0.4*gnomon_radius, h=gnomon_thickness*20, center=true, $fn=100);
680 // Hole for the top screw
681 translate([0,0,gnomon_radius/2.0])
682 rotate([90,0,0]) cylinder(r=Screw_hole_diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
683 // Flat surface for the top screw & washer/nut
684 translate([0,-gnomon_thickness*(1+0.5/2+0.25/2-0.01)+2,gnomon_radius/2.0])
685 rotate([90,0,0]) cylinder(r=1.5*Washer_Diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
686 translate([0,gnomon_thickness*(1+0.5/2+0.25/2-0.01)-2,gnomon_radius/2.0])
687 rotate([90,0,0]) cylinder(r=1.5*Washer_Diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
688 // Holes for the two bottom screws
689 translate([Connector_x_offset+1.1*Base_diameter/6,0,gnomon_radius/2.0])
690 rotate([0,0,0]) cylinder(r=Screw_hole_diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
691 translate([Connector_x_offset-1.1*Base_diameter/6,0,gnomon_radius/2.0])
692 rotate([0,0,0]) cylinder(r=Screw_hole_diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
693 // Flat surfaces for the two bottom screws
694 translate([Connector_x_offset+1.1*Base_diameter/6,0,gnomon_radius*1.63-Base_Wall_thickness+Base_Wall_thickness])
695 rotate([0,0,0]) cylinder(r=1.5*Washer_Diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
696 translate([Connector_x_offset-1.1*Base_diameter/6,0,gnomon_radius*1.63-Base_Wall_thickness+Base_Wall_thickness])
697 rotate([0,0,0]) cylinder(r=1.5*Washer_Diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
703 /* ************************************************************************/
704 module Block_jar_lid_bottom_old() {
705 //Dimensions for a Bonne Maman jam jar
706 Lid_diameter_outside = 88;
707 Lid_diameter_inside = 82;
709 Lid_skirt_height_under_teeth = 0;
710 Lid_skirt_full_height = 15 +Lid_thickness +Lid_skirt_height_under_teeth;
711 Teeth_thickness = 2.0;
714 Connector_x_offset = 10;
716 gnomon_thickness = 2*gnomon_radius;
717 Screw_hole_diameter = 6.5;
719 translate([Connector_x_offset, 0,0]) {
720 //The skirt of the lid
722 translate([0,0,-Lid_skirt_full_height/2]) rotate([0,0,0]) cylinder(r=Lid_diameter_outside/2 ,h=Lid_skirt_full_height, center=true, $fn=100);
723 translate([0,0,-Lid_skirt_full_height/2]) rotate([0,0,0]) cylinder(r=Lid_diameter_inside/2 ,h=2*Lid_skirt_full_height, center=true, $fn=100);
726 translate([0,0,-Lid_skirt_full_height+Teeth_thickness/2+Lid_skirt_height_under_teeth]) intersection(){
728 rotate([0,0,0]) cylinder(r=(0.5*Lid_diameter_inside+0.5*Lid_diameter_outside)/2 ,h=Teeth_thickness, center=true, $fn=100);
729 rotate([0,0,0]) cylinder(r=Lid_diameter_inside/2-Teeth_depth ,h=2*Teeth_thickness, center=true, $fn=100);
732 rotate([0,0,0]) cube([2*Lid_diameter_outside,Teeth_length,2*Teeth_thickness], center=true);
733 rotate([0,0,60]) cube([2*Lid_diameter_outside,Teeth_length,2*Teeth_thickness], center=true);
734 rotate([0,0,120]) cube([2*Lid_diameter_outside,Teeth_length,2*Teeth_thickness], center=true);
737 //The flat part of the lid
739 translate([0,0,-Lid_thickness/2]) rotate([0,0,0]) cylinder(r=Lid_diameter_outside/2 ,h=Lid_thickness, center=true, $fn=100);
740 // Holes for the two screws
741 translate([1.1*Base_diameter/6,0,gnomon_radius/2.0])
742 rotate([0,0,0]) cylinder(r=Screw_hole_diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
743 translate([-1.1*Base_diameter/6,0,gnomon_radius/2.0])
744 rotate([0,0,0]) cylinder(r=Screw_hole_diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
750 /* ************************************************************************/
751 module Block_jar_lid_bottom() {
752 //Dimensions for a Bonne Maman jam jar
753 Lid_diameter_outside = 88;
754 Lid_diameter_inside = 82;
756 Lid_skirt_height_under_teeth = 0;
757 Lid_skirt_full_height = 15 +Lid_thickness +Lid_skirt_height_under_teeth;
758 Teeth_thickness = 2.0;
761 Connector_x_offset = 10;
763 gnomon_thickness = 2*gnomon_radius;
764 Screw_hole_diameter = 6.5;
766 Logo_negative_depth = 2;
767 Logo_positive_depth = 2;
768 Logo_inside_cylinder_depth = 0;
769 Support_horizontal_gap = 0.2;
770 Support_vertical_gap = 0.1; // should 1 layer thickness
771 Support_thickness = 1.2;
772 Support_height_above = 5; // for an easier removal
774 translate([Connector_x_offset, 0,0]) {
775 //The skirt of the lid
778 //Outside shape for the skirt
780 translate([0,0,-Lid_skirt_full_height+1/2]) rotate([0,0,0]) cylinder(r=Lid_diameter_outside/2*1.035 ,h=1, center=true, $fn=12); // factor 1.035 because it has 12 faces: Lid_diameter_outside/2 is the minimum distance, instead of the maximum distance
781 translate([0,0,-Lid_thickness-1/2]) rotate([0,0,0]) cylinder(r=Lid_diameter_outside/2 ,h=1, center=true, $fn=100);
783 // Add the MOJOPTIX Logo (positive shape)
784 rotate([0,0,90]) translate([0,-Lid_diameter_outside/2+Logo_negative_depth+20,-Lid_skirt_full_height/2]) rotate([90,0,0]) linear_extrude(20) text("MOJOPTIX",size=Logo_font_size,halign="center", valign="center",font="Comic Sans MS:style=Bold");
785 rotate([0,0,-30]) translate([0,-Lid_diameter_outside/2+Logo_negative_depth+20,-Lid_skirt_full_height/2]) rotate([90,0,0]) linear_extrude(20) text("MOJOPTIX",size=Logo_font_size,halign="center", valign="center",font="Comic Sans MS:style=Bold");
786 rotate([0,0,210]) translate([0,-Lid_diameter_outside/2+Logo_negative_depth+20,-Lid_skirt_full_height/2]) rotate([90,0,0]) linear_extrude(20) text("MOJOPTIX",size=Logo_font_size,halign="center", valign="center",font="Comic Sans MS:style=Bold");
788 //Trim the Positive shape of the MOJOPTIX Logo with a tube
790 cylinder(r=10*Lid_diameter_outside/2+Logo_positive_depth,h=1000,center=true, $fn=100);
791 cylinder(r=Lid_diameter_outside/2+Logo_positive_depth,h=1000,center=true, $fn=100);
793 // Add the MOJOPTIX Logo (negative shape)
796 rotate([0,0,90]) translate([0,-Lid_diameter_outside/2+Logo_negative_depth,-Lid_skirt_full_height/2]) rotate([90,0,0]) linear_extrude(100) text("MOJOPTIX",size=Logo_font_size,halign="center", valign="center",font="Comic Sans MS:style=Bold");
797 rotate([0,0,-30]) translate([0,-Lid_diameter_outside/2+Logo_negative_depth,-Lid_skirt_full_height/2]) rotate([90,0,0]) linear_extrude(100) text("MOJOPTIX",size=Logo_font_size,halign="center", valign="center",font="Comic Sans MS:style=Bold");
798 rotate([0,0,210]) translate([0,-Lid_diameter_outside/2+Logo_negative_depth,-Lid_skirt_full_height/2]) rotate([90,0,0]) linear_extrude(100) text("MOJOPTIX",size=Logo_font_size,halign="center", valign="center",font="Comic Sans MS:style=Bold");
800 //Trim the Negative shape of the MOJOPTIX Logo with a cylinder
801 cylinder(r=Lid_diameter_outside/2-Logo_inside_cylinder_depth,h=1000,center=true, $fn=100);
803 //Inside shape for the skirt
804 translate([0,0,-Lid_skirt_full_height/2]) rotate([0,0,0]) cylinder(r=Lid_diameter_inside/2 ,h=2*Lid_skirt_full_height, center=true, $fn=100);
807 translate([0,0,-Lid_skirt_full_height+Teeth_thickness/2+Lid_skirt_height_under_teeth]) intersection(){
809 rotate([0,0,0]) cylinder(r=(0.5*Lid_diameter_inside+0.5*Lid_diameter_outside)/2 ,h=Teeth_thickness, center=true, $fn=100);
810 rotate([0,0,0]) cylinder(r=Lid_diameter_inside/2-Teeth_depth ,h=2*Teeth_thickness, center=true, $fn=100);
813 rotate([0,0,0]) cube([2*Lid_diameter_outside,Teeth_length,2*Teeth_thickness], center=true);
814 rotate([0,0,60]) cube([2*Lid_diameter_outside,Teeth_length,2*Teeth_thickness], center=true);
815 rotate([0,0,120]) cube([2*Lid_diameter_outside,Teeth_length,2*Teeth_thickness], center=true);
819 //The flat part of the lid
821 translate([0,0,-Lid_thickness]) rotate_extrude(convexity = 10, $fn = 100) {
822 square([Lid_diameter_outside/2-Lid_thickness,Lid_thickness], center=false);
824 translate([Lid_diameter_outside/2-Lid_thickness+epsilon_thickness,0,-Lid_thickness]) scale([1,1]) circle(r=Lid_thickness, center=true);
825 square([Lid_diameter_outside/2+epsilon_thickness,Lid_thickness+epsilon_thickness], center=false);
828 // Holes for the two screws
829 translate([1.1*Base_diameter/6,0,gnomon_radius/2.0])
830 rotate([0,0,0]) cylinder(r=Screw_hole_diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
831 translate([-1.1*Base_diameter/6,0,gnomon_radius/2.0])
832 rotate([0,0,0]) cylinder(r=Screw_hole_diameter/2, h=2*gnomon_thickness, center=true, $fn=100);
833 // A single line on the 1st layer to have a custom scarring (instead of some scarring at a random place)
834 translate([0,0,0]) cube([100,0.1,0.5], center=true);
838 // Support structure for the teeth
839 if (FLAG_bottom_lid_support == 1) {
840 color("red") difference(){
841 translate([0,0,-Lid_skirt_full_height/2-Lid_thickness/2-Support_vertical_gap-Support_height_above/2]) rotate([0,0,0]) cylinder(r=Lid_diameter_inside/2-Teeth_depth-Support_horizontal_gap,h=Lid_skirt_full_height-Lid_thickness+Support_height_above, center=true, $fn=100);
842 translate([0,0,-Lid_skirt_full_height/2-Lid_thickness]) rotate([0,0,0]) cylinder(r=Lid_diameter_inside/2-Teeth_depth-Support_horizontal_gap-Support_thickness ,h=2*Lid_skirt_full_height+2*Support_height_above, center=true, $fn=100);
843 cube([2,1000,1000],center=true);
856 /* ************************************************************************/
857 /* ************************************************************************/
858 module Gnomon_Digits(nn) {
859 /* translate([112.5/nn,0,0]) Block_hours_tens();
860 translate([85/nn,0,0]) build_spacer_block(10/nn);
861 translate([57.5/nn,0,0]) Block_hours_units();
862 translate([30/nn,0,0]) build_spacer_block(10/nn);
864 translate([12.5/nn,0,0]) Block_semicolon();
866 translate([-22.5/nn,0,0]) Block_minutes_tens();
867 translate([-50/nn,0,0]) build_spacer_block(10/nn);
868 translate([-77.5/nn,0,0]) Block_minutes_units();
870 translate([112.5/nn,0,0]) Block_hours_tens();
871 translate([89/nn,0,0]) build_spacer_block(2/nn);
872 translate([65.5/nn,0,0]) Block_hours_units();
873 translate([38/nn,0,0]) build_spacer_block(10/nn);
875 translate([20.5/nn,0,0]) Block_semicolon();
877 translate([-14.5/nn,0,0]) Block_minutes_tens();
878 translate([-42/nn,0,0]) build_spacer_block(10/nn);
879 translate([-69.5/nn,0,0]) Block_minutes_units();
883 /* ************************************************************************/
884 module Gnomon_Rounded_Top(nn) {
885 translate([-120/nn,0,0]) build_round_top_block();
887 /* ************************************************************************/
888 module Gnomon_Bottom_Connector(nn) {
889 translate([155/nn,0,0]) Block_rotating_base_upper();
891 /* ************************************************************************/
892 module Central_Connector(nn) {
893 color("red") translate([205/nn,0,0]) Block_rotating_base_mid();
895 /* ************************************************************************/
896 module Jar_Lid_Top(nn) {
897 translate([265/nn,0,0]) Block_jar_lid_top();
899 /* ************************************************************************/
900 module Jar_Lid_Bottom(nn) {
902 translate([265/nn,0,-24/nn]) Block_jar_lid_bottom();
907 /* ************************************************************************/
910 if (FLAG_northern_hemisphere==1){
911 translate([5,0,0]) Gnomon_Digits(nn);
912 translate([11,0,0]) Gnomon_Rounded_Top(nn);
913 translate([0,0,0]) Gnomon_Bottom_Connector(nn);
916 translate([37.25,0,0]) rotate([0,0,180]) Gnomon_Digits(nn);
917 translate([11,0,0]) Gnomon_Rounded_Top(nn);
918 translate([0,0,0]) Gnomon_Bottom_Connector(nn);
922 /* ************************************************************************/
923 /* MAIN *******************************************************************/
924 /* ************************************************************************/
926 // Choose what you want to print/display:
928 if (FLAG_PRINT == 1) Gnomon(nn);
929 // 2: the central connector piece
930 if (FLAG_PRINT == 2) translate([-8,0,0]) Central_Connector(nn);
931 // 3: the top part of the lid
932 if (FLAG_PRINT == 3) translate([-14,0,0]) Jar_Lid_Top(nn);
933 // 4: the bottom part of the lid
934 if (FLAG_PRINT == 4) translate([-9,0,3.75]) rotate([180,0,0]) Jar_Lid_Bottom(nn);
936 if (FLAG_PRINT == 10)
939 translate([-8,0,0]) Central_Connector(nn);
940 translate([-14,0,0]) Jar_Lid_Top(nn);
941 translate([-9,0,3.75]) Jar_Lid_Bottom(nn);