Please visit http://OpenSCAD.DIY3DTech.com for more information on this and many other projects! As in this episode, we will be looking at how we can use polygon code to and the Offset command to make a universal clock generator!
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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
/* Open SCAD Name.: ClockMaker_v1 * Copyright (c)..: 2016 www.DIY3DTech.com * * Creation Date..: Oct 16 2016 * Description....: Clock Maker code using the offset command * * Rev 1: Develop Model * Rev 2: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ /*------------------Customizer View-------------------*/ // preview[view:north, tilt:top] /*---------------------Parameters---------------------*/ //height of box box_height = 25; //height of box top top_height = 6; //top thickness top_thick = 2; //bottom thickness bottom_thick = 2; //map size of object x_ratio = 150; y_ratio = 170; z_ratio = 20; //clock spline size spline = 7.5; //clock spline offset x_spline_offset =0; y_spline_offset =30; /*-----------------------Execute----------------------*/ clock_module(); /*-----------------------Modules----------------------*/ module clock_module(){ //create module difference() { union() {//start union //create clock resize([x_ratio,y_ratio,z_ratio]) base_module(); } //end union //start subtraction of difference //create spline opening for clock motor translate([x_spline_offset,y_spline_offset, -box_height/2]) cylinder(bottom_thick*5,spline/2,spline/2,$fn=60,center=true); } //end difference }//end module module base_module(){ //create module difference() { union() {//start union //create box linear_extrude(height = box_height, center = true, convexity = 0, scale=1) translate([0, 0, 0])image_model(); } //end union //start subtraction of difference //remove the inside of the box translate([0, 0, bottom_thick]) linear_extrude(height = box_height, center = true, convexity = 0, scale=1) offset (r=bottom_thick*-1) image_model(); } //end difference }//end module module image_model(){ //inset polygon points polygon(points=[[0.7933492,48.87441],[2.116109,48.00195],[3.512045,46.24014],[5.712893,42.15929],[8.690516,35.40476],[10.39603,30.33887],[11.69628,24.56938],[12.45616,18.65917],[12.75449,13.45256],[12.65317,7.260911],[11.84262,-0.1972089],[11.52178,-2.589434],[11.84262,-3.996628],[12.86144,-5.685259],[19.83549,-15.53561],[20.42088,-17.22424],[20.49405,-35.51775],[20.40962,-37.31895],[20.12255,-37.58913],[19.42458,-37.31895],[8.020688,-25.65051],[7.058168,-25.15517],[6.568468,-25.25649],[6.140681,-26.08955],[5.701638,-26.98452],[4.958639,-27.41231],[1.074789,-27.49675],[-5.364529,-27.44045],[-6.15255,-27.0577],[-6.625372,-26.20213],[-7.030642,-25.31278],[-7.486573,-25.14392],[-8.409689,-25.54918],[-11.64623,-28.79699],[-19.94867,-37.31895],[-20.64664,-37.58913],[-20.96185,-37.23452],[-20.96748,-17.36495],[-20.42711,-15.67633],[-17.72531,-11.73619],[-12.06276,-3.715192],[-11.62935,-2.307997],[-11.69126,-0.9008061],[-12.50744,5.712998],[-12.7157,12.18609],[-12.423,19.08133],[-11.53366,25.55442],[-10.31221,30.76103],[-8.691129,35.54549],[-5.814826,42.01857],[-3.675897,45.95871],[-2.201157,47.88375],[-1.03037,48.74495],[-0.05096616,49.03202],[0.652631,48.92508]],paths=[[0,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]]); }//end image_model() module /*----------------------End Code----------------------*/ |
More Ideas!
OpenSCAD – Designing a Compression Cover!
OpenSCAD – Designing a Pressure Fit Endcap!
Open SCAD – Complex Flange Designer!