/* * Copyright © 2013 Bdale Garbee * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * 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. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ load "footprint.5c" import Footprint; int total_pad = 14; real center_gap = 6.00; real pad_width; real rf_pad_width = 0.8; real misc_pad_width = 1.1; real pad_height = 2.3; real pad_spacing = 2.54; int num_pad = total_pad / 2; /* per side */ string name = sprintf ("G6Z-1F"); real package_width = 20.0; real package_height = 8.6; real pad_y_off = center_gap / 2 + pad_height / 2; element_start(name); real pad_off(int n) { return pad_spacing * (n - (num_pad - 1) / 2); } real corner(int dx, int dy) { real x = dx * package_width / 2; real y = dy * package_height / 2; real len = 0.4; line(x, y, x - dx * len, y); line(x, y, x, y - dy * len); } corner(-1, -1); corner(1, -1); corner(-1, 1); corner(1, 1); real dot_off = -.3; line(-package_width/2 + dot_off, package_height/2 - dot_off, -package_width/2 + dot_off, package_height/2 - dot_off); for (int pad = 0; pad < num_pad; pad++) { /* bottom (1-num_pad) */ if (pad == 3) { pad_width = rf_pad_width; } else { pad_width = misc_pad_width; } if (pad != 1 && pad != 5) { pad_mm(pad_off(pad), pad_y_off, pad_width, pad_height, sprintf("%d", pad + 1), sprintf("%d", pad + 1)); } /* top side (total_pad - num_pad+1) */ if (pad == 0 || pad == 6) { pad_width = rf_pad_width; } else { pad_width = misc_pad_width; } if (pad != 3) { pad_mm(-pad_off(pad), -pad_y_off, pad_width, pad_height, sprintf("%d", total_pad - pad), sprintf("%d", total_pad - pad)); } } element_end();