Please visit http://OpenSCAD.DIY3DTech.com for more information on this and many other projects! As in this episode we will be looking at we repurposed our bolt pattern code to create a compression fit cat the easy way!
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 |
/* Open SCAD Name.: endcaps_v1.scad * Copyright (c)..: 2020 www.DIY3DTech.com * * Creation Date..: 07/05/2020 * Description....: end-cap for pipe (press fit) * * 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---------------------*/ // outer dia of rod to create cap ID rod_od = 20.0; // thickness of cap in mm (each side) rod_id = 15.6; // height of cap in mm cap_high = 2.0; // tapper of opening in mm cap_tapper = 0.3; // cuts in lip for compression cuts = 10.0; /*-----------------------Execute----------------------*/ main_module(); /*-----------------------Modules----------------------*/ module main_module(){ //create module difference() { union() {//start union // create base cap translate ([0,0,0]) rotate ([0,0,0]) cylinder(cap_high,(rod_od)/2,(rod_od)/2,$fn=60,true); // create tappered plug translate ([0,0,(cap_high*1.5) ]) rotate ([0,0,0]) cylinder(cap_high*2,(rod_id)/2,(rod_id-(cap_tapper*2))/2,$fn=60,true); } //end union //start subtraction of difference // create opening for compression translate ([0,0,(cap_high*1.5)+0.1 ]) rotate ([0,0,0]) cylinder(cap_high*2,(rod_id-(cap_tapper*6))/2,(rod_id-(cap_tapper*6))/2,$fn=60,true); //create pattern for compression lip for (i=[0:(360/cuts):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+((rod_id/2)-((cap_tapper*3)))*cos(theta); //this sets the y axis point based on the sin of the theta y=0+((rod_id/2)-((cap_tapper*3)))*sin(theta); //this creates the circle or other obect at the x,y point translate([x,y,((cap_high*1.5) +.1)]) cylinder(cap_high*2,(cap_tapper*6)/2,(cap_tapper*6)/2,$fn=60,true);; }//end for loop for circle creation } //end difference }//end module /*----------------------End Code----------------------*/ |
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 Pressure Fit Endcap!
Open SCAD – Complex Flange Designer!
OpenSCAD – Parametric Mounting Bracket!