KiCad PCB EDA Suite
Loading...
Searching...
No Matches
teardrop.cpp
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) 2021 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25
26#include <confirm.h>
27
29#include <pcb_track.h>
30#include <pad.h>
31#include <zone_filler.h>
32#include <board_commit.h>
33
35#include <teardrop/teardrop.h>
36#include <drc/drc_rtree.h>
38#include <geometry/rtree.h>
40#include <bezier_curves.h>
41
42#include <wx/log.h>
43
44// The first priority level of a teardrop area (arbitrary value)
45#define MAGIC_TEARDROP_ZONE_ID 30000
46
47
49 m_board( aBoard ),
50 m_toolManager( aToolManager )
51{
52 m_prmsList = m_board->GetDesignSettings().GetTeadropParamsList();
53 m_tolerance = 0;
54}
55
56
58 std::vector<VECTOR2I>& aPoints, PCB_TRACK* aTrack ) const
59{
60 ZONE* teardrop = new ZONE( m_board );
61
62 // teardrop settings are the last zone settings used by a zone dialog.
63 // override them by default.
65
66 // Add zone properties (priority will be fixed later)
67 teardrop->SetTeardropAreaType( aTeardropVariant == TD_TYPE_PADVIA ? TEARDROP_TYPE::TD_VIAPAD
69 teardrop->SetLayer( aTrack->GetLayer() );
70 teardrop->SetNetCode( aTrack->GetNetCode() );
71 teardrop->SetLocalClearance( 0 );
72 teardrop->SetMinThickness( pcbIUScale.mmToIU( 0.0254 ) ); // The minimum zone thickness
74 teardrop->SetIsFilled( false );
77
78 SHAPE_POLY_SET* outline = teardrop->Outline();
79 outline->NewOutline();
80
81 for( const VECTOR2I& pt: aPoints )
82 outline->Append( pt.x, pt.y );
83
84 // Until we know better (ie: pay for a potentially very expensive zone refill), the teardrop
85 // fill is the same as its outline.
86 teardrop->SetFilledPolysList( aTrack->GetLayer(), *teardrop->Outline() );
87 teardrop->SetIsFilled( true );
88
89 // Used in priority calculations:
90 teardrop->CalculateFilledArea();
91
92 return teardrop;
93}
94
95
97 std::vector<VECTOR2I>& aPoints, PCB_TRACK* aTrack ) const
98{
99 ZONE* teardrop = new ZONE( m_board );
100
101 teardrop->SetTeardropAreaType( aTeardropVariant == TD_TYPE_PADVIA ? TEARDROP_TYPE::TD_VIAPAD
103 teardrop->SetLayer( aTrack->GetLayer() == F_Cu ? F_Mask : B_Mask );
104 teardrop->SetMinThickness( pcbIUScale.mmToIU( 0.0254 ) ); // The minimum zone thickness
105 teardrop->SetIsFilled( false );
108
109 SHAPE_POLY_SET* outline = teardrop->Outline();
110 outline->NewOutline();
111
112 for( const VECTOR2I& pt: aPoints )
113 outline->Append( pt.x, pt.y );
114
115 if( int expansion = aTrack->GetSolderMaskExpansion() )
116 {
117 // The zone-min-thickness deflate/reinflate is going to round corners, so it's more
118 // efficient to allow acute corners on the solder mask expansion here, and delegate the
119 // rounding to the deflate/reinflate.
120 teardrop->SetMinThickness( std::max( teardrop->GetMinThickness(), expansion ) );
121
123 m_board->GetDesignSettings().m_MaxError );
124 }
125
126 // Until we know better (ie: pay for a potentially very expensive zone refill), the teardrop
127 // fill is the same as its outline.
128 teardrop->SetFilledPolysList( teardrop->GetLayer(), *teardrop->Outline() );
129 teardrop->SetIsFilled( true );
130
131 return teardrop;
132}
133
134
136 TEARDROP_VARIANT aTeardropVariant,
137 std::vector<VECTOR2I>& aPoints,
138 PCB_TRACK* aTrack )
139{
140 ZONE* new_teardrop = createTeardrop( aTeardropVariant, aPoints, aTrack );
141 m_board->Add( new_teardrop, ADD_MODE::BULK_INSERT );
142 m_createdTdList.push_back( new_teardrop );
143
144 aCommit.Added( new_teardrop );
145
146 if( aTrack->HasSolderMask() && IsExternalCopperLayer( aTrack->GetLayer() ) )
147 {
148 ZONE* new_teardrop_mask = createTeardropMask( aTeardropVariant, aPoints, aTrack );
149 m_board->Add( new_teardrop_mask, ADD_MODE::BULK_INSERT );
150 aCommit.Added( new_teardrop_mask );
151 }
152}
153
154
156 const TEARDROP_PARAMETERS& aParams,
157 TEARDROP_MANAGER::TEARDROP_VARIANT aTeardropVariant,
158 PCB_TRACK* aTrack, BOARD_ITEM* aCandidate,
159 const VECTOR2I& aPos )
160{
161 std::vector<VECTOR2I> points;
162
163 if( computeTeardropPolygon( aParams, points, aTrack, aCandidate, aPos ) )
164 {
165 createAndAddTeardropWithMask( aCommit, aTeardropVariant, points, aTrack );
166 return true;
167 }
168
169 return false;
170}
171
172
174 const std::vector<BOARD_ITEM*>* dirtyPadsAndVias,
175 const std::set<PCB_TRACK*>* dirtyTracks )
176{
177 std::shared_ptr<CONNECTIVITY_DATA> connectivity = m_board->GetConnectivity();
178
179 auto isStale =
180 [&]( ZONE* zone )
181 {
182 std::vector<PAD*> connectedPads;
183 std::vector<PCB_VIA*> connectedVias;
184
185 connectivity->GetConnectedPadsAndVias( zone, &connectedPads, &connectedVias );
186
187 for( PAD* pad : connectedPads )
188 {
189 if( alg::contains( *dirtyPadsAndVias, pad ) )
190 return true;
191 }
192
193 for( PCB_VIA* via : connectedVias )
194 {
195 if( alg::contains( *dirtyPadsAndVias, via ) )
196 return true;
197 }
198
199 for( PCB_TRACK* track : connectivity->GetConnectedTracks( zone ) )
200 {
201 if( alg::contains( *dirtyTracks, track ) )
202 return true;
203 }
204
205 return false;
206 };
207
208 for( ZONE* zone : m_board->Zones() )
209 {
210 if( zone->IsTeardropArea() && isStale( zone ) )
211 zone->SetFlags( STRUCT_DELETED );
212 }
213
214 m_board->BulkRemoveStaleTeardrops( aCommit );
215}
216
217
219 const std::vector<BOARD_ITEM*>* dirtyPadsAndVias,
220 const std::set<PCB_TRACK*>* dirtyTracks,
221 bool aForceFullUpdate )
222{
223 if( m_board->LegacyTeardrops() )
224 return;
225
226 // Init parameters:
227 m_tolerance = pcbIUScale.mmToIU( 0.01 );
228
230
231 // Old teardrops must be removed, to ensure a clean teardrop rebuild
232 if( aForceFullUpdate )
233 {
234 for( ZONE* zone : m_board->Zones() )
235 {
236 if( zone->IsTeardropArea() )
237 zone->SetFlags( STRUCT_DELETED );
238 }
239
240 m_board->BulkRemoveStaleTeardrops( aCommit );
241 }
242
243 std::shared_ptr<CONNECTIVITY_DATA> connectivity = m_board->GetConnectivity();
244
245 for( PCB_TRACK* track : m_board->Tracks() )
246 {
247 if( ! ( track->Type() == PCB_TRACE_T || track->Type() == PCB_ARC_T ) )
248 continue;
249
250 std::vector<PAD*> connectedPads;
251 std::vector<PCB_VIA*> connectedVias;
252
253 connectivity->GetConnectedPadsAndVias( track, &connectedPads, &connectedVias );
254
255 bool forceUpdate = aForceFullUpdate || dirtyTracks->contains( track );
256
257 for( PAD* pad : connectedPads )
258 {
259 if( !forceUpdate && !alg::contains( *dirtyPadsAndVias, pad ) )
260 continue;
261
262 TEARDROP_PARAMETERS& tdParams = pad->GetTeardropParams();
263 VECTOR2I padSize = pad->GetSize( track->GetLayer() );
264 int annularWidth = std::min( padSize.x, padSize.y );
265
266 if( !tdParams.m_Enabled )
267 continue;
268
269 // Ensure a teardrop shape can be built: track width must be < teardrop width and
270 // filter width
271 if( track->GetWidth() >= tdParams.m_TdMaxWidth
272 || track->GetWidth() >= annularWidth * tdParams.m_BestWidthRatio
273 || track->GetWidth() >= annularWidth * tdParams.m_WidthtoSizeFilterRatio )
274 {
275 continue;
276 }
277
278 bool startHitsPad = pad->HitTest( track->GetStart(), 0, track->GetLayer() );
279 bool endHitsPad = pad->HitTest( track->GetEnd(), 0, track->GetLayer() );
280
281 // The track is entirely inside the pad; cannot create a teardrop
282 if( startHitsPad && endHitsPad )
283 continue;
284
285 // Skip case where pad and the track are within a copper zone with the same net
286 // (and the pad can be connected to the zone)
287 if( !tdParams.m_TdOnPadsInZones && areItemsInSameZone( pad, track ) )
288 continue;
289
290 tryCreateTrackTeardrop( aCommit, tdParams, TEARDROP_MANAGER::TD_TYPE_PADVIA, track, pad, pad->GetPosition() );
291
292 if( !startHitsPad && !endHitsPad )
293 {
294 PCB_TRACK reversed( *track );
295 reversed.SetStart( track->GetEnd() );
296 reversed.SetEnd( pad->GetPosition() );
297 tryCreateTrackTeardrop( aCommit, tdParams, TEARDROP_MANAGER::TD_TYPE_PADVIA, &reversed, pad, pad->GetPosition() );
298 reversed.SetStart( track->GetStart() );
299 tryCreateTrackTeardrop( aCommit, tdParams, TEARDROP_MANAGER::TD_TYPE_PADVIA, &reversed, pad, pad->GetPosition() );
300 }
301 }
302
303 for( PCB_VIA* via : connectedVias )
304 {
305 if( !forceUpdate && !alg::contains( *dirtyPadsAndVias, via ) )
306 continue;
307
308 TEARDROP_PARAMETERS tdParams = via->GetTeardropParams();
309 int annularWidth = via->GetWidth( track->GetLayer() );
310
311 if( !tdParams.m_Enabled )
312 continue;
313
314 // Ensure a teardrop shape can be built: track width must be < teardrop width and
315 // filter width
316 if( track->GetWidth() >= tdParams.m_TdMaxWidth
317 || track->GetWidth() >= annularWidth * tdParams.m_BestWidthRatio
318 || track->GetWidth() >= annularWidth * tdParams.m_WidthtoSizeFilterRatio )
319 {
320 continue;
321 }
322
323 bool startHitsVia = via->HitTest( track->GetStart() );
324 bool endHitsVia = via->HitTest( track->GetEnd() );
325
326 // The track is entirely inside the via; cannot create a teardrop
327 if( startHitsVia && endHitsVia )
328 continue;
329
330
332 via->GetPosition() );
333
334 if( !startHitsVia && !endHitsVia )
335 {
336 PCB_TRACK reversed( *track );
337 reversed.SetStart( track->GetEnd() );
338 reversed.SetEnd( via->GetPosition() );
339 tryCreateTrackTeardrop( aCommit, tdParams, TEARDROP_MANAGER::TD_TYPE_PADVIA, &reversed, via, via->GetPosition() );
340 reversed.SetStart( track->GetStart() );
341 tryCreateTrackTeardrop( aCommit, tdParams, TEARDROP_MANAGER::TD_TYPE_PADVIA, &reversed, via, via->GetPosition() );
342 }
343 }
344 }
345
346 if( ( aForceFullUpdate || !dirtyTracks->empty() )
347 && m_prmsList->GetParameters( TARGET_TRACK )->m_Enabled )
348 {
349 AddTeardropsOnTracks( aCommit, dirtyTracks, aForceFullUpdate );
350 }
351
352 // Now set priority of teardrops now all teardrops are added
354}
355
356
358{
359 for( ZONE* zone : m_board->Zones() )
360 {
361 if( zone->IsTeardropArea() && zone->GetTeardropAreaType() == TEARDROP_TYPE::TD_TRACKEND )
362 zone->SetFlags( STRUCT_DELETED );
363 }
364
365 m_board->BulkRemoveStaleTeardrops( aCommit );
366}
367
368
370{
371 // Note: a teardrop area is on only one layer, so using GetFirstLayer() is OK
372 // to know the zone layer of a teardrop
373
374 int priority_base = MAGIC_TEARDROP_ZONE_ID;
375
376 // The sort function to sort by increasing copper layers. Group by layers.
377 // For same layers sort by decreasing areas
378 struct
379 {
380 bool operator()(ZONE* a, ZONE* b) const
381 {
382 if( a->GetFirstLayer() == b->GetFirstLayer() )
383 return a->GetOutlineArea() > b->GetOutlineArea();
384
385 return a->GetFirstLayer() < b->GetFirstLayer();
386 }
387 } compareLess;
388
389 for( ZONE* td: m_createdTdList )
390 td->CalculateOutlineArea();
391
392 std::sort( m_createdTdList.begin(), m_createdTdList.end(), compareLess );
393
394 int curr_layer = -1;
395
396 for( ZONE* td: m_createdTdList )
397 {
398 if( td->GetFirstLayer() != curr_layer )
399 {
400 curr_layer = td->GetFirstLayer();
401 priority_base = MAGIC_TEARDROP_ZONE_ID;
402 }
403
404 td->SetAssignedPriority( priority_base++ );
405 }
406}
407
408
410 const std::set<PCB_TRACK*>* aTracks,
411 bool aForceFullUpdate )
412{
413 std::shared_ptr<CONNECTIVITY_DATA> connectivity = m_board->GetConnectivity();
414 TEARDROP_PARAMETERS params = *m_prmsList->GetParameters( TARGET_TRACK );
415
416 // Explore groups (a group is a set of tracks on the same layer and the same net):
417 for( auto& grp : m_trackLookupList.GetBuffer() )
418 {
419 int layer, netcode;
420 TRACK_BUFFER::GetNetcodeAndLayerFromIndex( grp.first, &layer, &netcode );
421
422 std::vector<PCB_TRACK*>* sublist = grp.second;
423
424 if( sublist->size() <= 1 ) // We need at least 2 track segments
425 continue;
426
427 // The sort function to sort by increasing track widths
428 struct
429 {
430 bool operator()(PCB_TRACK* a, PCB_TRACK* b) const
431 { return a->GetWidth() < b->GetWidth(); }
432 } compareLess;
433
434 std::sort( sublist->begin(), sublist->end(), compareLess );
435 int min_width = sublist->front()->GetWidth();
436 int max_width = sublist->back()->GetWidth();
437
438 // Skip groups having the same track thickness
439 if( max_width == min_width )
440 continue;
441
442 for( unsigned ii = 0; ii < sublist->size()-1; ii++ )
443 {
444 PCB_TRACK* track = (*sublist)[ii];
445 int track_len = (int) track->GetLength();
446 bool track_needs_update = aForceFullUpdate || alg::contains( *aTracks, track );
447 min_width = track->GetWidth();
448
449 // to avoid creating a teardrop between 2 tracks having similar widths give a threshold
450 params.m_WidthtoSizeFilterRatio = std::max( params.m_WidthtoSizeFilterRatio, 0.1 );
451 const double th = 1.0 / params.m_WidthtoSizeFilterRatio;
452 min_width = KiROUND( min_width * th );
453
454 for( unsigned jj = ii+1; jj < sublist->size(); jj++ )
455 {
456 // Search candidates with thickness > curr thickness
457 PCB_TRACK* candidate = (*sublist)[jj];
458
459 if( min_width >= candidate->GetWidth() )
460 continue;
461
462 // Cannot build a teardrop on a too short track segment.
463 // The min len is > candidate radius
464 if( track_len <= candidate->GetWidth() /2 )
465 continue;
466
467 // Now test end to end connection:
468 EDA_ITEM_FLAGS match_points; // to return the end point EDA_ITEM_FLAGS:
469 // 0, STARTPOINT, ENDPOINT
470
471 VECTOR2I pos = candidate->GetStart();
472 match_points = track->IsPointOnEnds( pos, m_tolerance );
473
474 if( !match_points )
475 {
476 pos = candidate->GetEnd();
477 match_points = track->IsPointOnEnds( pos, m_tolerance );
478 }
479
480 if( !match_points )
481 continue;
482
483 if( !track_needs_update && alg::contains( *aTracks, candidate ) )
484 continue;
485
486 // Pads/vias have priority for teardrops; ensure there isn't one at our position
487 bool existingPadOrVia = false;
488 std::vector<PAD*> connectedPads;
489 std::vector<PCB_VIA*> connectedVias;
490
491 connectivity->GetConnectedPadsAndVias( track, &connectedPads, &connectedVias );
492
493 for( PAD* pad : connectedPads )
494 {
495 if( pad->HitTest( pos ) )
496 existingPadOrVia = true;
497 }
498
499 for( PCB_VIA* via : connectedVias )
500 {
501 if( via->HitTest( pos ) )
502 existingPadOrVia = true;
503 }
504
505 if( existingPadOrVia )
506 continue;
507
508 tryCreateTrackTeardrop( aCommit, params, TEARDROP_MANAGER::TD_TYPE_TRACKEND, track, candidate, pos );
509 }
510 }
511 }
512}
513
514
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:112
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:990
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:79
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition board_item.h:232
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:317
COMMIT & Added(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been added.
Definition commit.h:84
Definition pad.h:54
int GetSolderMaskExpansion() const
virtual double GetLength() const
Get the length of the track using the hypotenuse calculation.
void SetEnd(const VECTOR2I &aEnd)
Definition pcb_track.h:148
bool HasSolderMask() const
Definition pcb_track.h:176
void SetStart(const VECTOR2I &aStart)
Definition pcb_track.h:151
const VECTOR2I & GetStart() const
Definition pcb_track.h:152
const VECTOR2I & GetEnd() const
Definition pcb_track.h:149
EDA_ITEM_FLAGS IsPointOnEnds(const VECTOR2I &point, int min_dist=0) const
Return STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if point if near (dist = m...
virtual int GetWidth() const
Definition pcb_track.h:146
Represent a set of closed polygons.
void Inflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError, bool aSimplify=false)
Perform outline inflation/deflation.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
int NewOutline()
Creates a new empty polygon in the set and returns its index.
BOARD * m_board
Definition teardrop.h:265
static int GetWidth(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer)
bool computeTeardropPolygon(const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aCorners, PCB_TRACK *aTrack, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos) const
Compute all teardrop points of the polygon shape.
TEARDROP_MANAGER(BOARD *aBoard, TOOL_MANAGER *aToolManager)
Definition teardrop.cpp:48
void UpdateTeardrops(BOARD_COMMIT &aCommit, const std::vector< BOARD_ITEM * > *dirtyPadsAndVias, const std::set< PCB_TRACK * > *dirtyTracks, bool aForceFullUpdate=false)
Update teardrops on a list of items.
Definition teardrop.cpp:218
void createAndAddTeardropWithMask(BOARD_COMMIT &aCommit, TEARDROP_VARIANT aTeardropVariant, std::vector< VECTOR2I > &aPoints, PCB_TRACK *aTrack)
Creates and adds a teardrop with optional mask to the board.
Definition teardrop.cpp:135
void setTeardropPriorities()
Set priority of created teardrops.
Definition teardrop.cpp:369
void AddTeardropsOnTracks(BOARD_COMMIT &aCommit, const std::set< PCB_TRACK * > *aTracks, bool aForceFullUpdate=false)
Add teardrop on tracks of different sizes connected by their end.
Definition teardrop.cpp:409
bool tryCreateTrackTeardrop(BOARD_COMMIT &aCommit, const TEARDROP_PARAMETERS &aParams, TEARDROP_VARIANT aTeardropVariant, PCB_TRACK *aTrack, BOARD_ITEM *aCandidate, const VECTOR2I &aPos)
Attempts to create a track-to-track teardrop.
Definition teardrop.cpp:155
TRACK_BUFFER m_trackLookupList
Definition teardrop.h:270
TEARDROP_PARAMETERS_LIST * m_prmsList
Definition teardrop.h:267
std::vector< ZONE * > m_createdTdList
Definition teardrop.h:271
ZONE * createTeardrop(TEARDROP_VARIANT aTeardropVariant, std::vector< VECTOR2I > &aPoints, PCB_TRACK *aTrack) const
Creates a teardrop (a ZONE item) from its polygonal shape, track netcode and layer.
Definition teardrop.cpp:57
void DeleteTrackToTrackTeardrops(BOARD_COMMIT &aCommit)
Definition teardrop.cpp:357
bool areItemsInSameZone(BOARD_ITEM *aPadOrVia, PCB_TRACK *aTrack) const
ZONE * createTeardropMask(TEARDROP_VARIANT aTeardropVariant, std::vector< VECTOR2I > &aPoints, PCB_TRACK *aTrack) const
Definition teardrop.cpp:96
friend class TEARDROP_PARAMETERS
Definition teardrop.h:96
void RemoveTeardrops(BOARD_COMMIT &aCommit, const std::vector< BOARD_ITEM * > *dirtyPadsAndVias, const std::set< PCB_TRACK * > *dirtyTracks)
Remove teardrops connected to any dirty pads, vias or tracks.
Definition teardrop.cpp:173
TOOL_MANAGER * m_toolManager
Definition teardrop.h:266
double m_BestWidthRatio
The height of a teardrop as ratio between height and size of pad/via.
int m_TdMaxWidth
max allowed height for teardrops in IU. <= 0 to disable
double m_WidthtoSizeFilterRatio
The ratio (H/D) between the via/pad size and the track width max value to create a teardrop 1....
bool m_TdOnPadsInZones
A filter to exclude pads inside zone fills.
bool m_Enabled
Flag to enable teardrops.
Master controller class:
static void GetNetcodeAndLayerFromIndex(int aIdx, int *aLayer, int *aNetcode)
Definition teardrop.h:62
void ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
static const ZONE_SETTINGS & GetDefaultSettings()
Handle a list of polygons defining a copper zone.
Definition zone.h:74
double GetOutlineArea()
This area is cached from the most recent call to CalculateOutlineArea().
Definition zone.h:275
void SetLocalClearance(std::optional< int > aClearance)
Definition zone.h:186
void SetBorderDisplayStyle(ZONE_BORDER_DISPLAY_STYLE aBorderHatchStyle, int aBorderHatchPitch, bool aRebuilBorderdHatch)
Set all hatch parameters for the zone.
Definition zone.cpp:1225
void SetMinThickness(int aMinThickness)
Definition zone.h:302
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition zone.cpp:472
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
Definition zone.cpp:505
SHAPE_POLY_SET * Outline()
Definition zone.h:335
void SetFilledPolysList(PCB_LAYER_ID aLayer, const SHAPE_POLY_SET &aPolysList)
Set the list of filled polygons.
Definition zone.h:621
int GetMinThickness() const
Definition zone.h:301
void SetIsFilled(bool isFilled)
Definition zone.h:293
double CalculateFilledArea()
Compute the area currently occupied by the zone fill.
Definition zone.cpp:1525
void SetPadConnection(ZONE_CONNECTION aPadConnection)
Definition zone.h:299
void SetTeardropAreaType(TEARDROP_TYPE aType)
Set the type of teardrop if the zone is a teardrop area for non teardrop area, the type must be TEARD...
Definition zone.h:685
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
Definition zone.h:732
PCB_LAYER_ID GetFirstLayer() const
Definition zone.cpp:481
This file is part of the common library.
@ ALLOW_ACUTE_CORNERS
just inflate the polygon. Acute angles create spikes
#define STRUCT_DELETED
flag indication structures to be erased
std::uint32_t EDA_ITEM_FLAGS
bool IsExternalCopperLayer(int aLayerId)
Test whether a layer is an external (F_Cu or B_Cu) copper layer.
Definition layer_ids.h:685
@ B_Mask
Definition layer_ids.h:98
@ F_Mask
Definition layer_ids.h:97
@ F_Cu
Definition layer_ids.h:64
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition kicad_algo.h:100
#define MAGIC_TEARDROP_ZONE_ID
Definition teardrop.cpp:45
@ TARGET_TRACK
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition typeinfo.h:98
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition typeinfo.h:96
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695
@ FULL
pads are covered by copper
Definition zones.h:51