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