/* --- title: iPhone plank summary: Plank with a cable channel for a MagSafe charger, plus the channel cover. tags: [phone, magsafe, cable, plank] hardware: [M3 screws, M3 nuts] print: Print both parts flat. The cover clips into the channel. --- A 5 unit plank on a short rail box that carries the [iPhone MagSafe holder](../iphone-magsafe/) (rail base) and routes its cable: a 4 mm channel runs along the plank and exits at the back. The **cover** closes the channel and has nut-shaped pegs that sit in the plank's nut pockets. Used in the VW ID. Buzz display build. */ use ; use ; // Which part part = "plank"; // [plank, cover] // Cable diameter in mm cableDiameter = 4; // [2:0.5:8] if (part == "plank") iphonePlank(cableDiameter); else iphonePlankChannelCover(cableDiameter); module iphonePlank(cableDiameter = 4) { e = 0.01; gu = 15; channelHeight = gu / 2 + cableDiameter / 2; $fn = 32; difference() { union() { translate([0, 0, -1 * gu]) railBox(1 * gu + 2, 1 * gu, 2 * gu, top=true, rear=false, holes=true); translate([1 * gu, 0, 0]) plank(5 * gu); } translate([4 * gu, 3, gu - channelHeight]) cylinder(d=cableDiameter, h=channelHeight + e); translate([4 * gu - cableDiameter / 2, 3, gu - channelHeight]) cube([cableDiameter, gu, channelHeight + e]); translate([4, gu / 2, gu / 2]) rotate([0, 90, 0]) cylinder(d=cableDiameter, h=4 * gu - 4); translate([4, gu / 2, gu / 2 - cableDiameter / 2]) cube([4 * gu - 4, gu / 2 + e, cableDiameter]); } } module iphonePlankChannelCover(cableDiameter = 4) { e = 0.01; gu = 15; channelHeight = gu / 2 + cableDiameter / 2; coverThickness = 2; translate([4 * gu - cableDiameter / 2, gu - coverThickness, gu - channelHeight]) cube([cableDiameter, coverThickness, channelHeight + e]); translate([gu, gu - coverThickness, gu / 2 - cableDiameter / 2]) cube([3 * gu, coverThickness, cableDiameter]); for (i = [0:2]) { translate([gu / 2 + (i + 1) * gu, gu, gu / 2]) rotate([90, 30, 0]) cylinder(d=6.5, h=2, $fn=6); } }