-module Object(objnum){
- echo("Object",objnum);
- translate(pp) Joins(beta, objnum, 0,1);
- translate(pr) mirror([1,0,0]) Joins(0, objnum, 0,2);
- translate(pq) rotate([0,0,-90]) Joins(beta, objnum, 2,1);
+function r3(pc) = [ pc[0], 0, pc[1] ];
+
+module ObjectJoins(objnum){
+ translate(r3(pp)) Joins(beta, objnum, 0,1);
+ translate(r3(pr)) mirror([1,0,0]) Joins(0, objnum, 0,2);
+ translate(r3(pq)) rotate([0,90,0]) mirror([1,0,0]) Joins(-beta, objnum, 2,1);
+}
+
+module Base(){
+ xmin = pr[0] - eclip_rhs_offset - thicks[2];
+ xmax = pp[0] + eclip_rhs_offset + thicks[1]
+ + eclip_prong_th * (1/cos(beta) - 1)
+ + eclip_base_offset * tan(beta);
+ intersection(){
+ ObjectJoins(0);
+ translate([xmin,
+ -1,
+ -50])
+ cube([xmax - xmin,
+ front_width + 2,
+ 300]);
+ }
+ translate([xmin,
+ 0,
+ -eclip_base_offset - thicks[0]]){
+ difference(){
+ cube([xmax - xmin,
+ front_width,
+ thicks[0]]);
+ translate([xmax-xmin, front_width]/2)
+ rotate([0,0,270])
+ Commitid_Full16_M();
+ }
+ }
+}
+
+module FrontPattern(){
+ totalh = front_height - eclip_wall_offset + thicks[1];
+
+ ystride = front_hex_stride;
+ xstride = front_hex_stride * cos(30) * 2;
+
+ difference(){
+ square([front_width, totalh]);
+ translate([ front_surround_lr,
+ eclip_recept_height ])
+ square([ front_width - front_surround_lr*2,
+ totalh - eclip_recept_height*2
+ ]);
+ }
+
+ difference(){
+ square([front_width, totalh]);
+ for (xi=[ -5 : 5 ]) {
+ translate([front_width/2 +
+ xi * xstride,
+ 0]) {
+ for (yi=[ 0 : 10 ]) {
+ //echo(yi);
+ translate([0, yi * ystride +
+ front_hex_dia*front_hex_y_fudge]) {
+ for (dv=[ [0,0],
+ [-xstride/2, -ystride/2]
+ ])
+ translate(dv)
+ circle(r= front_hex_dia/2, $fn=6);
+ }
+ }
+ }
+ }
+ }
+}
+
+module Front(){
+ ObjectJoins(1);
+ rotate([0, 90-beta, 0])
+ translate([0, 0, ppxl])
+ rotate([0,0,90]) {
+ linear_extrude(height=thicks[1])
+ FrontPattern();
+ }