KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS Namespace Reference

Push and Shove diff pair dimensions (gap) settings dialog. More...

Classes

class  ALGO_BASE
 Base class for all P&S algorithms (shoving, walkaround, line placement, dragging, etc.). More...
 
class  ANGLE_CONSTRAINT_45
 
class  ARC
 
class  AREA_CONSTRAINT
 
struct  COLLISION_SEARCH_CONTEXT
 
struct  COLLISION_SEARCH_OPTIONS
 
class  COMPONENT_DRAGGER
 COMPONENT_DRAGGER. More...
 
struct  CONSTRAINT
 An abstract function object, returning a design rule (clearance, diff pair gap, etc) required between two items. More...
 
class  CORNER_COUNT_LIMIT_CONSTRAINT
 
class  COST_ESTIMATOR
 Calculate the cost of a given line, taking corner angles and total length into account. More...
 
class  DEBUG_DECORATOR
 
class  DIFF_PAIR
 Basic class for a differential pair. More...
 
class  DIFF_PAIR_PLACER
 Single track placement algorithm. More...
 
class  DP_GATEWAY
 Define a "gateway" for routing a differential pair - e.g. More...
 
class  DP_GATEWAYS
 A set of gateways calculated for the cursor or starting/ending primitive pair. More...
 
class  DP_MEANDER_PLACER
 Differential Pair length-matching/meandering tool. More...
 
class  DP_PRIMITIVE_PAIR
 Store starting/ending primitives (pads, vias or segments) for a differential pair. More...
 
class  DRAG_ALGO
 DRAG_ALGO. More...
 
class  DRAGGER
 DRAGGER. More...
 
class  FIXED_TAIL
 
struct  HIT_VISITOR
 
class  HOLE
 
class  INDEX
 INDEX. More...
 
class  ITEM
 Base class for PNS router board items. More...
 
class  ITEM_OWNER
 
class  ITEM_SET
 
class  JOINT
 A 2D point on a given set of layers and belonging to a certain net, that links together a number of board items. More...
 
class  KEEP_TOPOLOGY_CONSTRAINT
 
class  LAYER_CONTEXT_SETTER
 
class  LINE
 Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads, junctions between multiple traces or two traces different widths and combinations of these). More...
 
class  LINE_PLACER
 Single track placement algorithm. More...
 
class  LINK_HOLDER
 
class  LINKED_ITEM
 
class  LOGGER
 
class  MEANDER_PLACER
 Single track length matching/meandering tool. More...
 
class  MEANDER_PLACER_BASE
 Base class for Single trace & Differential pair meandering tools, as both of them share a lot of code. More...
 
class  MEANDER_SETTINGS
 Dimensions for the meandering algorithm. More...
 
class  MEANDER_SHAPE
 The geometry of a single meander. More...
 
class  MEANDER_SKEW_PLACER
 MEANDER_SKEW_PLACER. More...
 
class  MEANDERED_LINE
 Represent a set of meanders fitted over a single or two lines. More...
 
class  MOUSE_TRAIL_TRACER
 
class  MULTI_DRAGGER
 MULTI_DRAGGER. More...
 
class  NODE
 Keep the router "world" - i.e. More...
 
struct  OBSTACLE
 Hold an object colliding with another object, along with some useful data about the collision. More...
 
class  OBSTACLE_VISITOR
 
class  OPT_CONSTRAINT
 
class  OPTIMIZER
 Perform various optimizations of the lines being routed, attempting to make the lines shorter and less cornery. More...
 
class  OWNABLE_ITEM
 
class  PLACEMENT_ALGO
 PLACEMENT_ALGO. More...
 
class  PRESERVE_VERTEX_CONSTRAINT
 
class  RESTRICT_VERTEX_RANGE_CONSTRAINT
 
class  ROUTER
 
class  ROUTER_IFACE
 ROUTER. More...
 
class  ROUTING_SETTINGS
 Contain all persistent settings of the router, such as the mode, optimization effort, etc. More...
 
class  RULE_RESOLVER
 
class  SEGMENT
 
class  SHOVE
 The actual Push and Shove algorithm. More...
 
class  SIZES_SETTINGS
 
class  SOLID
 
class  TIME_LIMIT
 
class  TOOL_BASE
 
class  TOPOLOGY
 
class  VIA
 
struct  VIA_HANDLE
 
class  VVIA
 
class  WALKAROUND
 

Typedefs

typedef void * NET_HANDLE
 

Enumerations

enum  LineMarker { MK_HEAD = ( 1 << 0 ) , MK_VIOLATION = ( 1 << 3 ) , MK_LOCKED = ( 1 << 4 ) , MK_DP_COUPLED = ( 1 << 5 ) }
 
enum  MEANDER_TYPE {
  MT_SINGLE , MT_START , MT_FINISH , MT_TURN ,
  MT_CHECK_START , MT_CHECK_FINISH , MT_CORNER , MT_ARC ,
  MT_EMPTY
}
 Shapes of available meanders. More...
 
enum  MEANDER_STYLE { MEANDER_STYLE_ROUND = 1 , MEANDER_STYLE_CHAMFER }
 
enum  MEANDER_SIDE { MEANDER_SIDE_LEFT = -1 , MEANDER_SIDE_DEFAULT = 0 , MEANDER_SIDE_RIGHT = 1 }
 
enum class  CONSTRAINT_TYPE {
  CT_CLEARANCE = 1 , CT_DIFF_PAIR_GAP = 2 , CT_LENGTH = 3 , CT_WIDTH = 4 ,
  CT_VIA_DIAMETER = 5 , CT_VIA_HOLE = 6 , CT_HOLE_CLEARANCE = 7 , CT_EDGE_CLEARANCE = 8 ,
  CT_HOLE_TO_HOLE = 9 , CT_DIFF_PAIR_SKEW = 10 , CT_MAX_UNCOUPLED = 11 , CT_PHYSICAL_CLEARANCE = 12
}
 
enum  ROUTER_MODE {
  PNS_MODE_ROUTE_SINGLE = 1 , PNS_MODE_ROUTE_DIFF_PAIR , PNS_MODE_TUNE_SINGLE , PNS_MODE_TUNE_DIFF_PAIR ,
  PNS_MODE_TUNE_DIFF_PAIR_SKEW
}
 
enum  DRAG_MODE {
  DM_CORNER = 0x1 , DM_SEGMENT = 0x2 , DM_VIA = 0x4 , DM_FREE_ANGLE = 0x8 ,
  DM_ARC = 0x10 , DM_ANY = 0x17 , DM_COMPONENT = 0x20
}
 
enum  PNS_MODE { RM_MarkObstacles = 0 , RM_Shove , RM_Walkaround }
 < Routing modes More...
 
enum  PNS_OPTIMIZATION_EFFORT { OE_LOW = 0 , OE_MEDIUM = 1 , OE_FULL = 2 }
 
enum  SHOVE_POLICY {
  SHP_DEFAULT = 0 , SHP_SHOVE = 0x1 , SHP_WALK_FORWARD = 0x2 , SHP_WALK_BACK = 0x4 ,
  SHP_IGNORE = 0x8 , SHP_DONT_OPTIMIZE = 0x10
}
 

Functions

static DIRECTION_45::AngleType angle (const VECTOR2I &a, const VECTOR2I &b)
 
static bool checkGap (const SHAPE_LINE_CHAIN &p, const SHAPE_LINE_CHAIN &n, int gap)
 
static VECTOR2I makeGapVector (VECTOR2I dir, int length)
 
bool commonParallelProjection (SEG p, SEG n, SEG &pClip, SEG &nClip)
 
OPT_VECTOR2I getDanglingAnchor (NODE *aNode, ITEM *aItem)
 
static void dumpObstacles (const PNS::NODE::OBSTACLES &obstacles)
 
static bool shouldWeConsiderHoleCollisions (const ITEM *aItem, const ITEM *aHead)
 
template<typename T , typename S >
std::unique_ptr< T > ItemCast (std::unique_ptr< S > aPtr)
 
template<typename T >
std::unique_ptr< typename std::remove_const< T >::type > Clone (const T &aItem)
 
bool operator== (JOINT::HASH_TAG const &aP1, JOINT::HASH_TAG const &aP2)
 
static int areNeighbours (int x, int y, int max=0)
 
SHAPE_LINE_CHAIN dragCornerInternal (const SHAPE_LINE_CHAIN &aOrigin, const VECTOR2I &aP, DIRECTION_45 aPreferredEndingDirection=DIRECTION_45())
 
static void extendBox (BOX2I &aBox, bool &aDefined, const VECTOR2I &aP)
 
int findAmplitudeBinarySearch (MEANDER_SHAPE &aCopy, int targetLength, int minAmp, int maxAmp)
 
int findAmplitudeForLength (MEANDER_SHAPE *m, int targetLength, int minAmp, int maxAmp)
 
bool clipToOtherLine (NODE *aNode, const LINE &aRef, LINE &aClipped)
 
static bool pointInside2 (const SHAPE_LINE_CHAIN &aL, const VECTOR2I &aP)
 Determine if a point is located within a given polygon.
 
int findCoupledVertices (const VECTOR2I &aVertex, const SEG &aOrigSeg, const SHAPE_LINE_CHAIN &aCoupled, DIFF_PAIR *aPair, int *aIndices)
 
bool verifyDpBypass (NODE *aNode, DIFF_PAIR *aPair, bool aRefIsP, const SHAPE_LINE_CHAIN &aNewRef, const SHAPE_LINE_CHAIN &aNewCoupled)
 
bool coupledBypass (NODE *aNode, DIFF_PAIR *aPair, bool aRefIsP, const SHAPE_LINE_CHAIN &aRef, const SHAPE_LINE_CHAIN &aRefBypass, const SHAPE_LINE_CHAIN &aCoupled, SHAPE_LINE_CHAIN &aNewCoupled)
 
bool checkDpColliding (NODE *aNode, DIFF_PAIR *aPair, bool aIsP, const SHAPE_LINE_CHAIN &aPath)
 
static int64_t shovedArea (const SHAPE_LINE_CHAIN &aOld, const SHAPE_LINE_CHAIN &aNew)
 
bool tightenSegment (bool dir, NODE *aNode, const LINE &cur, const SHAPE_LINE_CHAIN &in, SHAPE_LINE_CHAIN &out)
 
void Tighten (NODE *aNode, const SHAPE_LINE_CHAIN &aOldLine, const LINE &aNewLine, LINE &aOptimized)
 
static void nodeStats (PNS::DEBUG_DECORATOR *dbg, NODE *node, wxString s)
 
const SHAPE_LINE_CHAIN OctagonalHull (const VECTOR2I &aP0, const VECTOR2I &aSize, int aClearance, int aChamfer)
 
const SHAPE_LINE_CHAIN ArcHull (const SHAPE_ARC &aSeg, int aClearance, int aWalkaroundThickness)
 Various utility functions.
 
static bool IsSegment45Degree (const SEG &aS)
 
template<typename T >
int sgn (T val)
 
const SHAPE_LINE_CHAIN SegmentHull (const SHAPE_SEGMENT &aSeg, int aClearance, int aWalkaroundThickness)
 
static void MoveDiagonal (SEG &aDiagonal, const SHAPE_LINE_CHAIN &aVertices, int aClearance)
 
const SHAPE_LINE_CHAIN ConvexHull (const SHAPE_SIMPLE &aConvex, int aClearance)
 Function ConvexHull()
 
SHAPE_RECT ApproximateSegmentAsRect (const SHAPE_SEGMENT &aSeg)
 
OPT_BOX2I ChangedArea (const ITEM *aItemA, const ITEM *aItemB)
 
