Commit 8c76e2e6 authored by dickelbeck's avatar dickelbeck
Browse files

current with latest freerouter's clearance support

parent f723c540
Loading
Loading
Loading
Loading
+12 −15
Original line number Original line Diff line number Diff line
@@ -983,15 +983,12 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
        int     curTrackWidth = aBoard->m_BoardSettings->m_CurrentTrackWidth;
        int     curTrackWidth = aBoard->m_BoardSettings->m_CurrentTrackWidth;
        int     curTrackClear = aBoard->m_BoardSettings->m_TrackClearence;
        int     curTrackClear = aBoard->m_BoardSettings->m_TrackClearence;


        // The 0.5 is to give freerouter a little extra room, this is 0.5 mils.
        // Add .1 mil to the requested clearances as a safety margin.
        // If we export without this, then on import freerouter violates our
        // There has been disagreement about interpretation of clearance in the past
        // DRC checks with track to via spacing, although this could be a
        // between Kicad and Freerouter, so keep this safetyMargin until the
        // result of > testing vs. >= testing in PCBNEW's DRC.
        // disagreement is resolved and stable.  Recently Kicad started adding
//       double  safetyMargin = 0.5;
        // 0.1 mils to what it is given, so we can use zero for now.

        const double  safetyMargin = 0.0;
        // recent freerouter code adds .1 to the requested clearances, and I want .5
        // so subtract .1 so we actually get 0.5.
        double  safetyMargin = 0.4;


        double  clearance = scale(curTrackClear);
        double  clearance = scale(curTrackClear);


@@ -1004,13 +1001,13 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
        rules.push_back( rule );
        rules.push_back( rule );


        // On a high density board, a typical solder mask clearance will be 2-3 mils.
        // On a high density board, a typical solder mask clearance will be 2-3 mils.
        // This exposes 2 to 3 mils of bare board around each pad.  So we need at least
        // This exposes 2 to 3 mils of bare board around each pad, and would
        // 2 mils *extra* clearance for tracks which would come near a pad on
        // leave only 1 to 2 mils of solder mask between the solder mask's boundary
        // to the edge of any trace within "clearance" of the pad.  So we need at least
        // 2 mils *extra* clearance for traces which would come near a pad on
        // a different net.  So if the baseline trace to trace clearance was say 4 mils, then
        // a different net.  So if the baseline trace to trace clearance was say 4 mils, then
        // the SMD to track clearance should be at least 6 mils.  Then, because
        // the SMD to trace clearance should be at least 6 mils.  Also add our safetyMargin.
        // freerouter seems to be off about a 1/2 mil on clearance tests, add
        sprintf( rule, "(clearance %.6g (type default_smd))", clearance + 2.0 + safetyMargin );
        // another .5 mil for this test discrepancy as a safety margin.
        sprintf( rule, "(clearance %.6g (type default_smd))", clearance + safetyMargin + 2.0 );
        rules.push_back( rule );
        rules.push_back( rule );


        /* see: http://www.freerouting.net/usren/viewtopic.php?f=5&t=339#p474
        /* see: http://www.freerouting.net/usren/viewtopic.php?f=5&t=339#p474