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
65 + [-post_dia,+post_dia] );
69 m4_dnl INREFFRAME(left_post, right_post, morevars) { body; }
70 m4_define(`INREFFRAME',`
71 length_vec = ($2) - ($1);
72 length = dist2d([0,0], length_vec);
73 length_uvec = length_vec / length;
74 ortho_uvec = [ -length_uvec[1], length_uvec[0] ];
75 m = [ [ length_uvec[0], ortho_uvec[0], 0, ($1)[0], ],
76 [ length_uvec[1], ortho_uvec[1], 0, ($1)[1], ],
83 m4_dnl INREFFRAME(left_post, right_post, morevars)
84 m4_dnl INREFFRAME_EDGE { body; }
85 m4_define(`INREFFRAME_EDGE',`
86 translate([-thehd[1], -thehd[0], -round_edge_rad])
89 module RoundEdge(left_post, right_post) {
90 INREFFRAME(left_post, right_post,
91 `tlength = length + thehd[1] * 2;') m4_dnl '
95 cylinder(r= round_edge_rad, h= tlength, $fn=50);
96 translate([-1, 0, -20])
97 cube([tlength+2, 20, 20]);
102 module RoundLeftCorner(this_post, right_post) {
103 INREFFRAME(this_post, right_post) INREFFRAME_EDGE {
105 sphere(r= round_edge_rad, $fn=60);
106 translate([0,0, -20])
112 module InterlockCore(r, plusth, ymir) {
115 translate([0, -thehd[0], plusth]){
118 linear_extrude(height=tile_th+plusth*2, convexity=10){
121 translate([-dx, -0.1])
122 square([ dx*2, r/2 + 0.1 ]);
124 translate([ xi*dx, r ])
134 module InterlockNegative(this_post, right_post) {
135 INREFFRAME(this_post, right_post)
136 InterlockCore(interlock_negative_rad, 1, 0);
139 module Interlock(this_post, right_post) {
140 INREFFRAME(this_post, right_post)
141 InterlockCore(interlock_rad, 0, 1);
144 module TestPiece1(){ ////toplevel
149 TileBase(holes[0], holes[1]);
150 InterlockNegative(holes[1], holes[1] + [0,1]);
153 RoundEdge(holes[0], holes[1]);
154 RoundEdge(holes[0] + [ 0, 0.1 ], holes[0]);
155 RoundLeftCorner(holes[0], holes[1]);
158 module TestPiece2(){ ////toplevel
162 TileBase(holes[0], holes[1]);
164 RoundEdge(holes[0], holes[1]);
165 Interlock(holes[0], holes[0] + [0, -1]);
169 translate([ -thehd[1], 0 ])
172 translate([ +thehd[1], 0 ])