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

Adding inner/outer volume switches to remaining pipe sections

parent a5114a48
No related branches found
No related tags found
No related merge requests found
......@@ -41,19 +41,19 @@ module cornerPipe(width, height, diameter, angle, radius, strength, center=false
// TODO: LayOnFace? Use a better name maybe…?
module cornerPipeLayOnFace(width, height, diameter, angle, radius, strength, center=false, centerX=false, centerY=false) {
module cornerPipeLayOnFace(width, height, diameter, angle, radius, strength, center=false, centerX=false, centerY=false, inner=true, outer=true) {
tx = center || centerX ? -height/2 : 0;
ty = center || centerY ? -width/2 : 0;
translate([tx + height, ty + width + diameter/2, 0]) rotate([90, 0, -90]) cornerPipe(width=width, height=height, diameter=diameter, angle=angle, radius=radius, strength=strength, center=center);
translate([tx + height, ty + width + diameter/2, 0]) rotate([90, 0, -90]) cornerPipe(width=width, height=height, diameter=diameter, angle=angle, radius=radius, strength=strength, center=center, inner=inner, outer=outer);
}
// 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) {
module helixPipe(width, height, length, diameter, angle, radius, strength, center=false, inner=true, outer=true) {
w = width;
h = height;
l = length;
......@@ -64,8 +64,8 @@ module helixPipe(width, height, length, diameter, angle, radius, strength, cente
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, center=true);
roundRect(w - _str*2, h - _str*2, r - _str, center=true);
if (outer) roundRect(w, h, r, center=true);
if (inner) roundRect(w - _str*2, h - _str*2, r - _str, center=true);
}
}
......@@ -75,7 +75,8 @@ module helixPipe(width, height, length, diameter, angle, radius, strength, cente
// TODO: documentation!
module adapterPipe(
w0, h0, r0, str0, w1, h1, r1, str1,
length, x_off=0, y_off=0, center=false
length, x_off=0, y_off=0,
center=false, inner=true, outer=true
) {
l = length;
......@@ -84,13 +85,13 @@ module adapterPipe(
difference() {
// outer shell
hull() {
if (outer) hull() {
linear_extrude(epsilon) roundRect(w0, h0, r0, center=true);
translate([x_off, y_off, l - epsilon]) linear_extrude(epsilon) roundRect(w1, h1, r1, center=true);
}
// inner hole
hull() {
if (inner) hull() {
linear_extrude(epsilon) roundRect(w0 - str0*2, h0 - str0*2, r0 - str0, center=true);
translate([x_off, y_off, l - epsilon]) linear_extrude(epsilon) roundRect(w1 - str1*2, h1 - str1*2, r1 - str1, center=true);
}
......@@ -102,7 +103,7 @@ module adapterPipe(
// 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) {
module crossNPipe(width, height, length, radius, strength, N, center=false, inner=true, outer=true) {
w = width;
h = height;
l = length;
......@@ -114,11 +115,11 @@ module crossNPipe(width, height, length, radius, strength, N, center=false) {
tz = center ? h/2 : 0;
translate([0, 0, tz]) difference() {
for (rz=[0:360/N:360]) rotate([-90, 0, rz]) linear_extrude(l) {
if (outer) for (rz=[0:360/N:360]) rotate([-90, 0, rz]) linear_extrude(l) {
roundRect(w, h, r, center=true);
}
for (rz=[0:360/N:360]) rotate([-90, 0, rz]) linear_extrude(l + epsilon) {
if (inner) for (rz=[0:360/N:360]) rotate([-90, 0, rz]) linear_extrude(l + epsilon) {
roundRect(w - _str*2, h - _str*2, r - _str, center=true);
}
}
......
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