-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
266 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Copyright 2019 Adrian Schlatter | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors | ||
may be used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,101 @@ | ||
PET-Bottle Waterrocket Fins | ||
threadlib | ||
+++++++++++++++++++++++++++ | ||
|
||
This is a CAD-model of fins intended to be screwed onto a PET bottle to create a | ||
water rocket. To create the rocket, you need: | ||
threadlib is a library of standard threads for OpenSCAD. 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. | ||
|
||
- bottle with PCO-1881 threading (e.g. a 1.5-l Coke bottle) | ||
- this part | ||
- Gardena tap connector G 1" | ||
- launcher | ||
In contrast to other thread libraries, 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. | ||
|
||
(+ water + pressurized air). | ||
Creating a thread is as simple as | ||
|
||
.. code-block:: OpenSCAD | ||
thread("G1/2-ext", turns=10, higbee_arc=20); | ||
to create a British Standard Pipe parallel external thread. Furthermore, | ||
threadlib allows for production tolerances by choosing thread dimensions well | ||
inside the ranges allowed by the norms. | ||
|
||
|
||
Usage | ||
=========================== | ||
|
||
To create a bolt (without head) with 10 turns of G1-inch thread: | ||
|
||
.. code-block:: OpenSCAD | ||
bolt("G1", turns=10); | ||
A nut: | ||
|
||
.. code-block:: OpenSCAD | ||
nut("G1", turns=10, Douter=40); | ||
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). | ||
|
||
If you only need the threads alone: | ||
|
||
.. code-block:: OpenSCAD | ||
thread("G2 1/2-ext", turns=5); | ||
Then, add the support you want. In the simplest case, a cylinder (which is what | ||
nut(...) uses): | ||
|
||
.. code-block:: OpenSCAD | ||
specs = thread_specs("G2 1/2-ext"); | ||
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); | ||
Here, we have used the function thread_specs(...) to look up the threads | ||
specifications - including the recommended diameter of the support structure. | ||
|
||
|
||
List of supported threads | ||
=========================== | ||
|
||
Currently, threadlib knows these threads: | ||
|
||
- British Standard Pipe Parallel Threadss G1/16 to G6 | ||
|
||
|
||
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 | ||
for addition to threadlib! | ||
|
||
|
||
Change Log | ||
=========================== | ||
|
||
- 0.1: Initial release supporting BSP parallel thread | ||
|
||
Use at your own risk. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
BEGIN { print "/* This script is auto-generated - do not edit" | ||
print " :License: 3-clause BSD. See LICENSE. */" | ||
printf "\nTHREAD_TABLE = [" } | ||
/^G/ { print "[\"" $1 "\", [" $2 ", " $3 ", " $4 ", [[" $5 ", " $6 "], [" $7 ", " $8 "], [" $9 ", " $10 "], [" $11 ", " $12 "]]]],"} | ||
END { print "];" } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Test and demonstrate thread library | ||
:Author: Adrian Schlatter | ||
:Date: 2019-04-07 | ||
:License: 3-Clause BSD. See LICENSE. | ||
*/ | ||
|
||
use <threadlib/threadlib.scad> | ||
|
||
echo ("threadlib version: ", __THREADLIB_VERSION()); | ||
|
||
type = "G1"; | ||
turns = 5; | ||
Douter = thread_specs(str(type, "-int"))[2] * 1.2; | ||
|
||
intersection() { | ||
color("Green") | ||
translate([-100, 0, -100]) | ||
cube(200, 200, 200); | ||
union() { | ||
bolt(type, turns); | ||
nut(type, turns, Douter); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
threadlib | ||
+++++++++ | ||
Create threads easily. | ||
:Author: Adrian Schlatter | ||
:Date: 2019-04-07 | ||
:License: 3-Clause BSD. See LICENSE. | ||
*/ | ||
|
||
function __THREADLIB_VERSION() = 0.1; | ||
|
||
use <thread_profile.scad> | ||
include <THREAD_TABLE.scad> | ||
|
||
function thread_specs(designator, table=THREAD_TABLE) = | ||
/* Returns thread specs of thread-type 'designator' as a vector of | ||
[pitch, Rrotation, Dsupport, section_profile] */ | ||
|
||
table[search([designator], table, num_returns_per_match=1, | ||
index_col_num=0)[0]][1]; | ||
|
||
module thread(designator, turns, higbee_arc=20, fn=120, table=THREAD_TABLE) | ||
{ | ||
specs = thread_specs(designator, table=table); | ||
P = specs[0]; Rrotation = specs[1]; section_profile = specs[3]; | ||
straight_thread( | ||
section_profile=section_profile, | ||
higbee_arc=higbee_arc, | ||
r=Rrotation, | ||
turns=turns, | ||
pitch=P); | ||
} | ||
|
||
module bolt(designator, turns, higbee_arc=20, fn=120, table=THREAD_TABLE) { | ||
union() { | ||
specs = thread_specs(str(designator, "-ext"), table=table); | ||
P = specs[0]; Dsupport = specs[2]; | ||
H = (turns + 1) * P; | ||
thread(str(designator, "-ext"), turns=turns, higbee_arc=higbee_arc, fn=fn, table=table); | ||
translate([0, 0, -P / 2]) | ||
cylinder(h=H, d=Dsupport, $fn=fn); | ||
}; | ||
}; | ||
|
||
module nut(designator, turns, Douter, higbee_arc=20, fn=120, table=THREAD_TABLE) { | ||
union() { | ||
specs = thread_specs(str(designator, "-int"), table=table); | ||
P = specs[0]; Dsupport = specs[2]; | ||
H = (turns + 1) * P; | ||
rotate(180) | ||
thread(str(designator, "-int"), turns=turns, higbee_arc=higbee_arc, fn=fn, table=table); | ||
|
||
translate([0, 0, -P / 2]) | ||
difference() { | ||
cylinder(h=H, d=Douter, $fn=fn); | ||
translate([0, 0, -0.1]) | ||
cylinder(h=H+0.2, d=Dsupport, $fn=fn); | ||
}; | ||
}; | ||
}; |
Binary file not shown.