Move CORNER_STRATEGY out of SHAPE_POLY_SET.
This commit is contained in:
parent
2cd630b47d
commit
d7863b09c5
|
@ -454,7 +454,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
|||
if( !poly.IsEmpty() )
|
||||
{
|
||||
if( clearance.x )
|
||||
poly.Inflate( clearance.x, SHAPE_POLY_SET::ROUND_ALL_CORNERS, maxError );
|
||||
poly.Inflate( clearance.x, CORNER_STRATEGY::ROUND_ALL_CORNERS, maxError );
|
||||
|
||||
// Add the PAD polygon
|
||||
ConvertPolygonToTriangles( poly, *aContainer, m_biuTo3Dunits, *aPad );
|
||||
|
|
|
@ -1664,7 +1664,7 @@ void EDA_SHAPE::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, int aClearance
|
|||
tmp.Append( poly.GetPoint( jj ) );
|
||||
|
||||
if( width > 0 )
|
||||
tmp.Inflate( width/2, SHAPE_POLY_SET::ROUND_ALL_CORNERS, aError, false);
|
||||
tmp.Inflate( width/2, CORNER_STRATEGY::ROUND_ALL_CORNERS, aError, false);
|
||||
|
||||
aBuffer.Append( tmp );
|
||||
}
|
||||
|
|
|
@ -620,7 +620,7 @@ void VIEW::SetCenter( const VECTOR2D& aCenter, const std::vector<BOX2D>& obscuri
|
|||
while( !unobscuredPoly.IsEmpty() )
|
||||
{
|
||||
unobscuredCenter = unobscuredPoly.BBox().Centre();
|
||||
unobscuredPoly.Deflate( step, SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS, ARC_LOW_DEF );
|
||||
unobscuredPoly.Deflate( step, CORNER_STRATEGY::ALLOW_ACUTE_CORNERS, ARC_LOW_DEF );
|
||||
}
|
||||
|
||||
SetCenter( aCenter - ToWorld( unobscuredCenter - screenRect.Centre(), false ) );
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2019 CERN
|
||||
* Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* @author Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
|
||||
*
|
||||
* Point in polygon algorithm adapted from Clipper Library (C) Angus Johnson,
|
||||
* subject to Clipper library license.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef CORNER_STRATEGY_H_
|
||||
#define CORNER_STRATEGY_H_
|
||||
|
||||
|
||||
/// define how inflate transform build inflated polygon
|
||||
enum class CORNER_STRATEGY
|
||||
{
|
||||
ALLOW_ACUTE_CORNERS, ///< just inflate the polygon. Acute angles create spikes
|
||||
CHAMFER_ACUTE_CORNERS, ///< Acute angles are chamfered
|
||||
ROUND_ACUTE_CORNERS, ///< Acute angles are rounded
|
||||
CHAMFER_ALL_CORNERS, ///< All angles are chamfered.
|
||||
///< The distance between new and old polygon edges is not
|
||||
///< constant, but do not change a lot
|
||||
ROUND_ALL_CORNERS ///< All angles are rounded.
|
||||
///< The distance between new and old polygon edges is constant
|
||||
};
|
||||
|
||||
|
||||
#endif // CORNER_STRATEGY_H_
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
#include <clipper.hpp> // for ClipType, PolyTree (ptr only)
|
||||
#include <clipper2/clipper.h>
|
||||
#include <geometry/corner_strategy.h>
|
||||
#include <geometry/seg.h> // for SEG
|
||||
#include <geometry/shape.h>
|
||||
#include <geometry/shape_line_chain.h>
|
||||
|
@ -1008,19 +1009,6 @@ public:
|
|||
*/
|
||||
void RebuildHolesFromContours();
|
||||
|
||||
/// define how inflate transform build inflated polygon
|
||||
enum CORNER_STRATEGY
|
||||
{
|
||||
ALLOW_ACUTE_CORNERS, ///< just inflate the polygon. Acute angles create spikes
|
||||
CHAMFER_ACUTE_CORNERS, ///< Acute angles are chamfered
|
||||
ROUND_ACUTE_CORNERS, ///< Acute angles are rounded
|
||||
CHAMFER_ALL_CORNERS, ///< All angles are chamfered.
|
||||
///< The distance between new and old polygon edges is not
|
||||
///< constant, but do not change a lot
|
||||
ROUND_ALL_CORNERS ///< All angles are rounded.
|
||||
///< The distance between new and old polygon edges is constant
|
||||
};
|
||||
|
||||
/**
|
||||
* Perform outline inflation/deflation.
|
||||
*
|
||||
|
|
|
@ -1031,8 +1031,7 @@ void SHAPE_POLY_SET::BooleanXor( const SHAPE_POLY_SET& a, const SHAPE_POLY_SET&
|
|||
}
|
||||
|
||||
|
||||
void SHAPE_POLY_SET::InflateWithLinkedHoles( int aFactor,
|
||||
SHAPE_POLY_SET::CORNER_STRATEGY aCornerStrategy,
|
||||
void SHAPE_POLY_SET::InflateWithLinkedHoles( int aFactor, CORNER_STRATEGY aCornerStrategy,
|
||||
int aMaxError, POLYGON_MODE aFastMode )
|
||||
{
|
||||
Unfracture( aFastMode );
|
||||
|
@ -1061,28 +1060,28 @@ void SHAPE_POLY_SET::inflate1( int aAmount, int aCircleSegCount, CORNER_STRATEGY
|
|||
|
||||
switch( aCornerStrategy )
|
||||
{
|
||||
case ALLOW_ACUTE_CORNERS:
|
||||
case CORNER_STRATEGY::ALLOW_ACUTE_CORNERS:
|
||||
joinType = jtMiter;
|
||||
miterLimit = 10; // Allows large spikes
|
||||
miterFallback = jtSquare;
|
||||
break;
|
||||
|
||||
case CHAMFER_ACUTE_CORNERS: // Acute angles are chamfered
|
||||
case CORNER_STRATEGY::CHAMFER_ACUTE_CORNERS: // Acute angles are chamfered
|
||||
joinType = jtMiter;
|
||||
miterFallback = jtRound;
|
||||
break;
|
||||
|
||||
case ROUND_ACUTE_CORNERS: // Acute angles are rounded
|
||||
case CORNER_STRATEGY::ROUND_ACUTE_CORNERS: // Acute angles are rounded
|
||||
joinType = jtMiter;
|
||||
miterFallback = jtSquare;
|
||||
break;
|
||||
|
||||
case CHAMFER_ALL_CORNERS: // All angles are chamfered.
|
||||
case CORNER_STRATEGY::CHAMFER_ALL_CORNERS: // All angles are chamfered.
|
||||
joinType = jtSquare;
|
||||
miterFallback = jtSquare;
|
||||
break;
|
||||
|
||||
case ROUND_ALL_CORNERS: // All angles are rounded.
|
||||
case CORNER_STRATEGY::ROUND_ALL_CORNERS: // All angles are rounded.
|
||||
joinType = jtRound;
|
||||
miterFallback = jtSquare;
|
||||
break;
|
||||
|
@ -1152,24 +1151,24 @@ void SHAPE_POLY_SET::inflate2( int aAmount, int aCircleSegCount, CORNER_STRATEGY
|
|||
|
||||
switch( aCornerStrategy )
|
||||
{
|
||||
case ALLOW_ACUTE_CORNERS:
|
||||
case CORNER_STRATEGY::ALLOW_ACUTE_CORNERS:
|
||||
joinType = JoinType::Miter;
|
||||
miterLimit = 10; // Allows large spikes
|
||||
break;
|
||||
|
||||
case CHAMFER_ACUTE_CORNERS: // Acute angles are chamfered
|
||||
case CORNER_STRATEGY::CHAMFER_ACUTE_CORNERS: // Acute angles are chamfered
|
||||
joinType = JoinType::Miter;
|
||||
break;
|
||||
|
||||
case ROUND_ACUTE_CORNERS: // Acute angles are rounded
|
||||
case CORNER_STRATEGY::ROUND_ACUTE_CORNERS: // Acute angles are rounded
|
||||
joinType = JoinType::Miter;
|
||||
break;
|
||||
|
||||
case CHAMFER_ALL_CORNERS: // All angles are chamfered.
|
||||
case CORNER_STRATEGY::CHAMFER_ALL_CORNERS: // All angles are chamfered.
|
||||
joinType = JoinType::Square;
|
||||
break;
|
||||
|
||||
case ROUND_ALL_CORNERS: // All angles are rounded.
|
||||
case CORNER_STRATEGY::ROUND_ALL_CORNERS: // All angles are rounded.
|
||||
joinType = JoinType::Round;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ bool DRC_TEST_PROVIDER_DISALLOW::Run()
|
|||
// they will be exactly touching along the entire exclusion border.
|
||||
SHAPE_POLY_SET areaPoly = ruleArea->Outline()->CloneDropTriangulation();
|
||||
areaPoly.Fracture( SHAPE_POLY_SET::PM_FAST );
|
||||
areaPoly.Deflate( epsilon, SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS, ARC_LOW_DEF );
|
||||
areaPoly.Deflate( epsilon, CORNER_STRATEGY::ALLOW_ACUTE_CORNERS, ARC_LOW_DEF );
|
||||
|
||||
DRC_RTREE* zoneRTree = board->m_CopperZoneRTreeCache[ copperZone ].get();
|
||||
|
||||
|
|
|
@ -225,9 +225,9 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::buildRTrees()
|
|||
solderMask->GetFill( F_Mask )->Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
solderMask->GetFill( B_Mask )->Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
solderMask->GetFill( F_Mask )->Deflate( m_webWidth / 2, SHAPE_POLY_SET::CHAMFER_ALL_CORNERS,
|
||||
solderMask->GetFill( F_Mask )->Deflate( m_webWidth / 2, CORNER_STRATEGY::CHAMFER_ALL_CORNERS,
|
||||
m_maxError );
|
||||
solderMask->GetFill( B_Mask )->Deflate( m_webWidth / 2, SHAPE_POLY_SET::CHAMFER_ALL_CORNERS,
|
||||
solderMask->GetFill( B_Mask )->Deflate( m_webWidth / 2, CORNER_STRATEGY::CHAMFER_ALL_CORNERS,
|
||||
m_maxError );
|
||||
|
||||
solderMask->SetFillFlag( F_Mask, true );
|
||||
|
|
|
@ -177,7 +177,7 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run()
|
|||
|
||||
SHAPE_POLY_SET poly = outlineGlyph->CloneDropTriangulation();
|
||||
poly.Deflate( constraint.Value().Min() / 2,
|
||||
SHAPE_POLY_SET::CHAMFER_ALL_CORNERS, ARC_LOW_DEF );
|
||||
CORNER_STRATEGY::CHAMFER_ALL_CORNERS, ARC_LOW_DEF );
|
||||
poly.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
|
||||
int resultingOutlineCount = poly.OutlineCount();
|
||||
|
@ -199,7 +199,7 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run()
|
|||
continue;
|
||||
|
||||
poly.Inflate( constraint.Value().Min() / 2,
|
||||
SHAPE_POLY_SET::CHAMFER_ALL_CORNERS, ARC_LOW_DEF, true );
|
||||
CORNER_STRATEGY::CHAMFER_ALL_CORNERS, ARC_LOW_DEF, true );
|
||||
|
||||
double resultingGlyphArea = poly.Area();
|
||||
|
||||
|
|
|
@ -2487,7 +2487,7 @@ void FOOTPRINT::BuildCourtyardCaches( OUTLINE_ERROR_HANDLER* aErrorHandler )
|
|||
true, aErrorHandler ) )
|
||||
{
|
||||
// Touching courtyards, or courtyards -at- the clearance distance are legal.
|
||||
m_courtyard_cache_front.Inflate( -1, SHAPE_POLY_SET::CHAMFER_ACUTE_CORNERS, maxError );
|
||||
m_courtyard_cache_front.Inflate( -1, CORNER_STRATEGY::CHAMFER_ACUTE_CORNERS, maxError );
|
||||
|
||||
m_courtyard_cache_front.CacheTriangulation( false );
|
||||
}
|
||||
|
@ -2500,7 +2500,7 @@ void FOOTPRINT::BuildCourtyardCaches( OUTLINE_ERROR_HANDLER* aErrorHandler )
|
|||
true, aErrorHandler ) )
|
||||
{
|
||||
// Touching courtyards, or courtyards -at- the clearance distance are legal.
|
||||
m_courtyard_cache_back.Inflate( -1, SHAPE_POLY_SET::CHAMFER_ACUTE_CORNERS, maxError );
|
||||
m_courtyard_cache_back.Inflate( -1, CORNER_STRATEGY::CHAMFER_ACUTE_CORNERS, maxError );
|
||||
|
||||
m_courtyard_cache_back.CacheTriangulation( false );
|
||||
}
|
||||
|
|
|
@ -1654,7 +1654,7 @@ void PAD::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer,
|
|||
if( aErrorLoc == ERROR_OUTSIDE )
|
||||
aClearance += aMaxError;
|
||||
|
||||
outline.Inflate( aClearance, SHAPE_POLY_SET::ROUND_ALL_CORNERS, aMaxError );
|
||||
outline.Inflate( aClearance, CORNER_STRATEGY::ROUND_ALL_CORNERS, aMaxError );
|
||||
outline.Fracture( SHAPE_POLY_SET::PM_FAST );
|
||||
}
|
||||
else if( aClearance < 0 )
|
||||
|
@ -1663,7 +1663,7 @@ void PAD::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer,
|
|||
// worry ourselves overly about which side the error is on.
|
||||
|
||||
// aClearance is negative so this is actually a deflate
|
||||
outline.Inflate( aClearance, SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS, aMaxError );
|
||||
outline.Inflate( aClearance, CORNER_STRATEGY::ALLOW_ACUTE_CORNERS, aMaxError );
|
||||
outline.Fracture( SHAPE_POLY_SET::PM_FAST );
|
||||
}
|
||||
|
||||
|
|
|
@ -477,7 +477,7 @@ void PCB_BASE_FRAME::FocusOnItems( std::vector<BOARD_ITEM*> aItems, PCB_LAYER_ID
|
|||
|
||||
try
|
||||
{
|
||||
itemPoly.Deflate( step, SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS, ARC_LOW_DEF );
|
||||
itemPoly.Deflate( step, CORNER_STRATEGY::ALLOW_ACUTE_CORNERS, ARC_LOW_DEF );
|
||||
}
|
||||
catch( const std::exception& exc )
|
||||
{
|
||||
|
|
|
@ -1574,7 +1574,7 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
|||
for( int ii = 0; ii < poly->PointCount(); ++ii )
|
||||
outline.Append( poly->CPoint( ii ) );
|
||||
|
||||
outline.Deflate( -margin.x, SHAPE_POLY_SET::CHAMFER_ALL_CORNERS,
|
||||
outline.Deflate( -margin.x, CORNER_STRATEGY::CHAMFER_ALL_CORNERS,
|
||||
m_maxError );
|
||||
|
||||
m_gal->DrawPolygon( outline );
|
||||
|
|
|
@ -507,7 +507,7 @@ void PCB_TEXT::TransformTextToPolySet( SHAPE_POLY_SET& aBuffer, int aClearance,
|
|||
if( aErrorLoc == ERROR_OUTSIDE )
|
||||
aClearance += aMaxError;
|
||||
|
||||
textShape.Inflate( aClearance, SHAPE_POLY_SET::ROUND_ALL_CORNERS, aMaxError );
|
||||
textShape.Inflate( aClearance, CORNER_STRATEGY::ROUND_ALL_CORNERS, aMaxError );
|
||||
}
|
||||
|
||||
aBuffer.Append( textShape );
|
||||
|
|
|
@ -507,7 +507,7 @@ void PCB_TEXTBOX::TransformTextToPolySet( SHAPE_POLY_SET& aBuffer, int aClearanc
|
|||
if( aErrorLoc == ERROR_OUTSIDE )
|
||||
aClearance += aMaxError;
|
||||
|
||||
buffer.Inflate( aClearance, SHAPE_POLY_SET::ROUND_ALL_CORNERS, aMaxError, true );
|
||||
buffer.Inflate( aClearance, CORNER_STRATEGY::ROUND_ALL_CORNERS, aMaxError, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -429,7 +429,7 @@ bool collidesWithArea( BOARD_ITEM* aItem, PCBEXPR_CONTEXT* aCtx, ZONE* aArea )
|
|||
SHAPE_POLY_SET areaOutline = aArea->Outline()->CloneDropTriangulation();
|
||||
areaOutline.ClearArcs();
|
||||
areaOutline.Deflate( board->GetDesignSettings().GetDRCEpsilon(),
|
||||
SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS, ARC_LOW_DEF );
|
||||
CORNER_STRATEGY::ALLOW_ACUTE_CORNERS, ARC_LOW_DEF );
|
||||
|
||||
if( aItem->GetFlags() & HOLE_PROXY )
|
||||
{
|
||||
|
|
|
@ -451,7 +451,7 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
// Shape polygon can have holes so use InflateWithLinkedHoles(), not Inflate()
|
||||
// which can create bad shapes if margin.x is < 0
|
||||
outline.InflateWithLinkedHoles( mask_clearance,
|
||||
SHAPE_POLY_SET::ROUND_ALL_CORNERS, maxError,
|
||||
CORNER_STRATEGY::ROUND_ALL_CORNERS, maxError,
|
||||
SHAPE_POLY_SET::PM_FAST );
|
||||
dummy.DeletePrimitivesList();
|
||||
dummy.AddPrimitivePoly( outline, 0, true );
|
||||
|
@ -500,7 +500,7 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
dummy.TransformShapeToPolygon( outline, UNDEFINED_LAYER, 0, maxError,
|
||||
ERROR_INSIDE );
|
||||
outline.InflateWithLinkedHoles( mask_clearance,
|
||||
SHAPE_POLY_SET::ROUND_ALL_CORNERS, maxError,
|
||||
CORNER_STRATEGY::ROUND_ALL_CORNERS, maxError,
|
||||
SHAPE_POLY_SET::PM_FAST );
|
||||
|
||||
// Initialize the dummy pad shape:
|
||||
|
@ -532,7 +532,7 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
// Shape polygon can have holes so use InflateWithLinkedHoles(), not Inflate()
|
||||
// which can create bad shapes if margin.x is < 0
|
||||
shape.InflateWithLinkedHoles( mask_clearance,
|
||||
SHAPE_POLY_SET::ROUND_ALL_CORNERS, maxError,
|
||||
CORNER_STRATEGY::ROUND_ALL_CORNERS, maxError,
|
||||
SHAPE_POLY_SET::PM_FAST );
|
||||
dummy.DeletePrimitivesList();
|
||||
dummy.AddPrimitivePoly( shape, 0, true );
|
||||
|
@ -982,7 +982,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
// Merge all polygons: After deflating, not merged (not overlapping) polygons will have the
|
||||
// initial shape (with perhaps small changes due to deflating transform)
|
||||
areas.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
areas.Deflate( inflate, SHAPE_POLY_SET::CHAMFER_ALL_CORNERS, maxError );
|
||||
areas.Deflate( inflate, CORNER_STRATEGY::CHAMFER_ALL_CORNERS, maxError );
|
||||
|
||||
// To avoid a lot of code, use a ZONE to handle and plot polygons, because our polygons look
|
||||
// exactly like filled areas in zones.
|
||||
|
|
|
@ -2145,7 +2145,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers()
|
|||
{
|
||||
fill = getPolySetFromCadstarShape( csCopper.Shape, -1 );
|
||||
fill.ClearArcs();
|
||||
fill.Inflate( copperWidth / 2, SHAPE_POLY_SET::ROUND_ALL_CORNERS, ARC_HIGH_DEF );
|
||||
fill.Inflate( copperWidth / 2, CORNER_STRATEGY::ROUND_ALL_CORNERS, ARC_HIGH_DEF );
|
||||
}
|
||||
|
||||
if( pouredZone->HasFilledPolysForLayer( getKiCadLayer( csCopper.LayerID ) ) )
|
||||
|
@ -3039,7 +3039,7 @@ SHAPE_POLY_SET CADSTAR_PCB_ARCHIVE_LOADER::getPolySetFromCadstarShape( const SHA
|
|||
polySet.ClearArcs();
|
||||
|
||||
if( aLineThickness > 0 )
|
||||
polySet.Inflate( aLineThickness / 2, SHAPE_POLY_SET::ROUND_ALL_CORNERS, ARC_HIGH_DEF );
|
||||
polySet.Inflate( aLineThickness / 2, CORNER_STRATEGY::ROUND_ALL_CORNERS, ARC_HIGH_DEF );
|
||||
|
||||
#ifdef DEBUG
|
||||
for( int i = 0; i < polySet.OutlineCount(); ++i )
|
||||
|
@ -3734,7 +3734,7 @@ bool CADSTAR_PCB_ARCHIVE_LOADER::calculateZonePriorities( PCB_LAYER_ID& aLayer )
|
|||
{
|
||||
SHAPE_POLY_SET intersectShape( *aHigherZone->Outline() );
|
||||
intersectShape.Inflate( inflateValue( aLowerZone, aHigherZone ),
|
||||
SHAPE_POLY_SET::ROUND_ALL_CORNERS, ARC_HIGH_DEF );
|
||||
CORNER_STRATEGY::ROUND_ALL_CORNERS, ARC_HIGH_DEF );
|
||||
|
||||
SHAPE_POLY_SET lowerZoneFill( *aLowerZone->GetFilledPolysList( aLayer ) );
|
||||
SHAPE_POLY_SET lowerZoneOutline( *aLowerZone->Outline() );
|
||||
|
@ -3752,11 +3752,11 @@ bool CADSTAR_PCB_ARCHIVE_LOADER::calculateZonePriorities( PCB_LAYER_ID& aLayer )
|
|||
[&]( ZONE* aZoneA, ZONE* aZoneB ) -> double
|
||||
{
|
||||
SHAPE_POLY_SET outLineA( *aZoneA->Outline() );
|
||||
outLineA.Inflate( inflateValue( aZoneA, aZoneB ), SHAPE_POLY_SET::ROUND_ALL_CORNERS,
|
||||
outLineA.Inflate( inflateValue( aZoneA, aZoneB ), CORNER_STRATEGY::ROUND_ALL_CORNERS,
|
||||
ARC_HIGH_DEF );
|
||||
|
||||
SHAPE_POLY_SET outLineB( *aZoneA->Outline() );
|
||||
outLineB.Inflate( inflateValue( aZoneA, aZoneB ), SHAPE_POLY_SET::ROUND_ALL_CORNERS,
|
||||
outLineB.Inflate( inflateValue( aZoneA, aZoneB ), CORNER_STRATEGY::ROUND_ALL_CORNERS,
|
||||
ARC_HIGH_DEF );
|
||||
|
||||
outLineA.BooleanIntersection( outLineB, SHAPE_POLY_SET::PM_FAST );
|
||||
|
|
|
@ -1526,7 +1526,7 @@ ZONE* EAGLE_PLUGIN::loadPolygon( wxXmlNode* aPolyNode )
|
|||
// We trace the zone such that the copper is completely inside.
|
||||
if( p.width.ToPcbUnits() > 0 )
|
||||
{
|
||||
polygon.Inflate( p.width.ToPcbUnits() / 2, SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS,
|
||||
polygon.Inflate( p.width.ToPcbUnits() / 2, CORNER_STRATEGY::ALLOW_ACUTE_CORNERS,
|
||||
ARC_HIGH_DEF, true );
|
||||
}
|
||||
|
||||
|
@ -2283,7 +2283,7 @@ void EAGLE_PLUGIN::packagePolygon( FOOTPRINT* aFootprint, wxXmlNode* aTree ) con
|
|||
dwg->Rotate( { 0, 0 }, aFootprint->GetOrientation() );
|
||||
dwg->Move( aFootprint->GetPosition() );
|
||||
dwg->GetPolyShape().Inflate( p.width.ToPcbUnits() / 2,
|
||||
SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS, ARC_HIGH_DEF );
|
||||
CORNER_STRATEGY::ALLOW_ACUTE_CORNERS, ARC_HIGH_DEF );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1257,7 +1257,7 @@ void PCB_EASYEDAPRO_PARSER::ParseBoard(
|
|||
|
||||
const int strokeWidth = pcbIUScale.MilsToIU( 8 ); // Seems to be 8 mils
|
||||
|
||||
fillPolySet.Inflate( strokeWidth / 2, SHAPE_POLY_SET::ROUND_ALL_CORNERS,
|
||||
fillPolySet.Inflate( strokeWidth / 2, CORNER_STRATEGY::ROUND_ALL_CORNERS,
|
||||
ARC_HIGH_DEF, false );
|
||||
|
||||
fillPolySet.BooleanAdd( thermalSpokes, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
|
|
@ -5708,7 +5708,7 @@ ZONE* PCB_PARSER::parseZONE( BOARD_ITEM_CONTAINER* aParent )
|
|||
for( auto& [layer, polyset] : pts )
|
||||
{
|
||||
polyset.InflateWithLinkedHoles(
|
||||
zone->GetMinThickness() / 2, SHAPE_POLY_SET::ROUND_ALL_CORNERS,
|
||||
zone->GetMinThickness() / 2, CORNER_STRATEGY::ROUND_ALL_CORNERS,
|
||||
ARC_HIGH_DEF / 2, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2617,7 +2617,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
|
|||
SHAPE_POLY_SET inflatedFill = SHAPE_POLY_SET( *zc->GetFilledPolysList( layer ) );
|
||||
|
||||
inflatedFill.InflateWithLinkedHoles( zc->GetMinThickness() / 2,
|
||||
SHAPE_POLY_SET::ROUND_ALL_CORNERS,
|
||||
CORNER_STRATEGY::ROUND_ALL_CORNERS,
|
||||
ARC_HIGH_DEF / 2,
|
||||
SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
|
|
|
@ -1262,7 +1262,7 @@ bool ZONE::BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly, PCB_LAYER_ID aLayer
|
|||
if( aSmoothedPolyWithApron )
|
||||
{
|
||||
SHAPE_POLY_SET poly = maxExtents->CloneDropTriangulation();
|
||||
poly.Inflate( m_ZoneMinThickness, SHAPE_POLY_SET::ROUND_ALL_CORNERS, maxError );
|
||||
poly.Inflate( m_ZoneMinThickness, CORNER_STRATEGY::ROUND_ALL_CORNERS, maxError );
|
||||
*aSmoothedPolyWithApron = aSmoothedPoly;
|
||||
aSmoothedPolyWithApron->BooleanIntersection( poly, SHAPE_POLY_SET::PM_FAST );
|
||||
}
|
||||
|
@ -1326,7 +1326,7 @@ void ZONE::TransformSmoothedOutlineToPolygon( SHAPE_POLY_SET& aBuffer, int aClea
|
|||
if( aErrorLoc == ERROR_OUTSIDE )
|
||||
aClearance += maxError;
|
||||
|
||||
polybuffer.Inflate( aClearance, SHAPE_POLY_SET::ROUND_ALL_CORNERS, maxError );
|
||||
polybuffer.Inflate( aClearance, CORNER_STRATEGY::ROUND_ALL_CORNERS, maxError );
|
||||
}
|
||||
|
||||
polybuffer.Fracture( SHAPE_POLY_SET::PM_FAST );
|
||||
|
@ -1365,7 +1365,7 @@ void ZONE::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer
|
|||
if( aErrorLoc == ERROR_OUTSIDE )
|
||||
aClearance += aError;
|
||||
|
||||
temp_buf.InflateWithLinkedHoles( aClearance, SHAPE_POLY_SET::ROUND_ALL_CORNERS, aError,
|
||||
temp_buf.InflateWithLinkedHoles( aClearance, CORNER_STRATEGY::ROUND_ALL_CORNERS, aError,
|
||||
SHAPE_POLY_SET::PM_FAST );
|
||||
}
|
||||
|
||||
|
|
|
@ -1396,8 +1396,8 @@ bool ZONE_FILLER::fillCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer, PCB_LA
|
|||
// as a "less-safe" option.
|
||||
// ROUND_ALL_CORNERS produces the uniformly nicest shapes, but also a lot of segments.
|
||||
// CHAMFER_ALL_CORNERS improves the segment count.
|
||||
SHAPE_POLY_SET::CORNER_STRATEGY fastCornerStrategy = SHAPE_POLY_SET::CHAMFER_ALL_CORNERS;
|
||||
SHAPE_POLY_SET::CORNER_STRATEGY cornerStrategy = SHAPE_POLY_SET::ROUND_ALL_CORNERS;
|
||||
CORNER_STRATEGY fastCornerStrategy = CORNER_STRATEGY::CHAMFER_ALL_CORNERS;
|
||||
CORNER_STRATEGY cornerStrategy = CORNER_STRATEGY::ROUND_ALL_CORNERS;
|
||||
|
||||
std::vector<PAD*> thermalConnectionPads;
|
||||
std::vector<PAD*> noConnectionPads;
|
||||
|
@ -1664,7 +1664,7 @@ bool ZONE_FILLER::fillNonCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer,
|
|||
int half_min_width = aZone->GetMinThickness() / 2;
|
||||
int epsilon = pcbIUScale.mmToIU( 0.001 );
|
||||
|
||||
aFillPolys.Deflate( half_min_width - epsilon, SHAPE_POLY_SET::CHAMFER_ALL_CORNERS, m_maxError );
|
||||
aFillPolys.Deflate( half_min_width - epsilon, CORNER_STRATEGY::CHAMFER_ALL_CORNERS, m_maxError );
|
||||
|
||||
// Remove the non filled areas due to the hatch pattern
|
||||
if( aZone->GetFillMode() == ZONE_FILL_MODE::HATCH_PATTERN )
|
||||
|
@ -1675,7 +1675,7 @@ bool ZONE_FILLER::fillNonCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer,
|
|||
|
||||
// Re-inflate after pruning of areas that don't meet minimum-width criteria
|
||||
if( half_min_width - epsilon > epsilon )
|
||||
aFillPolys.Inflate( half_min_width - epsilon, SHAPE_POLY_SET::ROUND_ALL_CORNERS, m_maxError );
|
||||
aFillPolys.Inflate( half_min_width - epsilon, CORNER_STRATEGY::ROUND_ALL_CORNERS, m_maxError );
|
||||
|
||||
aFillPolys.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
return true;
|
||||
|
@ -2127,12 +2127,12 @@ bool ZONE_FILLER::addHatchFillTypeOnZone( const ZONE* aZone, PCB_LAYER_ID aLayer
|
|||
// account for anything beyond that.
|
||||
SHAPE_POLY_SET deflatedFilledPolys = aFillPolys.CloneDropTriangulation();
|
||||
deflatedFilledPolys.Deflate( outline_margin - aZone->GetMinThickness(),
|
||||
SHAPE_POLY_SET::CHAMFER_ALL_CORNERS, maxError );
|
||||
CORNER_STRATEGY::CHAMFER_ALL_CORNERS, maxError );
|
||||
holes.BooleanIntersection( deflatedFilledPolys, SHAPE_POLY_SET::PM_FAST );
|
||||
DUMP_POLYS_TO_COPPER_LAYER( holes, In11_Cu, wxT( "fill-clipped-hatch-holes" ) );
|
||||
|
||||
SHAPE_POLY_SET deflatedOutline = aZone->Outline()->CloneDropTriangulation();
|
||||
deflatedOutline.Deflate( outline_margin, SHAPE_POLY_SET::CHAMFER_ALL_CORNERS, maxError );
|
||||
deflatedOutline.Deflate( outline_margin, CORNER_STRATEGY::CHAMFER_ALL_CORNERS, maxError );
|
||||
holes.BooleanIntersection( deflatedOutline, SHAPE_POLY_SET::PM_FAST );
|
||||
DUMP_POLYS_TO_COPPER_LAYER( holes, In12_Cu, wxT( "outline-clipped-hatch-holes" ) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue