Giter Site home page Giter Site logo

adrianschlatter / threadlib Goto Github PK

View Code? Open in Web Editor NEW
316.0 18.0 30.0 4.14 MB

thread library for OpenSCAD

License: BSD 3-Clause "New" or "Revised" License

OpenSCAD 94.28% Awk 5.34% Makefile 0.38%
openscad thread library metric bsp pco-1881 unc unf unef 4-un

threadlib's Introduction

bolt-in-nut logo

threadlib is a library of standard threads for OpenSCAD. It is based on Helges excellent threadprofile.scad to create nice threads with lead-in / lead-out tapers. Check out his article on generating nice threads on Hackaday.

In contrast to other thread libraries such as openscad-threads, yet another thread library, threads for screws and nuts V1, and threading.scad, 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.

Creating a thread is as simple as

use <threadlib/threadlib.scad>
thread("G1/2-ext", turns=10);

bolt-in-nut logo

to create a British Standard Pipe parallel external thread.

Why you may want to use threadlib

  • really easy to use
  • creates nice threads
  • configurable higbee arc
  • creates working threads (clearances are left for production tolerances)
  • flexible:
    • choose the $fn you need to fit the rest of your design
    • let threadlib tell you the thread specs so you can do with them what you want
  • extensible: Add your own threads
  • 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.

Installation

Prerequisits:

Save all of these into your OpenSCAD library folder

threadlib:

Clone threadlib into the folder 'threadlib' inside your OpenSCAD library folder

Your libraries folder should now look similar to this:

libraries
├── list-comprehension-demos/
├── scad-utils/
├── thread_profile.scad
└── threadlib/

Usage

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!

To create a bolt (without head) with 5 turns of M4 thread:

bolt("M4", turns=5, higbee_arc=30);

Bolt with M4 thread

See these nice lead-in / lead-out tapers? Try a nut (this time using the default argument for higbee_arc):

nut("M12x0.5", turns=10, Douter=16);

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 ("M12x0.5" in this case). You can set the number of sides for the nut! So you can make hex nuts:

nut("M30", turns=4, Douter=46, nut_sides=6); 

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:

tap("G1/2", turns=5);

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:

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.

If you only need the threads alone:

thread("G1/2-ext", turns=5);

G1/2 external thread

(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):

specs = thread_specs("G1/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);

G1/2 bolt

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:

  • Metric threads (coarse, fine, and super-fine pitches) M0.25 to M600.
  • Unified Inch Screw Threads (UNC, UNF, UNEF, 4-UN, 6-UN, 8-UN, 12-UN, 16-UN, 20-UN, 28-UN, and 32-UN). All threads are class 2 threads.
  • BSP parallel thread G1/16 to G6. All threads are class A threads.
  • PCO-1881 and PCO-1810 (PET-bottle thread)
  • Royal Microscopical Society's Thread (RMS)

Extensibility

Don't find some of the threads you need for your project? Don't worry: You can add your own:

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! See How to contribute for help on how to become a contributor.

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.)

Contributing

Did you find a bug and would like to report it? Or maybe you've fixed it already or want to help fixing it? That's great! Please read [CONTRIBUTING](./CONTRIBUTING.md) to learn how to proceed.

To help ascertain that contributing to this project is a pleasant experience, we have established a [code of conduct](./CODE_OF_CONDUCT.md). You can expect everyone to adhere to it, just make sure you do as well.

Change Log

  • 0.5: Royal Microscopical Society's thread (RMS)
  • 0.4: PCO-1810. tap module. Fixes bug with $fn in straight_thread(). Lists metric threads under short designator and full designator.
  • 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 with G-ext threads. New build system.
  • 0.2: Metric threads, PCO-1881
  • 0.1: Initial release supporting BSP parallel thread

threadlib's People

Contributors

adrianschlatter avatar atharr avatar bvarner avatar ccrome avatar jbruce12000 avatar linkian209 avatar twbaumann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

threadlib's Issues

Example M4 profile in DesignOfThreadlib.md gives unexpected results (winding order)

