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