- dir structure (docs, tests, design)

- renderings for README.rst
This commit is contained in:
Adrian Schlatter 2019-04-10 21:55:13 +02:00
parent 873a266abc
commit beee1f1921
8 changed files with 91 additions and 3 deletions

View File

@ -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:

19
docs/Makefile Normal file
View File

@ -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

15
docs/bolt.scad Normal file
View File

@ -0,0 +1,15 @@
/*
Create nice previews for documentation
:Author: Adrian Schlatter
:Date: 2019-04-10
:License: 3-Clause BSD. See LICENSE.
*/
use <threadlib/threadlib.scad>
type = "M6";
turns = 5;
higbee_arc = 45;
bolt(type, turns, higbee_arc=higbee_arc);

16
docs/nut.scad Normal file
View File

@ -0,0 +1,16 @@
/*
Create nice previews for documentation
:Author: Adrian Schlatter
:Date: 2019-04-10
:License: 3-Clause BSD. See LICENSE.
*/
use <threadlib/threadlib.scad>
type = "M12x0.5";
turns = 10;
Douter = 16;
higbee_arc = 45;
nut(type, turns, Douter, higbee_arc=higbee_arc);

26
docs/nutNbolt.scad Normal file
View File

@ -0,0 +1,26 @@
/*
Create nice previews for documentation
:Author: Adrian Schlatter
:Date: 2019-04-10
:License: 3-Clause BSD. See LICENSE.
*/
use <threadlib/threadlib.scad>
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]);
};