nove modely
authorTomas Mudrunka <tomas.mudrunka@gmail.com>
Thu, 2 Nov 2023 23:05:20 +0000 (00:05 +0100)
committerTomas Mudrunka <tomas.mudrunka@gmail.com>
Thu, 2 Nov 2023 23:05:20 +0000 (00:05 +0100)
openscad/shower_nozzle.scad [new file with mode: 0644]
openscad/train-usb.scad [new file with mode: 0644]

diff --git a/openscad/shower_nozzle.scad b/openscad/shower_nozzle.scad
new file mode 100644 (file)
index 0000000..7b16f0f
--- /dev/null
@@ -0,0 +1,105 @@
+//sine_thread.scad by Ron Butcher (aka. Ming of Mongo), 
+//with bits borrowed from ISOThread by Trevor Moseley
+//
+//Thread libs for OpenSCAD are hideously slow.  I love OpenSCAD, but that's the fact.
+//But I found that, if you are cool with approximating iso threads with a sine wave,
+//you can make very smooth threads really fast just by spinning a circle around.
+//
+//Actually, you could make near perfect threads by specifying a polygon other than a circle
+//with the exact screw cross-section you need, but I leave that as an excersize for those
+//who care more than I do.  Circle works for me.
+//
+//threads module gives a threaded rod
+//hex_nut(diameter) does just what you think
+//hex_screw(diameter, length) gives an M(diameter) hex head screw with length mm of thread.
+//
+//defaults get you an M4 x 10mm bolt and an M4 nut.  If you want something non standard,
+//you can supply the pitch, head height and diameter, rez(olution) and a scaling factor
+//to help make up for the oddities of everyone's individual printers and settings.
+//
+//Finer layering gets you better results.  At .1mm layer height, my M4 threads kick ass.
+//
+//This is all metric, but you can translate US diameters and pitch to mm easily enough.
+
+
+module threads(diameter=4,pitch=undef,length=10,scale=1,rez=20){
+       pitch = (pitch!=undef) ? pitch : get_coarse_pitch(diameter);
+       twist = length/pitch*360;
+       depth=pitch*.6;
+       linear_extrude(height = length, center = false, convexity = 10, twist = -twist, $fn = rez)
+               translate([depth/2, 0, 0]){
+                       circle(r = scale*diameter/2-depth/2);
+               }
+}      
+
+module hex_nut(        diameter = 4,
+                               height = undef, 
+                               span = undef,  
+                               pitch = undef, 
+                               scale = 1, 
+                               rez = 20){
+       height = (height!=undef) ? height : hex_nut_hi(diameter);
+       span = (span!=undef) ? span : hex_nut_dia(diameter);
+       
+       difference(){
+               cylinder(h=height,r=span/2, $fn=6); //six sided cylinder
+               threads(diameter,pitch,height,scale,rez);
+               cylinder(h=diameter/2, r1=diameter/2, r2=0, $fn=rez);
+                       translate([0,0,height+.0001])
+               rotate([180,0,0])
+                               #cylinder(h=diameter/2, r1=diameter/2, r2=0, $fn=rez);
+       }
+}
+
+module hex_screw(diameter = 4, 
+                               length = 10, 
+                               height = undef, 
+                               span = undef, 
+                               pitch = undef, 
+                               scale = 1, 
+                               rez = 20){
+       height = (height!=undef) ? height : hex_bolt_hi(diameter);
+       span = (span!=undef) ? span : hex_bolt_dia(diameter);
+       cylinder(h=height,r=span/2,$fn=6); //six sided cylinder
+       translate([0,0,height])
+               threads(diameter,pitch,length,scale,rez);
+}
+
+// Lookups shamelessly stolen from ISOThread.scad by Trevor Moseley
+// function for thread pitch
+function get_coarse_pitch(dia) = lookup(dia, [
+[1,0.25],[1.2,0.25],[1.4,0.3],[1.6,0.35],[1.8,0.35],[2,0.4],[2.5,0.45],[3,0.5],[3.5,0.6],[4,0.7],[5,0.8],[6,1],[7,1],[8,1.25],[10,1.5],[12,1.75],[14,2],[16,2],[18,2.5],[20,2.5],[22,2.5],[24,3],[27,3],[30,3.5],[33,3.5],[36,4],[39,4],[42,4.5],[45,4.5],[48,5],[52,5],[56,5.5],[60,5.5],[64,6],[78,5]]);
+
+// function for hex nut diameter from thread size
+function hex_nut_dia(dia) = lookup(dia, [
+[3,6.4],[4,8.1],[5,9.2],[6,11.5],[8,16.0],[10,19.6],[12,22.1],[16,27.7],[20,34.6],[24,41.6],[30,53.1],[36,63.5]]);
+// function for hex nut height from thread size
+function hex_nut_hi(dia) = lookup(dia, [
+[3,2.4],[4,3.2],[5,4],[6,3],[8,5],[10,5],[12,10],[16,13],[20,16],[24,19],[30,24],[36,29]]);
+
+
+// function for hex bolt head diameter from thread size
+function hex_bolt_dia(dia) = lookup(dia, [
+[3,6.4],[4,8.1],[5,9.2],[6,11.5],[8,14.0],[10,16],[12,22.1],[16,27.7],[20,34.6],[24,41.6],[30,53.1],[36,63.5]]);
+// function for hex bolt head height from thread size
+function hex_bolt_hi(dia) = lookup(dia, [
+[3,2.4],[4,3.2],[5,4],[6,3.5],[8,4.5],[10,5],[12,10],[16,13],[20,16],[24,19],[30,24],[36,29]]);
+
+wrench_ratio = 1.1547;
+wrench = wrench_ratio * 13;
+
+difference() {
+       union() {
+               //european shower head thread
+               threads(diameter=20, pitch=2, length=10, rez=60);
+               hull() {
+               cylinder(d1=wrench, d2=wrench, h=15, $fn=6);
+               translate([0,0,20]) sphere(d=6, $fn=32);
+               }
+       }
+       translate([0,0,-10]) cylinder(d=1, h=100, $fn=32);
+       translate([0,0,-0.1]) cylinder(d1=4, d2=1, h=10, $fn=32);
+}
+
+//translate([18.8,0,0.5])
+//import("/home/harvie/Downloads/nasadka_na_dysh_2_mm_v1.stl");
\ No newline at end of file
diff --git a/openscad/train-usb.scad b/openscad/train-usb.scad
new file mode 100644 (file)
index 0000000..5d86e7f
--- /dev/null
@@ -0,0 +1,34 @@
+//Z kostky by melo koukat 5-6mm konektoru!
+
+$fn=32;
+
+
+difference() {
+       hull() {
+               intersection() {
+                       translate([-4,-3/2,0]) cube([26,27,33.9]);
+                       translate([7,12,0]) cylinder(d=30, h=33.9, $fn=100);
+               }
+               translate([9,23.5/2,-7]) cylinder(d=20, h=7);
+       }
+       union() {
+       cube([2,24,34]);
+               intersection() {
+       translate([2,2,0]) cube([18,20,34]);
+                       translate([7,12,0]) cylinder(d=26, h=33.9, $fn=100);
+               }
+       translate([-2,2,0]) cube([2,20,34]);
+       translate([7+4,24/2,-20]) cylinder(d=10.2, h=100); //same
+
+       difference() {
+       translate([20,6.5,30]) rotate([90,90,90])
+               linear_extrude(3) text("USB");
+               translate([7,12,0]) cylinder(d=29.6, h=33.9, $fn=100);
+       }
+       }
+}
+
+difference() {
+       translate([7+4,24/2,0]) cylinder(d=15, h=2);
+       translate([7+4,24/2,-20]) cylinder(d=10.2, h=100); //same
+}
This page took 0.17615 seconds and 4 git commands to generate.