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 (C) 2022-2023 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>
42#include <wx/log.h>
43
44static double iu2hyp( double iu )
45{
46 return iu / 1e9 / 0.0254;
47}
48
49
51
53{
54public:
55 friend class HYPERLYNX_EXPORTER;
56
57 HYPERLYNX_PAD_STACK( BOARD* aBoard, const PAD* aPad );
58 HYPERLYNX_PAD_STACK( BOARD* aBoard, const PCB_VIA* aVia );
60
61 bool IsThrough() const
62 {
63 return m_type == PAD_ATTRIB::NPTH || m_type == PAD_ATTRIB::PTH;
64 }
65
66 bool operator==( const HYPERLYNX_PAD_STACK& other ) const
67 {
68 if( m_shape != other.m_shape )
69 return false;
70
71 if( m_type != other.m_type )
72 return false;
73
74 if( IsThrough() && other.IsThrough() && m_drill != other.m_drill )
75 return false;
76
77 if( m_sx != other.m_sx )
78 return false;
79
80 if( m_sy != other.m_sy )
81 return false;
82
83 if( m_layers != other.m_layers )
84 return false;
85
86 if( m_angle != other.m_angle )
87 return false;
88
89 return true;
90 }
91
92 void SetId( int id )
93 {
94 m_id = id;
95 }
96
97 int GetId() const
98 {
99 return m_id;
100 }
101
102 bool IsEmpty() const
103 {
104 LSET layerMask = LSET::AllCuMask() & m_board->GetEnabledLayers();
105 LSET outLayers = m_layers & layerMask;
106
107 return outLayers.none();
108 }
109
110private:
112 int m_id;
115 int m_sx, m_sy;
116 double m_angle;
119};
120
121
123{
124public:
126 {
127 }
128
130
131 virtual bool Run() override;
132
133private:
135 {
137 {
138 if( *p == stack )
139 return p;
140 }
141
142 stack.SetId( m_padStacks.size() );
143 m_padStacks.push_back( new HYPERLYNX_PAD_STACK( stack ) );
144
145 return m_padStacks.back();
146 }
147
148 const std::string formatPadShape( const HYPERLYNX_PAD_STACK& aStack )
149 {
150 int shapeId = 0;
151 char buf[1024];
152
153 switch( aStack.m_shape )
154 {
155 case PAD_SHAPE::CIRCLE:
156 case PAD_SHAPE::OVAL:
157 shapeId = 0;
158 break;
159
160 case PAD_SHAPE::ROUNDRECT:
161 shapeId = 2;
162 break;
163
164 case PAD_SHAPE::RECTANGLE:
165 shapeId = 1;
166 break;
167
168 default:
169 if( m_reporter )
170 {
171 m_reporter->Report( _( "File contains pad shapes that are not supported by the "
172 "Hyperlynx exporter (supported shapes are oval, rectangle, "
173 "rounded rectangle, and circle)." ),
175 m_reporter->Report( _( "They have been exported as oval pads." ),
177 }
178
179 shapeId = 0;
180 break;
181 }
182
183 snprintf( buf, sizeof( buf ), "%d, %.9f, %.9f, %.1f, M",
184 shapeId,
185 iu2hyp( aStack.m_sx ),
186 iu2hyp( aStack.m_sy ),
187 aStack.m_angle );
188
189 return buf;
190 }
191
192 bool generateHeaders();
193 bool writeBoardInfo();
194 bool writeStackupInfo();
195 bool writeDevices();
196 bool writePadStacks();
197 bool writeNets();
198 bool writeNetObjects( const std::vector<BOARD_ITEM*>& aObjects );
199
200
202
203 const std::vector<BOARD_ITEM*> collectNetObjects( int netcode );
204
205private:
206 std::vector<HYPERLYNX_PAD_STACK*> m_padStacks;
207 std::map<BOARD_ITEM*, HYPERLYNX_PAD_STACK*> m_padMap;
208
209 std::shared_ptr<FILE_OUTPUTFORMATTER> m_out;
211};
212
213
215{
216 // TODO(JE) padstacks
217 m_board = aBoard;
220 m_angle = 180.0 - aPad->GetOrientation().AsDegrees();
221
222 if( m_angle < 0.0 )
223 m_angle += 360.0;
224
225 m_layers = aPad->GetLayerSet();
226 m_drill = aPad->GetDrillSize().x;
228 m_type = PAD_ATTRIB::PTH;
229 m_id = 0;
230}
231
232
234{
235 m_board = aBoard;
236 // TODO(JE) padstacks
238 m_angle = 0;
239 m_layers = aVia->GetLayerSet();
240 m_drill = aVia->GetDrillValue();
241 m_shape = PAD_SHAPE::CIRCLE;
242 m_type = PAD_ATTRIB::PTH;
243 m_id = 0;
244}
245
246
248{
249 m_out->Print( 0, "{VERSION=2.14}\n" );
250 m_out->Print( 0, "{UNITS=ENGLISH LENGTH}\n\n" );
251 return true;
252}
253
254
256{
257 LSET layerMask = LSET::AllCuMask() & m_board->GetEnabledLayers();
258 LSET outLayers = aStack.m_layers & layerMask;
259
260 if( outLayers.none() )
261 return;
262
263 m_out->Print( 0, "{PADSTACK=%d, %.9f\n", aStack.m_id, iu2hyp( aStack.m_drill ) );
264
265 if( outLayers == layerMask )
266 {
267 m_out->Print( 1, "(\"MDEF\", %s)\n", formatPadShape( aStack ).c_str() );
268 }
269 else
270 {
271 for( PCB_LAYER_ID l : outLayers.Seq() )
272 {
273 m_out->Print( 1, "(\"%s\", %s)\n",
274 (const char*) m_board->GetLayerName( l ).c_str(),
275 formatPadShape( aStack ).c_str() );
276 }
277 }
278
279 m_out->Print( 0, "}\n\n" );
280}
281
282
284{
285 SHAPE_POLY_SET outlines;
286
287 m_out->Print( 0, "{BOARD \"%s\"\n", (const char*) m_board->GetFileName().c_str() );
288
289 if( !m_board->GetBoardPolygonOutlines( outlines ) )
290 {
291 wxLogError( _( "Board outline is malformed. Run DRC for a full analysis." ) );
292 return false;
293 }
294
295 for( int o = 0; o < outlines.OutlineCount(); o++ )
296 {
297 const SHAPE_LINE_CHAIN& outl = outlines.COutline( o );
298
299 for( int i = 0; i < outl.SegmentCount(); i++ )
300 {
301 const SEG& s = outl.CSegment( i );
302 m_out->Print( 1, "(PERIMETER_SEGMENT X1=%.9f Y1=%.9f X2=%.9f Y2=%.9f)\n",
303 iu2hyp( s.A.x ),
304 iu2hyp( s.A.y ),
305 iu2hyp( s.B.x ),
306 iu2hyp( s.B.y ) );
307 }
308 }
309
310 m_out->Print( 0, "}\n\n" );
311
312 return true;
313}
314
315
317{
318 /* Format:
319 * {STACKUP
320 * (SIGNAL T=thickness [P=plating_thickness] [C=constant] L=layer_name [M=material_name]) [comment]
321 * (DIELECTRIC T=thickness [C=constant] [L=layer_name] [M=material_name]) [comment]
322 * }
323 * name length is <= 20 chars
324 */
325
327
328 // Get the board physical stackup structure
330
331 m_out->Print( 0, "{STACKUP\n" );
332
333 wxString layer_name; // The last copper layer name used in stackup
334
335 for( BOARD_STACKUP_ITEM* item: stackup.GetList() )
336 {
337 if( item->GetType() == BS_ITEM_TYPE_COPPER )
338 {
339 layer_name = m_board->GetLayerName( item->GetBrdLayerId() );
340 int plating_thickness = 0;
341 double resistivity = 1.724e-8; // Good for copper
342 m_out->Print( 1, "(SIGNAL T=%g P=%g C=%g L=\"%.20s\" M=COPPER)\n",
343 iu2hyp( item->GetThickness( 0 ) ),
344 iu2hyp( plating_thickness ),
345 resistivity,
346 TO_UTF8( layer_name ) );
347 }
348 else if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
349 {
350 if( item->GetSublayersCount() < 2 )
351 {
352 m_out->Print( 1, "(DIELECTRIC T=%g C=%g L=\"DE_%.17s\" M=\"%.20s\")\n",
353 iu2hyp( item->GetThickness( 0 ) ),
354 item->GetEpsilonR( 0 ),
355 TO_UTF8( layer_name ),
356 TO_UTF8( item->GetMaterial( 0 ) ) );
357 }
358 else for( int idx = 0; idx < item->GetSublayersCount(); idx++ )
359 {
360 m_out->Print( 1, "(DIELECTRIC T=%g C=%g L=\"DE%d_%.16s\" M=\"%.20s\")\n",
361 iu2hyp( item->GetThickness( idx ) ),
362 item->GetEpsilonR( idx ),
363 idx,
364 TO_UTF8( layer_name ),
365 TO_UTF8( item->GetMaterial( idx ) ) );
366 }
367 }
368 }
369
370 m_out->Print( 0, "}\n\n" );
371
372 return true;
373}
374
375
377{
378 m_out->Print( 0, "{DEVICES\n" );
379
380 for( FOOTPRINT* footprint : m_board->Footprints() )
381 {
382 wxString ref = footprint->GetReference();
383 wxString layerName = m_board->GetLayerName( footprint->GetLayer() );
384
385 if( ref.IsEmpty() )
386 ref = wxT( "EMPTY" );
387
388 m_out->Print( 1, "(? REF=\"%s\" L=\"%s\")\n",
389 (const char*) ref.c_str(),
390 (const char*) layerName.c_str() );
391 }
392 m_out->Print( 0, "}\n\n" );
393
394 return true;
395}
396
397
399{
400 for( FOOTPRINT* footprint : m_board->Footprints() )
401 {
402 for( PAD* pad : footprint->Pads() )
403 {
405 m_padMap[pad] = ps;
406 }
407 }
408
409 for( PCB_TRACK* track : m_board->Tracks() )
410 {
411 if( PCB_VIA* via = dyn_cast<PCB_VIA*>( track ) )
412 {
414 m_padMap[via] = ps;
415 }
416 }
417
418 for( HYPERLYNX_PAD_STACK* pstack : m_padStacks )
419 writeSinglePadStack( *pstack );
420
421 return true;
422}
423
424
425bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjects )
426{
427 for( BOARD_ITEM* item : aObjects )
428 {
429 if( PAD* pad = dyn_cast<PAD*>( item ) )
430 {
431 auto pstackIter = m_padMap.find( pad );
432
433 if( pstackIter != m_padMap.end() )
434 {
435 wxString ref = pad->GetParentFootprint()->GetReference();
436
437 if( ref.IsEmpty() )
438 ref = wxT( "EMPTY" );
439
440 wxString padName = pad->GetNumber();
441
442 if( padName.IsEmpty() )
443 padName = wxT( "1" );
444
445
446 m_out->Print( 1, "(PIN X=%.10f Y=%.10f R=\"%s.%s\" P=%d)\n",
447 iu2hyp( pad->GetPosition().x ),
448 iu2hyp( pad->GetPosition().y ),
449 (const char*) ref.c_str(),
450 (const char*) padName.c_str(),
451 pstackIter->second->GetId() );
452 }
453 }
454 else if( PCB_VIA* via = dyn_cast<PCB_VIA*>( item ) )
455 {
456 auto pstackIter = m_padMap.find( via );
457
458 if( pstackIter != m_padMap.end() )
459 {
460 m_out->Print( 1, "(VIA X=%.10f Y=%.10f P=%d)\n",
461 iu2hyp( via->GetPosition().x ),
462 iu2hyp( via->GetPosition().y ),
463 pstackIter->second->GetId() );
464 }
465 }
466 else if( PCB_TRACK* track = dyn_cast<PCB_TRACK*>( item ) )
467 {
468 const wxString layerName = m_board->GetLayerName( track->GetLayer() );
469
470 m_out->Print( 1, "(SEG X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f W=%.10f L=\"%s\")\n",
471 iu2hyp( track->GetStart().x ),
472 iu2hyp( track->GetStart().y ),
473 iu2hyp( track->GetEnd().x ),
474 iu2hyp( track->GetEnd().y ),
475 iu2hyp( track->GetWidth() ),
476 (const char*) layerName.c_str() );
477 }
478 else if( PCB_ARC* arc = dyn_cast<PCB_ARC*>( item ) )
479 {
480 const wxString layerName = m_board->GetLayerName( arc->GetLayer() );
481 VECTOR2I start = arc->GetStart();
482 VECTOR2I end = arc->GetEnd();
483
484 if( arc->IsCCW() )
485 std::swap( start, end );
486
487 m_out->Print( 1, "(ARC X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f XC=%.10f YC=%.10f R=%.10f W=%.10f L=\"%s\")\n",
488 iu2hyp( start.x ),
489 iu2hyp( start.y ),
490 iu2hyp( end.x ),
491 iu2hyp( end.y ),
492 iu2hyp( arc->GetCenter().x ),
493 iu2hyp( arc->GetCenter().y ),
494 iu2hyp( arc->GetRadius() ),
495 iu2hyp( arc->GetWidth() ),
496 (const char*) layerName.c_str() );
497 }
498 else if( ZONE* zone = dyn_cast<ZONE*>( item ) )
499 {
500 for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
501 {
502 const wxString layerName = m_board->GetLayerName( layer );
503 SHAPE_POLY_SET fill = zone->GetFilledPolysList( layer )->CloneDropTriangulation();
504
506
507 for( int i = 0; i < fill.OutlineCount(); i++ )
508 {
509 const SHAPE_LINE_CHAIN& outl = fill.COutline( i );
510 const VECTOR2I p0 = outl.CPoint( 0 );
511
512 m_out->Print( 1, "{POLYGON T=POUR L=\"%s\" ID=%d X=%.10f Y=%.10f\n",
513 (const char*) layerName.c_str(),
514 m_polyId,
515 iu2hyp( p0.x ),
516 iu2hyp( p0.y ) );
517
518 for( int v = 0; v < outl.PointCount(); v++ )
519 {
520 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
521 iu2hyp( outl.CPoint( v ).x ),
522 iu2hyp( outl.CPoint( v ).y ) );
523 }
524
525 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n", iu2hyp( p0.x ), iu2hyp( p0.y ) );
526 m_out->Print( 1, "}\n" );
527
528 for( int h = 0; h < fill.HoleCount( i ); h++ )
529 {
530 const SHAPE_LINE_CHAIN& holeShape = fill.CHole( i, h );
531 const VECTOR2I ph0 = holeShape.CPoint( 0 );
532
533 m_out->Print( 1, "{POLYVOID ID=%d X=%.10f Y=%.10f\n",
534 m_polyId,
535 iu2hyp( ph0.x ),
536 iu2hyp( ph0.y ) );
537
538 for( int v = 0; v < holeShape.PointCount(); v++ )
539 {
540 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
541 iu2hyp( holeShape.CPoint( v ).x ),
542 iu2hyp( holeShape.CPoint( v ).y ) );
543 }
544
545 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
546 iu2hyp( ph0.x ),
547 iu2hyp( ph0.y ) );
548 m_out->Print( 1, "}\n" );
549 }
550
551 m_polyId++;
552 }
553 }
554 }
555 }
556
557 return true;
558}
559
560
561const std::vector<BOARD_ITEM*> HYPERLYNX_EXPORTER::collectNetObjects( int netcode )
562{
563 std::vector<BOARD_ITEM*> rv;
564
565 auto check =
566 [&]( BOARD_CONNECTED_ITEM* item ) -> bool
567 {
568 if( ( item->GetLayerSet() & LSET::AllCuMask() ).none() )
569 return false;
570
571 if( item->GetNetCode() == netcode || ( netcode < 0 && item->GetNetCode() <= 0 ) )
572 return true;
573
574 return false;
575 };
576
577 for( FOOTPRINT* footprint : m_board->Footprints() )
578 {
579 for( PAD* pad : footprint->Pads() )
580 {
581 if( check( pad ) )
582 rv.push_back( pad );
583 }
584 }
585
586 for( PCB_TRACK* item : m_board->Tracks() )
587 {
588 if( check( item ) )
589 rv.push_back( item );
590 }
591
592 for( ZONE* zone : m_board->Zones() )
593 {
594 if( check( zone ) )
595 rv.push_back( zone );
596 }
597
598 return rv;
599}
600
601
603{
604 m_polyId = 1;
605
606 for( const NETINFO_ITEM* netInfo : m_board->GetNetInfo() )
607 {
608 int netcode = netInfo->GetNetCode();
609 bool isNullNet = netInfo->GetNetCode() <= 0 || netInfo->GetNetname().IsEmpty();
610
611 if( isNullNet )
612 continue;
613
614 const std::vector<BOARD_ITEM*> netObjects = collectNetObjects( netcode );
615
616 if( netObjects.size() )
617 {
618 m_out->Print( 0, "{NET=\"%s\"\n", (const char*) netInfo->GetNetname().c_str() );
619 writeNetObjects( netObjects );
620 m_out->Print( 0, "}\n\n" );
621 }
622 }
623
624 const std::vector<BOARD_ITEM*> nullNetObjects = collectNetObjects( -1 );
625
626 int idx = 0;
627
628 for( BOARD_ITEM* item : nullNetObjects )
629 {
630 m_out->Print( 0, "{NET=\"EmptyNet%d\"\n", idx );
631 writeNetObjects( { item } );
632 m_out->Print( 0, "}\n\n" );
633 idx++;
634 }
635
636 return true;
637}
638
639
641{
642 LOCALE_IO toggle; // toggles on, then off, the C locale.
643
644 try
645 {
646 m_out.reset( new FILE_OUTPUTFORMATTER( m_outputFilePath.GetFullPath() ) );
647
651 writeDevices();
653 writeNets();
654 }
655 catch( IO_ERROR& )
656 {
657 return false;
658 }
659
660 return true;
661}
662
663
664bool ExportBoardToHyperlynx( BOARD* aBoard, const wxFileName& aPath )
665{
666 HYPERLYNX_EXPORTER exporter;
667 exporter.SetBoard( aBoard );
668 exporter.SetOutputFilename( aPath );
669 return exporter.Run();
670}
@ 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,...
LSET GetEnabledLayers() const
Return a bit-mask of all the layers that are enabled.
BOARD_STACKUP & GetStackupDescriptor()
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:290
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:2496
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:871
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:778
const ZONES & Zones() const
Definition: board.h:335
const FOOTPRINTS & Footprints() const
Definition: board.h:331
const TRACKS & Tracks() const
Definition: board.h:329
const wxString & GetFileName() const
Definition: board.h:327
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:574
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:895
double AsDegrees() const
Definition: eda_angle.h:113
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:49
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:36
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
Definition: lset.cpp:240
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:676
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:410
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:144
Definition: pad.h:54
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:439
const VECTOR2I & GetDrillSize() const
Definition: pad.h:307
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) const
Definition: pad.h:193
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
Definition: pad.h:410
const VECTOR2I & GetSize(PCB_LAYER_ID aLayer) const
Definition: pad.h:266
int GetWidth() const override
Definition: pcb_track.cpp:359
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
Definition: pcb_track.cpp:613
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pcb_track.cpp:1062
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
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(POLYGON_MODE aFastMode)
Simplify the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFastMo...
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
Handle a list of polygons defining a copper zone.
Definition: zone.h:73
#define _(s)
static double iu2hyp(double iu)
bool ExportBoardToHyperlynx(BOARD *aBoard, const wxFileName &aPath)
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:398