KiCad PCB EDA Suite
pns_kicad_iface.cpp File Reference
#include <board.h>
#include <board_connected_item.h>
#include <board_design_settings.h>
#include <fp_text.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <zone.h>
#include <pcb_shape.h>
#include <pcb_text.h>
#include <board_commit.h>
#include <layer_ids.h>
#include <geometry/convex_hull.h>
#include <confirm.h>
#include <tools/pcb_tool_base.h>
#include <tool/tool_manager.h>
#include <settings/app_settings.h>
#include <pcb_painter.h>
#include <geometry/shape.h>
#include <geometry/shape_line_chain.h>
#include <geometry/shape_arc.h>
#include <geometry/shape_simple.h>
#include <drc/drc_rule.h>
#include <drc/drc_engine.h>
#include <connectivity/connectivity_data.h>
#include <wx/log.h>
#include <memory>
#include <advanced_config.h>
#include <pcbnew_settings.h>
#include <macros.h>
#include "pns_kicad_iface.h"
#include "pns_arc.h"
#include "pns_routing_settings.h"
#include "pns_sizes_settings.h"
#include "pns_item.h"
#include "pns_solid.h"
#include "pns_segment.h"
#include "pns_node.h"
#include "pns_router.h"
#include "pns_debug_decorator.h"
#include "router_preview_item.h"

Go to the source code of this file.

Classes

struct  CLEARANCE_CACHE_KEY
 
struct  std::hash< CLEARANCE_CACHE_KEY >
 
class  PNS_PCBNEW_RULE_RESOLVER
 
class  PNS_PCBNEW_DEBUG_DECORATOR
 

Namespaces

namespace  std
 

Macros

#define HAS_PLATED_HOLE(a)   ( a )->IsRoutable()
 

Typedefs

typedef VECTOR2I::extended_type ecoord
 

Functions

bool isCopper (const PNS::ITEM *aItem)
 
bool isEdge (const PNS::ITEM *aItem)
 

Macro Definition Documentation

◆ HAS_PLATED_HOLE

#define HAS_PLATED_HOLE (   a)    ( a )->IsRoutable()

Typedef Documentation

◆ ecoord

Definition at line 73 of file pns_kicad_iface.cpp.

Function Documentation

◆ isCopper()

bool isCopper ( const PNS::ITEM aItem)

Definition at line 248 of file pns_kicad_iface.cpp.

249{
250 BOARD_ITEM* parent = aItem->Parent();
251
252 if( parent && parent->Type() == PCB_PAD_T )
253 {
254 PAD* pad = static_cast<PAD*>( parent );
255
256 if( !pad->IsOnCopperLayer() )
257 return false;
258
259 if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
260 return true;
261
262 // round NPTH with a hole size >= pad size are not on a copper layer
263 // All other NPTH are seen on copper layers
264 // This is a basic criteria, but probably enough for a NPTH
265 if( pad->GetShape() == PAD_SHAPE::CIRCLE )
266 {
267 if( pad->GetSize().x <= pad->GetDrillSize().x )
268 return false;
269 }
270
271 return true;
272 }
273
274 return true;
275}
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:58
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
Definition: pad.h:59
BOARD_ITEM * Parent() const
Definition: pns_item.h:151
@ NPTH
like PAD_PTH, but not plated
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87

References CIRCLE, NPTH, pad, PNS::ITEM::Parent(), PCB_PAD_T, and EDA_ITEM::Type().

Referenced by PNS_PCBNEW_RULE_RESOLVER::Clearance().

◆ isEdge()

bool isEdge ( const PNS::ITEM aItem)

Definition at line 278 of file pns_kicad_iface.cpp.

279{
280 const BOARD_ITEM *parent = aItem->Parent();
281
282 return parent && ( parent->IsOnLayer( Edge_Cuts ) || parent->IsOnLayer( Margin ) );
283}
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Definition: board_item.h:245
@ Edge_Cuts
Definition: layer_ids.h:113
@ Margin
Definition: layer_ids.h:114

References Edge_Cuts, BOARD_ITEM::IsOnLayer(), Margin, and PNS::ITEM::Parent().

Referenced by PNS_PCBNEW_RULE_RESOLVER::Clearance().