1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-12-22 13:25:11 +02:00

Added a new pad type: trace pads, for antennas and other trace-like elements.

- layer.h (enum pad_type): added pad type pt_trace
- layer.c (pad_type_to_layers, layers_to_pad_type), inst.c (inst_pad):
  "trace" pad instantition and conversion infrastructure
- fpd.y (pad_type), dump.c (print_obj): .fpd file I/O for "trace" pads
- postscript.c (prologue): added Postscript function "horpath" to produce
  horizontal stripes
- postscript.c (hatch): show "trace" pads with horizontal stripes
- gui_style.h (gc_pad_trace), gui_style.c (gc_pad_trace, gui_setup_style),
  gui_inst.c (pad_gc): added visualization of "trace" pads
- gui_status.c (show_pad_type): added "trace" pad type
- README: added description of "trace" pads
- README: added usage examples for the various pad types



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5998 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner 2011-01-18 00:30:57 +00:00
parent 0bfba12f3c
commit 49a1bbdd05
11 changed files with 67 additions and 24 deletions

8
README
View File

@ -270,9 +270,17 @@ Type Layers
--------- -------------------------------------
(default) copper, solder mask, and solder paste
bare copper and solder mask
trace copper without solder mask opening
paste solder paste
mask solder mask
Typical uses:
- "bare": connectors printed directly on the PCB
- "trace": connections or antennas
- "paste": sparse solder paste, e.g., for QFN center pads
- "mask": non-standard mask openings, e.g., for solder mask defined
pads
Rounded pads
- - - - - -

7
dump.c
View File

@ -1,8 +1,8 @@
/*
* dump.c - Dump objects in the native FPD format
*
* Written 2009, 2010 by Werner Almesberger
* Copyright 2009, 2010 by Werner Almesberger
* Written 2009-2011 by Werner Almesberger
* Copyright 2009-2011 by Werner Almesberger
*
* 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
@ -345,6 +345,9 @@ char *print_obj(const struct obj *obj, const struct vec *prev)
case pt_bare:
s2 = " bare";
break;
case pt_trace:
s2 = " trace";
break;
case pt_paste:
s2 = " paste";
break;

6
fpd.y
View File

@ -2,8 +2,8 @@
/*
* fpd.y - FootPrint Definition language
*
* Written 2009, 2010 by Werner Almesberger
* Copyright 2009, 2010 by Werner Almesberger
* Written 2009-2011 by Werner Almesberger
* Copyright 2009-2011 by Werner Almesberger
*
* 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
@ -986,6 +986,8 @@ pad_type:
{
if (!strcmp($1, "bare"))
$$ = pt_bare;
else if (!strcmp($1, "trace"))
$$ = pt_trace;
else if (!strcmp($1, "paste"))
$$ = pt_paste;
else if (!strcmp($1, "mask"))

View File

@ -1,8 +1,8 @@
/*
* gui_inst.c - GUI, instance functions
*
* Written 2009, 2010 by Werner Almesberger
* Copyright 2009, 2010 by Werner Almesberger
* Written 2009-2011 by Werner Almesberger
* Copyright 2009-2011 by Werner Almesberger
*
* 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
@ -319,6 +319,8 @@ static GdkGC *pad_gc(const struct inst *inst, int *fill)
switch (layers_to_pad_type(inst->u.pad.layers)) {
case pt_bare:
return gc_pad_bare[get_mode(inst)];
case pt_trace:
return gc_pad_trace[get_mode(inst)];
case pt_mask:
*fill = FALSE;
return gc_pad_mask[get_mode(inst)];

View File

@ -1,8 +1,8 @@
/*
* gui_status.c - GUI, status area
*
* Written 2009, 2010 by Werner Almesberger
* Copyright 2009, 2010 by Werner Almesberger
* Written 2009-2011 by Werner Almesberger
* Copyright 2009-2011 by Werner Almesberger
*
* 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
@ -204,6 +204,9 @@ static void show_pad_type(void)
case pt_bare:
s = "bare";
break;
case pt_trace:
s = "trace";
break;
case pt_paste:
s = "paste";
break;

View File

@ -1,7 +1,8 @@
/* * gui_style.c - GUI, style definitions
/*
* gui_style.c - GUI, style definitions
*
* Written 2009, 2010 by Werner Almesberger
* Copyright 2009, 2010 by Werner Almesberger
* Written 2009-2011 by Werner Almesberger
* Copyright 2009-2011 by Werner Almesberger
*
* 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
@ -26,6 +27,7 @@ GdkGC *gc_vec[mode_n];
GdkGC *gc_obj[mode_n];
GdkGC *gc_pad[mode_n];
GdkGC *gc_pad_bare[mode_n];
GdkGC *gc_pad_trace[mode_n];
GdkGC *gc_pad_mask[mode_n];
GdkGC *gc_ptext[mode_n];
GdkGC *gc_rim[mode_n];
@ -68,6 +70,7 @@ void gui_setup_style(GdkDrawable *drawable)
style(gc_obj, "#006060", "#00ffff", "#ffff80", 1);
style(gc_pad, "#400000", "#ff0000", "#ffff80", 1);
style(gc_pad_bare, "#402000", "#ff6000", "#ffff80", 1);
style(gc_pad_trace, "#304000", "#80c000", "#ffff80", 1);
style(gc_pad_mask, "#000040", "#0000ff", "#ffff80", 2);
style(gc_ptext, "#404040", "#ffffff", "#ffffff", 1);
style(gc_hole, "#000000", "#000000", "#000000", 0);

View File

@ -1,8 +1,8 @@
/*
* gui_style.h - GUI, style definitions
*
* Written 2009, 2010 by Werner Almesberger
* Copyright 2009, 2010 by Werner Almesberger
* Written 2009-2011 by Werner Almesberger
* Copyright 2009-2011 by Werner Almesberger
*
* 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
@ -114,6 +114,7 @@ extern GdkGC *gc_vec[mode_n];
extern GdkGC *gc_obj[mode_n];
extern GdkGC *gc_pad[mode_n];
extern GdkGC *gc_pad_bare[mode_n];
extern GdkGC *gc_pad_trace[mode_n];
extern GdkGC *gc_pad_mask[mode_n];
extern GdkGC *gc_ptext[mode_n];
extern GdkGC *gc_rim[mode_n];

7
inst.c
View File

@ -1,8 +1,8 @@
/*
* inst.c - Instance structures
*
* Written 2009, 2010 by Werner Almesberger
* Copyright 2009, 2010 by Werner Almesberger
* Written 2009-2011 by Werner Almesberger
* Copyright 2009-2011 by Werner Almesberger
*
* 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
@ -896,7 +896,8 @@ int inst_pad(struct obj *obj, const char *name, struct coord a, struct coord b)
struct inst *inst;
inst = add_inst(obj->u.pad.rounded ? &rpad_ops : &pad_ops,
obj->u.pad.type == pt_normal || obj->u.pad.type == pt_bare ?
obj->u.pad.type == pt_normal || obj->u.pad.type == pt_bare ||
obj->u.pad.type == pt_trace ?
ip_pad_copper : ip_pad_special, a);
inst->obj = obj;
inst->u.pad.name = stralloc(name);

11
layer.c
View File

@ -1,8 +1,8 @@
/*
* layer.c - PCB layers on a pad
*
* Written 2009, 2010 by Werner Almesberger
* Copyright 2009, 2010 by Werner Almesberger
* Written 2009-2011 by Werner Almesberger
* Copyright 2009-2011 by Werner Almesberger
*
* 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
@ -52,6 +52,9 @@ layer_type pad_type_to_layers(enum pad_type type)
case pt_bare:
layers |= LAYER_COPPER_TOP | LAYER_MASK_TOP;
break;
case pt_trace:
layers |= LAYER_COPPER_TOP;
break;
case pt_paste:
layers = LAYER_PASTE_TOP;
break;
@ -70,7 +73,9 @@ enum pad_type layers_to_pad_type(layer_type layers)
if (layers & LAYER_COPPER_TOP) {
if (layers & LAYER_PASTE_TOP)
return pt_normal;
return pt_bare;
if (layers & LAYER_MASK_TOP)
return pt_bare;
return pt_trace;
} else {
if (layers & LAYER_PASTE_TOP)
return pt_paste;

View File

@ -1,8 +1,8 @@
/*
* layer.h - PCB layers on a pad
*
* Written 2009, 2010 by Werner Almesberger
* Copyright 2009, 2010 by Werner Almesberger
* Written 2009-2011 by Werner Almesberger
* Copyright 2009-2011 by Werner Almesberger
*
* 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
@ -57,6 +57,7 @@ enum kicad_layer {
enum pad_type {
pt_normal, /* copper and solder mask */
pt_bare, /* only copper (and finish) */
pt_trace, /* only copper, without solder mask opening */
pt_paste, /* only solder paste */
pt_mask, /* only solder mask */
pt_n

