Import various existing scad files
This commit is contained in:
parent
9ac1747e51
commit
80c4d267a7
|
@ -0,0 +1,67 @@
|
||||||
|
// filter settings
|
||||||
|
// this is for the "go around the outside of the filer" style
|
||||||
|
wall_thickness = 3; // mm
|
||||||
|
wall_height = 4; // mm
|
||||||
|
outer_ring_diameter = 181;
|
||||||
|
outer_ring_thickness = 7;
|
||||||
|
|
||||||
|
// fan settings
|
||||||
|
fan_diameter = 140; // mm
|
||||||
|
fan_wall_height = 10;
|
||||||
|
fan_base_height = 5;
|
||||||
|
fan_base_width = 3;
|
||||||
|
fan_screwhole_diameter = 5;
|
||||||
|
fan_corner_offset = 5;
|
||||||
|
|
||||||
|
// taper settings
|
||||||
|
taper_height = 25;
|
||||||
|
|
||||||
|
// ring
|
||||||
|
linear_extrude(wall_height) {
|
||||||
|
difference() {
|
||||||
|
circle(outer_ring_diameter / 2, $fa = 1);
|
||||||
|
circle(outer_ring_diameter/2 - outer_ring_thickness, $fa = 1);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// fan base
|
||||||
|
screw_offset = (fan_diameter / 2) - fan_corner_offset;
|
||||||
|
translate([0, 0, -fan_wall_height - taper_height]) {
|
||||||
|
linear_extrude(fan_base_height) {
|
||||||
|
difference() {
|
||||||
|
square(fan_diameter, center = true);
|
||||||
|
circle(fan_diameter/2 - fan_base_width, $fa = 1);
|
||||||
|
// Screw holes
|
||||||
|
translate([screw_offset, screw_offset, 0]) {
|
||||||
|
circle(fan_screwhole_diameter / 2, $fa = 1);
|
||||||
|
};
|
||||||
|
translate([-screw_offset, screw_offset, 0]) {
|
||||||
|
circle(fan_screwhole_diameter / 2, $fa = 1);
|
||||||
|
};
|
||||||
|
translate([screw_offset, -screw_offset, 0]) {
|
||||||
|
circle(fan_screwhole_diameter / 2, $fa = 1);
|
||||||
|
};
|
||||||
|
translate([-screw_offset, -screw_offset, 0]) {
|
||||||
|
circle(fan_screwhole_diameter / 2, $fa = 1);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// taper from fan edge to holder
|
||||||
|
translate([0, 0, -fan_wall_height-2]) {
|
||||||
|
union() {
|
||||||
|
difference() {
|
||||||
|
cylinder(taper_height, r1 = fan_diameter / 2, r2 = outer_ring_diameter /2, center = true, $fa = 1);
|
||||||
|
cylinder(taper_height, r1 = fan_diameter / 2 - wall_thickness, r2 = outer_ring_diameter /2 - outer_ring_thickness, center = true, $fa = 1);
|
||||||
|
};
|
||||||
|
translate([0, 0, -19]) {
|
||||||
|
linear_extrude(7) {
|
||||||
|
difference() {
|
||||||
|
circle(fan_diameter/2, $fa = 1);
|
||||||
|
circle(fan_diameter/2 - fan_base_width, $fa = 1);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,573 @@
|
||||||
|
/* 'Nut Job' nut, bolt, washer and threaded rod factory by Mike Thompson 1/12/2013, Thingiverse: mike_linus
|
||||||
|
*
|
||||||
|
* Licensing: This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia License.
|
||||||
|
* Further information is available here - http://creativecommons.org/licenses/by-nc-sa/3.0/au/deed.en_GB
|
||||||
|
*
|
||||||
|
* v2 8/12/2013 - added socket head types
|
||||||
|
* v3 2/11/2014 - adjusted wing nut algorithm for better behaviour with unusual nut sizes and added ISO262 metric references
|
||||||
|
* v4 31/12/2014 - added optional texture to socket heads, added ability to change the number of facets for a hex head
|
||||||
|
* and adjusted wingnut base level on certain nut sizes
|
||||||
|
* v5 11/1/2015 - added phillips and slot drive types and improved texture handling
|
||||||
|
* v6 21/2/2015 - added wing ratio to wingnuts
|
||||||
|
* v7 6/3/2016 - added extended options to control number of facets on nuts, square sockets (or any number of facets) and socket depth control
|
||||||
|
* v8 1/1/2017 - modified library code to remove dependence on deprecated 'assign' statement
|
||||||
|
*
|
||||||
|
* This script generates nuts, bolts, washers and threaded rod using the library
|
||||||
|
* script: polyScrewThead.scad (modified/updated version polyScrewThread_r1.scad)
|
||||||
|
* http://www.thingiverse.com/thing:8796, CC Public Domain
|
||||||
|
*
|
||||||
|
* Defaults are for a 8mm diameter bolts, rod, matching nuts and wing nuts that work well together
|
||||||
|
* without cleanup or modification. Some default parameters such as the nut outer diameter are deliberately
|
||||||
|
* altered to produce a snug fit that can still be hand tightened. This may need to be altered
|
||||||
|
* depending on individual printer variances, slicing tools, filament etc. Suggest printing a matching
|
||||||
|
* bolt and nut and adjusting as necessary. Note: slow print speeds, low temperatures and solid
|
||||||
|
* fill are recommended for best results.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* [Component Type] */
|
||||||
|
|
||||||
|
type = "bolt";//[nut,bolt,rod,washer]
|
||||||
|
|
||||||
|
/* [Bolt and Rod Options] */
|
||||||
|
|
||||||
|
//Head type - Hex, Socket Cap, Button Socket Cap or Countersunk Socket Cap (ignored for Rod)
|
||||||
|
head_type = "hex";//[hex,socket,button,countersunk]
|
||||||
|
//Drive type - Socket, Phillips, Slot (ignored for Hex head type and Rod)
|
||||||
|
drive_type = "socket";//[socket,phillips,slot]
|
||||||
|
//Distance between flats for the hex head or diameter for socket or button head (ignored for Rod)
|
||||||
|
head_diameter = 12;
|
||||||
|
//Height of the head (ignored for Rod)
|
||||||
|
head_height = 5;
|
||||||
|
//Diameter of drive type (ignored for Hex head and Rod)
|
||||||
|
drive_diameter = 5;
|
||||||
|
//Width of slot aperture for phillips or slot drive types
|
||||||
|
slot_width = 1;
|
||||||
|
//Depth of slot aperture for slot drive type
|
||||||
|
slot_depth = 2;
|
||||||
|
//Surface texture (socket head only)
|
||||||
|
texture = "exclude";//[include,exclude]
|
||||||
|
//Outer diameter of the thread
|
||||||
|
thread_outer_diameter = 8;
|
||||||
|
//Thread step or Pitch (2mm works well for most applications ref. ISO262: M3=0.5,M4=0.7,M5=0.8,M6=1,M8=1.25,M10=1.5)
|
||||||
|
thread_step = 2;
|
||||||
|
//Step shape degrees (45 degrees is optimised for most printers ref. ISO262: 30 degrees)
|
||||||
|
step_shape_degrees = 45;
|
||||||
|
//Length of the threaded section
|
||||||
|
thread_length = 25;
|
||||||
|
//Countersink in both ends
|
||||||
|
countersink = 2;
|
||||||
|
//Length of the non-threaded section
|
||||||
|
non_thread_length = 0;
|
||||||
|
//Diameter for the non-threaded section (-1: Same as inner diameter of the thread, 0: Same as outer diameter of the thread, value: The given value)
|
||||||
|
non_thread_diameter = 0;
|
||||||
|
|
||||||
|
/* [Nut Options] */
|
||||||
|
|
||||||
|
//Type: Normal or WingNut
|
||||||
|
nut_type = "normal";//[normal,wingnut]
|
||||||
|
//Distance between flats for the hex nut
|
||||||
|
nut_diameter = 12;
|
||||||
|
//Height of the nut
|
||||||
|
nut_height = 6;
|
||||||
|
//Outer diameter of the bolt thread to match (usually set about 1mm larger than bolt diameter to allow easy fit - adjust to personal preferences)
|
||||||
|
nut_thread_outer_diameter = 9;
|
||||||
|
//Thread step or Pitch (2mm works well for most applications ref. ISO262: M3=0.5,M4=0.7,M5=0.8,M6=1,M8=1.25,M10=1.5)
|
||||||
|
nut_thread_step = 2;
|
||||||
|
//Step shape degrees (45 degrees is optimised for most printers ref. ISO262: 30 degrees)
|
||||||
|
nut_step_shape_degrees = 45;
|
||||||
|
//Wing radius ratio. The proportional radius of the wing on the wing nut compared to the nut height value (default = 1)
|
||||||
|
wing_ratio = 1;
|
||||||
|
wing_radius=wing_ratio * nut_height;
|
||||||
|
|
||||||
|
/* [Washer Options] */
|
||||||
|
|
||||||
|
//Inner Diameter (suggest making diameter slightly larger than bolt diameter)
|
||||||
|
inner_diameter = 8;
|
||||||
|
//Outer Diameter
|
||||||
|
outer_diameter = 14;
|
||||||
|
//Thickness
|
||||||
|
thickness = 2;
|
||||||
|
|
||||||
|
/* [Extended Options] */
|
||||||
|
|
||||||
|
//Number of facets for hex head type or nut. Default is 6 for standard hex head and nut
|
||||||
|
facets = 6;
|
||||||
|
//Number of facets for hole in socket head. Default is 6 for standard hex socket
|
||||||
|
socket_facets = 6;
|
||||||
|
//Depth of hole in socket head. Default is 3.5
|
||||||
|
socket_depth = 3.5;
|
||||||
|
//Resolution (lower values for higher resolution, but may slow rendering)
|
||||||
|
resolution = 0.5;
|
||||||
|
nut_resolution = resolution;
|
||||||
|
|
||||||
|
//Hex Bolt
|
||||||
|
if (type=="bolt" && head_type=="hex")
|
||||||
|
{
|
||||||
|
hex_screw(thread_outer_diameter,thread_step,step_shape_degrees,thread_length,resolution,countersink,head_diameter,head_height,non_thread_length,non_thread_diameter);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Rod
|
||||||
|
if (type=="rod")
|
||||||
|
{
|
||||||
|
hex_screw(thread_outer_diameter,thread_step,step_shape_degrees,thread_length,resolution,countersink,head_diameter,0,non_thread_length,non_thread_diameter);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Hex Nut (normally slightly larger outer diameter to fit on bolt correctly)
|
||||||
|
if (type=="nut" && nut_type=="normal")
|
||||||
|
{
|
||||||
|
hex_nut(nut_diameter,nut_height,nut_thread_step,nut_step_shape_degrees,nut_thread_outer_diameter,nut_resolution);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Wing Nut variation of hex nut. Cylinders added to each side of nut for easy turning - ideal for quick release applications
|
||||||
|
if (type=="nut" && nut_type=="wingnut")
|
||||||
|
{
|
||||||
|
rotate([0,0,30])hex_nut(nut_diameter,nut_height,nut_thread_step,nut_step_shape_degrees,nut_thread_outer_diameter,nut_resolution); //nut
|
||||||
|
translate([(nut_diameter/2)+wing_radius-1,1.5,wing_radius/2+1])rotate([90,0,0])wing(); //attach wing
|
||||||
|
mirror(1,0,0)translate([(nut_diameter/2)+wing_radius-1,1.5,wing_radius/2+1])rotate([90,0,0])wing(); //attach wing
|
||||||
|
}
|
||||||
|
|
||||||
|
module wing()
|
||||||
|
{
|
||||||
|
difference()
|
||||||
|
{
|
||||||
|
cylinder(r=wing_radius,h=3,$fn=64); //cylinder
|
||||||
|
union()
|
||||||
|
{
|
||||||
|
translate([-wing_radius,-wing_radius-1,-0.5])cube([wing_radius*2,wing_radius/2,wing_radius*2]); //remove overhang so flush with base of nut
|
||||||
|
rotate([0,0,90])translate([-wing_radius,wing_radius-1,-0.5])cube([wing_radius*2,wing_radius/2,wing_radius*2]); //remove overhangs so flush with side of nut
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Washer
|
||||||
|
if (type=="washer")
|
||||||
|
{
|
||||||
|
difference()
|
||||||
|
{
|
||||||
|
cylinder(r=outer_diameter/2,h=thickness,$fn=100);
|
||||||
|
translate([0,0,-0.1])cylinder(r=inner_diameter/2,h=thickness+0.2,$fn=100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Socket Head Bolt
|
||||||
|
if (type=="bolt" && head_type!="hex")
|
||||||
|
{
|
||||||
|
socket_screw(thread_outer_diameter,thread_step,step_shape_degrees,thread_length,resolution,countersink,head_diameter,head_height,non_thread_length,non_thread_diameter);
|
||||||
|
}
|
||||||
|
|
||||||
|
module phillips_base()
|
||||||
|
{
|
||||||
|
linear_extrude(slot_width)polygon(points=[[0,0],[(drive_diameter-slot_width)/2,9/5*(drive_diameter-slot_width)/2],[(drive_diameter+slot_width)/2,9/5*(drive_diameter-slot_width)/2],[drive_diameter,0]]);
|
||||||
|
translate([(drive_diameter-slot_width)/2,0,(drive_diameter+slot_width)/2])rotate([0,90,0])linear_extrude(slot_width)polygon(points=[[0,0],[(drive_diameter-slot_width)/2,9/5*(drive_diameter-slot_width)/2],[(drive_diameter+slot_width)/2,9/5*(drive_diameter-slot_width)/2],[drive_diameter,0]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
module phillips_fillet()
|
||||||
|
{
|
||||||
|
union()
|
||||||
|
{
|
||||||
|
translate([-(drive_diameter-slot_width)/2-(slot_width/2),slot_width/2,0])rotate([90,0,0])phillips_base();
|
||||||
|
translate([0,0,9/5*(drive_diameter-slot_width)/2])union()
|
||||||
|
{
|
||||||
|
inner_curve();
|
||||||
|
rotate([0,0,90])inner_curve();
|
||||||
|
rotate([0,0,180])inner_curve();
|
||||||
|
rotate([0,0,270])inner_curve();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module inner_curve()
|
||||||
|
{
|
||||||
|
translate([slot_width/2,-slot_width/2,0])rotate([0,90,0])linear_fillet(9/5*(drive_diameter-slot_width)/2,drive_diameter/10);
|
||||||
|
}
|
||||||
|
|
||||||
|
//basic 2d profile used for fillet shape
|
||||||
|
module profile(radius)
|
||||||
|
{
|
||||||
|
difference()
|
||||||
|
{
|
||||||
|
square(radius);
|
||||||
|
circle(r=radius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//linear fillet for use along straight edges
|
||||||
|
module linear_fillet(length,profile_radius)
|
||||||
|
{
|
||||||
|
translate([0,-profile_radius,profile_radius])rotate([0,90,0])linear_extrude(height=length,convexity=10)profile(profile_radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
module phillips_drive()
|
||||||
|
{
|
||||||
|
intersection()
|
||||||
|
{
|
||||||
|
phillips_fillet();
|
||||||
|
cylinder(9/5*(drive_diameter-slot_width)/2,drive_diameter/2+(slot_width/2),slot_width/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module socket_screw(od,st,lf0,lt,rs,cs,df,hg,ntl,ntd)
|
||||||
|
{
|
||||||
|
ntr=od/2-(st/2)*cos(lf0)/sin(lf0);
|
||||||
|
$fn=60;
|
||||||
|
|
||||||
|
difference()
|
||||||
|
{
|
||||||
|
union()
|
||||||
|
{
|
||||||
|
if (head_type=="socket")
|
||||||
|
{
|
||||||
|
socket_head(hg,df);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (head_type=="button")
|
||||||
|
{
|
||||||
|
button_head(hg,df);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (head_type=="countersunk")
|
||||||
|
{
|
||||||
|
countersunk_head(hg,df);
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([0,0,hg])
|
||||||
|
if ( ntl == 0 )
|
||||||
|
{
|
||||||
|
cylinder(h=0.01, r=ntr, center=true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( ntd == -1 )
|
||||||
|
{
|
||||||
|
cylinder(h=ntl+0.01, r=ntr, $fn=floor(od*PI/rs), center=false);
|
||||||
|
}
|
||||||
|
else if ( ntd == 0 )
|
||||||
|
{
|
||||||
|
union()
|
||||||
|
{
|
||||||
|
cylinder(h=ntl-st/2,r=od/2, $fn=floor(od*PI/rs), center=false);
|
||||||
|
translate([0,0,ntl-st/2])
|
||||||
|
cylinder(h=st/2,
|
||||||
|
r1=od/2, r2=ntr,
|
||||||
|
$fn=floor(od*PI/rs), center=false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cylinder(h=ntl, r=ntd/2, $fn=ntd*PI/rs, center=false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
translate([0,0,ntl+hg]) screw_thread(od,st,lf0,lt,rs,cs);
|
||||||
|
}
|
||||||
|
//create opening for specific drive type
|
||||||
|
if (drive_type=="socket")
|
||||||
|
{
|
||||||
|
cylinder(r=drive_diameter/2,h=socket_depth,$fn=socket_facets); //socket
|
||||||
|
#translate([0,0,socket_depth])cylinder(r1=drive_diameter/2,r2=0,h=drive_diameter/3,$fn=socket_facets); //socket tapers at base to allow printing without bridging and improve socket grip
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (drive_type=="phillips")
|
||||||
|
{
|
||||||
|
translate([0,0,-0.001])phillips_drive();
|
||||||
|
}
|
||||||
|
else //slot
|
||||||
|
{
|
||||||
|
translate([-(drive_diameter)/2,slot_width/2,-0.001])rotate([90,0,0])cube([drive_diameter,slot_depth,slot_width]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module socket_head(hg,df)
|
||||||
|
{
|
||||||
|
texture_points=2*PI*(head_diameter/2);
|
||||||
|
texture_offset=head_diameter/18;
|
||||||
|
texture_radius=head_diameter/24;
|
||||||
|
|
||||||
|
rd0=df/2/sin(60);
|
||||||
|
x0=0; x1=df/2; x2=x1+hg/2;
|
||||||
|
y0=0; y1=hg/2; y2=hg;
|
||||||
|
|
||||||
|
intersection()
|
||||||
|
{
|
||||||
|
cylinder(h=hg, r=rd0, $fn=60, center=false);
|
||||||
|
rotate_extrude(convexity=10, $fn=6*round(df*PI/6/0.5))
|
||||||
|
polygon([ [x0,y0],[x1,y0],[x2,y1],[x1,y2],[x0,y2] ]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (texture=="include") //add texture to socket head. Adjust texture density and size using texture variables above
|
||||||
|
{
|
||||||
|
for (i= [1:texture_points])
|
||||||
|
{
|
||||||
|
translate([cos(360/texture_points*i)*(head_diameter/2+texture_offset), sin(360/texture_points*i)*(head_diameter/2+texture_offset), 1 ])
|
||||||
|
rotate([0,0,360/texture_points*i])cylinder(r=texture_radius,h=head_height*0.6,$fn=3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module button_head(hg,df)
|
||||||
|
{
|
||||||
|
rd0=df/2/sin(60);
|
||||||
|
x0=0; x1=df/2; x2=x1+hg/2;
|
||||||
|
y0=0; y1=hg/2; y2=hg;
|
||||||
|
|
||||||
|
intersection()
|
||||||
|
{
|
||||||
|
cylinder(h=hg, r1=drive_diameter/2 + 1, r2=rd0, $fn=60, center=false);
|
||||||
|
rotate_extrude(convexity=10, $fn=6*round(df*PI/6/0.5))
|
||||||
|
polygon([ [x0,y0],[x1,y0],[x2,y1],[x1,y2],[x0,y2] ]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module countersunk_head(hg,df)
|
||||||
|
{
|
||||||
|
rd0=df/2/sin(60);
|
||||||
|
x0=0; x1=df/2; x2=x1+hg/2;
|
||||||
|
y0=0; y1=hg/2; y2=hg;
|
||||||
|
|
||||||
|
intersection()
|
||||||
|
{
|
||||||
|
cylinder(h=hg, r1=rd0, r2=thread_outer_diameter/2-0.5, $fn=60, center=false);
|
||||||
|
|
||||||
|
rotate_extrude(convexity=10, $fn=6*round(df*PI/6/0.5))
|
||||||
|
polygon([ [x0,y0],[x1,y0],[x2,y1],[x1,y2],[x0,y2] ]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Library included below to allow customizer functionality
|
||||||
|
*
|
||||||
|
* polyScrewThread_r1.scad by aubenc @ Thingiverse
|
||||||
|
*
|
||||||
|
* Modified by mike_mattala @ Thingiverse 1/1/2017 to remove deprecated assign
|
||||||
|
*
|
||||||
|
* This script contains the library modules that can be used to generate
|
||||||
|
* threaded rods, screws and nuts.
|
||||||
|
*
|
||||||
|
* http://www.thingiverse.com/thing:8796
|
||||||
|
*
|
||||||
|
* CC Public Domain
|
||||||
|
*/
|
||||||
|
|
||||||
|
module screw_thread(od,st,lf0,lt,rs,cs)
|
||||||
|
{
|
||||||
|
or=od/2;
|
||||||
|
ir=or-st/2*cos(lf0)/sin(lf0);
|
||||||
|
pf=2*PI*or;
|
||||||
|
sn=floor(pf/rs);
|
||||||
|
lfxy=360/sn;
|
||||||
|
ttn=round(lt/st+1);
|
||||||
|
zt=st/sn;
|
||||||
|
|
||||||
|
intersection()
|
||||||
|
{
|
||||||
|
if (cs >= -1)
|
||||||
|
{
|
||||||
|
thread_shape(cs,lt,or,ir,sn,st);
|
||||||
|
}
|
||||||
|
|
||||||
|
full_thread(ttn,st,sn,zt,lfxy,or,ir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module hex_nut(df,hg,sth,clf,cod,crs)
|
||||||
|
{
|
||||||
|
|
||||||
|
difference()
|
||||||
|
{
|
||||||
|
hex_head(hg,df);
|
||||||
|
|
||||||
|
hex_countersink_ends(sth/2,cod,clf,crs,hg);
|
||||||
|
|
||||||
|
screw_thread(cod,sth,clf,hg,crs,-2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module hex_screw(od,st,lf0,lt,rs,cs,df,hg,ntl,ntd)
|
||||||
|
{
|
||||||
|
ntr=od/2-(st/2)*cos(lf0)/sin(lf0);
|
||||||
|
|
||||||
|
union()
|
||||||
|
{
|
||||||
|
hex_head(hg,df);
|
||||||
|
|
||||||
|
translate([0,0,hg])
|
||||||
|
if ( ntl == 0 )
|
||||||
|
{
|
||||||
|
cylinder(h=0.01, r=ntr, center=true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( ntd == -1 )
|
||||||
|
{
|
||||||
|
cylinder(h=ntl+0.01, r=ntr, $fn=floor(od*PI/rs), center=false);
|
||||||
|
}
|
||||||
|
else if ( ntd == 0 )
|
||||||
|
{
|
||||||
|
union()
|
||||||
|
{
|
||||||
|
cylinder(h=ntl-st/2,
|
||||||
|
r=od/2, $fn=floor(od*PI/rs), center=false);
|
||||||
|
|
||||||
|
translate([0,0,ntl-st/2])
|
||||||
|
cylinder(h=st/2,
|
||||||
|
r1=od/2, r2=ntr,
|
||||||
|
$fn=floor(od*PI/rs), center=false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cylinder(h=ntl, r=ntd/2, $fn=ntd*PI/rs, center=false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([0,0,ntl+hg]) screw_thread(od,st,lf0,lt,rs,cs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module hex_screw_0(od,st,lf0,lt,rs,cs,df,hg,ntl,ntd)
|
||||||
|
{
|
||||||
|
ntr=od/2-(st/2)*cos(lf0)/sin(lf0);
|
||||||
|
|
||||||
|
union()
|
||||||
|
{
|
||||||
|
hex_head_0(hg,df);
|
||||||
|
|
||||||
|
translate([0,0,hg])
|
||||||
|
if ( ntl == 0 )
|
||||||
|
{
|
||||||
|
cylinder(h=0.01, r=ntr, center=true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( ntd == -1 )
|
||||||
|
{
|
||||||
|
cylinder(h=ntl+0.01, r=ntr, $fn=floor(od*PI/rs), center=false);
|
||||||
|
}
|
||||||
|
else if ( ntd == 0 )
|
||||||
|
{
|
||||||
|
union()
|
||||||
|
{
|
||||||
|
cylinder(h=ntl-st/2,
|
||||||
|
r=od/2, $fn=floor(od*PI/rs), center=false);
|
||||||
|
|
||||||
|
translate([0,0,ntl-st/2])
|
||||||
|
cylinder(h=st/2,
|
||||||
|
r1=od/2, r2=ntr,
|
||||||
|
$fn=floor(od*PI/rs), center=false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cylinder(h=ntl, r=ntd/2, $fn=ntd*PI/rs, center=false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([0,0,ntl+hg]) screw_thread(od,st,lf0,lt,rs,cs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module thread_shape(cs,lt,or,ir,sn,st)
|
||||||
|
{
|
||||||
|
if ( cs == 0 )
|
||||||
|
{
|
||||||
|
cylinder(h=lt, r=or, $fn=sn, center=false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
union()
|
||||||
|
{
|
||||||
|
translate([0,0,st/2])
|
||||||
|
cylinder(h=lt-st+0.005, r=or, $fn=sn, center=false);
|
||||||
|
|
||||||
|
if ( cs == -1 || cs == 2 )
|
||||||
|
{
|
||||||
|
cylinder(h=st/2, r1=ir, r2=or, $fn=sn, center=false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cylinder(h=st/2, r=or, $fn=sn, center=false);
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([0,0,lt-st/2])
|
||||||
|
if ( cs == 1 || cs == 2 )
|
||||||
|
{
|
||||||
|
cylinder(h=st/2, r1=or, r2=ir, $fn=sn, center=false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cylinder(h=st/2, r=or, $fn=sn, center=false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module full_thread(ttn,st,sn,zt,lfxy,or,ir)
|
||||||
|
{
|
||||||
|
if(ir >= 0.2)
|
||||||
|
{
|
||||||
|
for(i=[0:ttn-1])
|
||||||
|
{
|
||||||
|
for(j=[0:sn-1])
|
||||||
|
{
|
||||||
|
pt = [[0,0,i*st-st],
|
||||||
|
[ir*cos(j*lfxy), ir*sin(j*lfxy), i*st+j*zt-st ],
|
||||||
|
[ir*cos((j+1)*lfxy), ir*sin((j+1)*lfxy), i*st+(j+1)*zt-st ],
|
||||||
|
[0,0,i*st],
|
||||||
|
[or*cos(j*lfxy), or*sin(j*lfxy), i*st+j*zt-st/2 ],
|
||||||
|
[or*cos((j+1)*lfxy), or*sin((j+1)*lfxy), i*st+(j+1)*zt-st/2 ],
|
||||||
|
[ir*cos(j*lfxy), ir*sin(j*lfxy), i*st+j*zt ],
|
||||||
|
[ir*cos((j+1)*lfxy), ir*sin((j+1)*lfxy), i*st+(j+1)*zt ],
|
||||||
|
[0,0,i*st+st]];
|
||||||
|
|
||||||
|
polyhedron(points=pt,faces=[[1,0,3],[1,3,6],[6,3,8],[1,6,4], //changed triangles to faces (to be deprecated)
|
||||||
|
[0,1,2],[1,4,2],[2,4,5],[5,4,6],[5,6,7],[7,6,8],
|
||||||
|
[7,8,3],[0,2,3],[3,2,7],[7,2,5] ]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo("Step Degrees too agresive, the thread will not be made!!");
|
||||||
|
echo("Try to increase de value for the degrees and/or...");
|
||||||
|
echo(" decrease the pitch value and/or...");
|
||||||
|
echo(" increase the outer diameter value.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module hex_head(hg,df)
|
||||||
|
{
|
||||||
|
rd0=df/2/sin(60);
|
||||||
|
x0=0; x1=df/2; x2=x1+hg/2;
|
||||||
|
y0=0; y1=hg/2; y2=hg;
|
||||||
|
|
||||||
|
intersection()
|
||||||
|
{
|
||||||
|
cylinder(h=hg, r=rd0, $fn=facets, center=false);
|
||||||
|
|
||||||
|
rotate_extrude(convexity=10, $fn=6*round(df*PI/6/0.5))
|
||||||
|
polygon([ [x0,y0],[x1,y0],[x2,y1],[x1,y2],[x0,y2] ]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module hex_head_0(hg,df)
|
||||||
|
{
|
||||||
|
cylinder(h=hg, r=df/2/sin(60), $fn=6, center=false);
|
||||||
|
}
|
||||||
|
|
||||||
|
module hex_countersink_ends(chg,cod,clf,crs,hg)
|
||||||
|
{
|
||||||
|
translate([0,0,-0.1])
|
||||||
|
cylinder(h=chg+0.01,
|
||||||
|
r1=cod/2,
|
||||||
|
r2=cod/2-(chg+0.1)*cos(clf)/sin(clf),
|
||||||
|
$fn=floor(cod*PI/crs), center=false);
|
||||||
|
|
||||||
|
translate([0,0,hg-chg+0.1])
|
||||||
|
cylinder(h=chg+0.01,
|
||||||
|
r1=cod/2-(chg+0.1)*cos(clf)/sin(clf),
|
||||||
|
r2=cod/2,
|
||||||
|
$fn=floor(cod*PI/crs), center=false);
|
||||||
|
}
|
|
@ -0,0 +1,351 @@
|
||||||
|
/*
|
||||||
|
* Customizable Fan Cover - https://www.thingiverse.com/thing:2802474
|
||||||
|
* by Dennis Hofmann - https://www.thingiverse.com/mightynozzle/about
|
||||||
|
* created 2018-02-22
|
||||||
|
* updated 2018-03-27
|
||||||
|
* version v1.2
|
||||||
|
*
|
||||||
|
* Changelog
|
||||||
|
* --------------
|
||||||
|
* v1.2:
|
||||||
|
* - better quality of rounded corners and crosshair pattern
|
||||||
|
* v1.1:
|
||||||
|
* - added support line option for crosshair and square pattern
|
||||||
|
* v1.0:
|
||||||
|
* - final design
|
||||||
|
* --------------
|
||||||
|
*
|
||||||
|
* This work is licensed under the Creative Commons - Attribution - Non-Commercial - ShareAlike license.
|
||||||
|
* https://creativecommons.org/licenses/by-nc-sa/3.0/
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// Parameter Section //
|
||||||
|
//-------------------//
|
||||||
|
|
||||||
|
/* [Global Settings] */
|
||||||
|
|
||||||
|
// Choose between presets of known and common fan sizes.
|
||||||
|
fan_preset = "40"; //[25:25mm,30:30mm,40:40mm,50:50mm,60:60mm,70:70mm,80:80mm,92:92mm,120:120mm,140:140mm,custom:Custom Fan Settings]
|
||||||
|
|
||||||
|
// If you want save to save about 40% filament and about 20% printing time, you can choose the reduced frame option.
|
||||||
|
frame_option = "reduced"; //[full,reduced]
|
||||||
|
|
||||||
|
// Minimum Border Size. I recommend to use two/four/six... times of your line width setting of your slicer. Simplify3D uses 0.48mm line width by default if you are using a 0.4mm nozzle. Cura uses 0.4mm line width.
|
||||||
|
min_border_size_in_millimeter = 1.92;
|
||||||
|
|
||||||
|
// Choose between a grill pattern
|
||||||
|
grill_pattern = "honeycomb"; //[honeycomb,grid,line,triangle,crosshair,square,dot,aperture]
|
||||||
|
|
||||||
|
// Set the angle of the pattern around the center of the cover.
|
||||||
|
grill_pattern_rotation = 0; //[0:5:360]
|
||||||
|
|
||||||
|
// Size of the pattern lines. I recommend to use two/four/six... times of your line width setting of your slicer. Simplify3D uses 0.48mm line width by default if you are using a 0.4mm nozzle. Cura uses 0.4mm line width.
|
||||||
|
line_size_in_millimter = 0.96; //[0.3:0.02:4]
|
||||||
|
|
||||||
|
// Space between two lines of your pattern. If you choose aperture pattern, this value set the size of the center octagon.
|
||||||
|
line_space_in_millimeter = 6; //[1:0.1:50]
|
||||||
|
|
||||||
|
// If you need countersunk holes, you can activate it here. Bottom = first layer. Top = last layer.
|
||||||
|
screw_hole_chamfer = "no"; //[no,top,bottom,top_and_bottom]
|
||||||
|
|
||||||
|
// Activate or deactivate rounded corners. The radius will be automatically calculated.
|
||||||
|
rounded_corners = "yes"; //[yes,no]
|
||||||
|
|
||||||
|
// number of straight lines supporting the crosshair or square pattern.
|
||||||
|
number_of_support_lines = 2; //[1:1:36]
|
||||||
|
|
||||||
|
/* [Custom Fan Settings] */
|
||||||
|
|
||||||
|
// Cover size. E.g. 80 for a 80mm Fan
|
||||||
|
cover_size_in_millimeter = 40;
|
||||||
|
|
||||||
|
// E.g. 2.9 for M2.5, 3.3 for M3, 4.4 for M4
|
||||||
|
screw_hole_diameter_in_millimeter = 3.3;
|
||||||
|
|
||||||
|
// 25mm fan: 20 | 30mm fan: 24 | 40mm fan: 32 | 50mm fan: 40 | 60mm fan: 50 | 70mm fan: 61.5 | 80mm fan: 71.5 | 92mm fan: 82.5 | 120mm fan: 105 | 140mm fan: 126
|
||||||
|
screw_hole_distance_in_millimeter = 32;
|
||||||
|
|
||||||
|
// Height of the outer frame of the cover
|
||||||
|
cover_height_in_millimeter = 3;
|
||||||
|
|
||||||
|
// Height of the pattern inside the cover frame
|
||||||
|
grill_pattern_height_in_millimeter = 1;
|
||||||
|
|
||||||
|
/* [Hidden] */
|
||||||
|
min_border_size = min_border_size_in_millimeter;
|
||||||
|
line_size = line_size_in_millimter;
|
||||||
|
line_space = line_space_in_millimeter;
|
||||||
|
|
||||||
|
// Program Section //
|
||||||
|
//-----------------//
|
||||||
|
|
||||||
|
if(fan_preset == "25") {
|
||||||
|
fan_cover(cover_size = 25, screw_hole_dia = 2.9, screw_hole_distance = 20, cover_h = 2, grill_pattern_h = 1);
|
||||||
|
}
|
||||||
|
if(fan_preset == "30") {
|
||||||
|
fan_cover(cover_size = 30, screw_hole_dia = 3.3, screw_hole_distance = 24, cover_h = 2.5, grill_pattern_h = 1.1);
|
||||||
|
}
|
||||||
|
if(fan_preset == "40") {
|
||||||
|
fan_cover(cover_size = 40, screw_hole_dia = 3.3, screw_hole_distance = 32, cover_h = 2.7, grill_pattern_h = 1.2);
|
||||||
|
}
|
||||||
|
if(fan_preset == "50") {
|
||||||
|
fan_cover(cover_size = 50, screw_hole_dia = 4.4, screw_hole_distance = 40, cover_h = 2.9, grill_pattern_h = 1.3);
|
||||||
|
}
|
||||||
|
if(fan_preset == "60") {
|
||||||
|
fan_cover(cover_size = 60, screw_hole_dia = 4.4, screw_hole_distance = 50, cover_h = 3, grill_pattern_h = 1.3);
|
||||||
|
}
|
||||||
|
if(fan_preset == "70") {
|
||||||
|
fan_cover(cover_size = 70, screw_hole_dia = 4.4, screw_hole_distance = 61.5, cover_h = 3, grill_pattern_h = 1.4);
|
||||||
|
}
|
||||||
|
if(fan_preset == "80") {
|
||||||
|
fan_cover(cover_size = 80, screw_hole_dia = 4.4, screw_hole_distance = 71.5, cover_h = 3.2, grill_pattern_h = 1.5);
|
||||||
|
}
|
||||||
|
if(fan_preset == "92") {
|
||||||
|
fan_cover(cover_size = 92, screw_hole_dia = 4.4, screw_hole_distance = 82.5, cover_h = 3.5, grill_pattern_h = 1.6);
|
||||||
|
}
|
||||||
|
if(fan_preset == "120") {
|
||||||
|
fan_cover(cover_size = 120, screw_hole_dia = 4.4, screw_hole_distance = 105, cover_h = 4, grill_pattern_h = 1.8);
|
||||||
|
}
|
||||||
|
if(fan_preset == "140") {
|
||||||
|
fan_cover(cover_size = 140, screw_hole_dia = 4.4, screw_hole_distance = 126, cover_h = 4.5, grill_pattern_h = 2.0);
|
||||||
|
}
|
||||||
|
if(fan_preset == "custom") {
|
||||||
|
fan_cover(cover_size = cover_size_in_millimeter, screw_hole_dia = screw_hole_diameter_in_millimeter, screw_hole_distance = screw_hole_distance_in_millimeter, cover_h = cover_height_in_millimeter, grill_pattern_h = grill_pattern_height_in_millimeter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Module Section //
|
||||||
|
//----------------//
|
||||||
|
|
||||||
|
module fan_cover(cover_size, screw_hole_dia, screw_hole_distance, cover_h, grill_pattern_h) {
|
||||||
|
corner_size = cover_size - screw_hole_distance;
|
||||||
|
corner_r = rounded_corners == "yes" ? corner_size / 2 : 0;
|
||||||
|
screw_pos = (cover_size - corner_size) / 2;
|
||||||
|
color("DodgerBlue") difference() {
|
||||||
|
union() {
|
||||||
|
linear_extrude(height = cover_h, convexity = 20) {
|
||||||
|
difference() {
|
||||||
|
offset(r=corner_r, $fn = ceil(corner_r * 8)) {
|
||||||
|
offset(r=-corner_r) {
|
||||||
|
square([cover_size, cover_size], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(frame_option == "reduced") {
|
||||||
|
offset(r=corner_r, $fn = ceil(corner_r * 8)) {
|
||||||
|
offset(r=-corner_r) {
|
||||||
|
square([cover_size - min_border_size*2, cover_size - min_border_size*2], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(frame_option == "full") {
|
||||||
|
circle(d = cover_size - min_border_size * 2, $fn = cover_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(frame_option == "reduced") {
|
||||||
|
for(y = [-1:2:1]) {
|
||||||
|
for(x = [-1:2:1]) {
|
||||||
|
translate([screw_pos * x, screw_pos * y, -2]) {
|
||||||
|
circle(d = corner_size, $fn = ceil(corner_r * 8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
linear_extrude(height = grill_pattern_h, convexity = 20) {
|
||||||
|
intersection() {
|
||||||
|
offset(r=corner_r, $fn = ceil(corner_r * 8)) {
|
||||||
|
offset(r=-corner_r) {
|
||||||
|
square([cover_size, cover_size], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rotate(grill_pattern_rotation) {
|
||||||
|
if(grill_pattern == "honeycomb") {
|
||||||
|
honeycomb_pattern(cover_size, line_size, line_space);
|
||||||
|
}
|
||||||
|
if(grill_pattern == "grid") {
|
||||||
|
grid_pattern(cover_size, line_size, line_space);
|
||||||
|
}
|
||||||
|
if(grill_pattern == "line") {
|
||||||
|
line_pattern(cover_size, line_size, line_space);
|
||||||
|
}
|
||||||
|
if(grill_pattern == "triangle") {
|
||||||
|
triangle_pattern(cover_size, line_size, line_space);
|
||||||
|
}
|
||||||
|
if(grill_pattern == "crosshair") {
|
||||||
|
crosshair_pattern(cover_size, line_size, line_space);
|
||||||
|
}
|
||||||
|
if(grill_pattern == "square") {
|
||||||
|
square_pattern(cover_size, line_size, line_space);
|
||||||
|
}
|
||||||
|
if(grill_pattern == "dot") {
|
||||||
|
dot_pattern(cover_size, line_size, line_space);
|
||||||
|
}
|
||||||
|
if(grill_pattern == "aperture") {
|
||||||
|
aperture_pattern(cover_size, line_size, line_space);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// HACK: REMOVE ME
|
||||||
|
for(y = [-1:2:1]) {
|
||||||
|
for(x= [-1:2:1]) {
|
||||||
|
translate([screw_pos * x - 9*x, screw_pos * y - 9 * y, -2]) {
|
||||||
|
leg(20, 15);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
for(y = [-1:2:1]) {
|
||||||
|
for(x = [-1:2:1]) {
|
||||||
|
translate([screw_pos * x, screw_pos * y, -2]) {
|
||||||
|
screw_hole(cover_h, screw_hole_dia);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module leg(leg_h, leg_dia) {
|
||||||
|
translate([0, 0, 2]) {
|
||||||
|
cylinder(leg_h, d = leg_dia, $fn = 360);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
module screw_hole(cover_h, screw_hole_dia) {
|
||||||
|
cylinder(h = cover_h + 4, d = screw_hole_dia, $fn = 16);
|
||||||
|
if(screw_hole_chamfer == "bottom" || screw_hole_chamfer == "top_and_bottom") {
|
||||||
|
translate([0, 0, 2.9 - screw_hole_dia]) {
|
||||||
|
cylinder(h = screw_hole_dia, d1 = screw_hole_dia * 4, d2 = screw_hole_dia);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(screw_hole_chamfer == "top" || screw_hole_chamfer == "top_and_bottom") {
|
||||||
|
translate([0, 0, cover_h + screw_hole_dia/4]) {
|
||||||
|
cylinder(h = screw_hole_dia, d2 = screw_hole_dia * 4, d1 = screw_hole_dia);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module grid_pattern(size, line_size, line_space) {
|
||||||
|
num = ceil(size / (line_size + line_space) * 1.42);
|
||||||
|
for(x = [floor(-num / 2) : ceil(num / 2)]) {
|
||||||
|
translate([x * (line_size + line_space), 0]) {
|
||||||
|
square([line_size, num *(line_size + line_space)], center=true);
|
||||||
|
}
|
||||||
|
rotate(90) {
|
||||||
|
translate([x * (line_size + line_space), 0]) {
|
||||||
|
square([line_size, num *(line_size + line_space)], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module triangle_pattern(size, line_size, line_space) {
|
||||||
|
num = ceil(size / (line_size + line_space) * 1.42);
|
||||||
|
for(x = [floor(-num / 2):ceil(num / 2)]) {
|
||||||
|
translate([x * (line_size + line_space), 0]) {
|
||||||
|
square([line_size, num *(line_size + line_space)], center = true);
|
||||||
|
}
|
||||||
|
rotate(60) {
|
||||||
|
translate([x * (line_size + line_space), 0]) {
|
||||||
|
square([line_size, num *(line_size + line_space)], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rotate(120) {
|
||||||
|
translate([x * (line_size + line_space), 0]) {
|
||||||
|
square([line_size, num *(line_size + line_space)], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module line_pattern(size, line_size, line_space) {
|
||||||
|
num = ceil(size / (line_size + line_space)*1.42);
|
||||||
|
for(x = [floor(-num / 2):ceil(num / 2)]) {
|
||||||
|
translate([x * (line_size + line_space), 0]) {
|
||||||
|
square([line_size, num *(line_size + line_space)], center=true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module crosshair_pattern(size, line_size, line_space) {
|
||||||
|
line = (line_size + line_space) * 2;
|
||||||
|
num = ceil(size / line * 1.42);
|
||||||
|
for(n = [1:num]) {
|
||||||
|
difference() {
|
||||||
|
circle(d = n * line + line_size * 2, $fn = ceil(n * line + line_size * 2));
|
||||||
|
circle(d = n * line, $fn = ceil(n * line + line_size * 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(rot=[0:90 / number_of_support_lines * 2:180]) {
|
||||||
|
rotate(rot + 45) square([size * 2, line_size], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module square_pattern(size, line_size, line_space) {
|
||||||
|
line = (line_size + line_space) * 2;
|
||||||
|
num = ceil(size / line * 1.42);
|
||||||
|
for(n = [1:num]) {
|
||||||
|
difference() {
|
||||||
|
square([n * line + line_size * 2, n * line + line_size * 2], center = true);
|
||||||
|
square([n * line, n * line], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(rot=[0:90 / number_of_support_lines * 2:180]) {
|
||||||
|
rotate(rot + 45) square([size * 2, line_size], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module honeycomb_pattern(size, line_size, line_space) {
|
||||||
|
min_rad = (line_space / 2 * sqrt(3)) / 2 + line_size / 2;
|
||||||
|
y_offset = sqrt(min_rad * min_rad * 4 - min_rad * min_rad);
|
||||||
|
num_x = ceil(size / min_rad / 2) * 1.42;
|
||||||
|
num_y = ceil(size / y_offset) * 1.42;
|
||||||
|
difference() {
|
||||||
|
square([size * 1.42, size * 1.42], center = true);
|
||||||
|
for(y = [floor(-num_y / 2) : ceil(num_y / 2)]) {
|
||||||
|
odd = (y % 2 == 0) ? 0 : min_rad;
|
||||||
|
for(x = [floor(-num_x / 2) : ceil(num_x / 2)]) {
|
||||||
|
translate([x * min_rad * 2 + odd, y * y_offset]) {
|
||||||
|
rotate(30) {
|
||||||
|
circle(d=line_space, $fn=6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module dot_pattern(size, line_size, line_space) {
|
||||||
|
rad = line_space / 2;
|
||||||
|
y_offset = sqrt((rad + line_size / 2) * (rad + line_size / 2) * 4 - (rad + line_size / 2) * (rad + line_size / 2));
|
||||||
|
num_x = ceil(size / rad / 2) * 1.42;
|
||||||
|
num_y = ceil(size / y_offset) * 1.42;
|
||||||
|
difference() {
|
||||||
|
square([size * 1.42, size * 1.42], center = true);
|
||||||
|
for(y = [floor(-num_y / 2) : ceil(num_y / 2)]) {
|
||||||
|
odd = (y % 2 == 0) ? 0 : rad + line_size / 2;
|
||||||
|
for(x = [floor(-num_x / 2) : ceil(num_x / 2)]) {
|
||||||
|
translate([x * (rad + line_size / 2) * 2 + odd, y * y_offset]) {
|
||||||
|
rotate(30) {
|
||||||
|
circle(d=line_space);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module aperture_pattern(size, line_size, line_space) {
|
||||||
|
circle(d = line_space, $fn = 8);
|
||||||
|
for(rot = [1:2:15]) {
|
||||||
|
rotate(360 / 16 * rot) {
|
||||||
|
translate([line_space / 2 * cos(360 / 16) - line_size, -line_size]) {
|
||||||
|
square([line_size, size]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
// 1U is 44.45mm
|
||||||
|
// the wood plates are ~3mm
|
||||||
|
h = 44.45 - 6;
|
||||||
|
|
||||||
|
// using 1/2" #8 wood screws, we want a pilot hole through
|
||||||
|
// the PLA spacer. I'm not sure if the pilot hole should be
|
||||||
|
// treated as a softwood or hardwood size. Experiment and
|
||||||
|
// find out.
|
||||||
|
// d_soft is definitely too narrow
|
||||||
|
// d_hard was too narrow as well.
|
||||||
|
// 3.5mm was still too narrow. I'm going to switch to 2.5mm
|
||||||
|
// and try using a M2.5 machine screw, since I have a tap
|
||||||
|
d_next = 2.5;
|
||||||
|
d_hard = 3.175;
|
||||||
|
d_soft = 2.38252;
|
||||||
|
d_outer = 10;
|
||||||
|
|
||||||
|
plate = true;
|
||||||
|
|
||||||
|
difference () {
|
||||||
|
if (plate) {
|
||||||
|
translate([2, 2, 1]) {
|
||||||
|
cube([16, 16, 2], center = true);
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
cylinder(h, d = d_outer, $fn = 360);
|
||||||
|
cylinder(h, d = d_next, $fn = 360);
|
||||||
|
};
|
|
@ -0,0 +1,22 @@
|
||||||
|
// extension ikea square table legs
|
||||||
|
|
||||||
|
lip_height = 25.4; // 1"
|
||||||
|
lip_thickness = 10; // 1cm
|
||||||
|
extension_height = 76.2; // 3"
|
||||||
|
|
||||||
|
// probably shouldnt need to change these
|
||||||
|
inner_w = 25.4 * 2; // 2"
|
||||||
|
inner_t = 25.4 * 2; // 2"
|
||||||
|
|
||||||
|
w = lip_thickness + inner_w;
|
||||||
|
h = lip_thickness + inner_t;
|
||||||
|
|
||||||
|
union() {
|
||||||
|
difference() {
|
||||||
|
cube([w, h, lip_height], true);
|
||||||
|
cube([inner_w, inner_t, lip_height], true);
|
||||||
|
}
|
||||||
|
translate([0, 0, -extension_height/2-lip_height/2]) {
|
||||||
|
cube([w, h, extension_height], true);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,120 @@
|
||||||
|
// @see https://www.dakkadakka.com/wiki/en/Basing_Guidelines_for_Warhammer_40,000
|
||||||
|
|
||||||
|
// Old base: 28, primaris: 32, hero: 40, dreadnought: 65
|
||||||
|
diameter = 32.0;
|
||||||
|
|
||||||
|
// Should the base not have the same radius in the x and y axis?
|
||||||
|
oblong = false;
|
||||||
|
|
||||||
|
// Oblong diameter. A biker is on a 25x70 base, for eg.
|
||||||
|
oblong_diameter = 70;
|
||||||
|
|
||||||
|
// 3.5mm for older 28mm bases; newer bases are 4mm
|
||||||
|
base_height = 4;
|
||||||
|
|
||||||
|
// should a slot be added?
|
||||||
|
slotted = false;
|
||||||
|
|
||||||
|
// Width of the slot. 2.5 for 28mm bases
|
||||||
|
slot_width = 2.5;
|
||||||
|
|
||||||
|
// Length of the slot
|
||||||
|
slot_length = 24;
|
||||||
|
|
||||||
|
// Offset along the x axis
|
||||||
|
slot_offset_x = 3;
|
||||||
|
|
||||||
|
// Offset along the y axis
|
||||||
|
slot_offset_y = 0;
|
||||||
|
|
||||||
|
// Should a magnet holder be added underneath
|
||||||
|
magnet_holder = false;
|
||||||
|
|
||||||
|
// Diameter in mm
|
||||||
|
magnet_diameter = 6;
|
||||||
|
|
||||||
|
// Depth of the magnet holder walls in mm.
|
||||||
|
magnet_height = 2;
|
||||||
|
|
||||||
|
// Thickness of magnet wall in mm
|
||||||
|
magnet_wall_thickness = 2;
|
||||||
|
|
||||||
|
magnet_offset_x = 5;
|
||||||
|
magnet_offset_y = 0;
|
||||||
|
magnet_offset_z = 0;
|
||||||
|
magnet_offset = [magnet_offset_x, magnet_offset_y, magnet_offset_z];
|
||||||
|
slot_offset = [slot_offset_x, slot_offset_y, 0];
|
||||||
|
|
||||||
|
module magnet_holder(diameter, height, offset = [], thickness = 2) {
|
||||||
|
translate(offset) {
|
||||||
|
difference() {
|
||||||
|
cylinder(d = diameter + thickness, h = height, $fn = 360);
|
||||||
|
cylinder(d = diameter, h = height+0.01, $fn = 360);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module slot_cutout(width, length, height, offset) {
|
||||||
|
translate(offset) {
|
||||||
|
cube([width, length, height + 1], true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module base(r1, r2, h, slot = false, slot_width = 0, slot_length = 0,
|
||||||
|
magnet = false, magnet_diameter = 0, magnet_height = 0, magnet_offset = [], t = 1, slot_offset = [],
|
||||||
|
magnet_wall_thickness = 2) {
|
||||||
|
|
||||||
|
difference() {
|
||||||
|
scale([r2/r1, 1]) {
|
||||||
|
difference() {
|
||||||
|
cylinder(r1 = r1, r2 = r1 - t, h = h, $fn = 360);
|
||||||
|
cylinder(r1 = r1 - t, r2 = r1 - (2*t), h = h - t, $fn = 360);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (slot) {
|
||||||
|
translate([0, 0, h / 2]) {
|
||||||
|
slot_cutout(slot_width, slot_length, h, slot_offset);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (magnet) {
|
||||||
|
// Move it up to abut against our top
|
||||||
|
if ((h - magnet_height) > 0) {
|
||||||
|
translate([0, 0, h - t]) {
|
||||||
|
cylinder(h - magnet_height, d = magnet_diameter + magnet_wall_thickness, center = true, $fn =360);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
translate([0, 0, 0]) {
|
||||||
|
magnet_holder(magnet_diameter, magnet_height, magnet_offset, magnet_wall_thickness);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (slot) {
|
||||||
|
translate([0, 0, h/2]) {
|
||||||
|
difference() {
|
||||||
|
translate(slot_offset) {cube([slot_width + (2*t), slot_length + (2*t), h], true); }
|
||||||
|
slot_cutout(slot_width, slot_length, h, slot_offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
r1 = diameter / 2;
|
||||||
|
r2 = oblong ? oblong_diameter / 2 : r1;
|
||||||
|
base(
|
||||||
|
r1 = r1,
|
||||||
|
r2 = r2,
|
||||||
|
h = base_height,
|
||||||
|
slot = slotted,
|
||||||
|
slot_width = slot_width,
|
||||||
|
slot_length = slot_length,
|
||||||
|
magnet = magnet_holder,
|
||||||
|
magnet_diameter = magnet_diameter,
|
||||||
|
magnet_height = magnet_height,
|
||||||
|
magnet_offset = magnet_offset,
|
||||||
|
t = 1,
|
||||||
|
slot_offset = slot_offset,
|
||||||
|
magnet_wall_thickness = magnet_wall_thickness
|
||||||
|
);
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,23 @@
|
||||||
|
// 1.5" x 2.25"
|
||||||
|
// 2.5" tall
|
||||||
|
|
||||||
|
height = 2.5 * 25.4;
|
||||||
|
width = 3.0 * 25.4;
|
||||||
|
depth = 2.0 * 25.4;
|
||||||
|
|
||||||
|
|
||||||
|
thickness = 4;
|
||||||
|
|
||||||
|
difference() {
|
||||||
|
cube([width, depth, height]);
|
||||||
|
translate([0, thickness/2, thickness/2]) {
|
||||||
|
cube([width, depth - thickness, height - thickness]);
|
||||||
|
}
|
||||||
|
translate([(width-(2.25*25.4))/2, (depth-(1.5*25.4))/2, height-thickness]) {
|
||||||
|
|
||||||
|
cube([2.25*25.4, 1.5*25.4, thickness]);
|
||||||
|
}
|
||||||
|
// remove the bulk for testing
|
||||||
|
//cube([width, depth, height - thickness+2]);
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue