Skip to content
Snippets Groups Projects
Commit 6ee5cb57 authored by fxk8y's avatar fxk8y :spider:
Browse files

Split out the piping into new project WebWeaver

parent 0e6a1eb9
No related branches found
No related tags found
No related merge requests found
......@@ -60,23 +60,6 @@ module symmetricHeatsink(
}
/**
*
* TODO: Moar documentation!
*
*/
module roundRect(w, h, r) {
if (r > 0) {
_dw2 = (w - 2*r) / 2;
_dh2 = (h - 2*r) / 2;
hull() for (tx=[-_dw2, _dw2], ty=[-_dh2, _dh2]) translate([tx, ty, 0]) circle(r=r);
} else {
square([w, h], center=true);
}
}
// f = fan
f_r = 4; // corner radius of fan case
f_d = 20; // depth. or thickness.
......@@ -167,26 +150,6 @@ module tri(w, h) {
]);
}
/**
* A round triangle pointing along the X-Axis
*
* `w` width; length along X
* `h` height; Y size
* `r` corner radius
* `style` use "inner" for the included area or anything else for the `outer` area, this is the included area plus corner size
*
*/
module roundTri(w, h, r, style="inner") {
_r = style == "inner" ? r : 0;
hull () {
translate([_r, -h/2 + _r, 0]) circle(r=r);
translate([_r, h/2 - _r, 0]) circle(r=r);
translate([w - _r, 0, 0]) circle(r=r);
}
}
// length of the outlet
x = 5; // TODO: rename!!!!
......@@ -268,118 +231,8 @@ module funnel() {
// ############################
module straightPipe(width, height, length, radius, strength, center=false) {
w = width;
h = height;
l = length;
r = radius;
_str = strength;
tz = center ? -l/2 : 0;
translate([0, 0, tz]) linear_extrude(l) difference() {
roundRect(w, h, r);
roundRect(w - _str*2, h - _str*2, r - _str);
}
}
// straightPipe(20, 10, 30, 1, 1);
// center only applies to Z-axis
// TODO: write documentation!
module cornerPipe(width, height, diameter, angle, radius, strength, center=false) {
w = width;
h = height;
d = diameter; // "size" of the corner. inner diameter of where it is virtually wound onto
a = angle;
r = radius;
_str = strength;
tz = center ? 0 : h/2;
translate([0, 0, tz]) rotate_extrude(angle=a, convexity=8) translate([w/2 + d/2, 0, 0]) difference() {
roundRect(w, h, r);
roundRect(w - _str*2, h - _str*2, r - _str);
}
}
// cornerPipe(20, 10, 5, 90, 1, 1, true);
// Not what I wanted to code - but may come in handy anywhere in the future…
module helixPipe(width, height, length, diameter, angle, radius, strength, center=false) {
w = width;
h = height;
l = length;
a = angle;
r = radius;
_str = strength;
tz = center ? 0 : h/2;
translate([0, 0, tz]) linear_extrude(l, twist=a, convexity=8) translate([0, 0, 0]) difference() {
roundRect(w, h, r);
roundRect(w - _str*2, h - _str*2, r - _str);
}
}
// helixPipe(20, 10, 20, 5, 90, 1, 1, true);
// TODO: documentation!
module adapterPipe(
w0, h0, r0, str0, w1, h1, r1, str1,
length, x_off=0, y_off=0, center=false
) {
l = length;
epsilon = 0.001;
tz = center ? -l/2 : 0;
difference() {
// outer shell
hull() {
linear_extrude(epsilon) roundRect(w0, h0, r0);
translate([x_off, y_off, l - epsilon]) linear_extrude(epsilon) roundRect(w1, h1, r1);
}
// inner hole
hull() {
linear_extrude(epsilon) roundRect(w0 - str0*2, h0 - str0*2, r0 - str0);
translate([x_off, y_off, l - epsilon]) linear_extrude(epsilon) roundRect(w1 - str1*2, h1 - str1*2, r1 - str1);
}
}
}
// adapterPipe(20, 30, 6, 1, 20, 10, 1, 2, 30, x_off = 23, center=true);
// N is the number of pipe endings
// length means length of each pipe measured from the centre
module crossNPipe(width, height, length, radius, strength, N, center=false) {
w = width;
h = height;
l = length;
r = radius;
_str = strength;
epsilon = 0.001; // TODO: may need adjustment
tz = center ? h/2 : 0;
translate([0, 0, tz]) difference() {
for (rz=[0:360/N:360]) rotate([-90, 0, rz]) linear_extrude(l) {
roundRect(w, h, r);
}
for (rz=[0:360/N:360]) rotate([-90, 0, rz]) linear_extrude(l + epsilon) {
roundRect(w - _str*2, h - _str*2, r - _str);
}
}
}
// TODO: link nad include the WebWeaver and write the code ^^
crossNPipe(20, 10, 40, 1, 1, 6);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment