From 80124d246387fa8eeef8a237d0662bf592c34580 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 28 May 2022 00:18:46 +0100 Subject: [PATCH] Write out partial pad-stacks for blind/buried/microvias. Fixes https://gitlab.com/kicad/code/kicad/issues/11692 --- pcbnew/exporters/export_hyperlynx.cpp | 58 +++++++++------------------ 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/pcbnew/exporters/export_hyperlynx.cpp b/pcbnew/exporters/export_hyperlynx.cpp index d7960ebd76..750b920193 100644 --- a/pcbnew/exporters/export_hyperlynx.cpp +++ b/pcbnew/exporters/export_hyperlynx.cpp @@ -89,22 +89,6 @@ public: return true; } - bool IsSMD() const - { - return m_type == PAD_ATTRIB::SMD; - } - - PCB_LAYER_ID GetSMDLayer() const - { - for( PCB_LAYER_ID l : LSET::AllCuMask().Seq() ) - { - if( m_layers[l] ) - return l; - } - - return F_Cu; - } - void SetId( int id ) { m_id = id; @@ -115,21 +99,6 @@ public: return m_id; } - int IsSupportedByExporter() const - { - switch( m_shape ) - { - case PAD_SHAPE::CIRCLE: - case PAD_SHAPE::OVAL: - case PAD_SHAPE::ROUNDRECT: - case PAD_SHAPE::RECT: - return true; - - default: - return false; - } - } - bool IsEmpty() const { LSET layerMask = LSET::AllCuMask() & m_board->GetEnabledLayers(); @@ -184,21 +153,30 @@ private: switch( aStack.m_shape ) { case PAD_SHAPE::CIRCLE: - case PAD_SHAPE::OVAL: shapeId = 0; break; - case PAD_SHAPE::ROUNDRECT: shapeId = 2; break; - case PAD_SHAPE::RECT: shapeId = 1; break; - default: + case PAD_SHAPE::OVAL: shapeId = 0; + break; + case PAD_SHAPE::ROUNDRECT: + shapeId = 2; + break; + + case PAD_SHAPE::RECT: + shapeId = 1; + break; + + default: if( m_reporter ) { m_reporter->Report( _( "File contains pad shapes that are not supported by the " - "Hyperlynx exporter (supported shapes are oval, rectangle " - "and circle)." ), + "Hyperlynx exporter (supported shapes are oval, rectangle, " + "rounded rectangle, and circle)." ), RPT_SEVERITY_WARNING ); m_reporter->Report( _( "They have been exported as oval pads." ), RPT_SEVERITY_INFO ); } + + shapeId = 0; break; } @@ -257,7 +235,7 @@ HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const PCB_VIA* aVia ) m_sx = aVia->GetWidth(); m_sy = aVia->GetWidth(); m_angle = 0; - m_layers = LSET::AllCuMask(); + m_layers = aVia->GetLayerSet(); m_drill = aVia->GetDrillValue(); m_shape = PAD_SHAPE::CIRCLE; m_type = PAD_ATTRIB::PTH; @@ -496,6 +474,10 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector& aObjec iu2hyp( track->GetWidth() ), (const char*) layerName.c_str() ); } + else if( PCB_ARC* arc = dyn_cast( item ) ) + { + // TODO! + } else if( ZONE* zone = dyn_cast( item ) ) { for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )