3 include <commitid.scad>
11 eclip_prong_th = 2.25;
12 eclip_outer_strt = 0.5;
13 eclip_inner_xstrt = 0.5;
16 eclip_base_epsilon = 0.5;
19 eclip_each_every = 29;
25 test_len = eclip_each_len + eclip_each_every*(test_eclips-1);
26 echo("test_len",test_len);
32 eclip_inner_strt = eclip_outer_strt + eclip_inner_xstrt;
35 r1 = r0 + eclip_gap_rad;
36 r2 = r1 + eclip_prong_th;
37 r2e = r1 + eclip_base_epsilon;
39 ppxl = -(r0 / sqrt(2)) + (eclip_inner_strt / sqrt(2));
43 eclip_base_offset = r1;
44 eclip_wall_offset = -ppxl;
46 eclip_ra_offset = r2 - 0.1;
50 module EclipLPlanCore(alpha){
51 FArcSegment(0,0, r1,r2,
52 180-eclip_ult_angle, eclip_ult_angle-alpha +1);
58 rotate(-alpha) mirror([1,1]) square([r2e, 50]);
60 rotate(-alpha) mirror([1,1]) square([r2e, r2]);
66 module EclipRPlan(alpha, main_th){
69 translate([ppxl + main_th + rgap, -r2*2])
70 square([eclip_prong_th, r2*(2 + 1/sqrt(2))]);
71 translate([-r2, -r2e])
72 square([r2*3, eclip_base_epsilon + r2*4]);
76 module EclipLPlan(alpha){
77 rotate(alpha) EclipLPlanCore(alpha);
80 module EclipPPlan(main_th){
84 rotate(90-eclip_ult_angle) square([r0,r0]);
86 translate([-(r0+.1), -(r0+.1)])
87 square([(r0+.1) + main_th + ppxl, r2*2]);
89 translate([ppxl, 0]) square([main_th, r2]);
92 module TestBase(){ ////toplevel
93 translate([0,0, eclip_base_offset]){
94 for (i=[1 : 2: test_eclips-2]) {
95 translate([0, i*eclip_each_every])
97 linear_extrude(height=eclip_each_len)
98 EclipLPlan(test_alpha);
100 for (j=[0 : 2: test_eclips-1]) {
101 translate([0, j*eclip_each_every])
103 linear_extrude(height=eclip_each_len)
104 EclipRPlan(test_alpha, test_main_th);
107 translate([-r2, -eclip_each_len, -test_base_th]){
112 mirror([0,0,1]) Commitid_BestCount_M([r2*2, test_len]);
117 module TestProtr(){ ////toplevel
119 translate([0,0, test_main_th - eclip_wall_offset])
121 linear_extrude(height=test_len)
122 EclipPPlan(test_main_th);
123 mirror([0,0,1]) Commitid_BestCount_M([test_len, r2]);
127 module TestRAProtr(){ ////toplevel
128 rotate([-90,0,0]) TestProtr();
130 translate([-test_len,
132 -(eclip_ra_offset + test_base_th)])
138 module TestPlanDemo(){
139 color("red") EclipLPlan(test_alpha);
140 color("blue") rotate(test_alpha) EclipPPlan(test_main_th);
141 color("green") EclipRPlan(test_alpha, test_main_th);
144 beta = asin(front_setback / front_height);
146 uf = [-sin(beta), cos(beta)];
147 ur = [-uf[0], uf[1]];
150 pq = pp + uf*front_height + ur*eclip_ra_offset;
151 pr = [ pq[0] - eclip_base_offset + eclip_wall_offset, 0 ];
154 polygon([pq, pp, pr]);
157 thicks = [ 2, 2, 2 ];
159 module Joins(alpha, objnum, objnum_f, objnum_m) {
160 echo("Joins",objnum, objnum_f, objnum_m);
161 thm = thicks[objnum_m];
162 if (objnum==objnum_f) {
164 EclipRPlan(alpha, thm);
166 if (objnum==objnum_m)
171 module ObjectJoins(objnum){
172 echo("Object",objnum);
173 translate(pp) Joins(beta, objnum, 0,1);
174 translate(pr) mirror([1,0,0]) Joins(0, objnum, 0,2);
175 translate(pq) rotate([0,0,-90]) Joins(beta, objnum, 2,1);