View File

@ -1,8 +1,8 @@
/*
* postscript.c - Dump objects in Postscript
*
* Written 2009, 2010 by Werner Almesberger
* Copyright 2009, 2010 by Werner Almesberger
* Written 2009-2011 by Werner Almesberger
* Copyright 2009-2011 by Werner Almesberger
*
* 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
@ -64,6 +64,8 @@
#define PS_HATCH mm_to_units(0.1)
#define PS_HATCH_LINE mm_to_units(0.015)
#define PS_STRIPE mm_to_units(0.08)
#define PS_RIM_LINE mm_to_units(0.02)
#define PS_FONT_OUTLINE mm_to_units(0.025)
@ -223,6 +225,8 @@ static const char *hatch(layer_type layers)
return "backhatchpath";
case pt_mask:
return "dotpath";
case pt_trace:
return "horpath";
default:
abort();
}
@ -940,7 +944,7 @@ static void prologue(FILE *file, int pages)
"/backhatchpath {\n"
" gsave flattenpath pathbbox clip newpath\n"
" /ury exch def /urx exch def /lly exch def /llx exch def\n"
" 0 %d ury lly sub urx llx sub add {\n" /* for 0 to urx-llx_ury-lly */
" 0 %d ury lly sub urx llx sub add {\n" /* for 0 to urx-llx+ury-lly */
" llx add dup lly moveto\n"
" ury lly sub sub ury lineto stroke\n"
" } for\n"
@ -950,6 +954,16 @@ fprintf(file,
"/crosspath {\n"
" gsave hatchpath grestore backhatchpath } def\n");
fprintf(file,
"/horpath {\n"
" gsave flattenpath pathbbox clip newpath\n"
" /ury exch def /urx exch def /lly exch def /llx exch def\n"
" lly %d ury {\n" /* for lly to ury */
" dup llx exch moveto\n"
" urx exch lineto stroke\n"
" } for\n"
" grestore newpath } def\n", PS_STRIPE);
/*
* Stack: font string width height factor -> factor
*