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 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;
31 thehd = [ tile_hard_edge_hole_dist, tile_hard_edge_hole_dist ];
33 interlock_rad = interlock_dia/2;
34 interlock_negative_rad = interlock_rad + 0.125;
39 cylinder(r= post_dia/2, h= tile_th + ply_th - post_shorter);
40 translate([0,0, tile_th]) {
41 cylinder(r= screw_big_dia/2, h= screw_big_len);
42 cylinder(r= screw_dia/2, h= ply_th, $fn=20);
50 translate([p[0], p[1], 0])
55 module TileBase(botleft_post, topright_post){
56 botleft = botleft_post - thehd;
57 size = topright_post - botleft_post + thehd * 2;
60 translate([botleft[0], botleft[1], 0])
61 cube([size[0], size[1], tile_th]);
62 translate( [ botleft_post[0], botleft_post[1], -tile_th ]
63 + 0.5 * [ post_dia, post_dia, 0 ] )
64 Commitid_BestCount_M( topright_post-botleft_post
66 + [-post_dia,-post_dia] );
70 m4_dnl INREFFRAME(left_post, right_post, morevars) { body; }
71 m4_define(`INREFFRAME',`
72 length_vec = ($2) - ($1);
73 length = dist2d([0,0], length_vec);
74 length_uvec = length_vec / length;
75 ortho_uvec = [ -length_uvec[1], length_uvec[0] ];
76 m = [ [ length_uvec[0], ortho_uvec[0], 0, ($1)[0], ],
77 [ length_uvec[1], ortho_uvec[1], 0, ($1)[1], ],
84 m4_dnl INREFFRAME(left_post, right_post, morevars)
85 m4_dnl INREFFRAME_EDGE { body; }
86 m4_define(`INREFFRAME_EDGE',`
87 translate([-thehd[1], -thehd[0], -round_edge_rad])
90 module RoundEdge(left_post, right_post) {
91 INREFFRAME(left_post, right_post,
92 `tlength = length + thehd[1] * 2;') m4_dnl '
96 cylinder(r= round_edge_rad, h= tlength, $fn=50);
97 translate([-1, 0, -20])
98 cube([tlength+2, 20, 20]);
103 module RoundLeftCorner(this_post, right_post) {
104 INREFFRAME(this_post, right_post) INREFFRAME_EDGE {
106 sphere(r= round_edge_rad, $fn=60);
107 translate([0,0, -20])
113 module InterlockCore(r, plusth, ymir) {
116 translate([0, -thehd[0], plusth]){
119 linear_extrude(height=tile_th+plusth*2, convexity=10){
122 translate([-dx, -0.1])
123 square([ dx*2, r/2 + 0.1 ]);
125 translate([ xi*dx, r ])
135 module InterlockNegative(this_post, right_post) {
136 INREFFRAME(this_post, right_post)
137 InterlockCore(interlock_negative_rad, 1, 0);
140 module Interlock(this_post, right_post) {
141 INREFFRAME(this_post, right_post)
142 InterlockCore(interlock_rad, 0, 1);
145 module TestPiece1(){ ////toplevel
150 TileBase(holes[0], holes[1]);
151 InterlockNegative(holes[1], holes[1] + [0,1]);
154 RoundEdge(holes[0], holes[1]);
155 RoundEdge(holes[0] + [ 0, 0.1 ], holes[0]);
156 RoundLeftCorner(holes[0], holes[1]);
159 module TestPiece2(){ ////toplevel
163 TileBase(holes[0], holes[1]);
165 RoundEdge(holes[0], holes[1]);
166 Interlock(holes[0], holes[0] + [0, -1]);
170 translate([ -thehd[1], 0 ])
173 translate([ +thehd[1], 0 ])