4 include <commitid.scad>
25 ply_edge_hole_dist = ply_edge_min + ply_hole_dia/2;
27 echo(str("HOLES IN PLY ctr dist from PLY edge = ", ply_edge_hole_dist));
29 hole_slop = (ply_hole_dia - post_dia)/2;
30 tile_hard_edge_hole_dist = ply_edge_hole_dist + hole_slop;
32 echo(str("HOLES IN PLY ctr dist from TILE HARD edge = ",
33 tile_hard_edge_hole_dist));
35 echo(str("HOLES IN PLY ctr dist from TILE ROUND edge = ",
36 tile_hard_edge_hole_dist + round_edge_rad));
38 thehd = [ tile_hard_edge_hole_dist, tile_hard_edge_hole_dist ];
40 thehd_tl = [ -thehd_tr[0], thehd_tr[1] ];
44 interlock_rad = interlock_dia/2;
45 interlock_negative_rad = interlock_rad + 0.125;
50 cylinder(r= post_dia/2, h= tile_th + ply_th - post_shorter);
51 translate([0,0, tile_th]) {
52 cylinder(r= screw_big_dia/2, h= screw_big_len);
53 cylinder(r= screw_dia/2, h= ply_th, $fn=20);
61 translate(concat(p, [0]))
66 module TileBase(botleft, topright){
67 size = topright - botleft;
68 botleft_post = botleft + thehd_tr;
69 topright_post = topright - thehd_bl;
70 echo(botleft_post, topright_post);
73 translate(concat(botleft, [0]))
74 cube(concat(size, [tile_th]));
75 translate( concat(botleft_post, [-tile_th])
76 + 0.5 * [ post_dia, post_dia, 0 ] )
77 Commitid_BestCount_M( topright_post-botleft_post
79 + [-post_dia,-post_dia] );
83 m4_dnl INREFFRAME(left_cnr, right_cnr, morevars) { body; }
84 m4_define(`INREFFRAME',`
85 length_vec = ($2) - ($1);
86 length = dist2d([0,0], length_vec);
87 length_uvec = length_vec / length;
88 ortho_uvec = [ -length_uvec[1], length_uvec[0] ];
89 m = [ [ length_uvec[0], ortho_uvec[0], 0, ($1)[0], ],
90 [ length_uvec[1], ortho_uvec[1], 0, ($1)[1], ],
97 m4_dnl INREFFRAME(left_cnr, right_cnr, morevars)
98 m4_dnl INREFFRAME_EDGE { body; }
99 m4_define(`INREFFRAME_EDGE',`
100 translate([0,0, -round_edge_rad])
103 module RoundEdge(left_cnr, right_cnr) {
104 INREFFRAME(left_cnr, right_cnr)
108 cylinder(r= round_edge_rad, h= length, $fn=50);
109 translate([-1, 0, -20])
110 cube([length+2, 20, 20]);
115 module RoundLeftCorner(this_cnr, right_cnr) {
116 INREFFRAME(this_cnr, right_cnr) INREFFRAME_EDGE {
118 sphere(r= round_edge_rad, $fn=60);
119 translate([0,0, -20])
125 module InterlockPlan(r, ymir) {
128 translate([thehd[0], 0]){
132 translate([-dx, -0.1])
133 square([ dx*2, r/2 + 0.1 ]);
135 translate([ xi*dx, r ])
143 module InterlockCore(r, plusth, ymir) {
144 translate([0, 0, plusth]){
146 linear_extrude(height=tile_th+plusth*2, convexity=10){
147 InterlockPlan(r, ymir);
153 module InterlockNegative(this_cnr, right_cnr) {
154 INREFFRAME(this_cnr, right_cnr)
155 InterlockCore(interlock_negative_rad, 1, 0);
158 module Interlock(this_cnr, right_cnr) {
159 INREFFRAME(this_cnr, right_cnr)
160 InterlockCore(interlock_rad, 0, 1);
163 function TestPiece_holes2corners(holes) =
164 [ holes[0] + thehd_bl,
167 holes[0] + thehd_tl ];
169 module TestPiece1(){ ////toplevel
173 corners = TestPiece_holes2corners(holes);
175 TileBase(corners[0], corners[2]);
176 InterlockNegative(corners[1], corners[2]);
179 RoundEdge(corners[0], corners[1]);
180 RoundEdge(corners[3], corners[0]);
181 RoundLeftCorner(corners[0], corners[1]);
184 module TestPiece2(){ ////toplevel
188 corners = TestPiece_holes2corners(holes);
189 TileBase(corners[0], corners[2]);
191 RoundEdge(corners[0], corners[1]);
192 Interlock(corners[3], corners[0]);
195 module Demo(){ ////toplevel
196 translate([ -thehd[0], 0 ])
199 translate([ +thehd[0], 0 ])