The example M4 thread profile in docs/DesignOfThreadlib.md appears to give incorrect results (invalid faces) due to winding order. This confused me for a while when doing a difference() and getting weird output.

Suggested fix:

Change

["M4-int", [0.7, -2.1095, 4.1095,
            [
             [0, 0.3465], 
             [0, -0.3465], 
             [0.43304671, -0.09648036], 
             [0.43304671, 0.09648036]
            ]]]

to

["M4-int", [0.7, -2.1095, 4.1095,
            [
             [0, -0.3465], 
             [0, 0.3465], 
             [0.43304671, 0.09648036], 
             [0.43304671, -0.09648036]
            ]]]

PCO-1881-int threads too thick

The internal threads for PCO-1881 seem to be too thick.
https://i.imgur.com/SrbsaqO.jpg
It's a bit hard to see due to the material but compared to an actual PET bottle, the threads appear much thicker. A PET bottle lid will fit easily on an external thread made by threadlib but the lid I printed will lock up after less than half a turn on both the printed thread and a PET bottle.

Edit: screenshot from OpenSCAD: https://i.imgur.com/1YBdIPJ.jpg

Collision Test

Find a way to test for collisions between nut and corresponding bolt.

Idea

Render a nut and bolt combination (example: tests/test.scad). Use “number of volumes” that OpenSCAD shows after rendering:

  • 3 volumes: PASS (1 volume nut, 1 volume bolt, 1 volume surroundings)
  • 2 volumes: FAIL (collision)
  • 1 volume: FAIL (something went terribly wrong)
  • More than 3 volumes: FAIL (probably thread did not overlap bolt / nut and remained a separate part)

Problem

Find a way to make OpenSCAD tell us the number of volumes in a programmatic way (we don’t want to open OpenSCAD and hit F6 for hundreds of threads).

Error creating a thread?/

I have figured out how to get the data for a thread profile and am trying to get it to work with a known-good example. But the following code fails, for reasons I cannot understand. Can you suggest what I am doing wrong?
`use <threadlib/threadlib.scad>

echo ("threadlib version: ", __THREADLIB_VERSION());

MYTHREADTABLE=[["test1-ext",[0.0750, 0.0700,0.1500,[[0,-0.0343],[0, 0.0343],[0.0513, 0.0047],[0.0513,-0.0047]]]],
["test1-int",[0.0750,-0.1358,0.2655,[[0, 0.0371],[0,-0.0371],[0.0408,-0.0136],[0.0408, 0.0136]]]],
];
type = "test1";
turns = 5;
Douter = thread_specs(str(type, "-int"), table=MYTHREADTABLE)[2] * 1.2;

echo(thread_specs(str(type, "-ext")));`

The error message in the console is:
Parsing design (AST generation)...
[...]
ECHO: "threadlib version: ", 0.3
[ERROR: Assertion '!is_undef(specs)' failed: "Designator: 'test1-ext' not found" in file threadlib.scad, line 25]
[TRACE: called by 'thread_specs' in file , line 12]
[TRACE: called by 'echo' in file , line 12]
Compiling design (CSG Products generation)...

Thanks in advance for any help.
mconsidine

FreeCAD Compatibility

threadlib models do not seem to open in FreeCAD.

FreeCAD's OpenSCAD reader does not support all OpenSCAD functions. My guess is threadib is using one of those unsupported functions.

If it were easy to work around, I find the FreeCAD interface very useful for things like generating .step models.

thread() produces error

This works:
use <threadlib/threadlib.scad>
thread("G1/2-ext", turns=10);

This is fine, too:
use <threadlib/threadlib.scad>
bolt("M5", turns=10);

But this produces an error:
use <threadlib/threadlib.scad>
thread("M5", turns=10);

DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.
Compiling design (CSG Products generation)...
ERROR: Unable to convert point at index 1 to a vec3 of numbers, in file .local/share/OpenSCAD/libraries/list-comprehension-demos/skin.scad, line 32
WARNING: PolySet has degenerate polygons
Geometries in cache: 3
Geometry cache size in bytes: 709224
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
Compile and preview finished.
Total rendering time: 0 hours, 0 minutes, 2 seconds

