KiCad PCB EDA Suite
zone_filler.cpp File Reference
#include <thread>
#include <algorithm>
#include <future>
#include <advanced_config.h>
#include <board.h>
#include <zone.h>
#include <footprint.h>
#include <pcb_shape.h>
#include <pcb_target.h>
#include <track.h>
#include <connectivity/connectivity_data.h>
#include <convert_basic_shapes_to_polygon.h>
#include <board_commit.h>
#include <widgets/progress_reporter.h>
#include <geometry/shape_poly_set.h>
#include <geometry/convex_hull.h>
#include <geometry/geometry_utils.h>
#include <confirm.h>
#include <convert_to_biu.h>
#include <math/util.h>
#include "zone_filler.h"

Go to the source code of this file.

Macros

#define DUMP_POLYS_TO_COPPER_LAYER(a, b, c)
 
#define SMOOTH_MIN_VAL_MM   0.02
 
#define SMOOTH_SMALL_VAL_MM   0.04
 

Functions

bool hasThermalConnection (PAD *pad, const ZONE *aZone)
 Return true if the given pad has a thermal connection with the given zone. More...
 

Variables

static const double s_RoundPadThermalSpokeAngle = 450
 

Macro Definition Documentation

◆ DUMP_POLYS_TO_COPPER_LAYER

#define DUMP_POLYS_TO_COPPER_LAYER (   a,
  b,
 
)
Value:
{ if( m_debugZoneFiller && aDebugLayer == b ) \
{ \
m_board->SetLayerName( b, c ); \
SHAPE_POLY_SET d = a; \
aRawPolys = d; \
return false; \
} \
}

Definition at line 980 of file zone_filler.cpp.

◆ SMOOTH_MIN_VAL_MM

#define SMOOTH_MIN_VAL_MM   0.02

◆ SMOOTH_SMALL_VAL_MM

#define SMOOTH_SMALL_VAL_MM   0.04

Function Documentation

◆ hasThermalConnection()

bool hasThermalConnection ( PAD pad,
const ZONE aZone 
)

Return true if the given pad has a thermal connection with the given zone.

Definition at line 507 of file zone_filler.cpp.

508 {
509  // Rejects non-standard pads with tht-only thermal reliefs
511  && pad->GetAttribute() != PAD_ATTRIB_PTH )
512  {
513  return false;
514  }
515 
518  {
519  return false;
520  }
521 
522  if( pad->GetNetCode() != aZone->GetNetCode() || pad->GetNetCode() <= 0 )
523  return false;
524 
525  EDA_RECT item_boundingbox = pad->GetBoundingBox();
526  int thermalGap = aZone->GetThermalReliefGap( pad );
527  item_boundingbox.Inflate( thermalGap, thermalGap );
528 
529  return item_boundingbox.Intersects( aZone->GetCachedBoundingBox() );
530 }
int GetThermalReliefGap() const
Definition: zone.h:190
const EDA_RECT GetCachedBoundingBox() const
ONLY TO BE USED BY CLIENTS WHICH SET UP THE CACHE!
Definition: zone.h:145
Thermal relief only for THT pads.
Use thermal relief for pads.
Plated through hole pad.
Definition: pad_shapes.h:80
Handle the component boundary box.
Definition: eda_rect.h:42
bool Intersects(const EDA_RECT &aRect) const
Test for a common area between rectangles.
Definition: eda_rect.cpp:150
ZONE_CONNECTION GetPadConnection(PAD *aPad, wxString *aSource=nullptr) const
Definition: zone.cpp:771
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:363

References ZONE::GetCachedBoundingBox(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE::GetPadConnection(), ZONE::GetThermalReliefGap(), EDA_RECT::Inflate(), EDA_RECT::Intersects(), pad, PAD_ATTRIB_PTH, THERMAL, and THT_THERMAL.

Referenced by ZONE_FILLER::buildThermalSpokes(), and ZONE_FILLER::knockoutThermalReliefs().

Variable Documentation

◆ s_RoundPadThermalSpokeAngle

const double s_RoundPadThermalSpokeAngle = 450
static

Definition at line 49 of file zone_filler.cpp.

Referenced by ZONE_FILLER::buildThermalSpokes().