KiCad PCB EDA Suite
Loading...
Searching...
No Matches
exporter_step.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) 2022 Mark Roszko <[email protected]>
5 * Copyright (C) 2016 Cirilo Bernardo <[email protected]>
6 * Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include "exporter_step.h"
27#include <board.h>
29#include <footprint.h>
30#include <pcb_track.h>
31#include <pcb_shape.h>
32#include <pad.h>
33#include <zone.h>
34#include <fp_lib_table.h>
35#include "step_pcb_model.h"
36
37#include <pgm_base.h>
38#include <base_units.h>
39#include <filename_resolver.h>
40#include <trace_helpers.h>
41#include <project_pcb.h>
42
43#include <Message.hxx> // OpenCascade messenger
44#include <Message_PrinterOStream.hxx> // OpenCascade output messenger
45#include <Standard_Failure.hxx> // In open cascade
46
47#include <Standard_Version.hxx>
48
49#include <wx/crt.h>
50#include <wx/log.h>
51#include <core/profile.h> // To use GetRunningMicroSecs or another profiling utility
52
53#define OCC_VERSION_MIN 0x070500
54
55#if OCC_VERSION_HEX < OCC_VERSION_MIN
56#include <Message_Messenger.hxx>
57#endif
58
59
60void ReportMessage( const wxString& aMessage )
61{
62 wxPrintf( aMessage );
63 fflush( stdout ); // Force immediate printing (needed on mingw)
64}
65
66class KiCadPrinter : public Message_Printer
67{
68public:
69 KiCadPrinter( EXPORTER_STEP* aConverter ) : m_converter( aConverter ) {}
70
71protected:
72#if OCC_VERSION_HEX < OCC_VERSION_MIN
73 virtual void Send( const TCollection_ExtendedString& theString,
74 const Message_Gravity theGravity,
75 const Standard_Boolean theToPutEol ) const override
76 {
77 Send( TCollection_AsciiString( theString ), theGravity, theToPutEol );
78 }
79
80 virtual void Send( const TCollection_AsciiString& theString,
81 const Message_Gravity theGravity,
82 const Standard_Boolean theToPutEol ) const override
83#else
84 virtual void send( const TCollection_AsciiString& theString,
85 const Message_Gravity theGravity ) const override
86#endif
87 {
88 if( theGravity >= Message_Warning
89 || ( wxLog::IsAllowedTraceMask( traceKiCad2Step ) && theGravity == Message_Info ) )
90 {
91 ReportMessage( theString.ToCString() );
92
93#if OCC_VERSION_HEX < OCC_VERSION_MIN
94 if( theToPutEol )
95 ReportMessage( wxT( "\n" ) );
96#else
97 ReportMessage( wxT( "\n" ) );
98#endif
99 }
100
101 if( theGravity == Message_Warning )
103
104 if( theGravity >= Message_Alarm )
106
107 if( theGravity == Message_Fail )
109 }
110
111private:
113};
114
115
117{
118 switch( m_format )
119 {
120 case EXPORTER_STEP_PARAMS::FORMAT::STEP: return wxS( "step" );
121 case EXPORTER_STEP_PARAMS::FORMAT::BREP: return wxS( "brep" );
122 case EXPORTER_STEP_PARAMS::FORMAT::GLB: return wxS( "glb" );
123 default: return wxEmptyString; // shouldn't happen
124 }
125}
126
128{
129 switch( m_format )
130 {
131 // honestly these names shouldn't be translated since they are mostly industry standard acronyms
132 case EXPORTER_STEP_PARAMS::FORMAT::STEP: return wxS( "STEP" );
133 case EXPORTER_STEP_PARAMS::FORMAT::BREP: return wxS( "BREP" );
134 case EXPORTER_STEP_PARAMS::FORMAT::GLB: return wxS( "Binary GLTF" );
135 default: return wxEmptyString; // shouldn't happen
136 }
137}
138
139
141 m_params( aParams ),
142 m_error( false ),
143 m_fail( false ),
144 m_warn( false ),
145 m_board( aBoard ),
146 m_pcbModel( nullptr ),
147 m_boardThickness( DEFAULT_BOARD_THICKNESS_MM )
148{
149 m_solderMaskColor = COLOR4D( 0.08, 0.20, 0.14, 0.83 );
150 m_copperColor = COLOR4D( 0.7, 0.61, 0.0, 1.0 );
151
152 // Init m_pcbBaseName to the board short filename (no path, no ext)
153 // m_pcbName is used later to identify items in step file
154 wxFileName fn( aBoard->GetFileName() );
155 m_pcbBaseName = fn.GetName();
156
157 m_resolver = std::make_unique<FILENAME_RESOLVER>();
158 m_resolver->Set3DConfigDir( wxT( "" ) );
159 // needed to add the project to the search stack
160 m_resolver->SetProject( aBoard->GetProject() );
161 m_resolver->SetProgramBase( &Pgm() );
162}
163
164
166{
167}
168
169
171{
172 bool hasdata = false;
173
174 // Dump the pad holes into the PCB
175 for( PAD* pad : aFootprint->Pads() )
176 {
177 if( m_pcbModel->AddPadHole( pad, aOrigin ) )
178 hasdata = true;
179
180 if( ExportTracksAndVias() )
181 {
182 if( m_pcbModel->AddPadShape( pad, aOrigin ) )
183 hasdata = true;
184 }
185 }
186
187 // Build 3D shapes of the footprint graphic items on external layers:
188 if( ExportTracksAndVias() )
189 {
190 int maxError = m_board->GetDesignSettings().m_MaxError;
192 false, /* include text */
193 true, /* include shapes */
194 false /* include private items */ );
196 false, /* include text */
197 true, /* include shapes */
198 false /* include private items */ );
199 }
200
201 if( ( !(aFootprint->GetAttributes() & (FP_THROUGH_HOLE|FP_SMD)) ) && !m_params.m_includeUnspecified )
202 {
203 return hasdata;
204 }
205
206 if( ( aFootprint->GetAttributes() & FP_DNP ) && !m_params.m_includeDNP )
207 {
208 return hasdata;
209 }
210
211 // Prefetch the library for this footprint
212 // In case we need to resolve relative footprint paths
213 wxString libraryName = aFootprint->GetFPID().GetLibNickname();
214 wxString footprintBasePath = wxEmptyString;
215
216 double posX = aFootprint->GetPosition().x - aOrigin.x;
217 double posY = (aFootprint->GetPosition().y) - aOrigin.y;
218
219 if( m_board->GetProject() )
220 {
221 try
222 {
223 // FindRow() can throw an exception
224 const FP_LIB_TABLE_ROW* fpRow =
225 PROJECT_PCB::PcbFootprintLibs( m_board->GetProject() )->FindRow( libraryName, false );
226
227 if( fpRow )
228 footprintBasePath = fpRow->GetFullURI( true );
229 }
230 catch( ... )
231 {
232 // Do nothing if the libraryName is not found in lib table
233 }
234 }
235
236 // Exit early if we don't want to include footprint models
238 {
239 return hasdata;
240 }
241
242 VECTOR2D newpos( pcbIUScale.IUTomm( posX ), pcbIUScale.IUTomm( posY ) );
243
244 for( const FP_3DMODEL& fp_model : aFootprint->Models() )
245 {
246 if( !fp_model.m_Show || fp_model.m_Filename.empty() )
247
248 continue;
249
250 std::vector<wxString> searchedPaths;
251 wxString mname = m_resolver->ResolvePath( fp_model.m_Filename, footprintBasePath );
252
253
254 if( mname.empty() || !wxFileName::FileExists( mname ) )
255 {
256 // the error path will return an empty name sometimes, at least report back the original filename
257 if( mname.empty() )
258 mname = fp_model.m_Filename;
259
260 ReportMessage( wxString::Format( wxT( "Could not add 3D model to %s.\n"
261 "File not found: %s\n" ),
262 aFootprint->GetReference(), mname ) );
263 continue;
264 }
265
266 std::string fname( mname.ToUTF8() );
267 std::string refName( aFootprint->GetReference().ToUTF8() );
268 try
269 {
270 bool bottomSide = aFootprint->GetLayer() == B_Cu;
271
272 // the rotation is stored in degrees but opencascade wants radians
273 VECTOR3D modelRot = fp_model.m_Rotation;
274 modelRot *= M_PI;
275 modelRot /= 180.0;
276
277 if( m_pcbModel->AddComponent( fname, refName, bottomSide,
278 newpos,
279 aFootprint->GetOrientation().AsRadians(),
280 fp_model.m_Offset, modelRot,
281 fp_model.m_Scale, m_params.m_substModels ) )
282 {
283 hasdata = true;
284 }
285 }
286 catch( const Standard_Failure& e )
287 {
288 ReportMessage( wxString::Format( wxT( "Could not add 3D model to %s.\n"
289 "OpenCASCADE error: %s\n" ),
290 aFootprint->GetReference(), e.GetMessageString() ) );
291 }
292
293 }
294
295 return hasdata;
296}
297
298
300{
301 if( aTrack->Type() == PCB_VIA_T )
302 {
303 return m_pcbModel->AddViaShape( static_cast<const PCB_VIA*>( aTrack ), aOrigin );
304 }
305
306 PCB_LAYER_ID pcblayer = aTrack->GetLayer();
307
308 if( pcblayer != F_Cu && pcblayer != B_Cu )
309 return false;
310
311 if( aTrack->Type() == PCB_ARC_T )
312 {
313 int maxError = m_board->GetDesignSettings().m_MaxError;
314
315 if( pcblayer == F_Cu )
316 aTrack->TransformShapeToPolygon( m_top_copper_shapes, pcblayer, 0, maxError, ERROR_INSIDE );
317 else
318 aTrack->TransformShapeToPolygon( m_bottom_copper_shapes, pcblayer, 0, maxError, ERROR_INSIDE );
319 }
320 else
321 m_pcbModel->AddTrackSegment( aTrack, aOrigin );
322
323 return true;
324}
325
326
328{
329 for( ZONE* zone : m_board->Zones() )
330 {
331 for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
332 {
333 if( layer == F_Cu || layer == B_Cu )
334 {
335 SHAPE_POLY_SET copper_shape;
336 zone->TransformSolidAreasShapesToPolygon( layer, copper_shape );
338
339 m_pcbModel->AddCopperPolygonShapes( &copper_shape, layer == F_Cu, aOrigin, false );
340 }
341 }
342 }
343}
344
345
347{
348 PCB_SHAPE* graphic = dynamic_cast<PCB_SHAPE*>( aItem );
349
350 if( ! graphic )
351 return false;
352
353 PCB_LAYER_ID pcblayer = graphic->GetLayer();
354
355 if( pcblayer != F_Cu && pcblayer != B_Cu )
356 return false;
357
358 SHAPE_POLY_SET copper_shapes;
359 int maxError = m_board->GetDesignSettings().m_MaxError;
360
361
362 if( pcblayer == F_Cu )
363 graphic->TransformShapeToPolygon( m_top_copper_shapes, pcblayer, 0,
364 maxError, ERROR_INSIDE );
365 else
366 graphic->TransformShapeToPolygon( m_bottom_copper_shapes, pcblayer, 0,
367 maxError, ERROR_INSIDE );
368
369 return true;
370}
371
372
374{
375 if( m_pcbModel )
376 return true;
377
378 SHAPE_POLY_SET pcbOutlines; // stores the board main outlines
379
380 if( !m_board->GetBoardPolygonOutlines( pcbOutlines,
381 /* error handler */ nullptr,
382 /* allows use arcs in outlines */ true ) )
383 {
384 wxLogWarning( _( "Board outline is malformed. Run DRC for a full analysis." ) );
385 }
386
387 VECTOR2D origin;
388
389 // Determine the coordinate system reference:
390 // Precedence of reference point is Drill Origin > Grid Origin > User Offset
393 else if( m_params.m_useGridOrigin )
395 else
396 origin = m_params.m_origin;
397
398 m_pcbModel = std::make_unique<STEP_PCB_MODEL>( m_pcbBaseName );
399
400 // TODO: Handle when top & bottom soldermask colours are different...
403
404 m_pcbModel->SetPCBThickness( m_boardThickness );
405 m_pcbModel->SetFuseShapes( m_params.m_fuseShapes );
406
407 // Note: m_params.m_BoardOutlinesChainingEpsilon is used only to build the board outlines,
408 // not to set OCC chaining epsilon (much smaller)
409 //
410 // Set the min distance between 2 points for OCC to see these 2 points as merged
411 // OCC_MAX_DISTANCE_TO_MERGE_POINTS is acceptable for OCC, otherwise there are issues
412 // to handle the shapes chaining on copper layers, because the Z dist is 0.035 mm and the
413 // min dist must be much smaller (we use 0.001 mm giving good results)
414 m_pcbModel->OCCSetMergeMaxDistance( OCC_MAX_DISTANCE_TO_MERGE_POINTS );
415
417
418 // For copper layers, only pads and tracks are added, because adding everything on copper
419 // generate unreasonable file sizes and take a unreasonable calculation time.
420 for( FOOTPRINT* fp : m_board->Footprints() )
421 buildFootprint3DShapes( fp, origin );
422
423 if( ExportTracksAndVias() )
424 {
425 for( PCB_TRACK* track : m_board->Tracks() )
426 buildTrack3DShape( track, origin );
427
428 for( BOARD_ITEM* item : m_board->Drawings() )
429 buildGraphic3DShape( item, origin );
430 }
431
432 m_pcbModel->AddCopperPolygonShapes( &m_top_copper_shapes, true, origin, true );
433 m_pcbModel->AddCopperPolygonShapes( &m_bottom_copper_shapes, false, origin, true );
434
436 {
437 buildZones3DShape( origin );
438 }
439
440 ReportMessage( wxT( "Create PCB solid model\n" ) );
441
442 wxString msg;
443 msg.Printf( wxT( "Board outline: find %d initial points\n" ), pcbOutlines.FullPointCount() );
444 ReportMessage( msg );
445
446 if( !m_pcbModel->CreatePCB( pcbOutlines, origin ) )
447 {
448 ReportMessage( wxT( "could not create PCB solid model\n" ) );
449 return false;
450 }
451
452 return true;
453}
454
455
457{
459
461
462 if( bds.GetStackupDescriptor().GetCount() )
463 {
464 int thickness = 0;
465
466 for( BOARD_STACKUP_ITEM* item : bds.GetStackupDescriptor().GetList() )
467 {
468 switch( item->GetType() )
469 {
471 // Dielectric can have sub-layers. Layer 0 is the main layer
472 // Not frequent, but possible
473 for( int idx = 0; idx < item->GetSublayersCount(); idx++ )
474 thickness += item->GetThickness( idx );
475
476 break;
477
480 if( item->IsEnabled() )
481 thickness += item->GetThickness();
482
483 break;
484
485 default:
486 break;
487 }
488 }
489
490 if( thickness > 0 )
491 m_boardThickness = pcbIUScale.IUTomm( thickness );
492 }
493}
494
495
497{
498 // Display the export time, for statistics
499 int64_t stats_startExportTime = GetRunningMicroSecs();
500
501 // setup opencascade message log
502 Message::DefaultMessenger()->RemovePrinters( STANDARD_TYPE( Message_PrinterOStream ) );
503 Message::DefaultMessenger()->AddPrinter( new KiCadPrinter( this ) );
504
505 ReportMessage( _( "Determining PCB data\n" ) );
507 wxString msg;
508 msg.Printf( _( "Board Thickness from stackup: %.3f mm\n" ), m_boardThickness );
509 ReportMessage( msg );
510
511 if( m_params.m_outputFile.IsEmpty() )
512 {
513 wxFileName fn = m_board->GetFileName();
514 fn.SetName( fn.GetName() );
515 fn.SetExt( m_params.GetDefaultExportExtension() );
516
517 m_params.m_outputFile = fn.GetFullName();
518 }
519
520 try
521 {
522 ReportMessage( wxString::Format( _( "Build %s data\n" ), m_params.GetFormatName() ) );
523
524 if( !buildBoard3DShapes() )
525 {
526 ReportMessage( _( "\n** Error building STEP board model. Export aborted. **\n" ) );
527 return false;
528 }
529
530 ReportMessage( wxString::Format( _( "Writing %s file\n" ), m_params.GetFormatName() ) );
531
532 bool success = true;
534 success = m_pcbModel->WriteSTEP( m_outputFile, m_params.m_optimizeStep );
536 success = m_pcbModel->WriteBREP( m_outputFile );
538 success = m_pcbModel->WriteGLTF( m_outputFile );
539
540 if( !success )
541 {
542 ReportMessage( wxString::Format( _( "\n** Error writing %s file. **\n" ),
544 return false;
545 }
546 else
547 {
548 ReportMessage( wxString::Format( _( "%s file '%s' created.\n" ),
550 }
551 }
552 catch( const Standard_Failure& e )
553 {
554 ReportMessage( e.GetMessageString() );
555 ReportMessage( wxString::Format( _( "\n** Error exporting %s file. Export aborted. **\n" ),
557 return false;
558 }
559 catch( ... )
560 {
561 ReportMessage( wxString::Format( _( "\n** Error exporting %s file. Export aborted. **\n" ),
563 return false;
564 }
565
566 if( m_fail || m_error )
567 {
568 if( m_fail )
569 {
570 msg = wxString::Format( _( "Unable to create %s file.\n"
571 "Check that the board has a valid outline and models." ),
573 }
574 else if( m_error || m_warn )
575 {
576 msg = wxString::Format( _( "%s file has been created, but there are warnings." ),
578 }
579
580 ReportMessage( msg );
581 }
582
583 // Display calculation time in seconds
584 double calculation_time = (double)( GetRunningMicroSecs() - stats_startExportTime) / 1e6;
585 ReportMessage( wxString::Format( _( "\nExport time %.3f s\n" ), calculation_time ) );
586
587 return true;
588}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:108
#define DEFAULT_BOARD_THICKNESS_MM
@ BS_ITEM_TYPE_COPPER
Definition: board_stackup.h:44
@ BS_ITEM_TYPE_DIELECTRIC
Definition: board_stackup.h:45
@ BS_ITEM_TYPE_SOLDERMASK
Definition: board_stackup.h:48
Container for design settings for a BOARD object.
const VECTOR2I & GetGridOrigin()
const VECTOR2I & GetAuxOrigin()
BOARD_STACKUP & GetStackupDescriptor()
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:77
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:226
Manage one layer needed to make a physical board.
Definition: board_stackup.h:95
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
int GetCount() 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 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
PROJECT * GetProject() const
Definition: board.h:475
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:797
const DRAWINGS & Drawings() const
Definition: board.h:324
double AsRadians() const
Definition: eda_angle.h:159
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:100
wxString GetDefaultExportExtension()
void buildZones3DShape(VECTOR2D aOrigin)
KIGFX::COLOR4D m_solderMaskColor
SHAPE_POLY_SET m_top_copper_shapes
SHAPE_POLY_SET m_bottom_copper_shapes
wxString m_outputFile
bool buildGraphic3DShape(BOARD_ITEM *aItem, VECTOR2D aOrigin)
EXPORTER_STEP_PARAMS m_params
EXPORTER_STEP(BOARD *aBoard, const EXPORTER_STEP_PARAMS &aParams)
wxString m_pcbBaseName
the name of the project (board short filename (no path, no ext) used to identify items in step file
bool buildFootprint3DShapes(FOOTPRINT *aFootprint, VECTOR2D aOrigin)
std::unique_ptr< FILENAME_RESOLVER > m_resolver
bool ExportTracksAndVias()
Return rue to export tracks and vias on top and bottom copper layers.
bool buildBoard3DShapes()
std::unique_ptr< STEP_PCB_MODEL > m_pcbModel
void calculatePcbThickness()
bool buildTrack3DShape(PCB_TRACK *aTrack, VECTOR2D aOrigin)
KIGFX::COLOR4D m_copperColor
double m_boardThickness
EDA_ANGLE GetOrientation() const
Definition: footprint.h:212
int GetAttributes() const
Definition: footprint.h:276
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: footprint.h:221
PADS & Pads()
Definition: footprint.h:191
void TransformFPShapesToPolySet(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool aIncludeText=true, bool aIncludeShapes=true, bool aIncludePrivateItems=false) const
Generate shapes of graphic items (outlines) on layer aLayer as polygons and adds these polygons to aB...
Definition: footprint.cpp:3646
const LIB_ID & GetFPID() const
Definition: footprint.h:233
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:205
const wxString & GetReference() const
Definition: footprint.h:588
VECTOR2I GetPosition() const override
Definition: footprint.h:209
Hold a record identifying a library accessed by the appropriate footprint library #PLUGIN object in t...
Definition: fp_lib_table.h:42
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName, bool aCheckIfEnabled=false)
Return an FP_LIB_TABLE_ROW if aNickName is found in this table or in any chained fall back table frag...
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
double r
Red component.
Definition: color4d.h:392
double g
Green component.
Definition: color4d.h:393
double b
Blue component.
Definition: color4d.h:394
EXPORTER_STEP * m_converter
KiCadPrinter(EXPORTER_STEP *aConverter)
virtual void Send(const TCollection_ExtendedString &theString, const Message_Gravity theGravity, const Standard_Boolean theToPutEol) const override
virtual void Send(const TCollection_AsciiString &theString, const Message_Gravity theGravity, const Standard_Boolean theToPutEol) const override
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:87
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
Definition: pad.h:59
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the shape to a closed polygon.
Definition: pcb_shape.cpp:785
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: pcb_shape.h:70
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the track shape to a closed polygon.
Definition: pcb_track.cpp:1642
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
Definition: project_pcb.cpp:37
Represent a set of closed polygons.
int FullPointCount() const
Return the number of points in the shape poly set.
void Unfracture(POLYGON_MODE aFastMode)
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
Handle a list of polygons defining a copper zone.
Definition: zone.h:72
#define _(s)
void ReportMessage(const wxString &aMessage)
@ FP_SMD
Definition: footprint.h:73
@ FP_DNP
Definition: footprint.h:80
@ FP_THROUGH_HOLE
Definition: footprint.h:72
@ ERROR_INSIDE
const wxChar *const traceKiCad2Step
Flag to enable KiCad2Step debug tracing.
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ B_Cu
Definition: layer_ids.h:95
@ F_Cu
Definition: layer_ids.h:64
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: pgm_base.cpp:1059
see class PGM_BASE
int64_t GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.
static constexpr double OCC_MAX_DISTANCE_TO_MERGE_POINTS
Default distance between points to treat them as separate ones (mm) 0.001 mm or less is a reasonable ...
constexpr double IUTomm(int iu) const
Definition: base_units.h:86
wxLogTrace helper definitions.
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98