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 interlock_rad = interlock_dia/2;
41 interlock_negative_rad = interlock_rad + 0.125;
46 cylinder(r= post_dia/2, h= tile_th + ply_th - post_shorter);
47 translate([0,0, tile_th]) {
48 cylinder(r= screw_big_dia/2, h= screw_big_len);
49 cylinder(r= screw_dia/2, h= ply_th, $fn=20);
57 translate(concat(p, [0]))
62 module TileBase(botleft_post, topright_post){
63 botleft = botleft_post - thehd;
64 size = topright_post - botleft_post + thehd * 2;
67 translate(concat(botleft, [0]))
68 cube(concat(size, [tile_th]));
69 translate( concat(botleft_post, [-tile_th])
70 + 0.5 * [ post_dia, post_dia, 0 ] )
71 Commitid_BestCount_M( topright_post-botleft_post
73 + [-post_dia,-post_dia] );
77 m4_dnl INREFFRAME(left_post, right_post, morevars) { body; }
78 m4_define(`INREFFRAME',`
79 length_vec = ($2) - ($1);
80 length = dist2d([0,0], length_vec);
81 length_uvec = length_vec / length;
82 ortho_uvec = [ -length_uvec[1], length_uvec[0] ];
83 m = [ [ length_uvec[0], ortho_uvec[0], 0, ($1)[0], ],
84 [ length_uvec[1], ortho_uvec[1], 0, ($1)[1], ],
91 m4_dnl INREFFRAME(left_post, right_post, morevars)
92 m4_dnl INREFFRAME_EDGE { body; }
93 m4_define(`INREFFRAME_EDGE',`
94 translate(concat(-thehd, [-round_edge_rad]))
97 module RoundEdge(left_post, right_post) {
98 INREFFRAME(left_post, right_post,
99 `tlength = length + thehd[0] * 2;') m4_dnl '
103 cylinder(r= round_edge_rad, h= tlength, $fn=50);
104 translate([-1, 0, -20])
105 cube([tlength+2, 20, 20]);
110 module RoundLeftCorner(this_post, right_post) {
111 INREFFRAME(this_post, right_post) INREFFRAME_EDGE {
113 sphere(r= round_edge_rad, $fn=60);
114 translate([0,0, -20])
120 module InterlockCore(r, plusth, ymir) {
123 translate([0, -thehd[1], plusth]){
126 linear_extrude(height=tile_th+plusth*2, convexity=10){
129 translate([-dx, -0.1])
130 square([ dx*2, r/2 + 0.1 ]);
132 translate([ xi*dx, r ])
142 module InterlockNegative(this_post, right_post) {
143 INREFFRAME(this_post, right_post)
144 InterlockCore(interlock_negative_rad, 1, 0);
147 module Interlock(this_post, right_post) {
148 INREFFRAME(this_post, right_post)
149 InterlockCore(interlock_rad, 0, 1);
152 module TestPiece1(){ ////toplevel
157 TileBase(holes[0], holes[1]);
158 InterlockNegative(holes[1], holes[1] + [0,1]);
161 RoundEdge(holes[0], holes[1]);
162 RoundEdge(holes[0] + [ 0, 0.1 ], holes[0]);
163 RoundLeftCorner(holes[0], holes[1]);
166 module TestPiece2(){ ////toplevel
170 TileBase(holes[0], holes[1]);
172 RoundEdge(holes[0], holes[1]);
173 Interlock(holes[0], holes[0] + [0, -1]);
177 translate([ -thehd[0], 0 ])
180 translate([ +thehd[0], 0 ])