From 80b7f5fcbfec0f4a7a46a722f269848be5bb1ea8 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sun, 9 Jun 2024 18:56:40 +0300 Subject: [PATCH] Revert "Pcbnew, Altium import: Fix issues with hatched zones." This removed the hatch fill import functionality, and is no longer needed now that the root cause was found. This reverts commit 616510aca241ce6175cd70d9ac766a9fcfefc11e. --- pcbnew/pcb_io/altium/altium_pcb.cpp | 53 +---------------------------- 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/pcbnew/pcb_io/altium/altium_pcb.cpp b/pcbnew/pcb_io/altium/altium_pcb.cpp index 83068e4fa5..a164a87f08 100644 --- a/pcbnew/pcb_io/altium/altium_pcb.cpp +++ b/pcbnew/pcb_io/altium/altium_pcb.cpp @@ -563,43 +563,12 @@ void ALTIUM_PCB::Parse( const ALTIUM_COMPOUND_FILE& altiumPcbFi for( std::pair& zone : m_outer_plane ) zone.second->SetAssignedPriority( 0 ); - // Change zone fills in case we constructed them from tracks (hatched fill) - int zone_to_refill = 0; - int zone_converted = 0; - + // Simplify and fracture zone fills in case we constructed them from tracks (hatched fill) for( ZONE* zone : m_polygons ) { if( !zone ) continue; - if( zone->GetFillMode() == ZONE_FILL_MODE::HATCH_PATTERN ) - { - // Keep the hatch fill pattern only if the thickness and gap have a not too - // small value, especially if zone->GetHatchGap() is very small or null. - // Otherwise the refill calculation time can be **really big** - const int hatch_thickness_min_value = zone->GetMinThickness(); - - // If the gap is too small, the Hatch is similar to a solid filled area - // and trying to rebuild the hatch can look like hanging. - const int hatch_gap_min_value = pcbIUScale.mmToIU( 0.1 ); //arbitrary small value - - if( zone->GetHatchGap() < hatch_gap_min_value ) - { - zone->SetFillMode( ZONE_FILL_MODE::POLYGONS ); - zone_converted++; - } - - //if( zone->GetHatchThickness() < hatch_thickness_min_value ) - - // Remove the Altium fill solid areas, they are very different from Pcbnew - // that does not have a "painted" fill mode since a long time, - // and cannot be used as this. They must be rebuilt - zone->UnFill(); - zone_to_refill++; - } - - #if 0 - // Probably this section of code makes no sense. for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() ) { if( !zone->HasFilledPolysForLayer( layer ) ) @@ -607,22 +576,6 @@ void ALTIUM_PCB::Parse( const ALTIUM_COMPOUND_FILE& altiumPcbFi zone->GetFilledPolysList( layer )->Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); } - #endif - } - - if( m_reporter && zone_converted ) - { - m_reporter->Report( wxString::Format( - _( "%d hatched zones with very small gap converted to solid" ), - zone_converted ), - RPT_SEVERITY_INFO ); - } - - if( m_reporter && zone_to_refill ) - { - m_reporter->Report( wxString::Format( _( "%d hatched or converted zones found. They need refill" ), - zone_to_refill ), - RPT_SEVERITY_INFO ); } // Altium doesn't appear to store either the dimension value nor the dimensioned object in @@ -2125,10 +2078,6 @@ void ALTIUM_PCB::ParsePolygons6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbF if( elem.hatchstyle != ALTIUM_POLYGON_HATCHSTYLE::SOLID && elem.hatchstyle != ALTIUM_POLYGON_HATCHSTYLE::UNKNOWN ) { - // We can set the hach fill pattern only if the thickness and gap have a - // not too small value. Otherwise the refill calculation time can be - // **really big** - // The hatch option validity will be checked later, after all zones are built zone->SetFillMode( ZONE_FILL_MODE::HATCH_PATTERN ); zone->SetHatchThickness( elem.trackwidth );