37 auto seg = std::make_unique<FP_SHAPE>( &aFootprint,
S_SEGMENT );
39 seg->SetStart0( (wxPoint) aSeg.
A );
40 seg->SetEnd0( (wxPoint) aSeg.
B );
42 seg->SetWidth( aWidth );
43 seg->SetLayer( aLayer );
45 aFootprint.
Add( seg.release() );
52 for(
unsigned i = 0; i < aPts.size() - 1; ++i )
54 DrawSegment( aFootprint, { aPts[i], aPts[i + 1] }, aWidth, aLayer );
62 auto seg = std::make_unique<FP_SHAPE>( &aFootprint,
S_ARC );
64 seg->SetStart0( (wxPoint) aCentre );
65 seg->SetEnd0( (wxPoint) aStart );
66 seg->SetAngle( aAngle * 10 );
68 seg->SetWidth( aWidth );
69 seg->SetLayer( aLayer );
71 aFootprint.
Add( seg.release() );
78 const auto x_r = aPos.
x + aSize.
x / 2;
79 const auto x_l = aPos.
x - aSize.
x / 2;
80 const auto y_t = aPos.
y + aSize.
y / 2;
81 const auto y_b = aPos.
y - aSize.
y / 2;
83 const auto xin_r = x_r - aRadius;
84 const auto xin_l = x_l + aRadius;
85 const auto yin_t = y_t - aRadius;
86 const auto yin_b = y_b + aRadius;
91 DrawSegment( aFootprint, { { xin_l, y_t }, { xin_r, y_t } }, aWidth, aLayer );
92 DrawSegment( aFootprint, { { xin_l, y_b }, { xin_r, y_b } }, aWidth, aLayer );
97 DrawSegment( aFootprint, { { x_l, yin_b }, { x_l, yin_t } }, aWidth, aLayer );
98 DrawSegment( aFootprint, { { x_r, yin_b }, { x_r, yin_t } }, aWidth, aLayer );
103 DrawArc( aFootprint, { xin_r, yin_t }, { x_r, yin_t }, 90, aWidth, aLayer );
104 DrawArc( aFootprint, { xin_l, yin_t }, { xin_l, y_t }, 90, aWidth, aLayer );
105 DrawArc( aFootprint, { xin_l, yin_b }, { x_l, yin_b }, 90, aWidth, aLayer );
106 DrawArc( aFootprint, { xin_r, yin_b }, { xin_r, y_b }, 90, aWidth, aLayer );
void DrawSegment(FOOTPRINT &aFootprint, const SEG &aSeg, int aWidth, PCB_LAYER_ID aLayer)
Draw a segment in the given footprint.
usual segment : line with rounded ends
Construction utilities for PCB tests.
void DrawPolyline(FOOTPRINT &aFootprint, const std::vector< VECTOR2I > &aPts, int aWidth, PCB_LAYER_ID aLayer)
Draw a polyline - a set of linked segments.
PCB_LAYER_ID
A quick note on layer IDs:
void DrawRect(FOOTPRINT &aFootprint, const VECTOR2I &aPos, const VECTOR2I &aSize, int aRadius, int aWidth, PCB_LAYER_ID aLayer)
Draw a rectangle on a footprint.
void DrawArc(FOOTPRINT &aFootprint, const VECTOR2I &aCentre, const VECTOR2I &aStart, double aAngle, int aWidth, PCB_LAYER_ID aLayer)
Draw an arc on a footprint.