From 796e5fdc4550a2ebb934b9afa8e45090eaf76b35 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 20 Mar 2017 15:18:15 +0100 Subject: [PATCH] Fix an issue with pads not on copper layers (only on tech layers) when exporting .dsn file. The pad is invalid in .dsn file and crashes Freeroute. --- pcbnew/specctra_export.cpp | 46 +++++++++----------------------------- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index 5a0721c1b7..65a7cd3a5f 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -274,6 +274,7 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad ) uniqifier += 'A'; // A for all layers const int copperCount = aBoard->GetCopperLayerCount(); + for( int layer=0; layerimage_id = aModule->GetFPID().Format().c_str(); // from the pads, and make an IMAGE using collated padstacks. - for( int p=0; pGetPos0() ); int layerCount = aBoard->GetCopperLayerCount(); + for( int layer=0; layerGetLayerSet() & LSET::AllCuMask(); + + if( !mask_copper_layers.any() ) + continue; + PADSTACK* padstack = makePADSTACK( aBoard, pad ); PADSTACKSET::iterator iter = padstackset.find( *padstack ); @@ -719,41 +728,6 @@ PADSTACK* SPECCTRA_DB::makeVia( const ::VIA* aVia ) } -/** - * Function makeCircle - * does a line segmented circle into aPath. - */ -static void makeCircle( PATH* aPath, DRAWSEGMENT* aGraphic ) -{ - // do a circle segmentation - const int STEPS = 2 * 36; - - int radius = aGraphic->GetRadius(); - - if( radius <= 0 ) // Should not occur, but ... - return; - - wxPoint center = aGraphic->GetCenter(); - double angle = 3600.0; - wxPoint start = center; - start.x += radius; - - wxPoint nextPt; - - for( int step = 0; stepAppendPoint( mapPt( nextPt ) ); - } -} - - - void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IO_ERROR, boost::bad_pointer ) {