diff --git a/README.rst b/README.rst index 592287c..6e357b1 100644 --- a/README.rst +++ b/README.rst @@ -1,3 +1,7 @@ +.. image:: docs/nutNbolt.png + :width: 20% + :alt: bolt-in-nut logo + threadlib +++++++++++++++++++++++++++ @@ -27,11 +31,15 @@ inside the ranges allowed by the norms. Usage =========================== -To create a bolt (without head) with 10 turns of M12 thread: +To create a bolt (without head) with 5 turns of M4 thread: .. code-block:: OpenSCAD - bolt("M12x0.5", turns=10); + bolt("M4", turns=5); + +.. image:: docs/bolt-M4.png + :width: 30% + :alt: Bolt with M4 thread A nut: @@ -39,8 +47,12 @@ A nut: nut("M12x0.5", turns=10, Douter=40); +.. image:: docs/nut-M12x0.5.png + :width: 30% + :alt: M12x0.5 nut + Note that for a nut you also have to specify an outer diameter. The inner -diameter is implicitly given by the thread designator ("G1" in this case). +diameter is implicitly given by the thread designator ("M12x0.5" in this case). If you only need the threads alone: diff --git a/autogenerate.awk b/design/autogenerate.awk similarity index 100% rename from autogenerate.awk rename to design/autogenerate.awk diff --git a/threads.xlsx b/design/threads.xlsx similarity index 100% rename from threads.xlsx rename to design/threads.xlsx diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..57bb209 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,19 @@ +os = /usr/local/bin/openscad +opts = +imgs = bolt-M4.png nut-M12x0.5.png nutNbolt.png + +.PHONY: all +all: $(imgs) + +bolt-M4.png: bolt.scad + $(os) $(opts) --D 'type="M4"' --camera=0.49,-0.26,1.55,74.6,0.0,78.9,20 --imgsize=2048,2048 -o $@ $< + +nut-M12x0.5.png: nut.scad + $(os) $(opts) --D 'type="M12x0.5"' --D 'turns=10' --D 'Douter=16' --camera=-2.2,1.2,1.8,66,0,73,52 --imgsize=2048,2048 --projection=ortho -o $@ $< + +nutNbolt.png: nutNbolt.scad + $(os) $(opts) --camera=-0.24,1.19,4.24,83,0,326.9,40.3 --imgsize=2048,2048 --projection=ortho -o $@ $< + +.PHONY: clean +clean: + rm *.png diff --git a/docs/bolt.scad b/docs/bolt.scad new file mode 100644 index 0000000..18d0a58 --- /dev/null +++ b/docs/bolt.scad @@ -0,0 +1,15 @@ +/* +Create nice previews for documentation + +:Author: Adrian Schlatter +:Date: 2019-04-10 +:License: 3-Clause BSD. See LICENSE. +*/ + +use + +type = "M6"; +turns = 5; +higbee_arc = 45; + +bolt(type, turns, higbee_arc=higbee_arc); diff --git a/docs/nut.scad b/docs/nut.scad new file mode 100644 index 0000000..253a40d --- /dev/null +++ b/docs/nut.scad @@ -0,0 +1,16 @@ +/* +Create nice previews for documentation + +:Author: Adrian Schlatter +:Date: 2019-04-10 +:License: 3-Clause BSD. See LICENSE. +*/ + +use + +type = "M12x0.5"; +turns = 10; +Douter = 16; +higbee_arc = 45; + +nut(type, turns, Douter, higbee_arc=higbee_arc); diff --git a/docs/nutNbolt.scad b/docs/nutNbolt.scad new file mode 100644 index 0000000..317aaf6 --- /dev/null +++ b/docs/nutNbolt.scad @@ -0,0 +1,26 @@ +/* +Create nice previews for documentation + +:Author: Adrian Schlatter +:Date: 2019-04-10 +:License: 3-Clause BSD. See LICENSE. +*/ + +use + +type = "M6"; +turns = 6; +higbee_arc = 45; + +P = thread_specs(str(type, "-ext"))[0]; +dz = (turns / 2 - 1/4) * P; +Douter = thread_specs(str(type, "-int"))[2] * 1.5; + +translate([0, 0, dz]) + rotate([0, 0, -90]) + bolt(type, turns, higbee_arc=higbee_arc); +intersection() { + nut(type, turns, Douter, higbee_arc=higbee_arc); + translate([-100, 0, 0]) + cube([200, 200, 200]); +}; \ No newline at end of file diff --git a/test.scad b/tests/test.scad similarity index 100% rename from test.scad rename to tests/test.scad