OPT_BOX2I ChangedArea (const LINE &aLineA, const LINE &aLineB)
 
void HullIntersection (const SHAPE_LINE_CHAIN &hull, const SHAPE_LINE_CHAIN &line, SHAPE_LINE_CHAIN::INTERSECTIONS &ips)
 
const SHAPE_LINE_CHAIN BuildHullForPrimitiveShape (const SHAPE *aShape, int aClearance, int aWalkaroundThickness)
 
static wxString policy2string (WALKAROUND::WALK_POLICY policy)
 

Variables

const int LENGTH_TARGET_TOLERANCE = 20
 
static ROUTERtheRouter
 
const int pnsSchemaVersion = 0
 
constexpr int HULL_MARGIN = 10
 

Detailed Description

Push and Shove diff pair dimensions (gap) settings dialog.

Typedef Documentation

◆ NET_HANDLE

typedef void* PNS::NET_HANDLE

Definition at line 54 of file pns_item.h.

Enumeration Type Documentation

◆ CONSTRAINT_TYPE

enum class PNS::CONSTRAINT_TYPE
strong
Enumerator
CT_CLEARANCE 
CT_DIFF_PAIR_GAP 
CT_LENGTH 
CT_WIDTH 
CT_VIA_DIAMETER 
CT_VIA_HOLE 
CT_HOLE_CLEARANCE 
CT_EDGE_CLEARANCE 
CT_HOLE_TO_HOLE 
CT_DIFF_PAIR_SKEW 
CT_MAX_UNCOUPLED 
CT_PHYSICAL_CLEARANCE 

Definition at line 51 of file pns_node.h.

◆ DRAG_MODE

Enumerator
DM_CORNER 
DM_SEGMENT 
DM_VIA 
DM_FREE_ANGLE 
DM_ARC 
DM_ANY 
DM_COMPONENT 

Definition at line 70 of file pns_router.h.

◆ LineMarker

Enumerator
MK_HEAD 
MK_VIOLATION 
MK_LOCKED 
MK_DP_COUPLED 

Definition at line 41 of file pns_item.h.

◆ MEANDER_SIDE

Enumerator
MEANDER_SIDE_LEFT 
MEANDER_SIDE_DEFAULT 
MEANDER_SIDE_RIGHT 

Definition at line 57 of file pns_meander.h.

◆ MEANDER_STYLE

Enumerator
MEANDER_STYLE_ROUND 
MEANDER_STYLE_CHAMFER 

Definition at line 51 of file pns_meander.h.

◆ MEANDER_TYPE

Shapes of available meanders.

Enumerator
MT_SINGLE 
MT_START 
MT_FINISH 
MT_TURN 
MT_CHECK_START 
MT_CHECK_FINISH 
MT_CORNER 
MT_ARC 
MT_EMPTY 

Definition at line 38 of file pns_meander.h.

◆ PNS_MODE

< Routing modes

Enumerator
RM_MarkObstacles 

Ignore collisions, mark obstacles.

RM_Shove 

Only shove.

RM_Walkaround 

Only walk around.

Definition at line 39 of file pns_routing_settings.h.

◆ PNS_OPTIMIZATION_EFFORT

Enumerator
OE_LOW 
OE_MEDIUM 
OE_FULL 

Definition at line 47 of file pns_routing_settings.h.

◆ ROUTER_MODE

Enumerator
PNS_MODE_ROUTE_SINGLE 
PNS_MODE_ROUTE_DIFF_PAIR 
PNS_MODE_TUNE_SINGLE 
PNS_MODE_TUNE_DIFF_PAIR 
PNS_MODE_TUNE_DIFF_PAIR_SKEW 

Definition at line 62 of file pns_router.h.

◆ SHOVE_POLICY

Enumerator
SHP_DEFAULT 
SHP_SHOVE 
SHP_WALK_FORWARD 
SHP_WALK_BACK 
SHP_IGNORE 
SHP_DONT_OPTIMIZE 

