diff options
-rw-r--r-- | Lego/Lego.scad | 38 | ||||
-rw-r--r-- | Lego/Makefile | 3 |
2 files changed, 41 insertions, 0 deletions
diff --git a/Lego/Lego.scad b/Lego/Lego.scad index c1c9659..0522126 100644 --- a/Lego/Lego.scad +++ b/Lego/Lego.scad @@ -601,6 +601,42 @@ module Prellbock(br) { } } +module WeicheT(br) { + rot_radius = (br-1)*d-eps; + difference() { + union() { + Lego_unten(br,2*br-2,h); + for(i=[-1:2:1]) + translate([-br*d/2+eps,-i*rot_radius,h]) + rotate_extrude(angle = i*90) + translate([rot_radius,0,0]) + difference() { + circle(r=hubelino_d/2+r/2); + translate([-hubelino_d/2-r+eps,0]) + square([hubelino_d+2*r-2*eps,hubelino_d+r]); + } + for(x=[1:br]) + for(y=[1:2*br-2]) + if( + (x-1/2)*(x-1/2)+(y-1/2)*(y-1/2)<(rot_radius-hubelino_d/2-3/2*r)*(rot_radius-hubelino_d/2-3/2*r)/d/d || + (x-1/2)*(x-1/2)+(2*br-y-3/2)*(2*br-y-3/2)<(rot_radius-hubelino_d/2-3/2*r)*(rot_radius-hubelino_d/2-3/2*r)/d/d || + ( + (x-1/2)*(x-1/2)+(y-1/2)*(y-1/2)>(rot_radius+hubelino_d/2+3/2*r)*(rot_radius+hubelino_d/2+3/2*r)/d/d && + (x-1/2)*(x-1/2)+(2*br-y-3/2)*(2*br-y-3/2)>(rot_radius+hubelino_d/2+3/2*r)*(rot_radius+hubelino_d/2+3/2*r)/d/d + ) + ) + translate([(x-1/2-br/2)*d,(y+1/2-br)*d,h]) + Lego_oben(1,1); + } + for(i=[-1:2:1]) + translate([-br*d/2+eps,-i*rot_radius,h]) + rotate_extrude(angle = i*90) + translate([rot_radius,0,0]) + difference() + circle(r=hubelino_d/2); + } +} + l=4; if (Teil == "Helix") { Helix(l); @@ -634,4 +670,6 @@ if (Teil == "Helix") { d1=1; d2=1; Weiche(l,d1,d2); +} else if (Teil == "WeicheT") { + WeicheT(l); } diff --git a/Lego/Makefile b/Lego/Makefile index 811a604..e1e30b1 100644 --- a/Lego/Makefile +++ b/Lego/Makefile @@ -33,3 +33,6 @@ Lego/Lego-Trichter-%.stl: Lego/Lego.scad Lego/Lego-Weiche-%.stl: Lego/Lego.scad openscad -D '$$fa=$(FA)' -D '$$fs=$(FS)' -D 'Teil="Weiche"' -D l=$(word 3,$(subst -, ,$(patsubst %.stl,%,$@))) -D d1=$(word 4,$(subst -, ,$(patsubst %.stl,%,$@))) -D d2=$(word 5,$(subst -, ,$(patsubst %.stl,%,$@))) --export-format stl -o $@ $< + +Lego/Lego-WeicheT-%.stl: Lego/Lego.scad + openscad -D '$$fa=$(FA)' -D '$$fs=$(FS)' -D 'Teil="WeicheT"' -D l=$(word 3,$(subst -, ,$(patsubst %.stl,%,$@))) -D d1=$(word 4,$(subst -, ,$(patsubst %.stl,%,$@))) -D d2=$(word 5,$(subst -, ,$(patsubst %.stl,%,$@))) --export-format stl -o $@ $< |