+module ButtonCoverProfile(){
+ intersection(){
+ polygon([ bppM, bppP, bppO, bppJ, bppL, bppK ]);
+ hull(){
+ EdgeProfile();
+ LidEdgeProfile();
+ }
+ }
+}
+
+module ButtonPlan(l, deep, cut){
+ epsilon =
+ (cut ? 0 : lid_buttoncover_gap);
+
+ delta =
+ (deep ? lid_buttoncover_overlap : 0);
+
+ C = [0,0]; // by definition
+ T = [ 0, epp4[1] ];
+ G = T + [0,10];
+
+ B0 = C + [0,-1] * button_cutout_depth;
+ B1 = B0 + [0,1] * epsilon;
+
+ r0 = 0.5 * (T[1] - B0[1]);
+ A = [ -(l + button_l_fudge)/2 + r0, 0.5 * (T[1] + B0[1]) ];
+ H = A + [0,-1] * delta;
+
+ D = A + [-2,0] * r0;
+ F = D + [0,10];
+
+ E0 = 0.5 * (D + A);
+ E1 = E0 + [1,0] * epsilon;
+
+ I0 = [ E0[0], H[1] ];
+ I1 = [ E1[0], H[1] ];
+
+ hull(){
+ for (m=[0,1]) mirror([m,0])
+ circleat(H, r0 - epsilon);
+ }
+ for (m=[0,1]) mirror([m,0]) {
+ difference(){
+ polygon([ E1,
+ I1,
+ H,
+ B1,
+ G,
+ F,
+ D
+ ]);
+ circleat(D, r0 + epsilon);
+ }
+ }
+}
+