Definition at line 2464 of file pns_shove.cpp.

Function Documentation

◆ angle()

◆ ApproximateSegmentAsRect()

SHAPE_RECT PNS::ApproximateSegmentAsRect ( const SHAPE_SEGMENT aSeg)

◆ ArcHull()

◆ areNeighbours()

static int PNS::areNeighbours ( int  x,
int  y,
int  max = 0 
)
static

Definition at line 188 of file pns_line.cpp.

Referenced by PNS::LINE::Walkaround().

◆ BuildHullForPrimitiveShape()

const SHAPE_LINE_CHAIN PNS::BuildHullForPrimitiveShape ( const SHAPE aShape,
int  aClearance,
int  aWalkaroundThickness 
)

◆ ChangedArea() [1/2]

OPT_BOX2I PNS::ChangedArea ( const ITEM aItemA,
const ITEM aItemB 
)

◆ ChangedArea() [2/2]

OPT_BOX2I PNS::ChangedArea ( const LINE aLineA,
const LINE aLineB 
)

Definition at line 388 of file pns_utils.cpp.

References PNS::LINE::ChangedArea().

◆ checkDpColliding()

bool PNS::checkDpColliding ( NODE aNode,
DIFF_PAIR aPair,
bool  aIsP,
const SHAPE_LINE_CHAIN aPath 
)

◆ checkGap()

static bool PNS::checkGap ( const SHAPE_LINE_CHAIN p,
const SHAPE_LINE_CHAIN n,
int  gap 
)
static

◆ clipToOtherLine()

◆ Clone()

◆ commonParallelProjection()

bool PNS::commonParallelProjection ( SEG  p,
SEG  n,
SEG pClip,
SEG nClip 
)

◆ ConvexHull()

const SHAPE_LINE_CHAIN PNS::ConvexHull ( const SHAPE_SIMPLE aConvex,
int  aClearance 
)

Function ConvexHull()

Creates an octagonal hull around a convex polygon.

Parameters
aConvexThe convex polygon.
aClearanceThe minimum distance between polygon and hull.
Returns
A closed line chain describing the octagon.

Definition at line 299 of file pns_utils.cpp.

