OpenSCAD SD Card Holder

Coding in openscad was a little difficult to get the hang of at first so I decided I’d start by watching Dr. Taalman’s Youtube guide on how to code a polybowl and then work from there.

Code:

// polybowl experiment

radius = 20;
sides = 7;
bodyheight = 75;
baseheight = 1;
bodytwist = 300;
bodyflare = 2.7;
thickness = 2;

/////////////////////////
// renders

// base
linear_extrude( height=baseheight )
polyshape( solid=”yes” );

// body
translate([0,0,baseheight])
linear_extrude( height=bodyheight, twist=bodytwist, scale = bodyflare, slices = 3*bodyheight )
polyshape( solid=”no” );

///////////////////////
// Modules

module polyshape(solid){
difference(){
// outside shape
offset( r=5, $fn=sides );
// take away inside shape
if (solid==”no”){
offset(r=5-thickness, $fn=48 )
circle(radius, $fn=sides );
}
}
}

I started by using the basic layout of a polybowl, then making the base shape a 7 sided figure and adding 300 degrees of twist to make it look almost like a corkscrew. I also coded the bodyflare to be much smaller at the bottom and fan out at the top. I then made it solid on the inside and printed this object to make sure it worked.

Once I knew that my design was sound and looked the way I wanted, I decided to add another level of functionality to this cool shape by adding slots to make it an SD card holder. I eventually ended up with 3 separate rectangular prisms that I sunk into the shape and made transparent.

Code:

// sd card holder
radius = 34;
sides = 7;
bodyheight = 75;
baseheight = 1;
bodytwist = 300;
bodyflare = 1.7;
thickness = 1;

/////////////////////////
// renders

// base
linear_extrude( height=baseheight )
polyshape( solid=”yes” );

// body
translate([0,0,baseheight])
linear_extrude( height=bodyheight, twist=bodytwist, scale = bodyflare, slices = 3*bodyheight )
polyshape( solid=”no” );

///////////////////////
// Modules

module polyshape(solid){
difference() {
difference(){
// outside shape
offset( r=5, $fn=sides );
// take away inside shape
if (solid==”no”){
offset(r=5-thickness, $fn=48 )
circle(radius, $fn=sides );
}
}
}

// cube
rotate([90,90,90])
translate([-100,0,-25])
%cube([110,80,8],true);

rotate([90,90,90])
translate([-100,0,0])
%cube([110,80,8],true);

rotate([90,90,90])
translate([-100,0,25])
%cube([110,80,8],true);}

I used the difference function to subtract these shapes from the polybowl shape and decreased my bodyflare so that they could go further down, then printed it to see if it worked.

Luckily even though coding this was a bit frustrating, it turned out great! It is able to hold 3 SD cards comfortably and it’s sturdy and looks nice on my desk.

Link to thingiverse: https://www.thingiverse.com/thing:2705211