As in this episode we will be sharing with you the code which I used to create a flange customizer on Thingiverse, While rather simple code, this could be very handy code also!
Amazing BIG Kit printer: http://diy3dtech.com/gearbest-tronxy-x5s-high-precision-large-scale-3d-printer/
Original Gearbest version: http://diy3dtech.com/gearbest-cr-10-super-large-3d-printer/
Best Deals on a Creality: http://diy3dtech.com/creality-cr-10-best-deals/
Have you been bitten: http://diy3dtech.com/gearbest-tevo-black-widow-3d-printer-kit/
Have you seen this: http://diy3dtech.com/gearbest-tronxy-x1-desktop-3d-printer/
Best Kit Deal and Community: http://diy3dtech.com/tevo-tarantula/
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 |
/* * Open SCAD Name.: flange_model_v2.scad * Copyright (c)..: 2017 www.DIY3DTech.com * * Creation Date..:12/24/2017 * Discription....: general flange model * * Rev 1: Developed 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. * * If used commercially attribution is required (OpenSCAD.DIY3DTech.com) * */ /*------------------Customizer View-------------------*/ // preview[view:north, tilt:top] /*---------------------Parameters---------------------*/ // outer diameter in (mm) flange_OD = 150; //[50:1:300] // inter diameter in (mm) flange_ID = 101.6; //[25:1:200] // flange height in (mm) flange_height = 3; //[3:1:10] // tube center height center_height = 25; //[3:1:50] // opening diameter in (mm) bolt_ID = 6; //[3:1:12] // center to center spread of retaining bolts (mm) bolt_spread = 135; //[25:1:250] // number of bolts in flange bolt_count =4; //[2:1:24] /*-----------------------Execute----------------------*/ flange(); /*-----------------------Modules----------------------*/ module flange() { difference(){ //create flange union() { cylinder(flange_height,flange_OD/2,flange_OD/2,$fn=60,true); translate([0, 0,center_height/2]) cylinder(center_height,(flange_ID+flange_height)/2,(flange_ID+flange_height)/2,$fn=60,true); } //remove center translate([0, 0,center_height/2]) cylinder(center_height*2,flange_ID/2,flange_ID/2,$fn=60,true); //create circle pattern for (i=[0:(360/bolt_count):360]) { //theta is degrees set by for loop from 0 to 360 (degrees) theta=i; //this sets the x axis point based on the COS of the theta x=0+(bolt_spread/2)*cos(theta); //this sets the y axis point based on the sin of the theta y=0+(bolt_spread/2)*sin(theta); //this creates the circle or other obect at the x,y point translate([x,y,0]) cylinder(flange_height+2,bolt_ID/2,bolt_ID/2,$fn=60,true);; }//end for loop for circle creation }//end differance }//end module /*---------------------End Program--------------------*/ |
If your looking for looking 3D Printer, Laser Cutter and CNC Swag (T-Shirts, Hats, Mugs, etc), please support the channel by visiting our online shop at: http://swag.DIY3DTech.com
Also subscribe to our parent YouTube Channel DIY3DTech.com YouTube Channel for 3D Printing, Laser Manufacturing and CNC Machining: http://YouTube.DIY3DTech.com
More Ideas!
OpenSCAD – Designing a Compression Cover!
OpenSCAD – Designing a Pressure Fit Endcap!
Open SCAD – Complex Flange Designer!