summaryrefslogtreecommitdiff
authorMichael Krelin <hacker@klever.net>2018-07-25 21:41:27 (UTC)
committer Michael Krelin <hacker@klever.net>2018-07-25 21:41:27 (UTC)
commit5ab7711ef9b9180121e7dc4e8d33afd5a5ff97d1 (patch) (side-by-side diff)
treecef89db5a1b1ebc9be4da53505614aea535477c0
parentcd3c9592b1b26ed98eda97fbf5b098bdcf4c1abd (diff)
downloadextrudery-5ab7711ef9b9180121e7dc4e8d33afd5a5ff97d1.zip
extrudery-5ab7711ef9b9180121e7dc4e8d33afd5a5ff97d1.tar.gz
extrudery-5ab7711ef9b9180121e7dc4e8d33afd5a5ff97d1.tar.bz2
make printable position conditional
and remove the diameter parameter, because why :)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--multimixer.scad14
1 files changed, 9 insertions, 5 deletions
diff --git a/multimixer.scad b/multimixer.scad
index 21f71e4..80f41f1 100644
--- a/multimixer.scad
+++ b/multimixer.scad
@@ -4,71 +4,75 @@ epsilon=.01;
use <pushfittery.scad>;
include <pushfit_data.scad>;
module multimixer(
filament_d = 1.75,
liner_od = 4, liner_id = 2,
angle = 15, // to the vertical (output) axis
inputs = 4,
minshell = 2*extrusion_width,
shell = 5*extrusion_width,
pf = pushfit_embeddest,
debug = 0, // how many inputs -1 the debug cutout spans
+ print = false,
) {
fnd = 4*PI; fnr = 2*fnd;
pushfit_d = pf_d(pf);
pushfit_h = pf_h(pf);
angular_step = 360/inputs;
inputogon_angle = 180*(inputs-2)/inputs;
sinsin = sin(angle)*sin(angular_step/2);
function l_to(d) = d*cos(asin(sinsin))/sinsin;
l_output = liner_od;
l_input = l_to(pushfit_d/2+minshell);
l_fork = l_to(liner_id/2);
l_narrow = l_to(liner_od/2+minshell);
module forinputs() {
for(zr=[0:angular_step:359]) rotate([0,0,zr]) rotate([0,angle,0]) children();
}//forinputs module
module foroutput() {
rotate([180,0,0]) children();
}
- //translate([pf_d(pf)/2+shell,0,0])
- //translate([0,0,l_output+pushfit_h])
- module laydown(dia) {
- r = dia/2;
+ module laydown() {
+ r = pushfit_d/2+shell;
h_bottom = l_output+pushfit_h;
/* The top point on the cylinder that will touch the bed */
x0 = r*cos(angular_step/2);
y0 = r*sin(angular_step/2);
z0 = l_input+pushfit_h;
/* The same point after rotation by "angle" around Y axis */
x1 = z0*sin(angle)+x0*cos(angle);
y1 = y0;
z1 = z0*cos(angle)-x0*sin(angle);
ax1 = atan(y1/x1);
/* And its x-coordinate after final "angular_step/2" Z-rotation */
ax2 = ax1-angular_step/2;
x2 = x1*cos(ax2)/cos(ax1);
laydown_angle = atan((x2-r)/(z1+h_bottom));
rotate([90-laydown_angle,0,0])
translate([0,r,h_bottom])
rotate([0,0,angular_step/2-90])
children();
}
- laydown(dia=pushfit_d+shell*2) difference() {
+ module finalize() {
+ if(print) laydown() children();
+ else children();
+ }
+
+ finalize() difference() {
hull() {
forinputs()
translate([0,0,l_input+pushfit_h]) mirror([0,0,1])
cylinder(d=pushfit_d+shell*2,h=epsilon,$fn=pushfit_d*fnd);
foroutput()
translate([0,0,l_output+pushfit_h]) {
cylinder(d=pushfit_d+shell*2,h=epsilon,$fn=pushfit_d*fnd);
}
}
forinputs() {
translate([0,0,l_input]) pushfit(pf);
translate([0,0,l_narrow]) {