KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS::MEANDERED_LINE Class Reference

Represent a set of meanders fitted over a single or two lines. More...

#include <pns_meander.h>

Public Member Functions

 MEANDERED_LINE ()
 
 MEANDERED_LINE (MEANDER_PLACER_BASE *aPlacer, bool aIsDual=false)
 
 ~MEANDERED_LINE ()
 
void AddCorner (const VECTOR2I &aA, const VECTOR2I &aB=VECTOR2I(0, 0))
 Create a dummy meander shape representing a line corner.
 
void AddArc (const SHAPE_ARC &aArc1, const SHAPE_ARC &aArc2=SHAPE_ARC())
 Create a dummy meander shape representing an arc corner.
 
void AddArcAndPt (const SHAPE_ARC &aArc1, const VECTOR2I &aPt2)
 Create a dummy meander shape representing an arc corner.
 
void AddPtAndArc (const VECTOR2I &aPt1, const SHAPE_ARC &aArc2)
 Create a dummy meander shape representing an arc corner.
 
void AddMeander (MEANDER_SHAPE *aShape)
 Add a new meander shape to the meandered line.
 
void Clear ()
 Clear the line geometry, removing all corners and meanders.
 
void SetWidth (int aWidth)
 Set the line width.
 
void MeanderSegment (const SEG &aSeg, bool aSide, int aBaseIndex=0)
 Fit maximum amplitude meanders on a given segment and adds to the current line.
 
void SetBaselineOffset (int aOffset)
 Set the parallel offset between the base segment and the meandered line.
 
std::vector< MEANDER_SHAPE * > & Meanders ()
 
bool CheckSelfIntersections (MEANDER_SHAPE *aShape, int aClearance)
 Check if the given shape is intersecting with any other meander in the current line.
 
const MEANDER_SETTINGSSettings () const
 

Private Attributes

VECTOR2I m_last
 
MEANDER_PLACER_BASEm_placer
 
std::vector< MEANDER_SHAPE * > m_meanders
 
bool m_dual
 
int m_width
 
int m_baselineOffset
 

Detailed Description

Represent a set of meanders fitted over a single or two lines.

Definition at line 423 of file pns_meander.h.

Constructor & Destructor Documentation

◆ MEANDERED_LINE() [1/2]

PNS::MEANDERED_LINE::MEANDERED_LINE ( )
inline

Definition at line 426 of file pns_meander.h.

References m_baselineOffset, m_dual, m_placer, and m_width.

◆ MEANDERED_LINE() [2/2]

PNS::MEANDERED_LINE::MEANDERED_LINE ( MEANDER_PLACER_BASE aPlacer,
bool  aIsDual = false 
)
inline
Parameters
aPlacerthe meander placer instance
aIsDualwhen true, the meanders are generated for two coupled lines

Definition at line 439 of file pns_meander.h.

References m_baselineOffset, and m_width.

◆ ~MEANDERED_LINE()

PNS::MEANDERED_LINE::~MEANDERED_LINE ( )
inline

Definition at line 448 of file pns_meander.h.

References Clear().

Member Function Documentation

◆ AddArc()

void PNS::MEANDERED_LINE::AddArc ( const SHAPE_ARC aArc1,
const SHAPE_ARC aArc2 = SHAPE_ARC() 
)

Create a dummy meander shape representing an arc corner.

Allows representing existing arc tracks so they can be reconstructed after length tuning.

Parameters
aArc1Arc shape on the 1st line.
aArc2Arc shape on the 2nd line (if m_dual == true).

Definition at line 740 of file pns_meander.cpp.

References SHAPE_ARC::GetP1(), m_dual, m_last, m_meanders, m_placer, m_width, and PNS::MEANDER_SHAPE::MakeArc().

Referenced by AddArcAndPt(), AddPtAndArc(), and PNS::MEANDER_PLACER::doMove().

◆ AddArcAndPt()

void PNS::MEANDERED_LINE::AddArcAndPt ( const SHAPE_ARC aArc1,
const VECTOR2I aPt2 
)

Create a dummy meander shape representing an arc corner.

Allows representing existing arc tracks so they can be reconstructed after length tuning.

Parameters
aArc1Arc shape on the 1st line.
aPt2corner point of the 2nd line (if m_dual == true).

Definition at line 751 of file pns_meander.cpp.

References AddArc().

Referenced by PNS::DP_MEANDER_PLACER::Move().

◆ AddCorner()

void PNS::MEANDERED_LINE::AddCorner ( const VECTOR2I aA,
const VECTOR2I aB = VECTOR2I( 0, 0 ) 
)

Create a dummy meander shape representing a line corner.

Used to define the starts/ends of meandered segments.

Parameters
aAcorner point of the 1st line.
aBcorner point of the 2nd line (if m_dual == true).

Definition at line 729 of file pns_meander.cpp.

References m_dual, m_last, m_meanders, m_placer, m_width, and PNS::MEANDER_SHAPE::MakeCorner().

Referenced by PNS::MEANDER_PLACER::doMove(), MeanderSegment(), and PNS::DP_MEANDER_PLACER::Move().

◆ AddMeander()

void PNS::MEANDERED_LINE::AddMeander ( MEANDER_SHAPE aShape)

Add a new meander shape to the meandered line.

