include ; include ; include ; /* The DD play: TV base piece @author Perrier Stéphanie, Le Coultre Régis, Borgognon Nathalie @date 25 Jav. 2016 @licence CC BY-NC-SA 4.0 */ module tvFactory ( tvType ) { intersection() { // base and dots faces difference() { union() { doblo (col=$BASE_DOBLO_THICKNESS, row=$BASE_DOBLO_THICKNESS, up=$BASE_DOBLO_HEIGHT + $BASE_THICKNESS, width=$TV_DOBLO_WIDTH, length=$TV_DOBLO_LENGTH, height=$TV_DOBLO_HEIGHT - ($TV_DOBLO_HEIGHT / 2), nibbles_on_off=false, diamonds_on_off=false, scale=LUGO); // add 4 dots dice face wall thickness (ceiling) block (col=0, row=0, up=$BASE_DOBLO_HEIGHT + $BASE_THICKNESS + $TV_DOBLO_HEIGHT - ($TV_DOBLO_HEIGHT / 2), width=$TV_DOBLO_WIDTH + $BASE_DOBLO_THICKNESS, length=$TV_DOBLO_LENGTH + ($BASE_DOBLO_THICKNESS * 2), height=($BASE_THICKNESS/8) * 7 + ($TV_DOBLO_HEIGHT / 2), nibbles_on_off=false, diamonds_on_off=false, scale=LUGO); // add 2 dots dice face wall thickness (external long side) block (col=0, row=0, up=$BASE_DOBLO_HEIGHT + $BASE_THICKNESS, width=$BASE_DOBLO_THICKNESS, length=$TV_DOBLO_LENGTH + ($BASE_DOBLO_THICKNESS * 2), height=$TV_DOBLO_HEIGHT, nibbles_on_off=false, diamonds_on_off=false, scale=LUGO); // add 6 dots dice face wall thickness (external short side) block (col=$BASE_DOBLO_THICKNESS / 2, row=0, up=$BASE_DOBLO_HEIGHT + $BASE_THICKNESS, width=$TV_DOBLO_WIDTH + ($BASE_DOBLO_THICKNESS / 2), length=$BASE_DOBLO_THICKNESS, height=$TV_DOBLO_HEIGHT, nibbles_on_off=false, diamonds_on_off=false, scale=LUGO); //add short internal wall thickness block (col=$BASE_DOBLO_THICKNESS / 2, row=$TV_DOBLO_LENGTH + $BASE_DOBLO_THICKNESS, up=$BASE_DOBLO_HEIGHT + $BASE_THICKNESS, width=$TV_DOBLO_WIDTH + ($BASE_DOBLO_THICKNESS / 2), length=$BASE_DOBLO_THICKNESS, height=$TV_DOBLO_HEIGHT, nibbles_on_off=false, diamonds_on_off=false, scale=LUGO); //add poka-yoke part if (tvType == $TV_PLUS || tvType == $TV_BASIC) { if (tvType == $TV_PLUS) { addPokaYoke($TV_PLUS_POKA_YOKE); } else if (tvType == $TV_BASIC) { addPokaYoke($TV_BASIC_POKA_YOKE); } } } // 6 dots dice face rotate([-90,0,0]) { dotsFactory(topLeftDot=true, topRightDot=true, middleLeftDot=true, middleCenterDot=false, middleRightDot=true, bottomLeftDot=true, bottomRightDot=true); } // 2 dots dice face rotate([-90,0,-90]) { dotsFactory(topLeftDot=false, topRightDot=true, middleLeftDot=false, middleCenterDot=false, middleRightDot=false, bottomLeftDot=true, bottomRightDot=false); } // 4 dots dice face translate([0, 0, 1.6 *($BASE_DOBLO_HEIGHT + ($BASE_THICKNESS /2) * 3.5 + $TV_DOBLO_HEIGHT)]) { dotsFactory(topLeftDot=true, topRightDot=true, middleLeftDot=false, middleCenterDot=false, middleRightDot=false, bottomLeftDot=true, bottomRightDot=true); } } // Apply chamfers xChamfer(); yChamfer(); zChamfer(); } } /** * Add poka-yoke parts * @param pokaYokeValues the poka-yoke parts locations */ module addPokaYoke(pokaYokeValues) { //add a first poka-yoke part block (col=$BASE_DOBLO_THICKNESS, row=$BASE_DOBLO_THICKNESS + (($TV_DOBLO_LENGTH / 4) * pokaYokeValues[0]), up=$BASE_DOBLO_HEIGHT + $BASE_THICKNESS, width=$TV_DOBLO_WIDTH / 2, length=$TV_DOBLO_LENGTH / 4, height=$TV_DOBLO_HEIGHT, nibbles_on_off=false, diamonds_on_off=false, scale=LUGO); //add a second poka-yoke part block (col=$BASE_DOBLO_THICKNESS + ($TV_DOBLO_WIDTH / 2), row=$BASE_DOBLO_THICKNESS + (($TV_DOBLO_LENGTH / 4) * pokaYokeValues[1]), up=$BASE_DOBLO_HEIGHT + $BASE_THICKNESS, width=$TV_DOBLO_WIDTH / 2, length=$TV_DOBLO_LENGTH / 4, height=$TV_DOBLO_HEIGHT, nibbles_on_off=false, diamonds_on_off=false, scale=LUGO); }