3 include <commitid.scad>
14 eclip_inner_rad = 2.5;
16 eclip_prong_th = 2.25;
17 eclip_outer_strt = 0.5;
18 eclip_inner_xstrt = 0.5;
21 eclip_base_epsilon = 0.5;
24 eclip_each_every = 29;
30 test_len = eclip_each_len + eclip_each_every*(test_eclips-1);
38 eclip_inner_strt = eclip_outer_strt + eclip_inner_xstrt;
41 r1 = r0 + eclip_gap_rad;
42 r2 = r1 + eclip_prong_th;
43 r2e = r1 + eclip_base_epsilon;
45 ppxl = -(r0 / sqrt(2)) + (eclip_inner_strt / sqrt(2));
49 eclip_base_offset = r1;
50 eclip_wall_offset = -ppxl;
52 eclip_ra_offset = r2 - 0.1;
54 eclip_rhs_offset = ppxl + rgap + eclip_prong_th;
55 // does not include main_th
59 module EclipLPlanCore(alpha){
60 FArcSegment(0,0, r1,r2,
61 180-eclip_ult_angle, eclip_ult_angle-alpha +1);
67 rotate(-alpha) mirror([1,1]) square([r2e, 50]);
69 rotate(-alpha) mirror([1,1]) square([r2e, r2]);
75 module EclipRPlan(alpha, main_th){
78 translate([ppxl + main_th + rgap, -r2*2])
79 square([eclip_prong_th, r2*(2 + 1/sqrt(2))]);
80 translate([-r2, -r2e])
81 square([r2*3, eclip_base_epsilon + r2*4]);
85 module EclipLPlan(alpha){
86 rotate(alpha) EclipLPlanCore(alpha);
89 module EclipPPlan(main_th){
93 rotate(90-eclip_ult_angle) square([r0,r0]);
95 translate([-(r0+.1), -(r0+.1)])
96 square([(r0+.1) + main_th + ppxl, r2*2]);
98 translate([ppxl, 0]) square([main_th, r2]);
101 module TestBase(){ ////toplevel
102 translate([0,0, eclip_base_offset]){
103 for (i=[1 : 2: test_eclips-2]) {
104 translate([0, i*eclip_each_every])
106 linear_extrude(height=eclip_each_len)
107 EclipLPlan(test_alpha);
109 for (j=[0 : 2: test_eclips-1]) {
110 translate([0, j*eclip_each_every])
112 linear_extrude(height=eclip_each_len)
113 EclipRPlan(test_alpha, test_main_th);
116 translate([-r2, -eclip_each_len, -test_base_th]){
121 mirror([0,0,1]) Commitid_BestCount_M([r2*2, test_len]);
126 module TestProtr(){ ////toplevel
128 translate([0,0, test_main_th - eclip_wall_offset])
130 linear_extrude(height=test_len)
131 EclipPPlan(test_main_th);
132 mirror([0,0,1]) Commitid_BestCount_M([test_len, r2]);
136 module TestRAProtr(){ ////toplevel
137 rotate([-90,0,0]) TestProtr();
139 translate([-test_len,
141 -(eclip_ra_offset + test_base_th)])
147 module TestPlanDemo(){
148 color("red") EclipLPlan(test_alpha);
149 color("blue") rotate(test_alpha) EclipPPlan(test_main_th);
150 color("green") EclipRPlan(test_alpha, test_main_th);
153 beta = asin(front_setback / front_height);
155 uf = [-sin(beta), cos(beta)];
156 ur = [ -uf[1], uf[0]];
159 pq = pp + uf*front_height + ur*eclip_ra_offset;
160 pr = [ pq[0] - eclip_base_offset - eclip_wall_offset,
163 echo("uf ur P Q R", uf, ur, pp, pq, pr);
166 polygon([pq, pp, pr]);
169 thicks = [ base_thick, front_thick, back_thick ];
171 module Joins(alpha, objnum, objnum_f, objnum_m) {
172 pitch = (front_width - eclip_each_len) / (num_eclips-1);
174 thm = thicks[objnum_m];
175 stride = (front_width - eclip_each_len) / (num_eclips-1);
177 if (objnum==objnum_f) {
178 for (i=[ 1 : 2 : num_eclips-1 ]) {
179 translate([0, i*stride + eclip_each_len, 0]) {
181 linear_extrude(height=eclip_each_len)
185 for (i=[ 0 : 2 : num_eclips-1 ]) {
186 translate([0, i*stride + eclip_each_len, 0]) {
188 linear_extrude(height=eclip_each_len)
189 EclipRPlan(alpha, thm);
193 if (objnum==objnum_m)
196 linear_extrude(height=front_width)
201 function r3(pc) = [ pc[0], 0, pc[1] ];
203 module ObjectJoins(objnum){
204 translate(r3(pp)) Joins(beta, objnum, 0,1);
205 translate(r3(pr)) mirror([1,0,0]) Joins(0, objnum, 0,2);
206 translate(r3(pq)) rotate([0,90,0]) mirror([1,0,0]) Joins(-beta, objnum, 2,1);
210 xmin = pr[0] - eclip_rhs_offset - thicks[2];
211 xmax = pp[0] + eclip_rhs_offset + thicks[1]
212 + eclip_prong_th * (1/cos(beta) - 1)
213 + eclip_base_offset * tan(beta);
225 -eclip_base_offset - thicks[0]])
233 rotate([0, 90-beta, 0])
234 translate([0, 0, ppxl])
237 front_height - eclip_wall_offset + thicks[1],
246 zmax = pq[1] + eclip_prong_th;
247 height = zmax - zmin;
249 translate([pr[0] + eclip_wall_offset - thicks[2],
261 color("blue") Front();
262 color("black") Back();