References SHAPE_LINE_CHAIN::Append(), SHAPE_SIMPLE::BBox(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetOrigin(), BOX2< Vec >::GetSize(), BOX2< Vec >::GetWidth(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), SEG::IntersectLines(), MoveDiagonal(), BOX2< Vec >::Normalize(), SHAPE_LINE_CHAIN::SetClosed(), and SHAPE_SIMPLE::Vertices().

Referenced by BuildHullForPrimitiveShape().

◆ coupledBypass()

◆ dragCornerInternal()

◆ dumpObstacles()

static void PNS::dumpObstacles ( const PNS::NODE::OBSTACLES obstacles)
static

Definition at line 34 of file pns_item.cpp.

◆ extendBox()

static void PNS::extendBox ( BOX2I aBox,
bool &  aDefined,
const VECTOR2I aP 
)
static

Definition at line 1201 of file pns_line.cpp.

References BOX2< Vec >::Merge().

Referenced by PNS::LINE::ChangedArea().

◆ findAmplitudeBinarySearch()

int PNS::findAmplitudeBinarySearch ( MEANDER_SHAPE aCopy,
int  targetLength,
int  minAmp,
int  maxAmp 
)

◆ findAmplitudeForLength()

int PNS::findAmplitudeForLength ( MEANDER_SHAPE m,
int  targetLength,
int  minAmp,
int  maxAmp 
)

◆ findCoupledVertices()

int PNS::findCoupledVertices ( const VECTOR2I aVertex,
const SEG aOrigSeg,
const SHAPE_LINE_CHAIN aCoupled,
DIFF_PAIR aPair,
int *  aIndices 
)

◆ getDanglingAnchor()

◆ HullIntersection()

◆ IsSegment45Degree()

static bool PNS::IsSegment45Degree ( const SEG aS)
static

Definition at line 155 of file pns_utils.cpp.

References SEG::A, std::abs(), SEG::B, delta, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SegmentHull().

◆ ItemCast()

template<typename T , typename S >
std::unique_ptr< T > PNS::ItemCast ( std::unique_ptr< S >  aPtr)

Definition at line 319 of file pns_item.h.

◆ makeGapVector()

static VECTOR2I PNS::makeGapVector ( VECTOR2I  dir,
int  length 
)
static

◆ MoveDiagonal()

static void PNS::MoveDiagonal ( SEG aDiagonal,
const SHAPE_LINE_CHAIN aVertices,
int  aClearance 
)
static

Definition at line 288 of file pns_utils.cpp.

References SEG::A, SEG::B, SHAPE_LINE_CHAIN::NearestPoint(), and VECTOR2< T >::Resize().

Referenced by ConvexHull().

◆ nodeStats()

static void PNS::nodeStats ( PNS::DEBUG_DECORATOR dbg,
NODE node,
wxString  s 
)
static

Definition at line 2104 of file pns_shove.cpp.

References PNS::NODE::Depth(), PNS::NODE::GetUpdatedItems(), and PNS_DBG.

◆ OctagonalHull()

const SHAPE_LINE_CHAIN PNS::OctagonalHull ( const VECTOR2I aP0,
const VECTOR2I aSize,
int  aClearance,
int  aChamfer 
)

◆ operator==()

bool PNS::operator== ( JOINT::HASH_TAG const &  aP1,
JOINT::HASH_TAG const &  aP2 
)
inline

Definition at line 373 of file pns_joint.h.

References PNS::JOINT::HASH_TAG::net, and PNS::JOINT::HASH_TAG::pos.

◆ pointInside2()

static bool PNS::pointInside2 ( const SHAPE_LINE_CHAIN aL,
const VECTOR2I aP 
)
static

Determine if a point is located within a given polygon.

Todo:
fixme: integrate into SHAPE_LINE_CHAIN, check corner cases against current PointInside implementation
Parameters
aLPolygon
aPPoint to check for location within the polygon
Returns
false if point is not polygon boundary aL, true if within or on the polygon boundary

Definition at line 318 of file pns_optimizer.cpp.

References SHAPE_LINE_CHAIN::CPoint(), SHAPE_LINE_CHAIN::IsClosed(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::SegmentCount(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PNS::KEEP_TOPOLOGY_CONSTRAINT::Check().

◆ policy2string()

static wxString PNS::policy2string ( WALKAROUND::WALK_POLICY  policy)
static

◆ SegmentHull()

◆ sgn()

template<typename T >
int PNS::sgn ( val)

Definition at line 174 of file pns_utils.cpp.

Referenced by SegmentHull().

◆ shouldWeConsiderHoleCollisions()

static bool PNS::shouldWeConsiderHoleCollisions ( const ITEM aItem,
const ITEM aHead 
)
static

◆ shovedArea()

static int64_t PNS::shovedArea ( const SHAPE_LINE_CHAIN aOld,
const SHAPE_LINE_CHAIN aNew 
)
static

◆ Tighten()

◆ tightenSegment()

◆ verifyDpBypass()

bool PNS::verifyDpBypass ( NODE aNode,
DIFF_PAIR aPair,
bool  aRefIsP,
const SHAPE_LINE_CHAIN aNewRef,
const SHAPE_LINE_CHAIN aNewCoupled 
)

Variable Documentation

◆ HULL_MARGIN

constexpr int PNS::HULL_MARGIN = 10
constexpr

Definition at line 34 of file pns_utils.h.

◆ LENGTH_TARGET_TOLERANCE

const int PNS::LENGTH_TARGET_TOLERANCE = 20

◆ pnsSchemaVersion

const int PNS::pnsSchemaVersion = 0

Definition at line 29 of file pns_routing_settings.cpp.

◆ theRouter

ROUTER* PNS::theRouter
static