In this episode we will at some tips and tricks to create a oblong connector on Open SCAD as I am finding I always seem to need one of these for various projects which I am working so why not create a parametric module to create them on demand!
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 |
/* Open SCAD Name.:Oblong Connector * Copyright (c)..: 2016 www.DIY3DTech.com * * Creation Date..:04/15/2016 * Discription....:Oblong Connector * * Rev 1: Develop Model * Rev 2: Modifed for adjustments * * 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---------------------*/ // None /*-----------------------Execute----------------------*/ oblong(5,20,3,2,2,true); /*-----------------------Modules----------------------*/ module oblong(dia,len,tall,hole_1,hole_2,center){ difference() { union() { //create base oblong structure cube([dia,len,tall], center); translate ([0,len/2,0]) {cylinder(tall,dia/2,dia/2,$fn=60, center); } translate ([0,-len/2,0]) {cylinder(tall,dia/2,dia/2,$fn=60, center); } } //end union //if hole is greater than zero, remove hole otherwise do nothing if (hole_1>0) { translate ([0,len/2,-1]) {cylinder(tall+3,hole_1/2,hole_1/2,$fn=60, center); }} if (hole_2>0) { translate ([0,-len/2,-1]) {cylinder(tall+3,hole_2/2,hole_2/2,$fn=60, center); }} } //end differance }//end module /*----------------------End Code----------------------*/ |
More Ideas!
Open SCAD – Scale Guides!
Open SCAD – Introduction Part 1 for New Users!
Open SCAD – Universal Base Designer!