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 = 15;
25 test_len = eclip_each_len + eclip_each_every*(test_eclips-1);
31 eclip_inner_strt = eclip_outer_strt + eclip_inner_xstrt;
34 r1 = r0 + eclip_gap_rad;
35 r2 = r1 + eclip_prong_th;
36 r2e = r1 + eclip_base_epsilon;
38 ppxl = -(r0 / sqrt(2)) + (eclip_inner_strt / sqrt(2));
42 eclip_base_offset = r1;
43 eclip_wall_offset = -ppxl;
45 eclip_ra_offset = r2 - 0.1;
49 module EclipLPlanCore(alpha){
50 FArcSegment(0,0, r1,r2,
51 180-eclip_ult_angle, eclip_ult_angle-alpha +1);
57 rotate(-alpha) mirror([1,1]) square([r2e, 50]);
59 rotate(-alpha) mirror([1,1]) square([r2e, r2]);
65 module EclipRPlan(alpha, main_th){
68 translate([ppxl + main_th + rgap, -r2*2])
69 square([eclip_prong_th, r2*(2 + 1/sqrt(2))]);
70 translate([-r2, -r2e])
71 square([r2*3, eclip_base_epsilon + r2*4]);
75 module EclipLPlan(alpha){
76 rotate(alpha) EclipLPlanCore(alpha);
79 module EclipPPlan(main_th){
83 rotate(90-eclip_ult_angle) square([r0,r0]);
85 translate([-(r0+.1), -(r0+.1)])
86 square([(r0+.1) + main_th + ppxl, r2*2]);
88 translate([ppxl, 0]) square([main_th, r2]);
91 module TestBase(){ ////toplevel
92 translate([0,0, eclip_base_offset]){
93 for (i=[0 : 2: test_eclips-1]) {
94 translate([0, i*eclip_each_every])
96 linear_extrude(height=eclip_each_len)
97 EclipLPlan(test_alpha);
99 for (j=[1 : 2: test_eclips-2]) {
100 translate([0, j*eclip_each_every])
102 linear_extrude(height=eclip_each_len)
103 EclipRPlan(test_alpha, test_main_th);
106 translate([-r2, -eclip_each_len, -test_base_th]){
111 mirror([0,0,1]) Commitid_BestCount_M([r2*2, test_len]);
116 module TestProtr(){ ////toplevel
118 translate([0,0, test_main_th - eclip_wall_offset])
120 linear_extrude(height=test_len)
121 EclipPPlan(test_main_th);
122 mirror([0,0,1]) Commitid_BestCount_M([test_len, r2]);
126 module TestRAProtr(){ ////toplevel
127 rotate([-90,0,0]) TestProtr();
129 translate([-test_len,
131 -(eclip_ra_offset + test_base_th)])
137 module TestPlanDemo(){
138 color("red") EclipLPlan(test_alpha);
139 color("blue") rotate(test_alpha) EclipPPlan(test_main_th);
140 color("green") EclipRPlan(test_alpha, test_main_th);
143 beta = asin(front_setback / front_height);
145 uf = [-sin(beta), cos(beta)];
146 ur = [-uf[0], uf[1]];
149 pq = pp + uf*front_height + ur*eclip_ra_offset;
150 pr = [ pq[0] - eclip_base_offset + eclip_wall_offset, 0 ];
153 polygon([pq, pp, pr]);
156 thicks = [ 2, 2, 2 ];
158 //side_origins = [ pp,
160 module Joins(alpha, objnum, objnum_f, objnum_m) {
161 echo("Joins",objnum, objnum_f, objnum_m);
162 thm = thicks[objnum_m];
163 if (objnum==objnum_f) {
165 EclipRPlan(alpha, thm);
167 if (objnum==objnum_m)
172 module Object(objnum){
173 echo("Object",objnum);
174 translate(pp) Joins(beta, objnum, 0,1);
175 translate(pr) mirror([1,0,0]) Joins(0, objnum, 0,2);
176 translate(pq) rotate([0,0,-90]) Joins(beta, objnum, 2,1);
179 module Base(){ Object(0); }
180 module Front(){ Object(1); }
181 module Back(){ Object(2); }