mirror of
https://github.com/nophead/Mendel90.git
synced 2025-08-30 16:30:08 +02:00
first commit
This commit is contained in:
28
scad/utils/bom.scad
Normal file
28
scad/utils/bom.scad
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Mendel90
|
||||
//
|
||||
// GNU GPL v2
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// BOM generation
|
||||
//
|
||||
module assembly(name) { // start an assembly
|
||||
if(bom > 0)
|
||||
echo(str(name, "/"));
|
||||
}
|
||||
|
||||
module end(name) { // end an assembly
|
||||
if(bom > 0)
|
||||
echo(str("/",name));
|
||||
}
|
||||
|
||||
module stl(name) { // name an stl
|
||||
if(bom > 0)
|
||||
echo(str(name,".stl"));
|
||||
}
|
||||
|
||||
module vitamin(name) { // name a vitamin
|
||||
if(bom > 1)
|
||||
echo(name);
|
||||
}
|
26
scad/utils/cables.scad
Normal file
26
scad/utils/cables.scad
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Mendel90
|
||||
//
|
||||
// GNU GPL v2
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// Cable sizes
|
||||
//
|
||||
function cable_wires(cable) = cable[0];
|
||||
function cable_wire_size(cable) = cable[1];
|
||||
|
||||
// numbers from http://mathworld.wolfram.com/CirclePacking.html
|
||||
function cable_radius(cable) = ceil([0, 1, 2, 2.15, 2.41, 2.7, 3, 3][cable_wires(cable)] * cable_wire_size(cable)) / 2; // radius of a bundle
|
||||
|
||||
function wire_hole_radius(cable) = cable_radius(cable) + 0.5;
|
||||
|
||||
module wire_hole(r) {
|
||||
cylinder(r = r, h = 100, center = true);
|
||||
}
|
||||
|
||||
// arrangement of bundle in flat cable clip
|
||||
function cable_bundle(cable) = [[0,0], [1,1], [2,1], [2, 0.5 + sin(60)], [2,2], [3, 0.5 + sin(60)], [3,2]][cable_wires(cable)];
|
||||
|
||||
function cable_width(cable) = cable_bundle(cable)[0] * cable_wire_size(cable); // width in flat clip
|
||||
function cable_height(cable) = cable_bundle(cable)[1] * cable_wire_size(cable); // height in flat clip
|
30
scad/utils/polyholes.scad
Normal file
30
scad/utils/polyholes.scad
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Mendel90
|
||||
//
|
||||
// GNU GPL v2
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// See http://hydraraptor.blogspot.com/2011/02/polyholes.html
|
||||
//
|
||||
function sides(r) = max(round(4 *r),3);
|
||||
function corrected_radius(r,n) = 0.1 + r / cos(180 / n);
|
||||
function corrected_diameter(d) = 0.2 + d / cos(180 / sides(d / 2));
|
||||
|
||||
module poly_circle(r, center = false) {
|
||||
n = sides(r);
|
||||
circle(r = corrected_radius(r,n), $fn = n, center = center);
|
||||
}
|
||||
|
||||
module poly_cylinder(r, h, center = false) {
|
||||
n = sides(r);
|
||||
cylinder(h = h, r = corrected_radius(r,n), $fn = n, center = center);
|
||||
}
|
||||
|
||||
module poly_d_cylinder(r, center = false) {
|
||||
n = sides(r);
|
||||
r = corrected_radius(r,n);
|
||||
cylinder(h = h, r = r, $fn = n, center = center);
|
||||
translate([0, -r, 0])
|
||||
cube([r, 2 * r, h]);
|
||||
}
|
46
scad/utils/teardrops.scad
Normal file
46
scad/utils/teardrops.scad
Normal file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// Mendel90
|
||||
//
|
||||
// GNU GPL v2
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// For making horizontal holes that don't need support material
|
||||
// Small holes can get away without it but they print better with truncated teardrops
|
||||
//
|
||||
module teardrop_2D(r, truncate = true) {
|
||||
difference() {
|
||||
union() {
|
||||
circle(r = r, center = true);
|
||||
translate([0,r / sqrt(2),0])
|
||||
rotate([0,0,45])
|
||||
square([r, r], center = true);
|
||||
}
|
||||
if(truncate)
|
||||
translate([0, r * 2, 0])
|
||||
square([2 * r, 2 * r], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
module teardrop(h, r, center, truncate = true)
|
||||
linear_extrude(height = h, convexity = 2, center = center)
|
||||
teardrop_2D(r, truncate);
|
||||
|
||||
module teardrop_plus(h, r, center, truncate = true)
|
||||
teardrop(h, r + layer_height / 4, center, truncate);
|
||||
|
||||
|
||||
module tearslot(h, r, w, center)
|
||||
linear_extrude(height = h, convexity = 6, center = center)
|
||||
hull() {
|
||||
translate([-w/2,0,0]) teardrop_2D(r, true);
|
||||
translate([ w/2,0,0]) teardrop_2D(r, true);
|
||||
}
|
||||
|
||||
module vertical_tearslot(h, r, l, center = true)
|
||||
linear_extrude(height = h, convexity = 6, center = center)
|
||||
hull() {
|
||||
translate([0, l / 2]) teardrop_2D(r, true);
|
||||
translate([0, -l / 2, 0])
|
||||
circle(r = r, center = true);
|
||||
}
|
Reference in New Issue
Block a user