Please visit http://OpenSCAD.DIY3DTech.com for more information on this and many other projects! As in this episode we will be looking at a viewer request for a license plate over in Open-SCAD and the design aspects which we used to create it!
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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
/* Open SCAD Name.: license_plate_cover_v3.scad * Copyright (c)..: 2019 www.DIY3DTech.com * * Creation Date..: 05/11/2019 * Description....: license plate cover * * Rev 1: Develop Model * Rev 2: Made Modes (General) * Rev 3: Split Text Resize * * 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---------------------*/ //all mreasurement are in mm // tag_width = 307; //width of license plate tag_heigth = 155; //height of license plate tag_radius = 10; //corner radius of plate tag_thick = 10; //thickness in z axis width_offset = 40; //margin split 50/50 heigth_offset = 40; //margin split 50/50 bolt_x_offset = 175; //center to center x offset bolt_y_offset = 120; //center to center y offset bolt_dia = 10; //dia of mounting bolt bolt_dia_offset = 10; //margine around bolt lip_xy = 10; //lip offset to recess plate lip_z = 3; //amount of recess tag_text_top = "This is Text Top"; tag_text_bot = "This is Text Bottom"; tag_font = "Impact:style=Bold"; text_resize_top = 100; //set text size top text_resize_bot = 110; //set text size bottom //fudge can be either pos or neg text_top_x = 0; //fudge factor for top text x text_top_y = 0; //fudge factor for top text y text_bot_x = 0; //fudge factor for bot text x text_bot_y = 0; //fudge factor for bot text y // /*-----------------------Execute----------------------*/ main_module(); /*-----------------------Modules----------------------*/ module main_module(){ //create module difference() { union() {//start union //create blank plate translate ([0,0,0]) rotate ([0,0,0]) create_plate(heigth_offset,width_offset); //create bolt openings translate ([((bolt_x_offset)/2),((bolt_y_offset)/2),0]) rotate ([0,0,0]) cylinder(tag_thick ,(bolt_dia+bolt_dia_offset)/2,(bolt_dia+bolt_dia_offset)/2,$fn=60,true); translate ([-((bolt_x_offset)/2),-((bolt_y_offset)/2),0]) rotate ([0,0,0]) cylinder(tag_thick ,(bolt_dia+bolt_dia_offset)/2,(bolt_dia+bolt_dia_offset)/2,$fn=60,true); translate ([((bolt_x_offset)/2),-((bolt_y_offset)/2),0]) rotate ([0,0,0]) cylinder(tag_thick ,(bolt_dia+bolt_dia_offset)/2,(bolt_dia+bolt_dia_offset)/2,$fn=60,true); translate ([-((bolt_x_offset)/2),((bolt_y_offset)/2),0]) rotate ([0,0,0]) cylinder(tag_thick ,(bolt_dia+bolt_dia_offset)/2,(bolt_dia+bolt_dia_offset)/2,$fn=60,true); } //end union //start subtraction of difference //create lip translate ([0,0,-lip_z]) rotate ([0,0,0])license_plate(tag_heigth-lip_xy,tag_width-lip_xy,tag_thick,tag_radius); //create bolt openings translate ([((bolt_x_offset)/2),((bolt_y_offset)/2),0]) rotate ([0,0,0]) cylinder(tag_thick+1,bolt_dia/2,bolt_dia /2,$fn=60,true); translate ([-((bolt_x_offset)/2),-((bolt_y_offset)/2),0]) rotate ([0,0,0]) cylinder(tag_thick+1,bolt_dia/2,bolt_dia /2,$fn=60,true); translate ([((bolt_x_offset)/2),-((bolt_y_offset)/2),0]) rotate ([0,0,0]) cylinder(tag_thick+1,bolt_dia/2,bolt_dia /2,$fn=60,true); translate ([-((bolt_x_offset)/2),((bolt_y_offset)/2),0]) rotate ([0,0,0]) cylinder(tag_thick+1,bolt_dia/2,bolt_dia /2,$fn=60,true); //create text //top text box translate([(((tag_width/4)-(text_resize_top))/6)+text_top_x, ((tag_heigth/2)-20/2)+text_top_x,(tag_thick/2)-(lip_z-1)]) linear_extrude(height = tag_thick) resize([text_resize_top, 0], auto = true){ text(tag_text_top, font = tag_font, size = 20,valign = "center", halign = "center");} //bottom text box translate([(((tag_width/4)-(text_resize_bot))/6)+text_bot_x, ((-tag_heigth/2)+20/2)+text_bot_y,(tag_thick/2)-(lip_z-1)]) linear_extrude(height = tag_thick) resize([text_resize_bot, 0], auto = true){ text(tag_text_bot, font = tag_font, size = 20,valign = "center", halign = "center");} } //end difference }//end module module create_plate(heigth_offset_a,width_offset_a) {//base plate design with opening difference() { union() {//start union //create blank plate translate ([0,0,0]) rotate ([0,0,0]) license_plate(tag_heigth,tag_width,tag_thick,tag_radius); } //end union //start subtraction of difference //create opening translate ([0,0,0]) rotate ([0,0,0]) license_plate(tag_heigth-heigth_offset_a,tag_width-width_offset_a,tag_thick+1,tag_radius); //note tag_thick+1 is used to make //the view cleaner only } //end difference }//end module module license_plate(tag_heigth_a,tag_width_a,tag_thick_a,tag_radius_a){ //create license plate blank union() {//start union //create four corners translate ([((tag_width_a-tag_radius_a)/2),((tag_heigth_a-tag_radius_a)/2),0]) rotate ([0,0,0]) cylinder(tag_thick_a,tag_radius_a/2,tag_radius_a/2,$fn=60,true); translate ([-((tag_width_a-tag_radius_a)/2),-((tag_heigth_a-tag_radius_a)/2),0]) rotate ([0,0,0]) cylinder(tag_thick_a,tag_radius_a/2,tag_radius_a/2,$fn=60,true); translate ([((tag_width_a-tag_radius_a)/2),-((tag_heigth_a-tag_radius_a)/2),0]) rotate ([0,0,0]) cylinder(tag_thick_a,tag_radius_a/2,tag_radius_a/2,$fn=60,true); translate ([-((tag_width_a-tag_radius_a)/2),((tag_heigth_a-tag_radius_a)/2),0]) rotate ([0,0,0]) cylinder(tag_thick_a,tag_radius_a/2,tag_radius_a/2,$fn=60,true); //create cubes (two cubes are required to //round corners) //vertical square translate ([0,0,0]) rotate ([0,0,0]) cube([(tag_width_a-tag_radius_a),(tag_heigth_a),(tag_thick_a)],true); //horizontal square translate ([0,0,0]) rotate ([0,0,0])cube([(tag_width_a),(tag_heigth_a-tag_radius_a),(tag_thick_a)],true); } //end union }//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 Compression Cover!
OpenSCAD – Designing a Pressure Fit Endcap!
Open SCAD – Complex Flange Designer!