Skip the HW Store 3d Print it Instead

Folks, I am working on two related videos about the above title. I thought I would give everyone in this forum a heads up about what’s next while I wait for my sample prints to complete.

The first highlights a number of OpenSCAD models that you can use to produce practical prints of brackets, hinges, chains, nuts, and bolts. The goal of the video is to introduce a number of practical uses for 3d printers.

In the video, I demonstrate a new OpenSCAD shelf bracket scripts I wrote for the video. Then in a follow-up video, I will walk folks through the code in the shelf bracket script and introduce the use of trigonometry in OpenSCAD. Here is an early version of the code I will explain in the video.


/*
* Copyright (c)..: 2020 Cogitations, LLC
*
* Author: Irv Shapiro for the DrVAX youtube channel
* Creation Date..: 03/2021
* Description....: Customizable Shelf Bracket
*
* 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.
*/


/* Excellent resource for OpenSCAD syntax */
/* https://www.openscad.org/cheatsheet/ */

/* [Shelf Bracket Dimensions] */
base = 150.0;
side = 75.0;
width = 25.0;
thickness = 5.0;
screw_hole = 4.5;

/* [Hidden] */

$fn = 25; // number of sides in a circle
depth = thickness;
hole_1 = 40;
hole_2 = base - 40;
hole_3 = 20;
hole_4 = side - 20;
angle_attachment = side /2;

/* Horizontal Leg, with 2 screw holes */
difference(){

difference() {
/* horizontal leg */
cube([base,width,depth], center = false);
/* screw hole 1 */
translate([hole_1,width/2,-2])
cylinder( h=depth+3, d=screw_hole);
}

/* screw hole 2 */
translate([hole_2,width/2,-2])
cylinder( h=depth+3, d=screw_hole);

}

/* Vertical Leg, with 2 screw holes */

difference(){
difference() {
/* vertical leg */
cube([depth,width,side], center = false);
/* screw hole 1 */
translate([-2,width/2,hole_3])
rotate([0,90,0])
cylinder( h=depth+3, d=screw_hole);
}

/* screw hole 2 */
translate([-2,width/2,hole_4])
rotate([0,90,0])
cylinder( h=depth+3, d=screw_hole);

}

/************************************************** *******************
Add the cross beam at an angle
Calculate the length of the cross beam using a^2 + b^2 = c^2
Sin (x) = Opposite / Adjacent
angle of cross beam = inverse sin(Opposite / Adjacent)
************************************************** *******************/

a = side/2;
b = base/2;
c = sqrt((a^2)+(b^2));
angle = asin(a/c);


translate([0,0,angle_attachment])
rotate([0,angle,0])
cube([c,width,depth], center = false);

/* end of script */

Enjoy.

Hey, the man is getting into openSCAD!! I really like oSCAD, except for how poor it is at filleting. I have found I can’t stand not having filleting, so I had to give up on oSCAD. But, I just had a thought: I wonder if it would be possible to produce most of a model in oSCAD, then export it in a shareable format (STEP??) & do filleting in another program?

What is the name of this code that SCAD uses?

openSCAD has it’s own programming/scripting language. There are no 3D manipulation tools: i.e. you can’t select a line or face or body & dimension it or extrude it or anything else. Everything is done using the language.

Do you get any feed back? I’m having trouble imagining. It’s been 20 years since I watched my son doing 3d animation with a Windows five computer. I can barely handle Tinkercad.

I haven’t tried using it yet but saw last night while in FreeCad an Openscad workbench. This is one of the nightly builds of 0.19

Oh yes, there is a preview window that shows the effect of your code. You can zoom in/out, rotate, etc. You just can’t manipulate the image like you can in other CAD programs.

I’ll have to play with it when my brain gets back from holiday,