Horizon
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
PNS::MEANDER_SHAPE Class Reference

The geometry of a single meander. More...

#include <pns_meander.h>

Public Member Functions

 MEANDER_SHAPE (MEANDER_PLACER_BASE *aPlacer, int aWidth, bool aIsDual=false)
 
void SetType (MEANDER_TYPE aType)
 Set the type of the meander.
 
MEANDER_TYPE Type () const
 
void SetBaseIndex (int aIndex)
 Set an auxiliary index of the segment being meandered in its original LINE.
 
int BaseIndex () const
 
int Amplitude () const
 
void MakeCorner (const VECTOR2I &aP1, const VECTOR2I &aP2=VECTOR2I(0, 0))
 Create a dummy meander shape representing a line corner.
 
void MakeArc (const SHAPE_ARC &aArc1, const SHAPE_ARC &aArc2=SHAPE_ARC())
 Create a dummy meander shape representing an arc corner.
 
void Resize (int aAmpl)
 Change the amplitude of the meander shape to aAmpl and recalculates the resulting line chain.
 
void Recalculate ()
 Recalculate the line chain representing the meander's shape.
 
bool IsDual () const
 
bool Side () const
 
VECTOR2I End () const
 
const SHAPE_LINE_CHAINCLine (int aShape) const
 
void MakeEmpty ()
 Replace the meander with straight bypass line(s), effectively clearing it.
 
bool Fit (MEANDER_TYPE aType, const SEG &aSeg, const VECTOR2I &aP, bool aSide)
 Attempt to fit a meander of a given type onto a segment, avoiding collisions with other board features.
 
const SEGBaseSegment () const
 Return the base segment the meander was fitted to.
 
int BaselineLength () const
 
int MaxTunableLength () const
 
const MEANDER_SETTINGSSettings () const
 
int Width () const
 
void SetBaselineOffset (int aOffset)
 Set the parallel offset between the base segment and the meandered line.
 

Friends

class MEANDERED_LINE
 Start turtle drawing.
 

Detailed Description

The geometry of a single meander.

Constructor & Destructor Documentation

◆ MEANDER_SHAPE()

PNS::MEANDER_SHAPE::MEANDER_SHAPE ( MEANDER_PLACER_BASE aPlacer,
int  aWidth,
bool  aIsDual = false 
)
inline
Parameters
aPlacerthe meander placer instance.
aWidthwidth of the meandered line.
aIsDualwhen true, the shape contains two meandered lines at a given offset (diff pairs).

Member Function Documentation

◆ Amplitude()

int PNS::MEANDER_SHAPE::Amplitude ( ) const
inline
Returns
the amplitude of the meander shape.

◆ BaseIndex()

int PNS::MEANDER_SHAPE::BaseIndex ( ) const
inline
Returns
auxiliary index of the segment being meandered in its original LINE.

◆ BaselineLength()

int PNS::MEANDER_SHAPE::BaselineLength ( ) const
Returns
length of the base segment for the meander (i.e.the minimum tuned length).

◆ BaseSegment()

const SEG & PNS::MEANDER_SHAPE::BaseSegment ( ) const
inline

Return the base segment the meander was fitted to.

Returns
the base segment.

◆ CLine()

const SHAPE_LINE_CHAIN & PNS::MEANDER_SHAPE::CLine ( int  aShape) const
inline
Returns
the line chain representing the shape of the meander.

◆ End()

VECTOR2I PNS::MEANDER_SHAPE::End ( ) const
inline
Returns
end vertex of the base segment of the meander shape.

◆ Fit()

bool PNS::MEANDER_SHAPE::Fit ( MEANDER_TYPE  aType,
const SEG aSeg,
const VECTOR2I aP,
bool  aSide 
)

Attempt to fit a meander of a given type onto a segment, avoiding collisions with other board features.

Parameters
aTypetype of meander shape.
aSegbase segment for meandering.
aPstart point of the meander.
aSideside of aSeg to put the meander on (true = right).
Returns
true on success.

◆ IsDual()

bool PNS::MEANDER_SHAPE::IsDual ( ) const
inline
Returns
true if the shape represents 2 parallel lines (diff pair).

◆ MakeArc()

void PNS::MEANDER_SHAPE::MakeArc ( 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).

◆ MakeCorner()

void PNS::MEANDER_SHAPE::MakeCorner ( const VECTOR2I aP1,
const VECTOR2I aP2 = VECTOR2I( 0, 0 ) 
)

Create a dummy meander shape representing a line corner.

Used to define the starts/ends of meandered segments.

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

◆ MaxTunableLength()

int PNS::MEANDER_SHAPE::MaxTunableLength ( ) const
Returns
the length of the fitted line chain.

◆ Resize()

void PNS::MEANDER_SHAPE::Resize ( int  aAmpl)

Change the amplitude of the meander shape to aAmpl and recalculates the resulting line chain.

Parameters
aAmplnew amplitude.

◆ SetBaselineOffset()

void PNS::MEANDER_SHAPE::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.

◆ Settings()

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

◆ Side()

bool PNS::MEANDER_SHAPE::Side ( ) const
inline
Returns
true if the meander is to the right of its base segment.

◆ Type()

MEANDER_TYPE PNS::MEANDER_SHAPE::Type ( ) const
inline
Returns
the type of the meander.

◆ Width()

int PNS::MEANDER_SHAPE::Width ( ) const
inline
Returns
width of the meandered line.

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