Poor man's openscad screw library
by aubenc, published
Due to some bugs in the initial version, a revision of the OpenSCAD library has been uploaded, please use "polyScrewThread_r1.scad". Thanks a lot to mechadense for reporting the bugs!
This is my humble take on a screw library to be used in your OpenSCAD scripts.
If you are serious, please be, you'll better use thingiverse.com/thing:8793 syvwlch.
Anyway, I had this thing for months in the lost projects folder suffering from some serious issues, well some of them remain (it doesn't render) and once the dust has been shaken it compiles quite nice and printable things.
Instead of functions, this thing uses loops.
Instead of rotate polyhedrons, this thing draws the polyhedron in a new set of points.
Just a couple of comments to help using this thing:
- I've found that a resolution of something like 1.5mm (PI/2 is what I use the most) works very well for threads that will be used with nuts made with a resolution of 0.5mm.
- I've printed the threads with a very low infill (0.2) but for the nuts, setting up this value (I've used 0.45) helped a lot with the overhang issue.
More pics @ aubenc.imgur.com/screws_threads_an_other_polyhedron_games
Recent Commentsview all
Well, I'm afraid I did the same: too quick! :( :)
My changes as in the "_r1" version should work but may have unwanted results if the thickness of the hex block is too small :(
the code in the comment above will just fail in the same circumstances (thin hex block).
Anyway, this is an old thing asking for some changes, it was done when a 45 degs overhang was possible but not so easy and "fine res" was about 0.35mm for the layer height.
I may come soon with a customizer friendly new thing (from end to end)
Nice! Smoothing sharp edges is always good.
However :))) for hex bolt-heads/nuts I like to let them sharp because tools have better grip, just my personal taste.
I tried your changes and they where not working, I just used hex_head(8,13). The reason was one of the computed values going into the negative realm... (6,13) worked like a charm.
I will not change the code again, if you like, you may take this other approach for the smoothing:
x0=0; x1=df/2; x2=rd1;
y0=0; y1=rd0-(df/2); y2=hg-y1; y3=hg;
cylinder(h=hg, r=rd0, $fn=6, center=false);
polygon([ [x0,y0],[x1,y0],[x2,y1],[x2,y2],[x1,y3],[x0,y3] ]);
...just decrease/increase the 0.25 in rd1 to decr/incr the smoothing
Liked Byview all
Give a Shout Out
Drop "polyScrewThread_r1.scad" into your OpenSCAD library folder or the folder where you are writing your OpenSCAD script.
Use polytests.scad (*) as a user's guide, refference, whatever.
(* - Depending on how old/new is your OpenSCAD you may need to change the line where the library is included, replace "include" by "use")
Because this thing is made without much science, you'll need to tweak a little bit, sorry...
First print a nut (high res, see comments above), tweak the infill and/or the degrees for the shape of the thread.
Once your nut prints fine, print a short threaded rod, try to change the resolution of the thread, infill,... use your imagination.
I printed the provided examples and they all work fine without any cleaning, that's the reason why they look so ugly in the pictures.
Design bolted things.
Print bolted things.
Keep on bolting!
You must be logged in to post a comment.