SHAPE_POLY_SET::Inflate(): correct arc approximation for negative offsets (deflation). Control circle->segments count explicitly in all Inflate() calls
This commit is contained in:
parent
41c753b05d
commit
9f18e5a98f
|
@ -351,30 +351,13 @@ void EDA_3D_CANVAS::buildBoard3DView( GLuint aBoardList, GLuint aBodyOnlyList,
|
||||||
if( bufferPolys.IsEmpty() )
|
if( bufferPolys.IsEmpty() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
std::auto_ptr<SHAPE_FILE_IO> dumper( new SHAPE_FILE_IO( "poly_dump.txt", true ) );
|
|
||||||
|
|
||||||
// Use Clipper lib to subtract holes to copper areas
|
// Use Clipper lib to subtract holes to copper areas
|
||||||
|
|
||||||
dumper->BeginGroup( "clipper-zone" );
|
|
||||||
|
|
||||||
dumper->Write( &bufferPolys, "pre-simplify" );
|
|
||||||
bufferPolys.Simplify();
|
bufferPolys.Simplify();
|
||||||
dumper->Write( &bufferPolys, "post-simplify" );
|
|
||||||
|
|
||||||
currLayerHoles.Simplify();
|
currLayerHoles.Simplify();
|
||||||
allLayerHoles.Simplify();
|
allLayerHoles.Simplify();
|
||||||
|
|
||||||
//dumper->Write(&bufferPolys, "pre-sub");
|
|
||||||
//dumper->Write(&allLayerHoles, "holes");
|
|
||||||
|
|
||||||
// Add through holes (created only once) in current polygon holes list
|
|
||||||
//bufferPolys.BooleanSubtract( currLayerHoles );
|
|
||||||
//bufferPolys.Simplify();
|
|
||||||
bufferPolys.BooleanSubtract( allLayerHoles );
|
bufferPolys.BooleanSubtract( allLayerHoles );
|
||||||
|
|
||||||
//dumper->Write(&bufferPolys, "post-sub");
|
|
||||||
dumper->EndGroup();
|
|
||||||
|
|
||||||
bufferPolys.Fracture();
|
bufferPolys.Fracture();
|
||||||
|
|
||||||
int thickness = GetPrm3DVisu().GetLayerObjectThicknessBIU( layer );
|
int thickness = GetPrm3DVisu().GetLayerObjectThicknessBIU( layer );
|
||||||
|
|
|
@ -257,7 +257,7 @@ void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
|
||||||
|
|
||||||
PolyTree solution;
|
PolyTree solution;
|
||||||
|
|
||||||
c.ArcTolerance = (double)aFactor / M_PI / aCircleSegmentsCount;
|
c.ArcTolerance = (double)fabs( aFactor ) / M_PI / aCircleSegmentsCount;
|
||||||
|
|
||||||
c.Execute( solution, aFactor );
|
c.Execute( solution, aFactor );
|
||||||
|
|
||||||
|
|
|
@ -251,7 +251,7 @@ class SHAPE_POLY_SET : public SHAPE
|
||||||
void BooleanSubtract( const SHAPE_POLY_SET& b );
|
void BooleanSubtract( const SHAPE_POLY_SET& b );
|
||||||
|
|
||||||
///> Performs outline inflation/deflation, using round corners.
|
///> Performs outline inflation/deflation, using round corners.
|
||||||
void Inflate ( int aFactor, int aCircleSegmentsCount = 32 );
|
void Inflate( int aFactor, int aCircleSegmentsCount );
|
||||||
|
|
||||||
///> Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the outer ring
|
///> Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the outer ring
|
||||||
///> to the inner holes
|
///> to the inner holes
|
||||||
|
|
|
@ -111,7 +111,7 @@ bool ZONE_CONTAINER::BuildFilledSolidAreasPolygons( BOARD* aPcb, SHAPE_POLY_SET*
|
||||||
{
|
{
|
||||||
int margin = m_ZoneMinThickness / 2;
|
int margin = m_ZoneMinThickness / 2;
|
||||||
m_FilledPolysList = ConvertPolyListToPolySet( m_smoothedPoly->m_CornersList );
|
m_FilledPolysList = ConvertPolyListToPolySet( m_smoothedPoly->m_CornersList );
|
||||||
m_FilledPolysList.Inflate( -margin );
|
m_FilledPolysList.Inflate( -margin, 16 );
|
||||||
m_FilledPolysList.Fracture();
|
m_FilledPolysList.Fracture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -426,7 +426,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList_NG( BOARD* aPcb )
|
||||||
|
|
||||||
SHAPE_POLY_SET solidAreas = ConvertPolyListToPolySet( m_smoothedPoly->m_CornersList );
|
SHAPE_POLY_SET solidAreas = ConvertPolyListToPolySet( m_smoothedPoly->m_CornersList );
|
||||||
|
|
||||||
solidAreas.Inflate( -outline_half_thickness );
|
solidAreas.Inflate( -outline_half_thickness, segsPerCircle );
|
||||||
solidAreas.Simplify();
|
solidAreas.Simplify();
|
||||||
|
|
||||||
SHAPE_POLY_SET holes;
|
SHAPE_POLY_SET holes;
|
||||||
|
|
|
@ -65,7 +65,7 @@ void ZONE_CONTAINER::TransformOutlinesShapeWithClearanceToPolygon(
|
||||||
// Calculate the polygon with clearance
|
// Calculate the polygon with clearance
|
||||||
// holes are linked to the main outline, so only one polygon is created.
|
// holes are linked to the main outline, so only one polygon is created.
|
||||||
if( clearance )
|
if( clearance )
|
||||||
aCornerBuffer.Inflate( clearance );
|
aCornerBuffer.Inflate( clearance, 16 );
|
||||||
|
|
||||||
aCornerBuffer.Fracture( );
|
aCornerBuffer.Fracture( );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue