Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 4590) +++ trunk/scconfig/Rev.h (revision 4591) @@ -1 +1 @@ -static const int myrev = 4588; +static const int myrev = 4591; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 4590) +++ trunk/scconfig/Rev.tab (revision 4591) @@ -1,6 +1,6 @@ +4591 configure unravel - the big cleanup, moving code and files 4588 configure disable bison by default 4587 configure draw_fab moved to a plugin -4585 configure unravel - the big cleanup, moving code and files 4450 configure io_lihata plugin config and 3rd party lib dependency fix 4398 configure io_kicad plugin interdeps and enable io_kicad by default 4375 configure custom output style support in io_lihata Index: trunk/src/mirror.h =================================================================== --- trunk/src/mirror.h (revision 4590) +++ trunk/src/mirror.h (nonexistent) @@ -1,25 +0,0 @@ -/* - * COPYRIGHT - * - * PCB, interactive printed circuit board design - * Copyright (C) 1994,1995,1996 Thomas Nau - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Contact addresses for paper mail and Email: - * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany - * Thomas.Nau@rz.uni-ulm.de - * - */ Index: trunk/src/thermal.c =================================================================== --- trunk/src/thermal.c (revision 4590) +++ trunk/src/thermal.c (nonexistent) @@ -1,438 +0,0 @@ -/* - * COPYRIGHT - * - * PCB, interactive printed circuit board design - * Copyright (C) 1994,1995,1996,2004,2006 Thomas Nau - * - * this file, thermal.c was written by and is - * (C) Copyright 2006, harry eaton - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Contact addresses for paper mail and Email: - * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany - * Thomas.Nau@rz.uni-ulm.de - * - */ - -/* negative thermal finger polygons */ - -#include "config.h" - -#include -#include - -#include "board.h" -#include "polygon.h" -#include "thermal.h" - -static PCBTypePtr pcb; - -struct cent { - Coord x, y; - Coord s, c; - char style; - POLYAREA *p; -}; - -static POLYAREA *diag_line(Coord X, Coord Y, Coord l, Coord w, pcb_bool rt) -{ - PLINE *c; - Vector v; - Coord x1, x2, y1, y2; - - if (rt) { - x1 = (l - w) * M_SQRT1_2; - x2 = (l + w) * M_SQRT1_2; - y1 = x1; - y2 = x2; - } - else { - x2 = -(l - w) * M_SQRT1_2; - x1 = -(l + w) * M_SQRT1_2; - y1 = -x1; - y2 = -x2; - } - - v[0] = X + x1; - v[1] = Y + y2; - if ((c = poly_NewContour(v)) == NULL) - return NULL; - v[0] = X - x2; - v[1] = Y - y1; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[0] = X - x1; - v[1] = Y - y2; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[0] = X + x2; - v[1] = Y + y1; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - return ContourToPoly(c); -} - -static POLYAREA *square_therm(PinTypePtr pin, pcb_cardinal_t style) -{ - POLYAREA *p, *p2; - PLINE *c; - Vector v; - Coord d, in, out; - - switch (style) { - case 1: - d = pcb->ThermScale * pin->Clearance * M_SQRT1_2; - out = (pin->Thickness + pin->Clearance) / 2; - in = pin->Thickness / 2; - /* top (actually bottom since +y is down) */ - v[0] = pin->X - in + d; - v[1] = pin->Y + in; - if ((c = poly_NewContour(v)) == NULL) - return NULL; - v[0] = pin->X + in - d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[0] = pin->X + out - d; - v[1] = pin->Y + out; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[0] = pin->X - out + d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - p = ContourToPoly(c); - /* right */ - v[0] = pin->X + in; - v[1] = pin->Y + in - d; - if ((c = poly_NewContour(v)) == NULL) - return NULL; - v[1] = pin->Y - in + d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[0] = pin->X + out; - v[1] = pin->Y - out + d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[1] = pin->Y + out - d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - p2 = ContourToPoly(c); - p->f = p2; - p2->b = p; - /* left */ - v[0] = pin->X - in; - v[1] = pin->Y - in + d; - if ((c = poly_NewContour(v)) == NULL) - return NULL; - v[1] = pin->Y + in - d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[0] = pin->X - out; - v[1] = pin->Y + out - d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[1] = pin->Y - out + d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - p2 = ContourToPoly(c); - p->f->f = p2; - p2->b = p->f; - /* bottom (actually top since +y is down) */ - v[0] = pin->X + in - d; - v[1] = pin->Y - in; - if ((c = poly_NewContour(v)) == NULL) - return NULL; - v[0] = pin->X - in + d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[0] = pin->X - out + d; - v[1] = pin->Y - out; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[0] = pin->X + out - d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - p2 = ContourToPoly(c); - p->f->f->f = p2; - p2->f = p; - p2->b = p->f->f; - p->b = p2; - return p; - case 4: - { - LineType l; - l.Flags = NoFlags(); - d = pin->Thickness / 2 - pcb->ThermScale * pin->Clearance; - out = pin->Thickness / 2 + pin->Clearance / 4; - in = pin->Clearance / 2; - /* top */ - l.Point1.X = pin->X - d; - l.Point2.Y = l.Point1.Y = pin->Y + out; - l.Point2.X = pin->X + d; - p = LinePoly(&l, in); - /* right */ - l.Point1.X = l.Point2.X = pin->X + out; - l.Point1.Y = pin->Y - d; - l.Point2.Y = pin->Y + d; - p2 = LinePoly(&l, in); - p->f = p2; - p2->b = p; - /* bottom */ - l.Point1.X = pin->X - d; - l.Point2.Y = l.Point1.Y = pin->Y - out; - l.Point2.X = pin->X + d; - p2 = LinePoly(&l, in); - p->f->f = p2; - p2->b = p->f; - /* left */ - l.Point1.X = l.Point2.X = pin->X - out; - l.Point1.Y = pin->Y - d; - l.Point2.Y = pin->Y + d; - p2 = LinePoly(&l, in); - p->f->f->f = p2; - p2->b = p->f->f; - p->b = p2; - p2->f = p; - return p; - } - default: /* style 2 and 5 */ - d = 0.5 * pcb->ThermScale * pin->Clearance; - if (style == 5) - d += d; - out = (pin->Thickness + pin->Clearance) / 2; - in = pin->Thickness / 2; - /* topright */ - v[0] = pin->X + in; - v[1] = pin->Y + in; - if ((c = poly_NewContour(v)) == NULL) - return NULL; - v[1] = pin->Y + d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - if (style == 2) { - v[0] = pin->X + out; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - } - else - frac_circle(c, v[0] + pin->Clearance / 4, v[1], v, 2); - v[1] = pin->Y + in; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - /* pivot 1/4 circle to next point */ - frac_circle(c, pin->X + in, pin->Y + in, v, 4); - v[0] = pin->X + d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - if (style == 2) { - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[1] = pin->Y + in; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - } - else - frac_circle(c, v[0], v[1] - pin->Clearance / 4, v, 2); - p = ContourToPoly(c); - /* bottom right */ - v[0] = pin->X + in; - v[1] = pin->Y - d; - if ((c = poly_NewContour(v)) == NULL) - return NULL; - v[1] = pin->Y - in; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[0] = pin->X + d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - if (style == 2) { - v[1] = pin->Y - out; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - } - else - frac_circle(c, v[0], v[1] - pin->Clearance / 4, v, 2); - v[0] = pin->X + in; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - /* pivot 1/4 circle to next point */ - frac_circle(c, pin->X + in, pin->Y - in, v, 4); - v[1] = pin->Y - d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - if (style == 5) - frac_circle(c, v[0] - pin->Clearance / 4, v[1], v, 2); - p2 = ContourToPoly(c); - p->f = p2; - p2->b = p; - /* bottom left */ - v[0] = pin->X - d; - v[1] = pin->Y - in; - if ((c = poly_NewContour(v)) == NULL) - return NULL; - v[0] = pin->X - in; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[1] = pin->Y - d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - if (style == 2) { - v[0] = pin->X - out; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - } - else - frac_circle(c, v[0] - pin->Clearance / 4, v[1], v, 2); - v[1] = pin->Y - in; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - /* pivot 1/4 circle to next point */ - frac_circle(c, pin->X - in, pin->Y - in, v, 4); - v[0] = pin->X - d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - if (style == 5) - frac_circle(c, v[0], v[1] + pin->Clearance / 4, v, 2); - p2 = ContourToPoly(c); - p->f->f = p2; - p2->b = p->f; - /* top left */ - v[0] = pin->X - d; - v[1] = pin->Y + out; - if ((c = poly_NewContour(v)) == NULL) - return NULL; - v[0] = pin->X - in; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - /* pivot 1/4 circle to next point (x-out, y+in) */ - frac_circle(c, pin->X - in, pin->Y + in, v, 4); - v[1] = pin->Y + d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - if (style == 2) { - v[0] = pin->X - in; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - } - else - frac_circle(c, v[0] + pin->Clearance / 4, v[1], v, 2); - v[1] = pin->Y + in; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - v[0] = pin->X - d; - poly_InclVertex(c->head.prev, poly_CreateNode(v)); - if (style == 5) - frac_circle(c, v[0], v[1] + pin->Clearance / 4, v, 2); - p2 = ContourToPoly(c); - p->f->f->f = p2; - p2->f = p; - p2->b = p->f->f; - p->b = p2; - return p; - } -} - -static POLYAREA *oct_therm(PinTypePtr pin, pcb_cardinal_t style) -{ - POLYAREA *p, *p2, *m; - Coord t = 0.5 * pcb->ThermScale * pin->Clearance; - Coord w = pin->Thickness + pin->Clearance; - - p = OctagonPoly(pin->X, pin->Y, w, GET_SQUARE(pin)); - p2 = OctagonPoly(pin->X, pin->Y, pin->Thickness, GET_SQUARE(pin)); - /* make full clearance ring */ - poly_Boolean_free(p, p2, &m, PBO_SUB); - switch (style) { - default: - case 1: - p = diag_line(pin->X, pin->Y, w, t, pcb_true); - poly_Boolean_free(m, p, &p2, PBO_SUB); - p = diag_line(pin->X, pin->Y, w, t, pcb_false); - poly_Boolean_free(p2, p, &m, PBO_SUB); - return m; - case 2: - p = RectPoly(pin->X - t, pin->X + t, pin->Y - w, pin->Y + w); - poly_Boolean_free(m, p, &p2, PBO_SUB); - p = RectPoly(pin->X - w, pin->X + w, pin->Y - t, pin->Y + t); - poly_Boolean_free(p2, p, &m, PBO_SUB); - return m; - /* fix me add thermal style 4 */ - case 5: - { - Coord t = pin->Thickness / 2; - POLYAREA *q; - /* cheat by using the square therm's rounded parts */ - p = square_therm(pin, style); - q = RectPoly(pin->X - t, pin->X + t, pin->Y - t, pin->Y + t); - poly_Boolean_free(p, q, &p2, PBO_UNITE); - poly_Boolean_free(m, p2, &p, PBO_ISECT); - return p; - } - } -} - -/* ThermPoly returns a POLYAREA having all of the clearance that when - * subtracted from the plane create the desired thermal fingers. - * Usually this is 4 disjoint regions. - * - */ -POLYAREA *ThermPoly(PCBTypePtr p, PinTypePtr pin, pcb_cardinal_t laynum) -{ - ArcType a; - POLYAREA *pa, *arc; - pcb_cardinal_t style = GET_THERM(laynum, pin); - - if (style == 3) - return NULL; /* solid connection no clearance */ - pcb = p; - if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) - return square_therm(pin, style); - if (TEST_FLAG(PCB_FLAG_OCTAGON, pin)) - return oct_therm(pin, style); - /* must be circular */ - switch (style) { - case 1: - case 2: - { - POLYAREA *m; - Coord t = (pin->Thickness + pin->Clearance) / 2; - Coord w = 0.5 * pcb->ThermScale * pin->Clearance; - pa = CirclePoly(pin->X, pin->Y, t); - arc = CirclePoly(pin->X, pin->Y, pin->Thickness / 2); - /* create a thin ring */ - poly_Boolean_free(pa, arc, &m, PBO_SUB); - /* fix me needs error checking */ - if (style == 2) { - /* t is the theoretically required length, but we use twice that - * to avoid descritisation errors in our circle approximation. - */ - pa = RectPoly(pin->X - t * 2, pin->X + t * 2, pin->Y - w, pin->Y + w); - poly_Boolean_free(m, pa, &arc, PBO_SUB); - pa = RectPoly(pin->X - w, pin->X + w, pin->Y - t * 2, pin->Y + t * 2); - } - else { - /* t is the theoretically required length, but we use twice that - * to avoid descritisation errors in our circle approximation. - */ - pa = diag_line(pin->X, pin->Y, t * 2, w, pcb_true); - poly_Boolean_free(m, pa, &arc, PBO_SUB); - pa = diag_line(pin->X, pin->Y, t * 2, w, pcb_false); - } - poly_Boolean_free(arc, pa, &m, PBO_SUB); - return m; - } - - - default: - a.X = pin->X; - a.Y = pin->Y; - a.Height = a.Width = pin->Thickness / 2 + pin->Clearance / 4; - a.Thickness = 1; - a.Clearance = pin->Clearance / 2; - a.Flags = NoFlags(); - a.Delta = 90 - (a.Clearance * (1. + 2. * pcb->ThermScale) * 180) / (M_PI * a.Width); - a.StartAngle = 90 - a.Delta / 2 + (style == 4 ? 0 : 45); - pa = ArcPoly(&a, a.Clearance); - if (!pa) - return NULL; - a.StartAngle += 90; - arc = ArcPoly(&a, a.Clearance); - if (!arc) - return NULL; - pa->f = arc; - arc->b = pa; - a.StartAngle += 90; - arc = ArcPoly(&a, a.Clearance); - if (!arc) - return NULL; - pa->f->f = arc; - arc->b = pa->f; - a.StartAngle += 90; - arc = ArcPoly(&a, a.Clearance); - if (!arc) - return NULL; - pa->b = arc; - pa->f->f->f = arc; - arc->b = pa->f->f; - arc->f = pa; - pa->b = arc; - return pa; - } -} Index: trunk/src/thermal.h =================================================================== --- trunk/src/thermal.h (revision 4590) +++ trunk/src/thermal.h (nonexistent) @@ -1,45 +0,0 @@ -/* - * COPYRIGHT - * - * PCB, interactive printed circuit board design - * Copyright (C) 1994,1995,1996,2006 Thomas Nau - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Contact addresses for paper mail and Email: - * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany - * Thomas.Nau@rz.uni-ulm.de - * - */ - -/* prototypes for thermal routines - * - * Thermals are normal lines on the layout. The only thing unique - * about them is that they have the PCB_FLAG_USETHERMAL set so that they - * can be identified as thermals. It is handy for pcb to automatically - * make adjustments to the thermals when the user performs certain - * operations, and the functions in thermal.h help implement that. - */ - -#ifndef PCB_THERMAL_H -#define PCB_THERMAL_H - -#include -#include "config.h" -#include "mymem.h" - -POLYAREA *ThermPoly(PCBTypePtr, PinTypePtr, pcb_cardinal_t); - -#endif Index: trunk/src/mirror.c =================================================================== --- trunk/src/mirror.c (revision 4590) +++ trunk/src/mirror.c (nonexistent) @@ -1,36 +0,0 @@ -/* - * COPYRIGHT - * - * PCB, interactive printed circuit board design - * Copyright (C) 1994,1995,1996 Thomas Nau - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Contact addresses for paper mail and Email: - * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany - * Thomas.Nau@rz.uni-ulm.de - * - */ - - -/* functions used to change the mirror flag of an object - * - * an undo operation is not implemented because it's easy to - * recover an object - */ - -#include "config.h" - -#warning REMOVE ME Index: trunk/src/Makefile.dep =================================================================== --- trunk/src/Makefile.dep (revision 4590) +++ trunk/src/Makefile.dep (revision 4591) @@ -40,8 +40,8 @@ global_typedefs.h box.h math_helper.h move.h misc_util.h compat_misc.h \ compat_nls.h data.h global_element.h crosshair.h rubberband.h hid.h \ error.h drc.h buffer.h draw.h error.h layer.h intersect.h rtree.h \ - macro.h mirror.h misc.h mymem.h move.h mymem.h rats.h netlist.h \ - route_style.h remove.h rotate.h obj_pinvia.h obj_rat.h ptrlist.h + macro.h misc.h mymem.h move.h mymem.h rats.h netlist.h route_style.h \ + remove.h rotate.h obj_pinvia.h obj_rat.h ptrlist.h ../src_plugins/autoroute/action.o: ../src_plugins/autoroute/action.c \ ../config.h ../src_plugins/autoroute/autoroute.h board.h const.h macro.h \ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \ @@ -81,8 +81,8 @@ misc_util.h create.h draw.h error.h find.h heap.h rtree.h misc.h mymem.h \ ../src_plugins/autoroute/mtspace.h ../src_plugins/autoroute/vector.h \ mymem.h polygon.h rtree.h rats.h netlist.h route_style.h remove.h \ - thermal.h undo.h pcb-printf.h set.h layer.h compat_nls.h obj_all.h \ - obj_poly.h ptrlist.h + obj_pinvia_therm.h undo.h pcb-printf.h set.h layer.h compat_nls.h \ + obj_all.h obj_poly.h ptrlist.h ../src_plugins/autoroute/mtspace.o: ../src_plugins/autoroute/mtspace.c \ ../config.h box.h math_helper.h global_typedefs.h pcb_bool.h unit.h \ global_objs.h ../src_3rd/genlist/gendlist.h attrib.h flag.h \ @@ -223,6 +223,23 @@ hid_flags.h hid_actions.h ../src_plugins/djopt/djopt_conf.h conf.h \ obj_line.h obj_pinvia.h dolists.h \ ../src_plugins/djopt/djopt_conf_fields.h +../src_plugins/draw_fab/draw_fab.o: ../src_plugins/draw_fab/draw_fab.c \ + ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \ + vtroutestyle.h ../src_3rd/genvector/genvector_impl.h \ + ../src_3rd/genvector/genvector_undef.h global_objs.h \ + ../src_3rd/genlist/gendlist.h attrib.h flag.h globalconst.h polyarea.h \ + layer.h obj_all_list.h obj_arc_list.h obj_arc.h \ + ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ + ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \ + ht_element.h ../src_3rd/liblihata/genht/ht.h \ + ../src_3rd/liblihata/genht/ht_inlines.h \ + ../src_3rd/liblihata/genht/hash.h obj_line_list.h obj_line.h \ + obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_poly_list.h \ + obj_text_list.h obj_text.h obj_rat_list.h obj_rat.h library.h \ + rats_patch.h board.h vtonpoint.h build_run.h data.h global_element.h \ + crosshair.h rubberband.h hid.h error.h drc.h buffer.h draw.h \ + ../src_plugins/draw_fab/../report/drill.h obj_all.h obj_poly.h plugins.h \ + stub_draw_fab.h ../src_plugins/export_bboard/bboard.o: \ ../src_plugins/export_bboard/bboard.c ../config.h math_helper.h board.h \ const.h macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \ @@ -466,8 +483,8 @@ obj_text_list.h obj_text.h obj_rat_list.h obj_rat.h library.h \ rats_patch.h board.h vtonpoint.h data.h global_element.h crosshair.h \ rubberband.h hid.h error.h drc.h buffer.h misc.h mymem.h error.h \ - buffer.h mirror.h create.h misc_util.h hid.h hid_nogui.h \ - hid_draw_helpers.h hid_init.h ../src_plugins/export_openscad/scad.h + buffer.h create.h misc_util.h hid.h hid_nogui.h hid_draw_helpers.h \ + hid_init.h ../src_plugins/export_openscad/scad.h ../src_plugins/export_openscad/scadproto.o: \ ../src_plugins/export_openscad/scadproto.c ../config.h data.h \ globalconst.h global_typedefs.h pcb_bool.h unit.h global_objs.h \ @@ -546,13 +563,13 @@ rubberband.h hid.h error.h drc.h buffer.h misc.h mymem.h layer.h error.h \ draw.h pcb-printf.h ../src_3rd/genvector/gds_char.h plugins.h \ hid_helper.h hid.h hid_nogui.h hid_draw_helpers.h \ - ../src_plugins/export_ps/ps.h hid_init.h hid_attrib.h \ - hid_flags.h hid_actions.h conf_core.h conf.h pcb-printf.h \ + ../src_plugins/export_ps/ps.h hid_init.h hid_attrib.h hid_flags.h \ + hid_actions.h conf_core.h conf.h pcb-printf.h \ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/dom.h \ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \ ../src_3rd/liblihata/genht/htsp.h ../src_3rd/liblihata/genht/ht.h \ ../src_3rd/genvector/vtp0.h list_conf.h compat_misc.h compat_nls.h \ - dolists.h + stub_draw_fab.h dolists.h ../src_plugins/export_svg/svg.o: ../src_plugins/export_svg/svg.c \ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \ pcb-printf.h ../src_3rd/genvector/gds_char.h \ @@ -2031,9 +2048,9 @@ layer.h create.h rubberband.h data.h global_element.h crosshair.h hid.h \ error.h drc.h buffer.h error.h ../src_plugins/io_pcb/file.h plug_io.h \ mymem.h misc.h mymem.h ../src_plugins/io_pcb/parse_l.h polygon.h rtree.h \ - math_helper.h remove.h rtree.h flag_str.h thermal.h rats_patch.h \ - ../src_plugins/io_pcb/flags.h route_style.h compat_misc.h obj_all.h \ - obj_poly.h ../src_plugins/io_pcb/parse_y.h + math_helper.h remove.h rtree.h flag_str.h obj_pinvia_therm.h \ + rats_patch.h ../src_plugins/io_pcb/flags.h route_style.h compat_misc.h \ + obj_all.h obj_poly.h ../src_plugins/io_pcb/parse_y.h ../src_plugins/jostle/jostle.o: ../src_plugins/jostle/jostle.c \ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \ vtroutestyle.h ../src_3rd/genvector/genvector_impl.h \ @@ -2410,6 +2427,20 @@ ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/parser.h ../src_3rd/liblihata/genht/htsp.h \ ../src_3rd/liblihata/genht/ht.h ../src_3rd/genvector/vtp0.h list_conf.h +../src_plugins/report/drill.o: ../src_plugins/report/drill.c ../config.h \ + data.h globalconst.h global_typedefs.h pcb_bool.h unit.h global_objs.h \ + ../src_3rd/genlist/gendlist.h attrib.h flag.h polyarea.h \ + global_element.h obj_all_list.h obj_arc_list.h obj_arc.h \ + ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ + ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \ + ht_element.h ../src_3rd/liblihata/genht/ht.h \ + ../src_3rd/liblihata/genht/ht_inlines.h \ + ../src_3rd/liblihata/genht/hash.h obj_line_list.h obj_line.h \ + obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_poly_list.h \ + obj_text_list.h obj_text.h obj_rat_list.h obj_rat.h layer.h crosshair.h \ + rubberband.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \ + ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \ + mymem.h ../src_plugins/report/drill.h macro.h obj_pinvia.h ../src_plugins/report/report.o: ../src_plugins/report/report.c \ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \ pcb-printf.h ../src_3rd/genvector/gds_char.h \ @@ -2429,9 +2460,10 @@ ../src_3rd/liblihata/genht/hash.h obj_line_list.h obj_pad_list.h \ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_poly_list.h obj_text_list.h \ obj_text.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \ - data.h global_element.h crosshair.h buffer.h error.h search.h \ - rats.h netlist.h route_style.h misc_util.h misc.h mymem.h mymem.h rats.h \ - rtree.h flag_str.h macro.h undo.h find.h draw.h pcb-printf.h plugins.h \ + data.h global_element.h crosshair.h buffer.h \ + ../src_plugins/report/drill.h error.h search.h rats.h netlist.h \ + route_style.h misc_util.h misc.h mymem.h mymem.h rats.h rtree.h \ + flag_str.h macro.h undo.h find.h draw.h pcb-printf.h plugins.h \ action_helper.h hid_actions.h misc_util.h \ ../src_plugins/report/report_conf.h conf.h compat_misc.h compat_nls.h \ layer.h obj_all.h obj_poly.h ../src_3rd/genregex/regex_sei.h \ @@ -2535,7 +2567,7 @@ const.h macro.h vtroutestyle.h library.h rats_patch.h board.h box.h \ math_helper.h move.h misc_util.h create.h draw.h error.h find.h heap.h \ rtree.h misc.h mymem.h mymem.h polygon.h rtree.h rats.h netlist.h \ - route_style.h remove.h thermal.h undo.h ../src_3rd/gts/gts.h \ + route_style.h remove.h obj_pinvia_therm.h undo.h ../src_3rd/gts/gts.h \ pcb-printf.h ../src_3rd/genvector/gds_char.h compat_nls.h ../src_plugins/vendordrill/vendor.o: ../src_plugins/vendordrill/vendor.c \ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \ @@ -2737,12 +2769,11 @@ obj_pinvia.h obj_poly_list.h obj_text_list.h obj_text.h obj_rat_list.h \ obj_rat.h library.h rats_patch.h vtonpoint.h copy.h create.h \ rubberband.h data.h global_element.h crosshair.h hid.h error.h drc.h \ - plug_io.h mirror.h misc.h mymem.h misc_util.h polygon.h rtree.h \ - math_helper.h rotate.h remove.h select.h operation.h set.h \ - funchash_core.h funchash.h funchash_core_list.h compat_misc.h \ - compat_nls.h obj_all.h obj_poly.h obj_all_op.h obj_arc_op.h \ - obj_elem_op.h obj_line_op.h obj_pad_op.h obj_pinvia_op.h obj_poly_op.h \ - obj_text_op.h obj_rat_op.h + plug_io.h misc.h mymem.h misc_util.h polygon.h rtree.h math_helper.h \ + rotate.h remove.h select.h operation.h set.h funchash_core.h funchash.h \ + funchash_core_list.h compat_misc.h compat_nls.h obj_all.h obj_poly.h \ + obj_all_op.h obj_arc_op.h obj_elem_op.h obj_line_op.h obj_pad_op.h \ + obj_pinvia_op.h obj_poly_op.h obj_text_op.h obj_rat_op.h build_run.o: build_run.c ../config.h ../src_3rd/genvector/gds_char.h \ ../src_3rd/genvector/genvector_impl.h \ ../src_3rd/genvector/genvector_undef.h conf_core.h conf.h \ @@ -2780,11 +2811,10 @@ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_poly_list.h \ obj_text_list.h obj_text.h obj_rat_list.h obj_rat.h library.h \ rats_patch.h vtonpoint.h crosshair.h rubberband.h hid.h error.h drc.h \ - data.h global_element.h buffer.h draw.h misc.h mymem.h mirror.h \ - polygon.h rtree.h math_helper.h select.h operation.h undo.h \ - hid_actions.h compat_nls.h obj_all_op.h obj_arc_op.h obj_elem_op.h \ - obj_line_op.h obj_pad_op.h obj_pinvia_op.h obj_poly_op.h obj_text_op.h \ - obj_rat_op.h + data.h global_element.h buffer.h draw.h misc.h mymem.h polygon.h rtree.h \ + math_helper.h select.h operation.h undo.h hid_actions.h compat_nls.h \ + obj_all_op.h obj_arc_op.h obj_elem_op.h obj_line_op.h obj_pad_op.h \ + obj_pinvia_op.h obj_poly_op.h obj_text_op.h obj_rat_op.h change_act.o: change_act.c ../config.h conf_core.h conf.h \ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \ @@ -2969,36 +2999,7 @@ obj_text_list.h obj_text.h obj_rat_list.h obj_rat.h library.h \ rats_patch.h vtonpoint.h data.h global_element.h crosshair.h \ rubberband.h hid.h error.h drc.h buffer.h draw.h misc.h mymem.h rotate.h \ - rtree.h obj_all.h obj_poly.h -draw_fab.o: draw_fab.c ../config.h board.h const.h macro.h \ - global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \ - ../src_3rd/genvector/genvector_impl.h \ - ../src_3rd/genvector/genvector_undef.h global_objs.h \ - ../src_3rd/genlist/gendlist.h attrib.h flag.h globalconst.h polyarea.h \ - layer.h obj_all_list.h obj_arc_list.h obj_arc.h \ - ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ - ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \ - ht_element.h ../src_3rd/liblihata/genht/ht.h \ - ../src_3rd/liblihata/genht/ht_inlines.h \ - ../src_3rd/liblihata/genht/hash.h obj_line_list.h obj_line.h \ - obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_poly_list.h \ - obj_text_list.h obj_text.h obj_rat_list.h obj_rat.h library.h \ - rats_patch.h vtonpoint.h build_run.h data.h global_element.h crosshair.h \ - rubberband.h hid.h error.h drc.h buffer.h draw.h \ - obj_all.h obj_poly.h -drill.o: drill.c ../config.h data.h globalconst.h global_typedefs.h \ - pcb_bool.h unit.h global_objs.h ../src_3rd/genlist/gendlist.h attrib.h \ - flag.h polyarea.h global_element.h obj_all_list.h obj_arc_list.h \ - obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \ - ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_elem_list.h obj_elem.h ht_element.h ../src_3rd/liblihata/genht/ht.h \ - ../src_3rd/liblihata/genht/ht_inlines.h \ - ../src_3rd/liblihata/genht/hash.h obj_line_list.h obj_line.h \ - obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_poly_list.h \ - obj_text_list.h obj_text.h obj_rat_list.h obj_rat.h layer.h crosshair.h \ - rubberband.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \ - ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \ - mymem.h macro.h + rtree.h stub_draw_fab.h obj_all.h obj_poly.h error.o: error.c ../config.h data.h globalconst.h global_typedefs.h \ pcb_bool.h unit.h global_objs.h ../src_3rd/genlist/gendlist.h attrib.h \ flag.h polyarea.h global_element.h obj_all_list.h obj_arc_list.h \ @@ -3329,7 +3330,6 @@ ../src_3rd/genvector/vtp0.h list_conf.h \ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h globalconst.h -mirror.o: mirror.c ../config.h misc.o: misc.c ../config.h conf_core.h conf.h global_typedefs.h \ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \ ../src_3rd/genvector/genvector_impl.h \ @@ -3585,6 +3585,21 @@ obj_pinvia.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ ../src_3rd/genlist/gentdlist_impl.c +obj_pinvia_therm.o: obj_pinvia_therm.c ../config.h board.h const.h \ + macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \ + ../src_3rd/genvector/genvector_impl.h \ + ../src_3rd/genvector/genvector_undef.h global_objs.h \ + ../src_3rd/genlist/gendlist.h attrib.h flag.h globalconst.h polyarea.h \ + layer.h obj_all_list.h obj_arc_list.h obj_arc.h \ + ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ + ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \ + ht_element.h ../src_3rd/liblihata/genht/ht.h \ + ../src_3rd/liblihata/genht/ht_inlines.h \ + ../src_3rd/liblihata/genht/hash.h obj_line_list.h obj_line.h \ + obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_poly_list.h \ + obj_text_list.h obj_text.h obj_rat_list.h obj_rat.h library.h \ + rats_patch.h vtonpoint.h polygon.h rtree.h math_helper.h \ + obj_pinvia_therm.h mymem.h obj_poly.o: obj_poly.c ../config.h global_objs.h \ ../src_3rd/genlist/gendlist.h attrib.h flag.h globalconst.h \ global_typedefs.h pcb_bool.h unit.h polyarea.h board.h const.h macro.h \ @@ -3675,8 +3690,8 @@ board.h const.h macro.h vtroutestyle.h library.h rats_patch.h \ action_helper.h change.h undo.h funchash_core.h funchash.h \ funchash_core_list.h search.h rats.h netlist.h route_style.h misc_util.h \ - move.h draw.h mirror.h rotate.h set.h copy.h misc.h mymem.h remove.h \ - create.h compat_misc.h compat_nls.h obj_all.h obj_poly.h + move.h draw.h rotate.h set.h copy.h misc.h mymem.h remove.h create.h \ + compat_misc.h compat_nls.h obj_all.h obj_poly.h paths.o: paths.c ../config.h paths.h error.h conf_core.h conf.h \ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \ @@ -3764,8 +3779,8 @@ rats_patch.h vtonpoint.h box.h math_helper.h move.h misc_util.h create.h \ rubberband.h data.h global_element.h crosshair.h hid.h error.h drc.h \ buffer.h draw.h polygon.h rtree.h remove.h search.h rats.h netlist.h \ - route_style.h set.h thermal.h mymem.h undo.h misc.h compat_nls.h \ - obj_all.h obj_poly.h + route_style.h set.h obj_pinvia_therm.h mymem.h undo.h misc.h \ + compat_nls.h obj_all.h obj_poly.h polygon1.o: polygon1.c ../config.h rtree.h global_typedefs.h pcb_bool.h \ unit.h math_helper.h heap.h compat_cc.h pcb-printf.h \ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \ @@ -4023,6 +4038,10 @@ rats_patch.h vtonpoint.h buffer.h crosshair.h rubberband.h hid.h error.h \ drc.h data.h global_element.h draw.h find.h set.h undo.h hid_actions.h \ route_style.h compat_nls.h +stub_draw_fab.o: stub_draw_fab.c ../config.h stub_draw_fab.h hid.h \ + error.h drc.h unit.h global_typedefs.h pcb_bool.h attrib.h global_objs.h \ + ../src_3rd/genlist/gendlist.h flag.h globalconst.h polyarea.h obj_text.h \ + draw.h stub_mincut.o: stub_mincut.c ../config.h global_objs.h \ ../src_3rd/genlist/gendlist.h attrib.h flag.h globalconst.h \ global_typedefs.h pcb_bool.h unit.h polyarea.h stub_mincut.h \ @@ -4030,21 +4049,6 @@ stub_stroke.o: stub_stroke.c error.h ../config.h pcb_bool.h stub_vendor.o: stub_vendor.c ../config.h stub_vendor.h global_typedefs.h \ pcb_bool.h unit.h -thermal.o: thermal.c ../config.h board.h const.h macro.h \ - global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \ - ../src_3rd/genvector/genvector_impl.h \ - ../src_3rd/genvector/genvector_undef.h global_objs.h \ - ../src_3rd/genlist/gendlist.h attrib.h flag.h globalconst.h polyarea.h \ - layer.h obj_all_list.h obj_arc_list.h obj_arc.h \ - ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ - ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \ - ht_element.h ../src_3rd/liblihata/genht/ht.h \ - ../src_3rd/liblihata/genht/ht_inlines.h \ - ../src_3rd/liblihata/genht/hash.h obj_line_list.h obj_line.h \ - obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_poly_list.h \ - obj_text_list.h obj_text.h obj_rat_list.h obj_rat.h library.h \ - rats_patch.h vtonpoint.h polygon.h rtree.h math_helper.h thermal.h \ - mymem.h undo.o: undo.c ../config.h board.h const.h macro.h global_typedefs.h \ pcb_bool.h unit.h vtroutestyle.h ../src_3rd/genvector/genvector_impl.h \ ../src_3rd/genvector/genvector_undef.h global_objs.h \ @@ -4059,9 +4063,9 @@ obj_text_list.h obj_text.h obj_rat_list.h obj_rat.h library.h \ rats_patch.h vtonpoint.h buffer.h change.h create.h rubberband.h data.h \ global_element.h crosshair.h hid.h error.h drc.h draw.h insert.h misc.h \ - mymem.h mirror.h move.h polygon.h rtree.h math_helper.h remove.h \ - rotate.h search.h rats.h netlist.h route_style.h misc_util.h set.h \ - undo.h flag_str.h conf_core.h conf.h pcb-printf.h \ + mymem.h move.h polygon.h rtree.h math_helper.h remove.h rotate.h \ + search.h rats.h netlist.h route_style.h misc_util.h set.h undo.h \ + flag_str.h conf_core.h conf.h pcb-printf.h \ ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/parser.h ../src_3rd/liblihata/genht/htsp.h \ Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 4590) +++ trunk/src/Makefile.in (revision 4591) @@ -72,7 +72,6 @@ list_conf.o main.o main_act.o - mirror.o misc.o misc_util.o move.o @@ -91,6 +90,7 @@ obj_pad.o obj_pad_list.o obj_pinvia.o + obj_pinvia_therm.o obj_pinvia_list.o obj_poly.o obj_poly_list.o @@ -126,7 +126,6 @@ stub_mincut.o stub_stroke.o stub_vendor.o - thermal.o undo.o undo_act.o unit.o Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 4590) +++ trunk/src/buffer.c (revision 4591) @@ -36,7 +36,6 @@ #include "create.h" #include "data.h" #include "plug_io.h" -#include "mirror.h" #include "misc.h" #include "misc_util.h" #include "polygon.h" Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 4590) +++ trunk/src/change.c (revision 4591) @@ -37,7 +37,6 @@ #include "data.h" #include "draw.h" #include "misc.h" -#include "mirror.h" #include "polygon.h" #include "select.h" #include "undo.h" Index: trunk/src/obj_pinvia_therm.c =================================================================== --- trunk/src/obj_pinvia_therm.c (nonexistent) +++ trunk/src/obj_pinvia_therm.c (revision 4591) @@ -0,0 +1,438 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996,2004,2006 Thomas Nau + * + * this file, thermal.c was written by and is + * (C) Copyright 2006, harry eaton + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Contact addresses for paper mail and Email: + * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany + * Thomas.Nau@rz.uni-ulm.de + * + */ + +/* negative thermal finger polygons */ + +#include "config.h" + +#include +#include + +#include "board.h" +#include "polygon.h" +#include "obj_pinvia_therm.h" + +static PCBTypePtr pcb; + +struct cent { + Coord x, y; + Coord s, c; + char style; + POLYAREA *p; +}; + +static POLYAREA *diag_line(Coord X, Coord Y, Coord l, Coord w, pcb_bool rt) +{ + PLINE *c; + Vector v; + Coord x1, x2, y1, y2; + + if (rt) { + x1 = (l - w) * M_SQRT1_2; + x2 = (l + w) * M_SQRT1_2; + y1 = x1; + y2 = x2; + } + else { + x2 = -(l - w) * M_SQRT1_2; + x1 = -(l + w) * M_SQRT1_2; + y1 = -x1; + y2 = -x2; + } + + v[0] = X + x1; + v[1] = Y + y2; + if ((c = poly_NewContour(v)) == NULL) + return NULL; + v[0] = X - x2; + v[1] = Y - y1; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[0] = X - x1; + v[1] = Y - y2; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[0] = X + x2; + v[1] = Y + y1; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + return ContourToPoly(c); +} + +static POLYAREA *square_therm(PinTypePtr pin, pcb_cardinal_t style) +{ + POLYAREA *p, *p2; + PLINE *c; + Vector v; + Coord d, in, out; + + switch (style) { + case 1: + d = pcb->ThermScale * pin->Clearance * M_SQRT1_2; + out = (pin->Thickness + pin->Clearance) / 2; + in = pin->Thickness / 2; + /* top (actually bottom since +y is down) */ + v[0] = pin->X - in + d; + v[1] = pin->Y + in; + if ((c = poly_NewContour(v)) == NULL) + return NULL; + v[0] = pin->X + in - d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[0] = pin->X + out - d; + v[1] = pin->Y + out; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[0] = pin->X - out + d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + p = ContourToPoly(c); + /* right */ + v[0] = pin->X + in; + v[1] = pin->Y + in - d; + if ((c = poly_NewContour(v)) == NULL) + return NULL; + v[1] = pin->Y - in + d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[0] = pin->X + out; + v[1] = pin->Y - out + d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[1] = pin->Y + out - d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + p2 = ContourToPoly(c); + p->f = p2; + p2->b = p; + /* left */ + v[0] = pin->X - in; + v[1] = pin->Y - in + d; + if ((c = poly_NewContour(v)) == NULL) + return NULL; + v[1] = pin->Y + in - d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[0] = pin->X - out; + v[1] = pin->Y + out - d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[1] = pin->Y - out + d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + p2 = ContourToPoly(c); + p->f->f = p2; + p2->b = p->f; + /* bottom (actually top since +y is down) */ + v[0] = pin->X + in - d; + v[1] = pin->Y - in; + if ((c = poly_NewContour(v)) == NULL) + return NULL; + v[0] = pin->X - in + d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[0] = pin->X - out + d; + v[1] = pin->Y - out; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[0] = pin->X + out - d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + p2 = ContourToPoly(c); + p->f->f->f = p2; + p2->f = p; + p2->b = p->f->f; + p->b = p2; + return p; + case 4: + { + LineType l; + l.Flags = NoFlags(); + d = pin->Thickness / 2 - pcb->ThermScale * pin->Clearance; + out = pin->Thickness / 2 + pin->Clearance / 4; + in = pin->Clearance / 2; + /* top */ + l.Point1.X = pin->X - d; + l.Point2.Y = l.Point1.Y = pin->Y + out; + l.Point2.X = pin->X + d; + p = LinePoly(&l, in); + /* right */ + l.Point1.X = l.Point2.X = pin->X + out; + l.Point1.Y = pin->Y - d; + l.Point2.Y = pin->Y + d; + p2 = LinePoly(&l, in); + p->f = p2; + p2->b = p; + /* bottom */ + l.Point1.X = pin->X - d; + l.Point2.Y = l.Point1.Y = pin->Y - out; + l.Point2.X = pin->X + d; + p2 = LinePoly(&l, in); + p->f->f = p2; + p2->b = p->f; + /* left */ + l.Point1.X = l.Point2.X = pin->X - out; + l.Point1.Y = pin->Y - d; + l.Point2.Y = pin->Y + d; + p2 = LinePoly(&l, in); + p->f->f->f = p2; + p2->b = p->f->f; + p->b = p2; + p2->f = p; + return p; + } + default: /* style 2 and 5 */ + d = 0.5 * pcb->ThermScale * pin->Clearance; + if (style == 5) + d += d; + out = (pin->Thickness + pin->Clearance) / 2; + in = pin->Thickness / 2; + /* topright */ + v[0] = pin->X + in; + v[1] = pin->Y + in; + if ((c = poly_NewContour(v)) == NULL) + return NULL; + v[1] = pin->Y + d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + if (style == 2) { + v[0] = pin->X + out; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + } + else + frac_circle(c, v[0] + pin->Clearance / 4, v[1], v, 2); + v[1] = pin->Y + in; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + /* pivot 1/4 circle to next point */ + frac_circle(c, pin->X + in, pin->Y + in, v, 4); + v[0] = pin->X + d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + if (style == 2) { + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[1] = pin->Y + in; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + } + else + frac_circle(c, v[0], v[1] - pin->Clearance / 4, v, 2); + p = ContourToPoly(c); + /* bottom right */ + v[0] = pin->X + in; + v[1] = pin->Y - d; + if ((c = poly_NewContour(v)) == NULL) + return NULL; + v[1] = pin->Y - in; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[0] = pin->X + d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + if (style == 2) { + v[1] = pin->Y - out; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + } + else + frac_circle(c, v[0], v[1] - pin->Clearance / 4, v, 2); + v[0] = pin->X + in; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + /* pivot 1/4 circle to next point */ + frac_circle(c, pin->X + in, pin->Y - in, v, 4); + v[1] = pin->Y - d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + if (style == 5) + frac_circle(c, v[0] - pin->Clearance / 4, v[1], v, 2); + p2 = ContourToPoly(c); + p->f = p2; + p2->b = p; + /* bottom left */ + v[0] = pin->X - d; + v[1] = pin->Y - in; + if ((c = poly_NewContour(v)) == NULL) + return NULL; + v[0] = pin->X - in; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[1] = pin->Y - d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + if (style == 2) { + v[0] = pin->X - out; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + } + else + frac_circle(c, v[0] - pin->Clearance / 4, v[1], v, 2); + v[1] = pin->Y - in; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + /* pivot 1/4 circle to next point */ + frac_circle(c, pin->X - in, pin->Y - in, v, 4); + v[0] = pin->X - d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + if (style == 5) + frac_circle(c, v[0], v[1] + pin->Clearance / 4, v, 2); + p2 = ContourToPoly(c); + p->f->f = p2; + p2->b = p->f; + /* top left */ + v[0] = pin->X - d; + v[1] = pin->Y + out; + if ((c = poly_NewContour(v)) == NULL) + return NULL; + v[0] = pin->X - in; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + /* pivot 1/4 circle to next point (x-out, y+in) */ + frac_circle(c, pin->X - in, pin->Y + in, v, 4); + v[1] = pin->Y + d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + if (style == 2) { + v[0] = pin->X - in; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + } + else + frac_circle(c, v[0] + pin->Clearance / 4, v[1], v, 2); + v[1] = pin->Y + in; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + v[0] = pin->X - d; + poly_InclVertex(c->head.prev, poly_CreateNode(v)); + if (style == 5) + frac_circle(c, v[0], v[1] + pin->Clearance / 4, v, 2); + p2 = ContourToPoly(c); + p->f->f->f = p2; + p2->f = p; + p2->b = p->f->f; + p->b = p2; + return p; + } +} + +static POLYAREA *oct_therm(PinTypePtr pin, pcb_cardinal_t style) +{ + POLYAREA *p, *p2, *m; + Coord t = 0.5 * pcb->ThermScale * pin->Clearance; + Coord w = pin->Thickness + pin->Clearance; + + p = OctagonPoly(pin->X, pin->Y, w, GET_SQUARE(pin)); + p2 = OctagonPoly(pin->X, pin->Y, pin->Thickness, GET_SQUARE(pin)); + /* make full clearance ring */ + poly_Boolean_free(p, p2, &m, PBO_SUB); + switch (style) { + default: + case 1: + p = diag_line(pin->X, pin->Y, w, t, pcb_true); + poly_Boolean_free(m, p, &p2, PBO_SUB); + p = diag_line(pin->X, pin->Y, w, t, pcb_false); + poly_Boolean_free(p2, p, &m, PBO_SUB); + return m; + case 2: + p = RectPoly(pin->X - t, pin->X + t, pin->Y - w, pin->Y + w); + poly_Boolean_free(m, p, &p2, PBO_SUB); + p = RectPoly(pin->X - w, pin->X + w, pin->Y - t, pin->Y + t); + poly_Boolean_free(p2, p, &m, PBO_SUB); + return m; + /* fix me add thermal style 4 */ + case 5: + { + Coord t = pin->Thickness / 2; + POLYAREA *q; + /* cheat by using the square therm's rounded parts */ + p = square_therm(pin, style); + q = RectPoly(pin->X - t, pin->X + t, pin->Y - t, pin->Y + t); + poly_Boolean_free(p, q, &p2, PBO_UNITE); + poly_Boolean_free(m, p2, &p, PBO_ISECT); + return p; + } + } +} + +/* ThermPoly returns a POLYAREA having all of the clearance that when + * subtracted from the plane create the desired thermal fingers. + * Usually this is 4 disjoint regions. + * + */ +POLYAREA *ThermPoly(PCBTypePtr p, PinTypePtr pin, pcb_cardinal_t laynum) +{ + ArcType a; + POLYAREA *pa, *arc; + pcb_cardinal_t style = GET_THERM(laynum, pin); + + if (style == 3) + return NULL; /* solid connection no clearance */ + pcb = p; + if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) + return square_therm(pin, style); + if (TEST_FLAG(PCB_FLAG_OCTAGON, pin)) + return oct_therm(pin, style); + /* must be circular */ + switch (style) { + case 1: + case 2: + { + POLYAREA *m; + Coord t = (pin->Thickness + pin->Clearance) / 2; + Coord w = 0.5 * pcb->ThermScale * pin->Clearance; + pa = CirclePoly(pin->X, pin->Y, t); + arc = CirclePoly(pin->X, pin->Y, pin->Thickness / 2); + /* create a thin ring */ + poly_Boolean_free(pa, arc, &m, PBO_SUB); + /* fix me needs error checking */ + if (style == 2) { + /* t is the theoretically required length, but we use twice that + * to avoid descritisation errors in our circle approximation. + */ + pa = RectPoly(pin->X - t * 2, pin->X + t * 2, pin->Y - w, pin->Y + w); + poly_Boolean_free(m, pa, &arc, PBO_SUB); + pa = RectPoly(pin->X - w, pin->X + w, pin->Y - t * 2, pin->Y + t * 2); + } + else { + /* t is the theoretically required length, but we use twice that + * to avoid descritisation errors in our circle approximation. + */ + pa = diag_line(pin->X, pin->Y, t * 2, w, pcb_true); + poly_Boolean_free(m, pa, &arc, PBO_SUB); + pa = diag_line(pin->X, pin->Y, t * 2, w, pcb_false); + } + poly_Boolean_free(arc, pa, &m, PBO_SUB); + return m; + } + + + default: + a.X = pin->X; + a.Y = pin->Y; + a.Height = a.Width = pin->Thickness / 2 + pin->Clearance / 4; + a.Thickness = 1; + a.Clearance = pin->Clearance / 2; + a.Flags = NoFlags(); + a.Delta = 90 - (a.Clearance * (1. + 2. * pcb->ThermScale) * 180) / (M_PI * a.Width); + a.StartAngle = 90 - a.Delta / 2 + (style == 4 ? 0 : 45); + pa = ArcPoly(&a, a.Clearance); + if (!pa) + return NULL; + a.StartAngle += 90; + arc = ArcPoly(&a, a.Clearance); + if (!arc) + return NULL; + pa->f = arc; + arc->b = pa; + a.StartAngle += 90; + arc = ArcPoly(&a, a.Clearance); + if (!arc) + return NULL; + pa->f->f = arc; + arc->b = pa->f; + a.StartAngle += 90; + arc = ArcPoly(&a, a.Clearance); + if (!arc) + return NULL; + pa->b = arc; + pa->f->f->f = arc; + arc->b = pa->f->f; + arc->f = pa; + pa->b = arc; + return pa; + } +} Index: trunk/src/obj_pinvia_therm.h =================================================================== --- trunk/src/obj_pinvia_therm.h (nonexistent) +++ trunk/src/obj_pinvia_therm.h (revision 4591) @@ -0,0 +1,45 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996,2006 Thomas Nau + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Contact addresses for paper mail and Email: + * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany + * Thomas.Nau@rz.uni-ulm.de + * + */ + +/* prototypes for thermal routines + * + * Thermals are normal lines on the layout. The only thing unique + * about them is that they have the PCB_FLAG_USETHERMAL set so that they + * can be identified as thermals. It is handy for pcb to automatically + * make adjustments to the thermals when the user performs certain + * operations, and the functions in thermal.h help implement that. + */ + +#ifndef PCB_THERMAL_H +#define PCB_THERMAL_H + +#include +#include "config.h" +#include "mymem.h" + +POLYAREA *ThermPoly(PCBTypePtr, PinTypePtr, pcb_cardinal_t); + +#endif Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 4590) +++ trunk/src/object_act.c (revision 4591) @@ -39,7 +39,6 @@ #include "search.h" #include "move.h" #include "draw.h" -#include "mirror.h" #include "rotate.h" #include "set.h" #include "copy.h" Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 4590) +++ trunk/src/polygon.c (revision 4591) @@ -89,7 +89,7 @@ #include "remove.h" #include "search.h" #include "set.h" -#include "thermal.h" +#include "obj_pinvia_therm.h" #include "undo.h" #include "misc.h" #include "layer.h" Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 4590) +++ trunk/src/undo.c (revision 4591) @@ -55,7 +55,6 @@ #include "insert.h" #include "layer.h" #include "misc.h" -#include "mirror.h" #include "move.h" #include "polygon.h" #include "remove.h" Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 4590) +++ trunk/src_plugins/autoplace/autoplace.c (revision 4591) @@ -52,7 +52,6 @@ #include "intersect.h" #include "rtree.h" #include "macro.h" -#include "mirror.h" #include "misc.h" #include "move.h" #include "mymem.h" Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 4590) +++ trunk/src_plugins/autoroute/autoroute.c (revision 4591) @@ -72,7 +72,7 @@ #include "polygon.h" #include "rats.h" #include "remove.h" -#include "thermal.h" +#include "obj_pinvia_therm.h" #include "undo.h" #include "vector.h" #include "pcb-printf.h" Index: trunk/src_plugins/export_openscad/scadcomp.c =================================================================== --- trunk/src_plugins/export_openscad/scadcomp.c (revision 4590) +++ trunk/src_plugins/export_openscad/scadcomp.c (revision 4591) @@ -43,7 +43,6 @@ #include "misc.h" #include "error.h" #include "buffer.h" -#include "mirror.h" #include "create.h" #include "misc_util.h" Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 4590) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 4591) @@ -117,7 +117,7 @@ #include "remove.h" #include "rtree.h" #include "flag_str.h" -#include "thermal.h" +#include "obj_pinvia_therm.h" #include "rats_patch.h" #include "flags.h" #include "route_style.h" Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 4590) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 4591) @@ -54,7 +54,7 @@ #include "remove.h" #include "rtree.h" #include "flag_str.h" -#include "thermal.h" +#include "obj_pinvia_therm.h" #include "rats_patch.h" #include "flags.h" #include "route_style.h" Index: trunk/src_plugins/toporouter/toporouter.h =================================================================== --- trunk/src_plugins/toporouter/toporouter.h (revision 4590) +++ trunk/src_plugins/toporouter/toporouter.h (revision 4591) @@ -44,7 +44,7 @@ #include "polygon.h" #include "rats.h" #include "remove.h" -#include "thermal.h" +#include "obj_pinvia_therm.h" #include "undo.h" #include "config.h"