(tested on OpenScad 2019.05 and 2015.03-3)

PCO-1881 for PET bottle threads not producing workable result

My code is crazy simple. I have used your library for wine cap threads which worked great. But every attempt I have made to print internal PCO-1881 threads has resulted in something that simply will not thread onto a bottle. I am at version 0.3. Code looks like:

nut("PCO-1881", turns=2, higbee_arc=45, Douter=32);

Printer is a Lulzbot Mini 2. Have printed PCO-1881 bottle caps using Thingiverse STLs that seem decent. Is there some trick to making this particular internal thread work?

Developer Docs

Add development-related docs:

  • threads.xlsx => THREAD_TABLE.csv => autogenerate.awk => test_table.awk
  • structure of THREAD_TABLE.scad
  • relation to thread module
  • how tests work

PCO-1881-int: Dminor too large

Current PCO-1881 internal thread fits its external counterpart but it does not fit an actual PET bottle: The PET-bottle neck has a "lip" at its end with a somewhat larger diameter. Dminor of the internal thread must be made large enough to allow for this lip.

edit: the title is wrong, of course: Dminor is currently too small.

struggling to get a G1/2 nut fit on a G1/2 bolt

Hi,

Thanks for this exciting lib !

I've 3d printed (with an ender 3) some bolts with G1/2 threading using this lib and got good results, as I can fit standard gardening connectors.

Then I tried to print a nut as shown below that would fil but the result is way too tight.

use <threadlib/threadlib.scad>

difference() {
  cylinder(h=5, d=28, $fn=6, center=true);
  translate([0,0,-3]) tap("G1/2", turns=6);
}

Given the bolt is printed like this, am I missing something or should the solution maybe reside in better printer settings ?

use <threadlib/threadlib.scad>

turns = 7;
thread="G1/2-ext";

thread(thread, turns=turns);

specs = thread_specs(thread);

P = specs[0]; Rrot = specs[1]; Dsupport = specs[2];
section_profile = specs[3];
H = (turns + 1) * P;

difference() {
translate([0, 0, -P / 2])
    cylinder(h=H, d=Dsupport, $fn=120); /*  */
translate([0, 0, -P / 2 -1])
    cylinder(h=H+10, d=Dsupport-3, $fn=120); /*  */
}

WARNING: Ignoring unknown module 'straight_thread', in file threadlib/threadlib.scad, line 31.

Running the example:

use <threadlib/threadlib.scad>
thread("G1/2-ext", turns=10);

Generates the following warning and does not render anything:

WARNING: Ignoring unknown module 'straight_thread', in file threadlib/threadlib.scad, line 31.

(OSX, 10.11, OpenScad 2019.05)
(Note: on OSX the Documents/OpenScad/libraries folder is simply ignored and you have to put libs/modules etc INSIDE the .app package, in : Contents/Resources/libraries)

How do I make a 1/4" lag screw?

Greetings! I am trying to make a hole for a 1/4 inch lag screw which is basically just a 1/4 inch wood screw. I think these are AMSE threads?

Any idea how to find the 1/4 lag screw specs and translate to threads lib?

Thanks!

Internal thread vs 'difference'

Putting some threads on my model.

Are the 'internal threads (ie Mx-int) equivalent to using 'difference' with a bolt or external thread or is there some tolerance built into the internal threads?

Improved Profile illustration

While trying to create a thread profile, I had a hard with the visualization in DesignOfThreadLib.md. I'm a Sysadmin/IT guy but do write tech docs - 3d printing is a hobby, and "thread specifications" has not really been dinner conversation ( to be clear, it still isn't )

I'll add a pull request of the docs I added, I'm looking for early feedback, as I still have changes to make ( eg: crop the png images, confirm a few assumptions ). I also made assumption on certain things - but have not verified in the code ( "-int", "-ext" always appended ? )

DesignOfThreadlib example

