2019-04-13 14:59:41 +02:00
.. image :: docs/imgs/logo.png
2019-04-10 21:55:13 +02:00
:alt: bolt-in-nut logo
2019-04-13 19:03:41 +02:00
threadlib is a library of standard threads for `OpenSCAD <https://www.openscad.org> `__ .
It is based on Helges excellent
`threadprofile.scad <https://github.com/MisterHW/IoP-satellite/tree/master/OpenSCAD%20bottle%20threads> `__
to create nice threads with lead-in / lead-out tapers. Check out his `article on generating nice threads <https://hackaday.io/page/5252-generating-nice-threads-in-openscad> `__
on Hackaday.
In contrast to other thread libraries such as `openscad-threads <http://dkprojects.net/openscad-threads/> `__ ,
`yet another thread library <https://www.thingiverse.com/thing:2277141> `__ ,
`threads for screws and nuts V1 <https://www.thingiverse.com/thing:3131126> `__ ,
and `threading.scad <https://www.thingiverse.com/thing:1659079> `__ ,
threadlib does not make you look up diameters and pitches and maybe even
thread-profiles in tables and norms: It has these tables built in.
2019-03-24 18:21:13 +01:00
2019-04-07 21:44:50 +02:00
Creating a thread is as simple as
.. code-block :: OpenSCAD
2019-04-13 17:54:41 +02:00
use <threadlib/threadlib.scad>
2019-04-13 17:39:29 +02:00
thread("G1/2-ext", turns=10);
2019-04-07 21:44:50 +02:00
2019-04-13 17:39:29 +02:00
.. image :: docs/imgs/thread-G1o2-ext-10turns.png
:alt: bolt-in-nut logo
to create a British Standard Pipe parallel external thread.
Why you may want to use threadlib
==================================
2019-04-07 21:44:50 +02:00
2019-04-13 17:39:29 +02:00
- really easy to use
- creates nice threads
- configurable higbee arc
- creates working threads (clearances are left for production tolerances)
- flexible:
2019-04-14 11:44:47 +02:00
2019-04-13 17:39:29 +02:00
- choose the $fn you need to fit the rest of your design
2019-04-13 18:56:55 +02:00
- let threadlib tell you the thread specs so you can do with them what *you* want
2019-04-13 17:39:29 +02:00
- extensible: Add your own threads
2019-11-13 21:03:14 +01:00
- tried and tested in the real world: Well, partly. Given the sheer number of
threads, this is only possible with *your* help! Any feedback regarding working
(or not working) threadlib-threads is appreciated.
2019-04-07 21:44:50 +02:00
2019-04-13 17:39:29 +02:00
2019-04-13 17:54:41 +02:00
Installation
===========================
Prerequisits:
- `scad-utils <https://github.com/openscad/scad-utils> `__
- `list-comprehension <https://github.com/openscad/list-comprehension-demos> `__
2019-04-13 19:03:41 +02:00
- `threadprofile.scad <https://github.com/MisterHW/IoP-satellite/blob/master/OpenSCAD%20bottle%20threads/thread_profile.scad> `__
2019-04-13 17:54:41 +02:00
2019-04-13 19:03:41 +02:00
Save all of these into your OpenSCAD `library folder <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Libraries> `__
2019-04-13 17:54:41 +02:00
threadlib:
2019-04-13 18:56:55 +02:00
Clone threadlib into the folder 'threadlib' inside your OpenSCAD library folder
2019-04-13 17:54:41 +02:00
2020-06-09 18:33:30 +02:00
Your libraries folder should now look similar to this:
2020-06-12 11:38:01 +02:00
::
2020-06-09 18:33:30 +02:00
2020-06-12 11:38:01 +02:00
libraries
├── list-comprehension-demos/
├── scad-utils/
├── thread_profile.scad
└── threadlib/
2019-04-13 17:54:41 +02:00
2021-10-09 15:26:08 +02:00
2019-04-07 21:44:50 +02:00
Usage
===========================
2019-11-13 21:03:14 +01:00
Before you start: threadlib is designed in millimeters (not meters, not inches).
Make sure that your units are set accordingly or scale the output of threadlib
to match the units you use in your project!
2019-04-10 21:55:13 +02:00
To create a bolt (without head) with 5 turns of M4 thread:
2019-04-07 21:44:50 +02:00
.. code-block :: OpenSCAD
2019-04-13 17:39:29 +02:00
bolt("M4", turns=5, higbee_arc=30);
2019-04-10 21:55:13 +02:00
2019-04-10 22:09:58 +02:00
.. image :: docs/imgs/bolt-M4.png
2019-04-10 21:55:13 +02:00
:alt: Bolt with M4 thread
2019-04-07 21:44:50 +02:00
2019-04-13 18:36:00 +02:00
See these nice lead-in / lead-out tapers? Try a nut (this time using the default
2019-04-13 17:39:29 +02:00
argument for higbee_arc):
2019-04-07 21:44:50 +02:00
.. code-block :: OpenSCAD
2019-04-13 17:39:29 +02:00
nut("M12x0.5", turns=10, Douter=16);
2019-04-07 21:44:50 +02:00
2019-04-10 22:09:58 +02:00
.. image :: docs/imgs/nut-M12x0.5.png
2019-04-10 21:55:13 +02:00
:alt: M12x0.5 nut
2019-04-07 21:44:50 +02:00
Note that for a nut you also have to specify an outer diameter. The inner
2019-04-10 21:55:13 +02:00
diameter is implicitly given by the thread designator ("M12x0.5" in this case).
2019-04-07 21:44:50 +02:00
2020-08-04 22:36:37 +02:00
To make a threaded hole (e.g. in a plate), an intuitive approach would be to
create the difference of the plate and a bolt. However, this part would not work
well in practice: You need a little space around the bolt to avoid collisions.
threadlib's solution is to provide the tap module:
.. code-block :: OpenSCAD
tap("G1/2", turns=5);
.. image :: docs/imgs/tap-G1o2.png
:alt: G1/2 tap
The tap shown above *is* intended for use like this and has accounted for the
allowances needed in practice. Also, it will create the tapers:
.. code-block :: OpenSCAD
difference() {
part_to_be_tapped_here();
tap("G1/2", turns=5);
}
Make sure that the tap extends a tiny bit out of the part to be tapped.
Otherwise, you will end up with infinitely thin artifacts covering the entrance
of your tapped hole.
2019-04-07 21:44:50 +02:00
If you only need the threads alone:
.. code-block :: OpenSCAD
2019-04-13 17:39:29 +02:00
thread("G1/2-ext", turns=5);
2019-04-07 21:44:50 +02:00
2019-04-13 17:39:29 +02:00
.. image :: docs/imgs/thread-G1o2-ext.png
:alt: G1/2 external thread
2020-08-04 22:36:37 +02:00
(Note: You need to specify whether you want internal ("-int") or external
("-ext") thread here.) Then, add the support you want. In the simplest
case, a cylinder (which is what nut(...) uses):
2019-04-07 21:44:50 +02:00
.. code-block :: OpenSCAD
2021-05-18 07:16:14 -04:00
specs = thread_specs("G1/2-ext");
2019-04-07 21:44:50 +02:00
P = specs[0]; Rrot = specs[1]; Dsupport = specs[2];
section_profile = specs[3];
H = (5 + 1) * P;
translate([0, 0, -P / 2])
cylinder(h=H, d=Dsupport, $fn=120);
2019-04-13 17:39:29 +02:00
.. image :: docs/imgs/flexible.png
:alt: G1/2 bolt
2019-04-07 21:44:50 +02:00
Here, we have used the function thread_specs(...) to look up the threads
specifications - including the recommended diameter of the support structure.
2019-04-08 10:31:20 +02:00
List of supported threads
===========================
Currently, threadlib knows these threads:
2020-08-04 22:36:37 +02:00
- Metric threads (coarse, fine, and super-fine pitches) M0.25 to M600.
2020-06-09 18:33:30 +02:00
- Unified Inch Screw Threads (UNC, UNF, UNEF, 4-UN, 6-UN, 8-UN, 12-UN,
2020-04-18 16:36:26 +02:00
16-UN, 20-UN, 28-UN, and 32-UN). All threads are class 2 threads.
2020-08-04 22:36:37 +02:00
- `BSP parallel thread
<https://www.amesweb.info/Screws/British-Standard-Pipe-Parallel-Thread-BSPP.aspx>`__
G1/16 to G6. All threads are class A threads.
- `PCO-1881
<https://www.bevtech.org/assets/Committees/Packaging-Technology/20/3784253-20.pdf>`__
(PET-bottle thread)
2019-04-08 10:31:20 +02:00
2019-04-13 17:39:29 +02:00
2019-04-07 21:44:50 +02:00
Extensibility
===========================
Don't find some of the threads you need for your project? Don't worry: You can
add your own:
.. code-block :: OpenSCAD
use <threadlib/threadlib.scad>
MY_THREAD_TABLE = [
["special", [pitch, Rrot, Dsupport,
[[r0, z0], [r1, z1], ..., [rn, zn]]]]
];
thread("special", turns=15, table=MY_THREAD_TABLE);
Care to share? Safe others from repeating the valuable work you have already
accomplished and get the fame you deserve: Send in your tried and tested threads
2021-10-09 15:26:08 +02:00
for addition to threadlib! See `Design of Threadlib <./docs/DesignOfThreadlib.md> `_
for help on how to hack your own thread as shown above and
`Creating Thread Specs <./docs/CreatingThreadSpecs.md> `_ for an introduction on how
to contribute entire thread classes to threadlib.
2019-03-24 18:21:13 +01:00
2019-04-08 10:46:43 +02:00
2022-01-05 18:34:06 +01:00
Still reading?
===========================
If you read this far, you're probably not here for the first time. If you
use and like threadlib, would you consider giving it a Github Star? (The
button is at the top of this website.)
2019-04-08 10:46:43 +02:00
Change Log
===========================
2022-04-03 19:05:16 +02:00
- 0.4: `PCO-1810 <https://www.isbt.com/assets/Threadspecs/pco1810.pdf> `__ .
tap module. Fixes bug with $fn in straight_thread(). Lists metric
threads under short designator and full designator.
2019-11-13 21:03:14 +01:00
- 0.3: Unified Inch Screw Threads (UNC, UNF, UNEF, 4-UN, 6-UN, 8-UN, 12-UN,
16-UN, 20-UN, 28-UN, and 32-UN. Fixed problem with PCO-1881-int. Fixed problem
2022-04-03 19:05:16 +02:00
with G-ext threads. New build system.
2020-08-04 22:36:37 +02:00
- 0.2: Metric threads, `PCO-1881 <https://www.bevtech.org/assets/Committees/Packaging-Technology/20/3784253-20.pdf> `__
2019-04-13 19:03:41 +02:00
- 0.1: Initial release supporting `BSP parallel thread <https://www.amesweb.info/Screws/British-Standard-Pipe-Parallel-Thread-BSPP.aspx> `__