Parameters
aShapethe meander shape to add

Definition at line 791 of file pns_meander.cpp.

References SEG::B, PNS::MEANDER_SHAPE::BaseSegment(), m_last, and m_meanders.

Referenced by MeanderSegment().

◆ AddPtAndArc()

void PNS::MEANDERED_LINE::AddPtAndArc ( const VECTOR2I aPt1,
const SHAPE_ARC aArc2 
)

Create a dummy meander shape representing an arc corner.

Allows representing existing arc tracks so they can be reconstructed after length tuning.

Parameters
aPt1corner point of the 1st line.
aArc2Arc shape on the 2nd line (if m_dual == true).

Definition at line 759 of file pns_meander.cpp.

References AddArc().

Referenced by PNS::DP_MEANDER_PLACER::Move().

◆ CheckSelfIntersections()

bool PNS::MEANDERED_LINE::CheckSelfIntersections ( MEANDER_SHAPE aShape,
int  aClearance 
)

Check if the given shape is intersecting with any other meander in the current line.

Parameters
aShapethe shape to check.
aClearanceclearance value.
Returns
true, if the meander shape is not colliding.

Definition at line 573 of file pns_meander.cpp.

References SEG::ApproxParallel(), PNS::MEANDER_SHAPE::BaseSegment(), PNS::MEANDER_SHAPE::CLine(), SHAPE_LINE_CHAIN::Collide(), SHAPE_LINE_CHAIN::CSegment(), m_meanders, PNS::MT_CORNER, PNS::MT_EMPTY, SHAPE_LINE_CHAIN::SegmentCount(), and PNS::MEANDER_SHAPE::Type().

Referenced by PNS::DP_MEANDER_PLACER::CheckFit(), and PNS::MEANDER_PLACER::CheckFit().

◆ Clear()

void PNS::MEANDERED_LINE::Clear ( )

Clear the line geometry, removing all corners and meanders.

Definition at line 798 of file pns_meander.cpp.

References m_meanders.

Referenced by ~MEANDERED_LINE().

◆ Meanders()

std::vector< MEANDER_SHAPE * > & PNS::MEANDERED_LINE::Meanders ( )
inline
Returns
set of meander shapes for this line.

Definition at line 527 of file pns_meander.h.

References m_meanders.

Referenced by PNS::MEANDER_PLACER::doMove(), PNS::DP_MEANDER_PLACER::Move(), and PNS::MEANDER_PLACER_BASE::tuneLineLength().

◆ MeanderSegment()

void PNS::MEANDERED_LINE::MeanderSegment ( const SEG aSeg,
bool  aSide,
int  aBaseIndex = 0 
)

◆ SetBaselineOffset()

void PNS::MEANDERED_LINE::SetBaselineOffset ( int  aOffset)
inline

Set the parallel offset between the base segment and the meandered line.

Used for dual meanders (diff pair) only.

Parameters
aOffsetthe offset.

Definition at line 519 of file pns_meander.h.

References m_baselineOffset.

Referenced by PNS::MEANDER_PLACER::doMove(), and PNS::DP_MEANDER_PLACER::Move().

◆ Settings()

const MEANDER_SETTINGS & PNS::MEANDERED_LINE::Settings ( ) const
Returns
the current meandering settings.

Definition at line 118 of file pns_meander.cpp.

References m_placer, and PNS::MEANDER_PLACER_BASE::MeanderSettings().

Referenced by MeanderSegment().

◆ SetWidth()

void PNS::MEANDERED_LINE::SetWidth ( int  aWidth)
inline

Set the line width.

Definition at line 504 of file pns_meander.h.

References m_width.

Referenced by PNS::MEANDER_PLACER::doMove(), and PNS::DP_MEANDER_PLACER::Move().

Member Data Documentation

◆ m_baselineOffset

int PNS::MEANDERED_LINE::m_baselineOffset
private

Definition at line 554 of file pns_meander.h.

Referenced by MEANDERED_LINE(), MeanderSegment(), and SetBaselineOffset().

◆ m_dual

bool PNS::MEANDERED_LINE::m_dual
private

Definition at line 552 of file pns_meander.h.

Referenced by AddArc(), AddCorner(), MEANDERED_LINE(), and MeanderSegment().

◆ m_last

VECTOR2I PNS::MEANDERED_LINE::m_last
private

Definition at line 547 of file pns_meander.h.

Referenced by AddArc(), AddCorner(), AddMeander(), and MeanderSegment().

◆ m_meanders

std::vector<MEANDER_SHAPE*> PNS::MEANDERED_LINE::m_meanders
private

Definition at line 550 of file pns_meander.h.

Referenced by AddArc(), AddCorner(), AddMeander(), CheckSelfIntersections(), Clear(), and Meanders().

◆ m_placer

MEANDER_PLACER_BASE* PNS::MEANDERED_LINE::m_placer
private

Definition at line 549 of file pns_meander.h.

Referenced by AddArc(), AddCorner(), MEANDERED_LINE(), MeanderSegment(), and Settings().

◆ m_width

int PNS::MEANDERED_LINE::m_width
private

Definition at line 553 of file pns_meander.h.

Referenced by AddArc(), AddCorner(), MEANDERED_LINE(), MeanderSegment(), and SetWidth().


The documentation for this class was generated from the following files: