/* * Copyright 2022 Thomas Buck - thomas@xythobuz.de * Philipp Schönberger - mail@phschoen.de * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * See . */ include <../config.scad> include <../constant.scad> pmw3360_sensor(); module pmw3360_sensor() { translate([-sensor_w / 2, -sensor_l / 2, 0]) difference() { color("green") cube([sensor_w, sensor_l, sensor_pcb_h]); translate([sensor_cut_off_x, sensor_cut_off_y, -1]) cube([sensor_cut_w, sensor_cut_h, sensor_pcb_h + 2]); for (x = [0, sensor_hole_dist_x]) for (y = [0, sensor_hole_dist_y]) translate([sensor_hole_off_x + x, sensor_hole_off_y + y, -1]) cylinder(d = sensor_hole_dia, h = sensor_pcb_h + 2); } color("#303030") translate([-sensor_chip_w / 2, -sensor_l / 2 - sensor_chip_l + sensor_edge_to_pin1 + sensor_cut_off_y + sensor_cut_h - sensor_cut_edge_to_pin1, -sensor_chip_h]) cube([sensor_chip_w, sensor_chip_l, sensor_chip_h]); translate([0, -sensor_l / 2 - 15 * sensor_pin_pitch + sensor_cut_off_y + sensor_cut_h - sensor_cut_edge_to_pin1, 0]) for (p = [0 : 15]) translate([0, p * sensor_pin_pitch, 0]) for (x = [-sensor_pin_dist / 2, sensor_pin_dist / 2]) if (((p % 2 == 0) && (x < 0)) || ((p % 2 == 1) && (x > 0))) translate([-sensor_pin_d / 2 + x, -sensor_pin_w / 2, -sensor_chip_h + sensor_pin_off_top]) cube([sensor_pin_d, sensor_pin_w, sensor_pin_h]); color("cyan") translate([0, -sensor_l / 2 + sensor_cut_off_y + sensor_cut_h - sensor_cut_edge_to_pin1 - sensor_pin1_to_optical_center, -sensor_chip_h + 1]) cylinder(d = 0.2, h = sensor_ball_to_chip_bottom - 1); }