KiCad PCB EDA Suite
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 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 <wx/log.h>
41
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 {
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 {
156 case PAD_SHAPE::OVAL:
157 shapeId = 0;
158 break;
159
161 shapeId = 2;
162 break;
163
164 case PAD_SHAPE::RECT:
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 m_board = aBoard;
217 m_sx = aPad->GetSize().x;
218 m_sy = aPad->GetSize().y;
219 m_angle = 180.0 - aPad->GetOrientation().AsDegrees();
220
221 if( m_angle < 0.0 )
222 m_angle += 360.0;
223
224 m_layers = aPad->GetLayerSet();
225 m_drill = aPad->GetDrillSize().x;
226 m_shape = aPad->GetShape();
228 m_id = 0;
229}
230
231
233{
234 m_board = aBoard;
235 m_sx = aVia->GetWidth();
236 m_sy = aVia->GetWidth();
237 m_angle = 0;
238 m_layers = aVia->GetLayerSet();
239 m_drill = aVia->GetDrillValue();
242 m_id = 0;
243}
244
245
247{
248 m_out->Print( 0, "{VERSION=2.14}\n" );
249 m_out->Print( 0, "{UNITS=ENGLISH LENGTH}\n\n" );
250 return true;
251}
252
253
255{
256 LSET layerMask = LSET::AllCuMask() & m_board->GetEnabledLayers();
257 LSET outLayers = aStack.m_layers & layerMask;
258
259 if( outLayers.none() )
260 return;
261
262 m_out->Print( 0, "{PADSTACK=%d, %.9f\n", aStack.m_id, iu2hyp( aStack.m_drill ) );
263
264 if( outLayers == layerMask )
265 {
266 m_out->Print( 1, "(\"MDEF\", %s)\n", formatPadShape( aStack ).c_str() );
267 }
268 else
269 {
270 for( PCB_LAYER_ID l : outLayers.Seq() )
271 {
272 m_out->Print( 1, "(\"%s\", %s)\n",
273 (const char*) m_board->GetLayerName( l ).c_str(),
274 formatPadShape( aStack ).c_str() );
275 }
276 }
277
278 m_out->Print( 0, "}\n\n" );
279}
280
281
283{
284 SHAPE_POLY_SET outlines;
285
286 m_out->Print( 0, "{BOARD \"%s\"\n", (const char*) m_board->GetFileName().c_str() );
287
288 if( !m_board->GetBoardPolygonOutlines( outlines ) )
289 {
290 wxLogError( _( "Board outline is malformed. Run DRC for a full analysis." ) );
291 return false;
292 }
293
294 for( int o = 0; o < outlines.OutlineCount(); o++ )
295 {
296 const SHAPE_LINE_CHAIN& outl = outlines.COutline( o );
297
298 for( int i = 0; i < outl.SegmentCount(); i++ )
299 {
300 const SEG& s = outl.CSegment( i );
301 m_out->Print( 1, "(PERIMETER_SEGMENT X1=%.9f Y1=%.9f X2=%.9f Y2=%.9f)\n",
302 iu2hyp( s.A.x ),
303 iu2hyp( s.A.y ),
304 iu2hyp( s.B.x ),
305 iu2hyp( s.B.y ) );
306 }
307 }
308
309 m_out->Print( 0, "}\n\n" );
310
311 return true;
312}
313
314
316{
317 /* Format:
318 * {STACKUP
319 * (SIGNAL T=thickness [P=plating_thickness] [C=constant] L=layer_name [M=material_name]) [comment]
320 * (DIELECTRIC T=thickness [C=constant] [L=layer_name] [M=material_name]) [comment]
321 * }
322 * name length is <= 20 chars
323 */
324
326
327 // Get the board physical stackup structure
329
330 m_out->Print( 0, "{STACKUP\n" );
331
332 wxString layer_name; // The last copper layer name used in stackup
333
334 for( BOARD_STACKUP_ITEM* item: stackup.GetList() )
335 {
336 if( item->GetType() == BS_ITEM_TYPE_COPPER )
337 {
338 layer_name = m_board->GetLayerName( item->GetBrdLayerId() );
339 int plating_thickness = 0;
340 double resistivity = 1.724e-8; // Good for copper
341 m_out->Print( 1, "(SIGNAL T=%g P=%g C=%g L=\"%.20s\" M=COPPER)\n",
342 iu2hyp( item->GetThickness( 0 ) ),
343 iu2hyp( plating_thickness ),
344 resistivity,
345 TO_UTF8( layer_name ) );
346 }
347 else if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
348 {
349 if( item->GetSublayersCount() < 2 )
350 {
351 m_out->Print( 1, "(DIELECTRIC T=%g C=%g L=\"DE_%.17s\" M=\"%.20s\")\n",
352 iu2hyp( item->GetThickness( 0 ) ),
353 item->GetEpsilonR( 0 ),
354 TO_UTF8( layer_name ),
355 TO_UTF8( item->GetMaterial( 0 ) ) );
356 }
357 else for( int idx = 0; idx < item->GetSublayersCount(); idx++ )
358 {
359 m_out->Print( 1, "(DIELECTRIC T=%g C=%g L=\"DE%d_%.16s\" M=\"%.20s\")\n",
360 iu2hyp( item->GetThickness( idx ) ),
361 item->GetEpsilonR( idx ),
362 idx,
363 TO_UTF8( layer_name ),
364 TO_UTF8( item->GetMaterial( idx ) ) );
365 }
366 }
367 }
368
369 m_out->Print( 0, "}\n\n" );
370
371 return true;
372}
373
374
376{
377 m_out->Print( 0, "{DEVICES\n" );
378
379 for( FOOTPRINT* footprint : m_board->Footprints() )
380 {
381 wxString ref = footprint->GetReference();
382 wxString layerName = m_board->GetLayerName( footprint->GetLayer() );
383
384 if( ref.IsEmpty() )
385 ref = wxT( "EMPTY" );
386
387 m_out->Print( 1, "(? REF=\"%s\" L=\"%s\")\n",
388 (const char*) ref.c_str(),
389 (const char*) layerName.c_str() );
390 }
391 m_out->Print( 0, "}\n\n" );
392
393 return true;
394}
395
396
398{
399 for( FOOTPRINT* footprint : m_board->Footprints() )
400 {
401 for( PAD* pad : footprint->Pads() )
402 {
404 m_padMap[pad] = ps;
405 }
406 }
407
408 for( PCB_TRACK* track : m_board->Tracks() )
409 {
410 if( PCB_VIA* via = dyn_cast<PCB_VIA*>( track ) )
411 {
413 m_padMap[via] = ps;
414 }
415 }
416
417 for( HYPERLYNX_PAD_STACK* pstack : m_padStacks )
418 writeSinglePadStack( *pstack );
419
420 return true;
421}
422
423
424bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjects )
425{
426 for( BOARD_ITEM* item : aObjects )
427 {
428 if( PAD* pad = dyn_cast<PAD*>( item ) )
429 {
430 auto pstackIter = m_padMap.find( pad );
431
432 if( pstackIter != m_padMap.end() )
433 {
434 wxString ref = pad->GetParent()->GetReference();
435
436 if( ref.IsEmpty() )
437 ref = wxT( "EMPTY" );
438
439 wxString padName = pad->GetNumber();
440
441 if( padName.IsEmpty() )
442 padName = wxT( "1" );
443
444
445 m_out->Print( 1, "(PIN X=%.10f Y=%.10f R=\"%s.%s\" P=%d)\n",
446 iu2hyp( pad->GetPosition().x ),
447 iu2hyp( pad->GetPosition().y ),
448 (const char*) ref.c_str(),
449 (const char*) padName.c_str(),
450 pstackIter->second->GetId() );
451 }
452 }
453 else if( PCB_VIA* via = dyn_cast<PCB_VIA*>( item ) )
454 {
455 auto pstackIter = m_padMap.find( via );
456
457 if( pstackIter != m_padMap.end() )
458 {
459 m_out->Print( 1, "(VIA X=%.10f Y=%.10f P=%d)\n",
460 iu2hyp( via->GetPosition().x ),
461 iu2hyp( via->GetPosition().y ),
462 pstackIter->second->GetId() );
463 }
464 }
465 else if( PCB_TRACK* track = dyn_cast<PCB_TRACK*>( item ) )
466 {
467 const wxString layerName = m_board->GetLayerName( track->GetLayer() );
468
469 m_out->Print( 1, "(SEG X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f W=%.10f L=\"%s\")\n",
470 iu2hyp( track->GetStart().x ),
471 iu2hyp( track->GetStart().y ),
472 iu2hyp( track->GetEnd().x ),
473 iu2hyp( track->GetEnd().y ),
474 iu2hyp( track->GetWidth() ),
475 (const char*) layerName.c_str() );
476 }
477 else if( PCB_ARC* arc = dyn_cast<PCB_ARC*>( item ) )
478 {
479 const wxString layerName = m_board->GetLayerName( arc->GetLayer() );
480 VECTOR2I start = arc->GetStart();
481 VECTOR2I end = arc->GetEnd();
482
483 if( arc->IsCCW() )
484 std::swap( start, end );
485
486 m_out->Print( 1, "(ARC X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f XC=%.10f YC=%.10f R=%.10f W=%.10f L=\"%s\")\n",
487 iu2hyp( start.x ),
488 iu2hyp( start.y ),
489 iu2hyp( end.x ),
490 iu2hyp( end.y ),
491 iu2hyp( arc->GetCenter().x ),
492 iu2hyp( arc->GetCenter().y ),
493 iu2hyp( arc->GetRadius() ),
494 iu2hyp( arc->GetWidth() ),
495 (const char*) layerName.c_str() );
496 }
497 else if( ZONE* zone = dyn_cast<ZONE*>( item ) )
498 {
499 for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
500 {
501 const wxString layerName = m_board->GetLayerName( layer );
502 SHAPE_POLY_SET fill = zone->GetFilledPolysList( layer )->CloneDropTriangulation();
503
505
506 for( int i = 0; i < fill.OutlineCount(); i++ )
507 {
508 const SHAPE_LINE_CHAIN& outl = fill.COutline( i );
509 const VECTOR2I p0 = outl.CPoint( 0 );
510
511 m_out->Print( 1, "{POLYGON T=POUR L=\"%s\" ID=%d X=%.10f Y=%.10f\n",
512 (const char*) layerName.c_str(),
513 m_polyId,
514 iu2hyp( p0.x ),
515 iu2hyp( p0.y ) );
516
517 for( int v = 0; v < outl.PointCount(); v++ )
518 {
519 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
520 iu2hyp( outl.CPoint( v ).x ),
521 iu2hyp( outl.CPoint( v ).y ) );
522 }
523
524 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n", iu2hyp( p0.x ), iu2hyp( p0.y ) );
525 m_out->Print( 1, "}\n" );
526
527 for( int h = 0; h < fill.HoleCount( i ); h++ )
528 {
529 const SHAPE_LINE_CHAIN& holeShape = fill.CHole( i, h );
530 const VECTOR2I ph0 = holeShape.CPoint( 0 );
531
532 m_out->Print( 1, "{POLYVOID ID=%d X=%.10f Y=%.10f\n",
533 m_polyId,
534 iu2hyp( ph0.x ),
535 iu2hyp( ph0.y ) );
536
537 for( int v = 0; v < holeShape.PointCount(); v++ )
538 {
539 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
540 iu2hyp( holeShape.CPoint( v ).x ),
541 iu2hyp( holeShape.CPoint( v ).y ) );
542 }
543
544 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
545 iu2hyp( ph0.x ),
546 iu2hyp( ph0.y ) );
547 m_out->Print( 1, "}\n" );
548 }
549
550 m_polyId++;
551 }
552 }
553 }
554 }
555
556 return true;
557}
558
559
560const std::vector<BOARD_ITEM*> HYPERLYNX_EXPORTER::collectNetObjects( int netcode )
561{
562 std::vector<BOARD_ITEM*> rv;
563
564 auto check =
565 [&]( BOARD_CONNECTED_ITEM* item ) -> bool
566 {
567 if( ( item->GetLayerSet() & LSET::AllCuMask() ).none() )
568 return false;
569
570 if( item->GetNetCode() == netcode || ( netcode < 0 && item->GetNetCode() <= 0 ) )
571 return true;
572
573 return false;
574 };
575
576 for( FOOTPRINT* footprint : m_board->Footprints() )
577 {
578 for( PAD* pad : footprint->Pads() )
579 {
580 if( check( pad ) )
581 rv.push_back( pad );
582 }
583 }
584
585 for( PCB_TRACK* item : m_board->Tracks() )
586 {
587 if( check( item ) )
588 rv.push_back( item );
589 }
590
591 for( ZONE* zone : m_board->Zones() )
592 {
593 if( check( zone ) )
594 rv.push_back( zone );
595 }
596
597 return rv;
598}
599
600
602{
603 m_polyId = 1;
604
605 for( const NETINFO_ITEM* netInfo : m_board->GetNetInfo() )
606 {
607 int netcode = netInfo->GetNetCode();
608 bool isNullNet = netInfo->GetNetCode() <= 0 || netInfo->GetNetname().IsEmpty();
609
610 if( isNullNet )
611 continue;
612
613 const std::vector<BOARD_ITEM*> netObjects = collectNetObjects( netcode );
614
615 if( netObjects.size() )
616 {
617 m_out->Print( 0, "{NET=\"%s\"\n", (const char*) netInfo->GetNetname().c_str() );
618 writeNetObjects( netObjects );
619 m_out->Print( 0, "}\n\n" );
620 }
621 }
622
623 const std::vector<BOARD_ITEM*> nullNetObjects = collectNetObjects( -1 );
624
625 int idx = 0;
626
627 for( BOARD_ITEM* item : nullNetObjects )
628 {
629 m_out->Print( 0, "{NET=\"EmptyNet%d\"\n", idx );
630 writeNetObjects( { item } );
631 m_out->Print( 0, "}\n\n" );
632 idx++;
633 }
634
635 return true;
636}
637
638
640{
641 LOCALE_IO toggle; // toggles on, then off, the C locale.
642
643 try
644 {
645 m_out.reset( new FILE_OUTPUTFORMATTER( m_outputFilePath.GetFullPath() ) );
646
650 writeDevices();
652 writeNets();
653 }
654 catch( IO_ERROR& )
655 {
656 return false;
657 }
658
659 return true;
660}
661
662
663bool ExportBoardToHyperlynx( BOARD* aBoard, const wxFileName& aPath )
664{
665 HYPERLYNX_EXPORTER exporter;
666 exporter.SetBoard( aBoard );
667 exporter.SetOutputFilename( aPath );
668 return exporter.Run();
669}
@ BS_ITEM_TYPE_COPPER
Definition: board_stackup.h:43
@ BS_ITEM_TYPE_DIELECTRIC
Definition: board_stackup.h:44
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:58
Manage one layer needed to make a physical board.
Definition: board_stackup.h:91
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:265
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:765
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:526
ZONES & Zones()
Definition: board.h:313
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
Definition: board.cpp:1911
FOOTPRINTS & Footprints()
Definition: board.h:307
TRACKS & Tracks()
Definition: board.h:304
const wxString & GetFileName() const
Definition: board.h:302
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:413
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:643
double AsDegrees() const
Definition: eda_angle.h:149
Used for text file output.
Definition: richio.h:457
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:76
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: layer_ids.h:491
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
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:411
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
Definition: lset.cpp:170
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:773
Handle the data for a net.
Definition: netinfo.h:66
Definition: pad.h:59
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:392
const VECTOR2I & GetDrillSize() const
Definition: pad.h:262
PAD_SHAPE GetShape() const
Definition: pad.h:189
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
Definition: pad.h:365
const VECTOR2I & GetSize() const
Definition: pad.h:252
int GetWidth() const
Definition: pcb_track.h:106
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Definition: pcb_track.cpp:192
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pcb_track.cpp:478
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
Return the reference to aIndex-th outline in the set.
void Simplify(POLYGON_MODE aFastMode)
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
int OutlineCount() const
Return the number of vertices in a given outline/hole.
SHAPE_POLY_SET CloneDropTriangulation() const
Creates a new empty polygon in the set and returns its index.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
#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:59
This file contains miscellaneous commonly used macros and functions.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:96
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
Definition: pad_shapes.h:81
@ NPTH
like PAD_PTH, but not plated
@ PTH
Plated through hole pad.
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
Definition: pad_shapes.h:35
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_INFO