I’ve tried threadlib/docs/DesignOfThreadlib.md example:

use <threadlib/threadlib.scad>

MY_THREAD_TABLE = ["M4-int", [0.7, -2.1095, 4.1095,
            [
             [0, 0.3465], 
             [0, -0.3465], 
             [0.43304671, -0.09648036], 
             [0.43304671, 0.09648036]
            ]]];

thread("M4-int", turns=1, table=MY_THREAD_TABLE);

Got a lot of warnings and nothing is created:

…
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined + undefined) in file skin.scad, line 49 
WARNING: undefined operation (undefined - undefined) in file skin.scad, line 71 
WARNING: undefined operation (undefined - undefined) in file skin.scad, line 71 
WARNING: undefined operation (undefined + number) in file skin.scad, line 42 
WARNING: undefined operation (undefined - number) in file skin.scad, line 47 
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined + undefined) in file skin.scad, line 49 
WARNING: undefined operation (undefined - undefined) in file skin.scad, line 71 
WARNING: undefined operation (undefined - undefined) in file skin.scad, line 71 
WARNING: undefined operation (undefined + number) in file skin.scad, line 42 
WARNING: undefined operation (undefined - number) in file skin.scad, line 47 
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined * number) in file skin.scad, line 49 
WARNING: undefined operation (undefined + undefined) in file skin.scad, line 49 
DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated in file skin.scad, line 18 
DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated in file skin.scad, line 29 
Compiling design (CSG Products generation)...
WARNING: Point index 18446744073709551615 is out of bounds (from faces[0][0]) in file list-comprehension-demos/skin.scad, line 32 
ERROR: Unable to convert points[0] = undef to a vec3 of numbers in file list-comprehension-demos/skin.scad, line 32 
WARNING: PolySet has degenerate polygons 
Geometries in cache: 130
Geometry cache size in bytes: 16678832
CGAL Polyhedrons in cache: 15
CGAL cache size in bytes: 94345312
Compiling design (CSG Products normalization)...
Normalized tree has 1 elements!
Compile and preview finished.
Total rendering time: 0:00:31.795

Nothing is created with nut or bolt either

bolt:

Parsing design (AST generation)...
Saved backup file: /home/carre/.local/share/OpenSCAD/backups/unsaved-backup-cEeFxVfs.scad
Compiling design (CSG Tree generation)...
ERROR: Assertion '!is_undef(specs)' failed: "Designator: 'M4-int-ext' not found" in file threadlib.scad, line 25 
TRACE: called by 'thread_specs' in file threadlib.scad, line 42 
TRACE: called by 'union' in file threadlib.scad, line 41 
TRACE: called by 'bolt' in file libraries, line 11 
Compiling design (CSG Products generation)...
Geometries in cache: 131
Geometry cache size in bytes: 16678984
CGAL Polyhedrons in cache: 15
CGAL cache size in bytes: 94345312
Compiling design (CSG Products normalization)...
Normalized tree has 1 elements!
Compile and preview finished.
Total rendering time: 0:00:00.116

I’m trying to understand this documentation to create my own thread (diameter 21.4, pitch 907)

Eliminate threads.xlsx

It is hard to collaborate on an Excel file (mergeability issues) => store original thread infos as CSV instead and implement formulas to calculate THREAD_TABLE.csv in awk. To add a new thread type => contribute threadXY.csv + threadXY.awk + change Makefile.

specifying bolt by length

hello, modified a bit the bolt module to be able to specify the bolt by length:
module bolt(designator, turns = 5, higbee_arc=20, fn=120, table=THREAD_TABLE, h = -1)
{
name = str(sanitize(designator), "-ext");
union() {
specs = thread_specs(name, table=table);
P = specs[0]; Dsupport = specs[2];
H = (h >0)? h: (turns + 1) * P;
thread(name, turns=(h >0)?H/P-1:turns, higbee_arc=higbee_arc, fn=fn, table=table);
translate([0, 0, -P / 2])
cylinder(h=H, d=Dsupport, $fn=fn);
};
};

