Skip to content

Instantly share code, notes, and snippets.

@Feyr
Created July 29, 2022 04:23
Show Gist options
  • Save Feyr/463466107b73d784c4379177db9bb292 to your computer and use it in GitHub Desktop.
Save Feyr/463466107b73d784c4379177db9bb292 to your computer and use it in GitHub Desktop.
minkowski_radius=1; // radius of the chamfered edge.
inner_width=73; // width of the phone, in mm
outer_width = 4; // width of the object
height=40 ; // height of the triangle, in mm
depth=7.60 ; // depth between the back and the connector, in mm
bottom_of_wings = 12;
height_of_wings = 18; // approx
depth_of_wings = 9;
height_of_back_divot = 34;
divot_depth=1;
// calculate the full demensions of the object including the chamfering, which adds to the object's dimension and must substracted it from the real dimensions
inner_x = inner_width;
outside_x = outer_width + inner_width;
two_minko = minkowski_radius * 2;
y = height - two_minko;
z = depth - two_minko;
width_of_wings = outer_width/2;
real_height_of_wings = 18 - two_minko;
real_depth_of_wings = depth_of_wings - two_minko;
//color([.5,.5,.5]) polygon([[0,0],[outside_x,0],[outside_x,-10],[0,-10]]);
//color([.5,.5,.5]) polygon([[0,0],[outer_width/2,0],[outer_width/2,-10],[0,-10]]);
difference()
{
// the object
union(){
translate([ 0, -minkowski_radius,minkowski_radius]) // this is purely for grid alignment
{
minkowski() // do the chamfering of the main object
{
{
rotate([0,-90,180])
{
linear_extrude(outside_x,center=false,convexity=10)
{
polygon([[0,0],[0,z],[y,0]],convexity=10);
}
}
rotate([0,-90,180])
{
cylinder(r=minkowski_radius,h=0.0000000001, $fn=200,convexity=10);
}
}
}
}
// debugging primitive. it has the REAL size
//color([0.5,0.50,0.50]) linear_extrude(width_of_wings,center=false) polygon([[0,0],[height_of_wings,0],[height_of_wings,depth_of_wings],[0,depth_of_wings]]);
// wing1
translate([width_of_wings,-depth_of_wings,bottom_of_wings]) rotate([0,-90,0]) translate([ minkowski_radius, minkowski_radius,0]) minkowski()
{
linear_extrude(width_of_wings,center=false,convexity=10) polygon([[0,0],[0, real_depth_of_wings ],[real_height_of_wings , real_depth_of_wings ],[real_height_of_wings ,0]]);
cylinder(r=minkowski_radius,h=0.0000000001, $fn=200);
}
//wing2
translate([width_of_wings*2+inner_x,-depth_of_wings,bottom_of_wings]) rotate([0,-90,0]) translate([ minkowski_radius, minkowski_radius,0]) minkowski()
{
linear_extrude(width_of_wings,center=false,convexity=10) polygon([[0,0],[0, real_depth_of_wings ],[real_height_of_wings , real_depth_of_wings ],[real_height_of_wings ,0]]);
cylinder(r=minkowski_radius,h=0.0000000001, $fn=200);
}
}
// 2nd argument to difference, remove the back divot
divot_offset=2;
translate([-divot_offset/2,divot_offset,height_of_back_divot])
rotate([90,0,0])
linear_extrude(height=divot_depth+divot_offset,convexity=10)
polygon([[0,0],[0,height-height_of_back_divot+divot_offset],[outside_x+divot_offset, height - height_of_back_divot +divot_offset],[outside_x+divot_offset,0]]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment