KiCad PCB EDA Suite
Loading...
Searching...
No Matches
export_hyperlynx.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2019 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#include <kiface_base.h>
26#include <macros.h>
27#include <pcb_edit_frame.h>
28#include <board.h>
30#include <board_item.h>
31#include <footprint.h>
32#include <pad.h>
33#include <pcb_track.h>
34#include <zone.h>
35#include <cstdio>
36#include <vector>
37#include <ki_exception.h>
38#include <locale_io.h>
39#include <reporter.h>
40#include <richio.h>
43#include <wx/log.h>
44#include <wx/filedlg.h>
45
46static double iu2hyp( double iu )
47{
48 return iu / 1e9 / 0.0254;
49}
50
51
53
55{
56public:
57 friend class HYPERLYNX_EXPORTER;
58
59 HYPERLYNX_PAD_STACK( BOARD* aBoard, const PAD* aPad );
60 HYPERLYNX_PAD_STACK( BOARD* aBoard, const PCB_VIA* aVia );
62
63 bool IsThrough() const
64 {
65 return m_type == PAD_ATTRIB::NPTH || m_type == PAD_ATTRIB::PTH;
66 }
67
68 bool operator==( const HYPERLYNX_PAD_STACK& other ) const
69 {
70 if( m_shape != other.m_shape )
71 return false;
72
73 if( m_type != other.m_type )
74 return false;
75
76 if( IsThrough() && other.IsThrough() && m_drill != other.m_drill )
77 return false;
78
79 if( m_sx != other.m_sx )
80 return false;
81
82 if( m_sy != other.m_sy )
83 return false;
84
85 if( m_layers != other.m_layers )
86 return false;
87
88 if( m_angle != other.m_angle )
89 return false;
90
91 return true;
92 }
93
94 void SetId( int id )
95 {
96 m_id = id;
97 }
98
99 int GetId() const
100 {
101 return m_id;
102 }
103
104 bool IsEmpty() const
105 {
107
108 return outLayers.none();
109 }
110
111private:
113 int m_id;
116 int m_sx, m_sy;
117 double m_angle;
120};
121
122
124{
125public:
127 {
128 }
129
131
132 virtual bool Run() override;
133
134private:
136 {
138 {
139 if( *p == stack )
140 return p;
141 }
142
143 stack.SetId( m_padStacks.size() );
144 m_padStacks.push_back( new HYPERLYNX_PAD_STACK( stack ) );
145
146 return m_padStacks.back();
147 }
148
149 const std::string formatPadShape( const HYPERLYNX_PAD_STACK& aStack )
150 {
151 int shapeId = 0;
152 char buf[1024];
153
154 switch( aStack.m_shape )
155 {
156 case PAD_SHAPE::CIRCLE:
157 case PAD_SHAPE::OVAL:
158 shapeId = 0;
159 break;
160
161 case PAD_SHAPE::ROUNDRECT:
162 shapeId = 2;
163 break;
164
165 case PAD_SHAPE::RECTANGLE:
166 shapeId = 1;
167 break;
168
169 default:
170 if( m_reporter )
171 {
172 m_reporter->Report( _( "File contains pad shapes that are not supported by the "
173 "Hyperlynx exporter (supported shapes are oval, rectangle, "
174 "rounded rectangle, and circle)." ),
176 m_reporter->Report( _( "They have been exported as oval pads." ),
178 }
179
180 shapeId = 0;
181 break;
182 }
183
184 snprintf( buf, sizeof( buf ), "%d, %.9f, %.9f, %.1f, M",
185 shapeId,
186 iu2hyp( aStack.m_sx ),
187 iu2hyp( aStack.m_sy ),
188 aStack.m_angle );
189
190 return buf;
191 }
192
193 bool generateHeaders();
194 bool writeBoardInfo();
195 bool writeStackupInfo();
196 bool writeDevices();
197 bool writePadStacks();
198 bool writeNets();
199 bool writeNetObjects( const std::vector<BOARD_ITEM*>& aObjects );
200
201
203
204 const std::vector<BOARD_ITEM*> collectNetObjects( int netcode );
205
206private:
207 std::vector<HYPERLYNX_PAD_STACK*> m_padStacks;
208 std::map<BOARD_ITEM*, HYPERLYNX_PAD_STACK*> m_padMap;
209
210 std::shared_ptr<FILE_OUTPUTFORMATTER> m_out;
212};
213
214
216{
217 // TODO(JE) padstacks
218 m_board = aBoard;
221 m_angle = 180.0 - aPad->GetOrientation().AsDegrees();
222
223 if( m_angle < 0.0 )
224 m_angle += 360.0;
225
226 m_layers = aPad->GetLayerSet();
227 m_drill = aPad->GetDrillSize().x;
229 m_type = PAD_ATTRIB::PTH;
230 m_id = 0;
231}
232
233
235{
236 m_board = aBoard;
237 // TODO(JE) padstacks
239 m_angle = 0;
240 m_layers = aVia->GetLayerSet();
241 m_drill = aVia->GetDrillValue();
242 m_shape = PAD_SHAPE::CIRCLE;
243 m_type = PAD_ATTRIB::PTH;
244 m_id = 0;
245}
246
247
249{
250 m_out->Print( 0, "{VERSION=2.14}\n" );
251 m_out->Print( 0, "{UNITS=ENGLISH LENGTH}\n\n" );
252 return true;
253}
254
255
257{
259 LSET outLayers = aStack.m_layers & layerMask;
260
261 if( outLayers.none() )
262 return;
263
264 m_out->Print( 0, "{PADSTACK=%d, %.9f\n", aStack.m_id, iu2hyp( aStack.m_drill ) );
265
266 if( outLayers == layerMask )
267 {
268 m_out->Print( 1, "(\"MDEF\", %s)\n", formatPadShape( aStack ).c_str() );
269 }
270 else
271 {
272 for( PCB_LAYER_ID l : outLayers.Seq() )
273 {
274 m_out->Print( 1, "(\"%s\", %s)\n",
275 (const char*) m_board->GetLayerName( l ).c_str(),
276 formatPadShape( aStack ).c_str() );
277 }
278 }
279
280 m_out->Print( 0, "}\n\n" );
281}
282
283
285{
286 SHAPE_POLY_SET outlines;
287
288 m_out->Print( 0, "{BOARD \"%s\"\n", (const char*) m_board->GetFileName().c_str() );
289
290 if( !m_board->GetBoardPolygonOutlines( outlines ) )
291 {
292 wxLogError( _( "Board outline is malformed. Run DRC for a full analysis." ) );
293 return false;
294 }
295
296 for( int o = 0; o < outlines.OutlineCount(); o++ )
297 {
298 const SHAPE_LINE_CHAIN& outl = outlines.COutline( o );
299
300 for( int i = 0; i < outl.SegmentCount(); i++ )
301 {
302 const SEG& s = outl.CSegment( i );
303 m_out->Print( 1, "(PERIMETER_SEGMENT X1=%.9f Y1=%.9f X2=%.9f Y2=%.9f)\n",
304 iu2hyp( s.A.x ),
305 iu2hyp( -s.A.y ),
306 iu2hyp( s.B.x ),
307 iu2hyp( -s.B.y ) );
308 }
309 }
310
311 m_out->Print( 0, "}\n\n" );
312
313 return true;
314}
315
316
318{
319 /* Format:
320 * {STACKUP
321 * (SIGNAL T=thickness [P=plating_thickness] [C=constant] L=layer_name [M=material_name]) [comment]
322 * (DIELECTRIC T=thickness [C=constant] [L=layer_name] [M=material_name]) [comment]
323 * }
324 * name length is <= 20 chars
325 */
326
328
329 // Get the board physical stackup structure
331
332 m_out->Print( 0, "{STACKUP\n" );
333
334 wxString layer_name; // The last copper layer name used in stackup
335
336 for( BOARD_STACKUP_ITEM* item: stackup.GetList() )
337 {
338 if( item->GetType() == BS_ITEM_TYPE_COPPER )
339 {
340 layer_name = m_board->GetLayerName( item->GetBrdLayerId() );
341 int plating_thickness = 0;
342 double resistivity = 1.724e-8; // Good for copper
343 m_out->Print( 1, "(SIGNAL T=%g P=%g C=%g L=\"%.20s\" M=COPPER)\n",
344 iu2hyp( item->GetThickness( 0 ) ),
345 iu2hyp( plating_thickness ),
346 resistivity,
347 TO_UTF8( layer_name ) );
348 }
349 else if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
350 {
351 if( item->GetSublayersCount() < 2 )
352 {
353 m_out->Print( 1, "(DIELECTRIC T=%g C=%g L=\"DE_%.17s\" M=\"%.20s\")\n",
354 iu2hyp( item->GetThickness( 0 ) ),
355 item->GetEpsilonR( 0 ),
356 TO_UTF8( layer_name ),
357 TO_UTF8( item->GetMaterial( 0 ) ) );
358 }
359 else for( int idx = 0; idx < item->GetSublayersCount(); idx++ )
360 {
361 m_out->Print( 1, "(DIELECTRIC T=%g C=%g L=\"DE%d_%.16s\" M=\"%.20s\")\n",
362 iu2hyp( item->GetThickness( idx ) ),
363 item->GetEpsilonR( idx ),
364 idx,
365 TO_UTF8( layer_name ),
366 TO_UTF8( item->GetMaterial( idx ) ) );
367 }
368 }
369 }
370
371 m_out->Print( 0, "}\n\n" );
372
373 return true;
374}
375
376
378{
379 m_out->Print( 0, "{DEVICES\n" );
380
381 for( FOOTPRINT* footprint : m_board->Footprints() )
382 {
383 wxString ref = footprint->GetReference();
384 wxString layerName = m_board->GetLayerName( footprint->GetLayer() );
385
386 if( ref.IsEmpty() )
387 ref = wxT( "EMPTY" );
388
389 m_out->Print( 1, "(? REF=\"%s\" L=\"%s\")\n",
390 (const char*) ref.c_str(),
391 (const char*) layerName.c_str() );
392 }
393 m_out->Print( 0, "}\n\n" );
394
395 return true;
396}
397
398
400{
401 for( FOOTPRINT* footprint : m_board->Footprints() )
402 {
403 for( PAD* pad : footprint->Pads() )
404 {
406 m_padMap[pad] = ps;
407 }
408 }
409
410 for( PCB_TRACK* track : m_board->Tracks() )
411 {
412 if( PCB_VIA* via = dyn_cast<PCB_VIA*>( track ) )
413 {
415 m_padMap[via] = ps;
416 }
417 }
418
419 for( HYPERLYNX_PAD_STACK* pstack : m_padStacks )
420 writeSinglePadStack( *pstack );
421
422 return true;
423}
424
425
426bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjects )
427{
428 for( BOARD_ITEM* item : aObjects )
429 {
430 if( PAD* pad = dyn_cast<PAD*>( item ) )
431 {
432 auto pstackIter = m_padMap.find( pad );
433
434 if( pstackIter != m_padMap.end() )
435 {
436 wxString ref = pad->GetParentFootprint()->GetReference();
437
438 if( ref.IsEmpty() )
439 ref = wxT( "EMPTY" );
440
441 wxString padName = pad->GetNumber();
442
443 if( padName.IsEmpty() )
444 padName = wxT( "1" );
445
446
447 m_out->Print( 1, "(PIN X=%.10f Y=%.10f R=\"%s.%s\" P=%d)\n",
448 iu2hyp( pad->GetPosition().x ),
449 iu2hyp( -pad->GetPosition().y ),
450 (const char*) ref.c_str(),
451 (const char*) padName.c_str(),
452 pstackIter->second->GetId() );
453 }
454 }
455 else if( PCB_VIA* via = dyn_cast<PCB_VIA*>( item ) )
456 {
457 auto pstackIter = m_padMap.find( via );
458
459 if( pstackIter != m_padMap.end() )
460 {
461 m_out->Print( 1, "(VIA X=%.10f Y=%.10f P=%d)\n",
462 iu2hyp( via->GetPosition().x ),
463 iu2hyp( -via->GetPosition().y ),
464 pstackIter->second->GetId() );
465 }
466 }
467 else if( PCB_TRACK* track = dyn_cast<PCB_TRACK*>( item ) )
468 {
469 const wxString layerName = m_board->GetLayerName( track->GetLayer() );
470
471 m_out->Print( 1, "(SEG X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f W=%.10f L=\"%s\")\n",
472 iu2hyp( track->GetStart().x ),
473 iu2hyp( -track->GetStart().y ),
474 iu2hyp( track->GetEnd().x ),
475 iu2hyp( -track->GetEnd().y ),
476 iu2hyp( track->GetWidth() ),
477 (const char*) layerName.c_str() );
478 }
479 else if( PCB_ARC* arc = dyn_cast<PCB_ARC*>( item ) )
480 {
481 const wxString layerName = m_board->GetLayerName( arc->GetLayer() );
482 VECTOR2I start = arc->GetStart();
483 VECTOR2I end = arc->GetEnd();
484
485 if( arc->IsCCW() )
486 std::swap( start, end );
487
488 m_out->Print( 1, "(ARC X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f XC=%.10f YC=%.10f R=%.10f W=%.10f L=\"%s\")\n",
489 iu2hyp( start.x ),
490 iu2hyp( -start.y ),
491 iu2hyp( end.x ),
492 iu2hyp( -end.y ),
493 iu2hyp( arc->GetCenter().x ),
494 iu2hyp( -arc->GetCenter().y ),
495 iu2hyp( arc->GetRadius() ),
496 iu2hyp( arc->GetWidth() ),
497 (const char*) layerName.c_str() );
498 }
499 else if( ZONE* zone = dyn_cast<ZONE*>( item ) )
500 {
501 for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
502 {
503 const wxString layerName = m_board->GetLayerName( layer );
504 SHAPE_POLY_SET fill = zone->GetFilledPolysList( layer )->CloneDropTriangulation();
505
506 fill.Simplify();
507
508 for( int i = 0; i < fill.OutlineCount(); i++ )
509 {
510 const SHAPE_LINE_CHAIN& outl = fill.COutline( i );
511 const VECTOR2I p0 = outl.CPoint( 0 );
512
513 m_out->Print( 1, "{POLYGON T=POUR L=\"%s\" ID=%d X=%.10f Y=%.10f\n",
514 (const char*) layerName.c_str(),
515 m_polyId,
516 iu2hyp( p0.x ),
517 iu2hyp( -p0.y ) );
518
519 for( int v = 0; v < outl.PointCount(); v++ )
520 {
521 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
522 iu2hyp( outl.CPoint( v ).x ),
523 iu2hyp( -outl.CPoint( v ).y ) );
524 }
525
526 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n", iu2hyp( p0.x ), iu2hyp( -p0.y ) );
527 m_out->Print( 1, "}\n" );
528
529 for( int h = 0; h < fill.HoleCount( i ); h++ )
530 {
531 const SHAPE_LINE_CHAIN& holeShape = fill.CHole( i, h );
532 const VECTOR2I ph0 = holeShape.CPoint( 0 );
533
534 m_out->Print( 1, "{POLYVOID ID=%d X=%.10f Y=%.10f\n",
535 m_polyId,
536 iu2hyp( ph0.x ),
537 iu2hyp( -ph0.y ) );
538
539 for( int v = 0; v < holeShape.PointCount(); v++ )
540 {
541 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
542 iu2hyp( holeShape.CPoint( v ).x ),
543 iu2hyp( -holeShape.CPoint( v ).y ) );
544 }
545
546 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
547 iu2hyp( ph0.x ),
548 iu2hyp( -ph0.y ) );
549 m_out->Print( 1, "}\n" );
550 }
551
552 m_polyId++;
553 }
554 }
555 }
556 }
557
558 return true;
559}
560
561
562const std::vector<BOARD_ITEM*> HYPERLYNX_EXPORTER::collectNetObjects( int netcode )
563{
564 std::vector<BOARD_ITEM*> rv;
565
566 auto check =
567 [&]( BOARD_CONNECTED_ITEM* item ) -> bool
568 {
569 if( ( item->GetLayerSet() & LSET::AllCuMask() ).none() )
570 return false;
571
572 if( item->GetNetCode() == netcode || ( netcode < 0 && item->GetNetCode() <= 0 ) )
573 return true;
574
575 return false;
576 };
577
578 for( FOOTPRINT* footprint : m_board->Footprints() )
579 {
580 for( PAD* pad : footprint->Pads() )
581 {
582 if( check( pad ) )
583 rv.push_back( pad );
584 }
585 }
586
587 for( PCB_TRACK* item : m_board->Tracks() )
588 {
589 if( check( item ) )
590 rv.push_back( item );
591 }
592
593 for( ZONE* zone : m_board->Zones() )
594 {
595 if( check( zone ) )
596 rv.push_back( zone );
597 }
598
599 return rv;
600}
601
602
604{
605 m_polyId = 1;
606
607 for( const NETINFO_ITEM* netInfo : m_board->GetNetInfo() )
608 {
609 int netcode = netInfo->GetNetCode();
610 bool isNullNet = netInfo->GetNetCode() <= 0 || netInfo->GetNetname().IsEmpty();
611
612 if( isNullNet )
613 continue;
614
615 const std::vector<BOARD_ITEM*> netObjects = collectNetObjects( netcode );
616
617 if( netObjects.size() )
618 {
619 m_out->Print( 0, "{NET=\"%s\"\n", (const char*) netInfo->GetNetname().c_str() );
620 writeNetObjects( netObjects );
621 m_out->Print( 0, "}\n\n" );
622 }
623 }
624
625 const std::vector<BOARD_ITEM*> nullNetObjects = collectNetObjects( -1 );
626
627 int idx = 0;
628
629 for( BOARD_ITEM* item : nullNetObjects )
630 {
631 m_out->Print( 0, "{NET=\"EmptyNet%d\"\n", idx );
632 writeNetObjects( { item } );
633 m_out->Print( 0, "}\n\n" );
634 idx++;
635 }
636
637 return true;
638}
639
640
642{
643 LOCALE_IO toggle; // toggles on, then off, the C locale.
644
645 try
646 {
647 m_out.reset( new FILE_OUTPUTFORMATTER( m_outputFilePath.GetFullPath() ) );
648
652 writeDevices();
654 writeNets();
655 }
656 catch( IO_ERROR& )
657 {
658 return false;
659 }
660
661 return true;
662}
663
664
666{
667 wxString wildcard = wxT( "*.hyp" );
669 wxFileName fn = board->GetFileName();
670
671 fn.SetExt( wxT("hyp") );
672
673 wxFileDialog dlg( m_frame, _( "Export Hyperlynx Layout" ), fn.GetPath(), fn.GetFullName(),
674 wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
675
676 if( dlg.ShowModal() != wxID_OK )
677 return 0;
678
679 fn = dlg.GetPath();
680
681 // always enforce filename extension, user may not have entered it.
682 fn.SetExt( wxT( "hyp" ) );
683
684 HYPERLYNX_EXPORTER exporter;
685 exporter.SetBoard( board );
686 exporter.SetOutputFilename( fn );
687 exporter.Run();
688
689 return 0;
690}
691
@ BS_ITEM_TYPE_COPPER
Definition: board_stackup.h:45
@ BS_ITEM_TYPE_DIELECTRIC
Definition: board_stackup.h:46
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
const LSET & GetEnabledLayers() const
Return a bit-mask of all the layers that are enabled.
BOARD_STACKUP & GetStackupDescriptor()
int ExportHyperlynx(const TOOL_EVENT &aEvent)
void SetOutputFilename(const wxFileName &aPath)
void SetBoard(BOARD *aBoard)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
Manage one layer needed to make a physical board.
Definition: board_stackup.h:96
Manage layers needed to make a physical board.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:317
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr, bool aAllowUseArcsInPolygons=false, bool aIncludeNPTHAsOutlines=false)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
Definition: board.cpp:2604
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:934
const ZONES & Zones() const
Definition: board.h:362
int GetCopperLayerCount() const
Definition: board.cpp:859
const FOOTPRINTS & Footprints() const
Definition: board.h:358
const TRACKS & Tracks() const
Definition: board.h:356
const wxString & GetFileName() const
Definition: board.h:354
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:680
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:1024
double AsDegrees() const
Definition: eda_angle.h:116
Used for text file output.
Definition: richio.h:491
virtual bool Run() override
void writeSinglePadStack(HYPERLYNX_PAD_STACK &aStack)
const std::string formatPadShape(const HYPERLYNX_PAD_STACK &aStack)
std::vector< HYPERLYNX_PAD_STACK * > m_padStacks
std::map< BOARD_ITEM *, HYPERLYNX_PAD_STACK * > m_padMap
bool writeNetObjects(const std::vector< BOARD_ITEM * > &aObjects)
HYPERLYNX_PAD_STACK * addPadStack(HYPERLYNX_PAD_STACK stack)
std::shared_ptr< FILE_OUTPUTFORMATTER > m_out
const std::vector< BOARD_ITEM * > collectNetObjects(int netcode)
HYPERLYNX_PAD_STACK(BOARD *aBoard, const PAD *aPad)
bool operator==(const HYPERLYNX_PAD_STACK &other) const
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:77
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:41
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: lseq.h:47
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:37
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
Definition: lset.cpp:246
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:296
static LSET AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
Definition: lset.cpp:591
Handle the data for a net.
Definition: netinfo.h:56
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Definition: padstack.h:145
Definition: pad.h:54
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:437
const VECTOR2I & GetDrillSize() const
Definition: pad.h:305
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) const
Definition: pad.h:195
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
Definition: pad.h:408
const VECTOR2I & GetSize(PCB_LAYER_ID aLayer) const
Definition: pad.h:264
BOARD * GetBoard() const
BOARD * board() const
int GetWidth() const override
Definition: pcb_track.cpp:379
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
Definition: pcb_track.cpp:628
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pcb_track.cpp:1259
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
Definition: reporter.h:102
Definition: seg.h:42
VECTOR2I A
Definition: seg.h:49
VECTOR2I B
Definition: seg.h:50
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
int SegmentCount() const
Return the number of segments in this line chain.
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.
Represent a set of closed polygons.
int HoleCount(int aOutline) const
Returns the number of holes in a given outline.
void Simplify()
Simplify the polyset (merges overlapping polys, eliminates degeneracy/self-intersections)
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
int OutlineCount() const
Return the number of outlines in the set.
SHAPE_POLY_SET CloneDropTriangulation() const
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Generic, UI-independent tool event.
Definition: tool_event.h:168
Handle a list of polygons defining a copper zone.
Definition: zone.h:74
#define _(s)
static double iu2hyp(double iu)
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
This file contains miscellaneous commonly used macros and functions.
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
Definition: padstack.h:81
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
Definition: padstack.h:52
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_INFO
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: string_utils.h:429
VECTOR2I end