its in my tree... don't know if its any use to make pull requests?

Refactor nut to allow hex nut

Currently you can modify

cylinder(h=H, d=Douter, $fn=fn);
to set $fn=6 to obtain a hex nut:

image

However, you don't want to pass fn=6 into the nut module otherwise the resolution of the thread will be affected.

Can we refactor the nut module to allow for hex nuts?

US "hardware store" threads

I'm having some difficulties identifying which of the entries in the very large (and excellent) table refer to which specific thread in which country.

  1. Can I suggest to add a paragraph in the README that explains how the "designator" naming convention maps to descriptions one might be able to find with a web search. Perhaps with links to corresponding Wikipedia entries.

  2. Specifically, I'm attempting to find a thread that matches what I get when I go to a US hardware store and buy 1/2in PVC pipes. e.g. this part. The README says the library covers UNC, which I believe this is (?), but I cannot find a suitable entry. This page seems to have the correct dimensions, but nothing in the tables seems to match this.

creating custom thread....

Hello,
i am definitely no thread expert :( i tryed googling the terms used to specify the thread, but the only part that speaks to me is the pitch, the rest remains a vast mystery...

so i am quite stuck about how to fill in the data for my thread...
i tryed to copy over the data from a M48 thread, and tryed to fiddle around with it, but since each try uses up about 1.5min to compile, its hard to see what changes....
as soon as i change something randomly, the thread disappears... :( so having a plan on what to do would be nice...

i try to get a screw with an outer diameter of 50mm, an inner diameter of 40, a pitch of 8mm, and will need the associated nut so what data changes/is impacted/how ?

thanks in advance!

Multiple thread starts

threadlib currently does not support multiple thread starts but it would be nice to add the capability. This would enable the addition of PCF-33P-1 thread (#26, #27). Most probably there are other thread types with multiple starts although it does not seem to be common.

ToDos

  • extend THREAD_TABLE by a column N_THREADSTARTS or similar
  • modify module thread() with multiple-thread-start capability
  • decide on meaning of "turns" parameter: number of pitches or number of leads? Given the name, leads is probably more intuitive
  • existing personal THREAD_TABLEs ("table" argument) are endangered to become incompatible (they are missing the new column):
    • modify function thread_specs to add this column if it is not there (defaulting to 1)
    • preferably, the function also gives a deprecation warning
    • risk: Can these be done inside an OpenSCAD function?
  • build scripts have to be modified (simple)
  • tests have to be adapted (maybe restricted to parse() inside test_table.awk)
  • documentation: DesignOfThreadlib.md

Thred for filter

Hello Adrian, I am new in OpenScad. We are trying designing a reduction for particle filter against coronavirus. Can you, please, add a thread Rd 40x1/7" inner to your library? Thank you.

Invalid thread name => unhelpful error message

Hello
i hade to make an adapter for a pump, and that pump uses instead of metric threading british non-SI metrics :(
firing up your lib, i added a nut with 1/2" metric, and it exploded in my face....
doing just the thread was fine, but nut&bolt werent't ...
so i nagged the mailing list and Michael foudn out that there was no sanity check for those f...g imperial metrics, and that a fixed -int/-ext were added to the metrics....

i added those sanitize functions to make sure there is no double -int, or -int-ext on the name, and an assert to break the compilation with a n error message pointing to the source of the problem....
so, apart for my fervent, and unfortnately useless, wish that all those non-SI metrics could go down some very distant hell of their own, all my branch does is some parameter checking and correcting (if needed)...

BTW happy to see you are still alive and kicking :D

Tech-Docs BSPP

How I arrived at thread specs for BSP-parallel threads.

UMC-2B

I am trying to use the library to implement IEEE 1785.2a flange. UNC-2B do not appear in the thrads table. Is it possible to add?
image

Duplicates in THREAD_TABLE.scad

Just wanted to mention a lot of the lines (924 to be exact) in THREAD_TABLE.scad are duplicates. This brings the line count from 2,825 to 1,901.

Can't open library 'thread_profile.scad'.

Tring out "threadlib\tests\test.scad"

Getting the following warnings;
Can't open library 'thread_profile.scad'.
Ignoring unknown module 'straight_thread'

I can't find thread_profile.scad at all.

OpenSCAD Version: 2023.03.10 (git dbb29a268)
System information: Windows(TM) 10.0 SP 0.0 NTW 1 MSDN 724833 4 CPUs 15.88 GB RAM

Missing UIS Threads

32-UN-7/8, -15/16, and -1 are missing from design/UIS_thread.csv and therefore also from THREAD_TABLE.scad.

M12 nut and M12 bolt do not fit

Hi ! Thanks for this fantastic and easy to use library ! I have just one problem, when i print a M12 nut and a M12 bolt they do not fit, the nut only screws on the bolt for one turn and then seizes up.
I presume i need to add some more clearance ? How is that done properly ?

Thanks,
Cheers,
KK

Explanation of [pitch, Rrotation, Dsupport, section_profile]

I need threads for the E26 lamp base which is widely used in 120V countries. I also need a 1/4 NPS thread.

I'd be more than happy to put together PRs for them as soon as I grok the specification variables used by threadlib and thread_profile.

Could someone who understands the meaning of these structures jot down a schematic on a paper napkin? ☺️

It would probably be helpful to many people willing to contribute more thread standards.

Still a noob on the subject but I've read many papers and it's a shame to waste time figuring out these parameters through trial and error.

fn needs to be passed in call to straight_thread()

In this call https://github.com/adrianschlatter/threadlib/blob/develop/threadlib.scad#L31
You need to pass the fn= parameter to straight_thread() or the thread is not actually generated with the desired number of facets.
This is readily apparent when using low facet counts, $fn=5 for example (yes it makes a low-poly impossible bolt, but it looks cool sitting on your desk)

Also after fixing this, I note that with odd number of facets the nut() and tap() functions have the threads offset by one half of a facet. I fixed this by adding a rotate([0,0,360/fn/2]) to the thread() calls in those functions, but perhaps it needs to be rotated in the opposite direction? I am not sure that it matters.

test case for visualizing -
bolt("M4", turns=5, fn=5);
nut("M4", turns=5, Douter=6, fn=5);

Tool to create thread specs??

Hi,
I'm new to this library, so apologies if I have overlooked this answer.

I'm wondering if there is a bit of code already written to take specs for a custom thread (e.g. M28.5x0.6) and convert it to a table that can be used "on the fly", that is, without rebuilding tables that ship?

I used the calculator found here
https://www.omnicalculator.com/construction/thread
to get virtually all the data in the tables listed for metric data (18 of the 19 columns). Yet it looks like that info is used to calc an OpenSCAD-friendly table. I'm trying to figure out how to do this as a one-off.

Thoughts?
UPDATE: I have since found a thread calculator
https://www.omnicalculator.com/construction/thread?c=USD&v=TolGradeExt:1!!l,TolPosExt:15!!l,TolGradeInt:1!!l,TolPosInt:0!!l,extIntOption:3,TolGradePDiaExt:1!!l,TolGradePDiaInt:1.32!!l,P:0.6!!l,d:28.5!mm
that gives me what I need. Inputted into a spreadsheet, I can then kick out the table needed in OpenSCAD. Although at the moment I'm having issues defining my own thread ...

TIA,
mconsidine
``
M28.5x0.6 is used for astronomy filters, fwiw, and here's the info I calculated, in case anyone is interested
ISO Metric profile External (bolt thread) Internal (nut thread) Basic mm
Major Dia d=D Pitch Dia d2=D2 Minor Dia d3 Minor Dia D1 Pitch Dia d2=D2 Major Dia d=D
Size Designation Simple Desig. Pitch Class max min max min max min Class min max min max min max Tap Drill
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

28.5 M28.5x0.6 M28.5x0.6 0.6 6g 28.48 28.354 28.09 27.986 27.87 27.66 6H 27.85 28.01 28.11 28.246 28.5 28.65`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.