32 return mergedPolygons;
42 bool needsFlashOffset =
false;
44 if( item->m_ShapeAsPolygon.OutlineCount() > 0 )
46 itemPoly = item->m_ShapeAsPolygon;
50 D_CODE* dcode = item->GetDcodeDescr();
60 item->ConvertSegmentToPolygon( &itemPoly );
63 else if( item->m_ShapeType ==
GBR_ARC )
65 item->ConvertSegmentToPolygon( &itemPoly );
67 else if( item->m_Flashed )
69 D_CODE* dcode = item->GetDcodeDescr();
75 needsFlashOffset =
true;
86 SHAPE_POLY_SET& dest = item->GetLayerPolarity() ? negativePolygons : positivePolygons;
93 for(
int j = 0; j < outline.
PointCount(); j++ )
94 dest.
Append( item->GetABPosition( outline.
CPoint( j ) + offset ) );
96 for(
int h = 0; h < itemPoly.
HoleCount( i ); h++ )
102 dest.
Append( item->GetABPosition( hole.
CPoint( j ) + offset ) );
116 mergedPolygons = std::move( positivePolygons );
121 return mergedPolygons;
constexpr EDA_IU_SCALE gerbIUScale
constexpr double ARC_LOW_DEF_MM
A gerber DCODE (also called Aperture) definition.
APERTURE_T m_ApertType
Aperture type ( Line, rectangle, circle, oval poly, macro )
void ConvertShapeToPolygon(const GERBER_DRAW_ITEM *aParent)
Convert a shape to an equivalent polygon.
Hold the image data and parameters for one gerber file and layer parameters.
GERBER_DRAW_ITEMS & GetItems()
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
Represent a set of closed polygons.
void Inflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError, bool aSimplify=false)
Perform outline inflation/deflation.
int HoleCount(int aOutline) const
Returns the number of holes in a given outline.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
void Simplify()
Simplify the polyset (merges overlapping polys, eliminates degeneracy/self-intersections)
int NewOutline()
Creates a new empty polygon in the set and returns its index.
int NewHole(int aOutline=-1)
Creates a new hole in a given outline.
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
int OutlineCount() const
Return the number of outlines in the set.
void BooleanSubtract(const SHAPE_POLY_SET &b)
Perform boolean polyset difference.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
void TransformOvalToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a oblong shape to a polygon, using multiple segments.
@ ROUND_ALL_CORNERS
All angles are rounded.
SHAPE_POLY_SET ConvertGerberToPolySet(GERBER_FILE_IMAGE *aImage, int aTolerance)
Convert a GERBER_FILE_IMAGE to a merged SHAPE_POLY_SET.
VECTOR2< int32_t > VECTOR2I