← Back to team overview

kicad-developers team mailing list archive

Re: Question on Connectivity Algo

 

Le 07/08/2018 à 20:14, Seth Hillbrand a écrit :
> Hi Jeff-
> 
> Am Di., 7. Aug. 2018 um 08:07 Uhr schrieb Jeff Young <jeff@xxxxxxxxx
> <mailto:jeff@xxxxxxxxx>>:
> 
>     When building zone connectivity, we go through the following two
>     routines:
> 
>     bool ContainsPoint( const VECTOR2I p ) const
>     {
>         auto zone = static_cast<ZONE_CONTAINER*> ( Parent() );
>         return m_cachedPoly->ContainsPoint( p, zone->GetMinThickness() );
>     }
> 
>     int ContainsPoint( const VECTOR2I& aP, int aClearance = 0 )    // const
>     {
>         if( containsPoint(aP) )
>             return 1;
> 
>         if( aClearance > 0 )
>             return checkClearance ( aP, aClearance );
> 
>         return 0;
>     }
> 
> 
>     Why is zone->GetMinThickness() used?  Isn’t that the minimum web
>     thickness of the zone?
> 
> 
> Minimum thickness sets the trace thickness for the zone.  The outside
> points of the filled zone sets the maximum size, so the actual zone
> outline is offset into the zone area by half the min thickness.  This
> means that the corners are rounded (see attached image) and need to be
> considered when determining interior points.
>  
> 
>     And in the second routine, why check both?  Isn’t checkClearance() a
>     superset of containsPoint()?
> 
> 
> The clearance sets the minimum distance outside of the outer boundary. 
> So, in the case of a zone, clearance is half the trace width.  This is
> outside of the polygon, so it needs a distinct check.
> 
> Looking at this, it seems we _might_ have a discrepancy between
> m_ZoneMinThickness representing half or all of the zone trace width.
> 
> -Seth
> 

I agree.
I am guessing (although I dis not write the code):
return m_cachedPoly->ContainsPoint( p, zone->GetMinThickness() );
should be
return m_cachedPoly->ContainsPoint( p, zone->GetMinThickness()/2 );


-- 
Jean-Pierre CHARRAS


Follow ups

References