KiCad PCB EDA Suite
Loading...
Searching...
No Matches
zone_filler.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2014-2017 CERN
5 * Copyright (C) 2014-2017 KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Tomasz Włostowski <[email protected]>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#ifndef ZONE_FILLER_H
27#define ZONE_FILLER_H
28
29#include <vector>
30#include <zone.h>
31
33class BOARD;
34class COMMIT;
35class SHAPE_POLY_SET;
37
38
40{
41public:
42 ZONE_FILLER( BOARD* aBoard, COMMIT* aCommit );
44
45 void SetProgressReporter( PROGRESS_REPORTER* aReporter );
47
58 bool Fill( const std::vector<ZONE*>& aZones, bool aCheck = false, wxWindow* aParent = nullptr );
59
60 bool IsDebug() const { return m_debugZoneFiller; }
61
62private:
63
64 void addKnockout( PAD* aPad, PCB_LAYER_ID aLayer, int aGap, SHAPE_POLY_SET& aHoles );
65
66 void addKnockout( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer, int aGap, bool aIgnoreLineWidth,
67 SHAPE_POLY_SET& aHoles );
68
69 void addHoleKnockout( PAD* aPad, int aGap, SHAPE_POLY_SET& aHoles );
70
71 void knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aFill,
72 std::vector<PAD*>& aThermalConnectionPads,
73 std::vector<PAD*>& aNoConnectionPads );
74
75 void buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLayer,
76 const std::vector<PAD*>& aNoConnectionPads,
77 SHAPE_POLY_SET& aHoles );
78
79 void subtractHigherPriorityZones( const ZONE* aZone, PCB_LAYER_ID aLayer,
80 SHAPE_POLY_SET& aRawFill );
81
93 bool fillCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer, PCB_LAYER_ID aDebugLayer,
94 const SHAPE_POLY_SET& aSmoothedOutline,
95 const SHAPE_POLY_SET& aMaxExtents, SHAPE_POLY_SET& aFillPolys );
96
97 bool fillNonCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer,
98 const SHAPE_POLY_SET& aSmoothedOutline, SHAPE_POLY_SET& aFillPolys );
103 void buildThermalSpokes( const ZONE* box, PCB_LAYER_ID aLayer,
104 const std::vector<PAD*>& aSpokedPadsList,
105 std::deque<SHAPE_LINE_CHAIN>& aSpokes );
106
112 void connect_nearby_polys( SHAPE_POLY_SET& aPolys, double aDistance );
113
126 bool fillSingleZone( ZONE* aZone, PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aFillPolys );
127
135 bool addHatchFillTypeOnZone( const ZONE* aZone, PCB_LAYER_ID aLayer, PCB_LAYER_ID aDebugLayer,
136 SHAPE_POLY_SET& aFillPolys );
137
139 SHAPE_POLY_SET m_boardOutline; // the board outlines, if exists
140 bool m_brdOutlinesValid; // true if m_boardOutline is well-formed
143
146
148};
149
150#endif
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
Represent a set of changes (additions, deletions or modifications) of a data model (e....
Definition: commit.h:74
Definition: pad.h:54
A progress reporter interface for use in multi-threaded environments.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
COMMIT * m_commit
Definition: zone_filler.h:141
int m_worstClearance
Definition: zone_filler.h:145
void buildCopperItemClearances(const ZONE *aZone, PCB_LAYER_ID aLayer, const std::vector< PAD * > &aNoConnectionPads, SHAPE_POLY_SET &aHoles)
Removes clearance from the shape for copper items which share the zone's layer but are not connected ...
void addKnockout(PAD *aPad, PCB_LAYER_ID aLayer, int aGap, SHAPE_POLY_SET &aHoles)
Add a knockout for a pad.
bool m_debugZoneFiller
Definition: zone_filler.h:147
void connect_nearby_polys(SHAPE_POLY_SET &aPolys, double aDistance)
Create strands of zero-width between elements of SHAPE_POLY_SET that are within aDistance of each oth...
void buildThermalSpokes(const ZONE *box, PCB_LAYER_ID aLayer, const std::vector< PAD * > &aSpokedPadsList, std::deque< SHAPE_LINE_CHAIN > &aSpokes)
Function buildThermalSpokes Constructs a list of all thermal spokes for the given zone.
void subtractHigherPriorityZones(const ZONE *aZone, PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aRawFill)
Removes the outlines of higher-proirity zones with the same net.
SHAPE_POLY_SET m_boardOutline
Definition: zone_filler.h:139
bool m_brdOutlinesValid
Definition: zone_filler.h:140
bool addHatchFillTypeOnZone(const ZONE *aZone, PCB_LAYER_ID aLayer, PCB_LAYER_ID aDebugLayer, SHAPE_POLY_SET &aFillPolys)
for zones having the ZONE_FILL_MODE::ZONE_FILL_MODE::HATCH_PATTERN, create a grid pattern in filled a...
void SetProgressReporter(PROGRESS_REPORTER *aReporter)
PROGRESS_REPORTER * GetProgressReporter() const
Definition: zone_filler.h:46
BOARD * m_board
Definition: zone_filler.h:138
void knockoutThermalReliefs(const ZONE *aZone, PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aFill, std::vector< PAD * > &aThermalConnectionPads, std::vector< PAD * > &aNoConnectionPads)
Removes thermal reliefs from the shape for any pads connected to the zone.
PROGRESS_REPORTER * m_progressReporter
Definition: zone_filler.h:142
bool fillCopperZone(const ZONE *aZone, PCB_LAYER_ID aLayer, PCB_LAYER_ID aDebugLayer, const SHAPE_POLY_SET &aSmoothedOutline, const SHAPE_POLY_SET &aMaxExtents, SHAPE_POLY_SET &aFillPolys)
Function fillCopperZone Add non copper areas polygons (pads and tracks with clearance) to a filled co...
void addHoleKnockout(PAD *aPad, int aGap, SHAPE_POLY_SET &aHoles)
Add a knockout for a pad's hole.
bool fillNonCopperZone(const ZONE *aZone, PCB_LAYER_ID aLayer, const SHAPE_POLY_SET &aSmoothedOutline, SHAPE_POLY_SET &aFillPolys)
bool fillSingleZone(ZONE *aZone, PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aFillPolys)
Build the filled solid areas polygons from zone outlines (stored in m_Poly) The solid areas can be mo...
bool Fill(const std::vector< ZONE * > &aZones, bool aCheck=false, wxWindow *aParent=nullptr)
Fills the given list of zones.
bool IsDebug() const
Definition: zone_filler.h:60
Handle a list of polygons defining a copper zone.
Definition: zone.h:73
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60