From 16139ae6034987593b43609b0c5ad5bb5e6c023a Mon Sep 17 00:00:00 2001 From: Rob Spanton Date: Sun, 7 Feb 2016 17:39:28 +0000 Subject: [PATCH] Remove hard-coded minimum copper annulus requirement Currently, pcb requires that vias and pins have a copper annulus of 0.0508mm, and if they don't, pcb will increase the pad size to enforce this requirement. The requirement for a particular width of copper around a via or pin should depend upon the design rules for the particular fab process being used. This patch removes this hard-coded minimum requirement, and allows the user to create vias with no copper annulus should they wish. This means that it is now possible to create vias that have pads that are the same diameter as their holes. This is currently slightly troublesome, as it means they're quite hard to see with the default colour scheme in pcb -- but this can easily be fixed later. --- globalconst.h | 1 - src/change.c | 14 +++++--------- src/create.c | 22 +++++++++++----------- src/hid/gtk/ghid-route-style-selector.c | 4 ++-- src/parse_y.y | 10 ---------- src/set.c | 4 ++-- src/vendor.c | 6 ++---- 7 files changed, 22 insertions(+), 39 deletions(-) diff --git a/globalconst.h b/globalconst.h index d7c9d42..3249265 100755 --- a/globalconst.h +++ b/globalconst.h @@ -79,7 +79,6 @@ #define MIN_PINORVIASIZE MIL_TO_COORD(20) /* size of a pin or via */ #define MIN_PINORVIAHOLE MIL_TO_COORD(4) /* size of a pins or vias drilling hole */ #define MAX_PINORVIASIZE LARGE_VALUE -#define MIN_PINORVIACOPPER MIL_TO_COORD(4) /* min difference outer-inner diameter */ #define MIN_PADSIZE MIL_TO_COORD(1) /* min size of a pad */ #define MAX_PADSIZE LARGE_VALUE /* max size of a pad */ #define MIN_DRC_VALUE MIL_TO_COORD(0.1) diff --git a/src/change.c b/src/change.c index a2823b7..0bd2aad 100644 --- a/src/change.c +++ b/src/change.c @@ -399,7 +399,7 @@ ChangeViaSize (PinType *Via) return (NULL); if (!TEST_FLAG (HOLEFLAG, Via) && value <= MAX_PINORVIASIZE && value >= MIN_PINORVIASIZE && - value >= Via->DrillingHole + MIN_PINORVIACOPPER && + value > Via->DrillingHole && value != Via->Thickness) { AddObjectToSizeUndoList (VIA_TYPE, Via, Via, Via); @@ -435,8 +435,7 @@ ChangeVia2ndSize (PinType *Via) return (NULL); if (value <= MAX_PINORVIASIZE && value >= MIN_PINORVIAHOLE && (TEST_FLAG (HOLEFLAG, Via) || - value <= - Via->Thickness - MIN_PINORVIACOPPER) + value < Via->Thickness) && value != Via->DrillingHole) { AddObjectTo2ndSizeUndoList (VIA_TYPE, Via, Via, Via); @@ -504,7 +503,7 @@ ChangePinSize (ElementType *Element, PinType *Pin) return (NULL); if (!TEST_FLAG (HOLEFLAG, Pin) && value <= MAX_PINORVIASIZE && value >= MIN_PINORVIASIZE && - value >= Pin->DrillingHole + MIN_PINORVIACOPPER && + value > Pin->DrillingHole && value != Pin->Thickness) { AddObjectToSizeUndoList (PIN_TYPE, Element, Pin, Pin); @@ -637,9 +636,7 @@ ChangeElement2ndSize (ElementType *Element) value = (Absolute) ? Absolute : pin->DrillingHole + Delta; if (value <= MAX_PINORVIASIZE && value >= MIN_PINORVIAHOLE && (TEST_FLAG (HOLEFLAG, pin) || - value <= - pin->Thickness - - MIN_PINORVIACOPPER) + value <= pin->Thickness) && value != pin->DrillingHole) { changed = true; @@ -677,8 +674,7 @@ ChangePin2ndSize (ElementType *Element, PinType *Pin) return (NULL); if (value <= MAX_PINORVIASIZE && value >= MIN_PINORVIAHOLE && (TEST_FLAG (HOLEFLAG, Pin) || - value <= - Pin->Thickness - MIN_PINORVIACOPPER) + value < Pin->Thickness) && value != Pin->DrillingHole) { AddObjectTo2ndSizeUndoList (PIN_TYPE, Element, Pin, Pin); diff --git a/src/create.c b/src/create.c index 5907a1f..d164272 100644 --- a/src/create.c +++ b/src/create.c @@ -294,17 +294,17 @@ CreateNewVia (DataType *Data, SET_FLAG (VIAFLAG, Via); Via->ID = ID++; - /* - * don't complain about MIN_PINORVIACOPPER on a mounting hole (pure - * hole) - */ + /* Increase copper diameter to drill hole size if it's lower (unless + it's a mounting hole). This will at least make incrementing the + via's copper size reasonably intuitive (i.e. it won't take + several increments before the copper is visible). */ if (!TEST_FLAG (HOLEFLAG, Via) && - (Via->Thickness < Via->DrillingHole + MIN_PINORVIACOPPER)) + (Via->Thickness < Via->DrillingHole)) { - Via->Thickness = Via->DrillingHole + MIN_PINORVIACOPPER; - Message (_("%m+Increased via thickness to %$mS to allow enough copper" - " at %$mD.\n"), - Settings.grid_unit->allow, Via->Thickness, Via->X, Via->Y); + Via->Thickness = Via->DrillingHole; + Message (_("%m+Warning: Via's pad diameter was below hole size, " + "so pad diameter was increased to hole size at %$mD.\n"), + Settings.grid_unit->allow, Via->X, Via->Y); } SetPinBoundingBox (Via); @@ -837,9 +837,9 @@ CreateNewPin (ElementType *Element, pin->DrillingHole = DrillingHole; } else if (!TEST_FLAG (HOLEFLAG, pin) - && (pin->DrillingHole > pin->Thickness - MIN_PINORVIACOPPER)) + && (pin->DrillingHole > pin->Thickness)) { - Message (_("%m+Did not map pin #%s (%s) drill hole because %$mS does not leave enough copper\n"), + Message (_("%m+Did not map pin #%s (%s) drill hole because %$mS does not leave any copper\n"), Settings.grid_unit->allow, UNKNOWN (Number), UNKNOWN (Name), pin->DrillingHole); pin->DrillingHole = DrillingHole; } diff --git a/src/hid/gtk/ghid-route-style-selector.c b/src/hid/gtk/ghid-route-style-selector.c index 01f2a96..ea802ad 100644 --- a/src/hid/gtk/ghid-route-style-selector.c +++ b/src/hid/gtk/ghid-route-style-selector.c @@ -223,10 +223,10 @@ ghid_route_style_selector_edit_dialog (GHidRouteStyleSelector *rss) MIN_LINESIZE, MAX_LINESIZE); _table_attach (table, 2, _("Via hole size:"), &dialog_data.via_hole_entry, - MIN_PINORVIAHOLE, MAX_PINORVIASIZE - MIN_PINORVIACOPPER); + MIN_PINORVIAHOLE, MAX_PINORVIASIZE); _table_attach (table, 3, _("Via ring size:"), &dialog_data.via_size_entry, - MIN_PINORVIAHOLE + MIN_PINORVIACOPPER, MAX_PINORVIASIZE); + MIN_PINORVIAHOLE, MAX_PINORVIASIZE); _table_attach (table, 4, _("Clearance:"), &dialog_data.clearance_entry, MIN_LINESIZE, MAX_LINESIZE); diff --git a/src/parse_y.y b/src/parse_y.y index fe14c0c..08f02bb 100644 --- a/src/parse_y.y +++ b/src/parse_y.y @@ -796,11 +796,6 @@ via_oldformat { Coord hole = (OU($5) * DEFAULT_DRILLINGHOLE); - /* make sure that there's enough copper left */ - if (OU($5) - hole < MIN_PINORVIACOPPER && - OU($5) > MIN_PINORVIACOPPER) - hole = OU($5) - MIN_PINORVIACOPPER; - CreateNewVia(yyData, OU ($3), OU ($4), OU ($5), 2*GROUNDPLANEFRAME, OU($5) + 2*MASKFRAME, hole, $6, OldFlags($7)); free ($6); @@ -1626,11 +1621,6 @@ pin_oldformat Coord hole = OU ($5) * DEFAULT_DRILLINGHOLE; char p_number[8]; - /* make sure that there's enough copper left */ - if (OU ($5) - hole < MIN_PINORVIACOPPER && - OU ($5) > MIN_PINORVIACOPPER) - hole = OU ($5) - MIN_PINORVIACOPPER; - sprintf(p_number, "%d", pin_num++); CreateNewPin(yyElement, OU ($3), OU ($4), OU ($5), 2*GROUNDPLANEFRAME, OU ($5) + 2*MASKFRAME, hole, $6, p_number, OldFlags($7)); diff --git a/src/set.c b/src/set.c index 9bf64b8..5ce921b 100644 --- a/src/set.c +++ b/src/set.c @@ -109,7 +109,7 @@ SetViaSize (Coord Size, bool Force) { if (Force || (Size <= MAX_PINORVIASIZE && Size >= MIN_PINORVIASIZE && - Size >= Settings.ViaDrillingHole + MIN_PINORVIACOPPER)) + Size >= Settings.ViaDrillingHole)) { Settings.ViaThickness = Size; } @@ -123,7 +123,7 @@ SetViaDrillingHole (Coord Size, bool Force) { if (Force || (Size <= MAX_PINORVIASIZE && Size >= MIN_PINORVIAHOLE && - Size <= Settings.ViaThickness - MIN_PINORVIACOPPER)) + Size <= Settings.ViaThickness)) { Settings.ViaDrillingHole = Size; } diff --git a/src/vendor.c b/src/vendor.c index 9391404..dca1cb5 100644 --- a/src/vendor.c +++ b/src/vendor.c @@ -581,11 +581,9 @@ apply_vendor_map (void) "%6.2f mils\n"), PCB->RouteStyle[i].Name, 0.01 * PCB->RouteStyle[i].Hole); - if (PCB->RouteStyle[i].Diameter < - PCB->RouteStyle[i].Hole + MIN_PINORVIACOPPER) + if (PCB->RouteStyle[i].Diameter < PCB->RouteStyle[i].Hole) { - PCB->RouteStyle[i].Diameter = - PCB->RouteStyle[i].Hole + MIN_PINORVIACOPPER; + PCB->RouteStyle[i].Diameter = PCB->RouteStyle[i].Hole; Message (_("Increased %s routing style via diameter to " "%6.2f mils\n"), PCB->RouteStyle[i].Name, -- 2.5.0