chiark / gitweb /
air-hockey-puck: wip
[reprap-play.git] / thread-internal-test.scad
1 // -*- C -*-
2
3 include <threads.scad>
4 include <utils.scad>
5
6 // https://en.wikipedia.org/wiki/ISO_metric_screw_thread
7
8 // M6
9 thread_nom = 4;
10 thread_pitch = 0.70;
11 thread_act = thread_nom + 0.375;
12 head_size = 10;
13
14 thread_len = 12.5;
15 base_th = 1.5;
16 base_sz = [40, head_size];
17
18 $test = false;
19
20 // calculated
21
22 base_dia = head_size / cos(30);
23
24 module ScrewThread(){
25   translate([0, 0, -0.1])
26     render()
27     metric_thread(diameter=thread_act, pitch=thread_pitch,
28                   leadin=1, internal=true,
29                   test=$test, length=thread_len + 0.1);
30 }
31
32 module TestThread(){
33   difference(){
34     union(){
35       linextr(-base_th, 0)
36         square(center=true, base_sz);
37
38       linextr(-base_th, thread_len - 0.1)
39         circle(r= base_dia/2, $fn=6);
40     }
41
42     ScrewThread();
43   }
44 }
45
46 TestThread();