23#ifndef __PNS_MEANDER_H
24#define __PNS_MEANDER_H
26#include <math/vector2d.h>
28#include <geometry/shape.h>
29#include <geometry/shape_line_chain.h>
33class MEANDER_PLACER_BASE;
51 MEANDER_STYLE_ROUND = 1,
123 m_baselineOffset( 0 )
130 m_currentTarget =
nullptr;
131 m_meanCornerRadius = 0;
155 m_baseIndex = aIndex;
226 return m_clippedBaseSeg.B;
234 return m_shapes[aShape];
252 bool Fit( MEANDER_TYPE aType,
const SEG& aSeg,
const VECTOR2I& aP,
bool aSide );
261 return m_clippedBaseSeg;
295 m_baselineOffset = aOffset;
305 void forward(
int aLength );
308 void turn(
int aAngle );
311 void miter(
int aRadius,
bool aSide );
314 void uShape(
int aSides,
int aCorner,
int aTop );
321 MEANDER_TYPE aType,
int aAmpl,
int aBaselineOffset = 0 );
324 void updateBaseSegment();
327 int cornerRadius()
const;
348 int m_baselineOffset;
351 int m_meanCornerRadius;
360 SEG m_clippedBaseSeg;
394 m_baselineOffset = 0;
407 m_baselineOffset = 0;
483 m_baselineOffset = aOffset;
512 std::vector<MEANDER_SHAPE*> m_meanders;
516 int m_baselineOffset;
Represent a set of meanders fitted over a single or two lines.
Definition pns_meander.h:386
void AddMeander(MEANDER_SHAPE *aShape)
Add a new meander shape to the meandered line.
Definition pns_meander.cpp:628
void SetBaselineOffset(int aOffset)
Set the parallel offset between the base segment and the meandered line.
Definition pns_meander.h:481
void SetWidth(int aWidth)
Set the line width.
Definition pns_meander.h:466
void AddCorner(const VECTOR2I &aA, const VECTOR2I &aB=VECTOR2I(0, 0))
Create a dummy meander shape representing a line corner.
Definition pns_meander.cpp:566
void Clear()
Clear the line geometry, removing all corners and meanders.
Definition pns_meander.cpp:635
void MeanderSegment(const SEG &aSeg, bool aSide, int aBaseIndex=0)
Fit maximum amplitude meanders on a given segment and adds to the current line.
Definition pns_meander.cpp:45
void AddArc(const SHAPE_ARC &aArc1, const SHAPE_ARC &aArc2=SHAPE_ARC())
Create a dummy meander shape representing an arc corner.
Definition pns_meander.cpp:577
void AddArcAndPt(const SHAPE_ARC &aArc1, const VECTOR2I &aPt2)
Create a dummy meander shape representing an arc corner.
Definition pns_meander.cpp:588
bool CheckSelfIntersections(MEANDER_SHAPE *aShape, int aClearance)
Check if the given shape is intersecting with any other meander in the current line.
Definition pns_meander.cpp:404
const MEANDER_SETTINGS & Settings() const
Definition pns_meander.cpp:39
MEANDERED_LINE(MEANDER_PLACER_BASE *aPlacer, bool aIsDual=false)
Definition pns_meander.h:401
std::vector< MEANDER_SHAPE * > & Meanders()
Definition pns_meander.h:489
void AddPtAndArc(const VECTOR2I &aPt1, const SHAPE_ARC &aArc2)
Create a dummy meander shape representing an arc corner.
Definition pns_meander.cpp:596
Base class for Single trace & Differential pair meandering tools, as both of them share a lot of code...
Definition pns_meander_placer_base.h:47
Dimensions for the meandering algorithm.
Definition pns_meander.h:59
int m_minAmplitude
Maximum meandering amplitude.
Definition pns_meander.h:77
MEANDER_SETTINGS()
Minimum meandering amplitude.
Definition pns_meander.h:62
int m_cornerRadiusPercentage
Allowable tuning error.
Definition pns_meander.h:98
long long int m_targetLength
Type of corners for the meandered line.
Definition pns_meander.h:92
int m_lengthTolerance
Target skew value for diff pair de-skewing.
Definition pns_meander.h:101
int m_step
Length PadToDie.
Definition pns_meander.h:86
MEANDER_STYLE m_cornerStyle
Rounding percentage (0 - 100).
Definition pns_meander.h:95
int m_maxAmplitude
Meandering period/spacing (see dialog picture for explanation).
Definition pns_meander.h:80
int m_lenPadToDie
Desired length of the tuned line/diff pair (this is in nm, so allow more than board width).
Definition pns_meander.h:89
int m_spacing
Amplitude/spacing adjustment step.
Definition pns_meander.h:83
The geometry of a single meander.
Definition pns_meander.h:111
MEANDER_SHAPE(MEANDER_PLACER_BASE *aPlacer, int aWidth, bool aIsDual=false)
Definition pns_meander.h:119
int Amplitude() const
Definition pns_meander.h:169
void SetType(MEANDER_TYPE aType)
Set the type of the meander.
Definition pns_meander.h:137
VECTOR2I End() const
Definition pns_meander.h:224
void SetBaseIndex(int aIndex)
Set an auxiliary index of the segment being meandered in its original LINE.
Definition pns_meander.h:153
int BaseIndex() const
Definition pns_meander.h:161
bool Side() const
Definition pns_meander.h:216
void MakeArc(const SHAPE_ARC &aArc1, const SHAPE_ARC &aArc2=SHAPE_ARC())
Create a dummy meander shape representing an arc corner.
Definition pns_meander.cpp:616
void Recalculate()
Recalculate the line chain representing the meander's shape.
Definition pns_meander.cpp:527
void Resize(int aAmpl)
Change the amplitude of the meander shape to aAmpl and recalculates the resulting line chain.
Definition pns_meander.cpp:540
int Width() const
Definition pns_meander.h:282
bool IsDual() const
Definition pns_meander.h:208
void SetBaselineOffset(int aOffset)
Set the parallel offset between the base segment and the meandered line.
Definition pns_meander.h:293
MEANDER_TYPE Type() const
Definition pns_meander.h:145
const MEANDER_SETTINGS & Settings() const
Definition pns_meander.cpp:33
void MakeEmpty()
Replace the meander with straight bypass line(s), effectively clearing it.
Definition pns_meander.cpp:551
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 feature...
Definition pns_meander.cpp:432
int MaxTunableLength() const
Definition pns_meander.cpp:652
const SHAPE_LINE_CHAIN & CLine(int aShape) const
Definition pns_meander.h:232
int BaselineLength() const
Definition pns_meander.cpp:646
const SEG & BaseSegment() const
Return the base segment the meander was fitted to.
Definition pns_meander.h:259
void MakeCorner(const VECTOR2I &aP1, const VECTOR2I &aP2=VECTOR2I(0, 0))
Create a dummy meander shape representing a line corner.
Definition pns_meander.cpp:604
Definition shape_arc.h:36
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Definition shape_line_chain.h:81