chiark / gitweb /
poster-tube-lid: before rework bayo polygon
[reprap-play.git] / poster-tube-lid.scad.pl
1 #!/usr/bin/perl -w
2 # -*- C -*-
3
4 use strict;
5 use autodie;
6
7 my $settings = <<'END';
8
9 main_dia = 71.2 + 0.50;
10 top_thick = 4;
11
12 main_cnr = 4.0;
13
14 rivet_posn = 6.0;
15 rivet_thick = 1.67;
16 rivet_width = 4.15 + 1.0;
17 rivet_tall = 5.51 + 0.49;
18
19 over_rivet_gap = 0.5;
20 side_rivet_gap = 1.5;
21
22 bayo_interf = 0.75;
23 bayo_behind = 3.5;
24 bayo_interf_width = 2.0;
25 bayo_interf_slope = 0.75;
26
27 seal_thick = 0.1;
28 seal_recess = [ 2.0, 2.0 ]; // recess depth, recess height
29
30 side_taper = 1.0;
31
32 bayo_above_gap = 1.0;
33
34 // calculated
35
36 side_height = rivet_posn + bayo_behind;
37 side_thick = rivet_tall + over_rivet_gap;
38
39 top_z = top_thick + seal_thick;
40
41 bayo_entry = bayo_behind / 3.0;
42 bayo_top_z = bayo_behind + rivet_thick + over_rivet_gap;
43 bayo_entry_ramp = bayo_entry + bayo_interf;
44
45 rivet_entry_width = rivet_width + side_rivet_gap;
46
47 $fs=0.5;
48 $fa=5;
49
50 // bayonet definition
51
52 bayo_polygon = [[ -bayo_entry -rivet_entry_width,   -5             ],
53                 [ -bayo_entry -rivet_entry_width,   0              ],
54                 [ -rivet_entry_width, bayo_entry     ],
55 //              [ bayo_entry,         bayo_top_z     ]
56                 [ -rivet_entry_width, bayo_top_z ],
57                 [  bayo_entry + 2*bayo_interf/bayo_interf_slope + bayo_interf_width,  bayo_behind             ],
58                 [  bayo_entry + bayo_interf/bayo_interf_slope + bayo_interf_width,  bayo_behind + bayo_interf             ],
59                 [  bayo_entry + bayo_interf/bayo_interf_slope,  bayo_behind + bayo_interf             ],
60                 [  bayo_entry,  bayo_behind             ],
61                 [  0,  bayo_behind - bayo_entry             ],
62                 [  0,             bayo_entry             ],
63                 [  bayo_entry,                      0             ],
64                 [  bayo_entry,                      -5             ],
65                   ];
66
67 END
68
69 my $mainbody = <<'END';
70
71 module MainProfile(){
72   main_cnr_pos = [ side_thick, top_z ] - [1,1]*main_cnr;
73   translate(main_cnr_pos){
74     intersection(){
75       difference(){
76         circle(r = main_cnr);
77         circle(r = main_cnr * 0.5);
78       }
79       square([10,10]);
80     }
81   }
82   polygon([[ -1,                    seal_thick        ],
83            [ -1,                    top_z             ],
84            [ main_cnr_pos[0],       top_z             ],
85            [ side_thick,            main_cnr_pos[1]   ],
86            [ side_thick,            -side_height      ],
87            [ side_taper,            -side_height      ],
88            [ 0,                     -rivet_posn       ],
89            [ 0,                     -(seal_recess[0] + seal_recess[1]) ],
90            [ seal_recess[0],        -(seal_recess[0]) ],
91            [ seal_recess[0],        seal_thick        ],
92            ]);
93 }
94
95 translate([-20,0]) MainProfile();
96
97 polygon(bayo_polygon);
98
99 END
100
101 print $settings, $mainbody or die $!;
102