KiCad PCB EDA Suite
Loading...
Searching...
No Matches
convert_basic_shapes_to_polygon.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef CONVERT_BASIC_SHAPES_TO_POLYGON_H
22#define CONVERT_BASIC_SHAPES_TO_POLYGON_H
23
26
27
28// The chamfer positions of chamfered rect shape.
29// the position is relative to a pad with orientation = 0
30// we can have 1 to 4 chamfered corners (0 corner = roundrect)
31// The position list is the OR of corner to chamfer
44
45
57int ConvertArcToPolyline( SHAPE_LINE_CHAIN& aPolyline, VECTOR2I aCenter, int aRadius,
58 const EDA_ANGLE& aStartAngleDeg, const EDA_ANGLE& aArcAngleDeg,
59 double aAccuracy, ERROR_LOC aErrorLoc );
60
72int ConvertArcToPolyline( SHAPE_LINE_CHAIN& aPolyline, const VECTOR2I& aStart,
73 const VECTOR2I& aMid, const VECTOR2I& aEnd, double aAccuracy,
74 ERROR_LOC aErrorLoc, double aRadialOffset = 0.0 );
75
76
88void TransformCircleToPolygon( SHAPE_LINE_CHAIN& aBuffer, const VECTOR2I& aCenter, int aRadius,
89 int aError, ERROR_LOC aErrorLoc, int aMinSegCount = 0 );
90
102void TransformCircleToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aCenter, int aRadius,
103 int aError, ERROR_LOC aErrorLoc, int aMinSegCount = 0 );
104
105
123void TransformOvalToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aStart, const VECTOR2I& aEnd,
124 int aWidth, int aError, ERROR_LOC aErrorLoc, int aMinSegCount = 0 );
125
141void TransformTrapezoidToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aPosition,
142 const VECTOR2I& aSize, const EDA_ANGLE& aRotation, int aDeltaX,
143 int aDeltaY, int aInflate, int aError, ERROR_LOC aErrorLoc );
144
168void TransformRoundChamferedRectToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aPosition,
169 const VECTOR2I& aSize, const EDA_ANGLE& aRotation,
170 int aCornerRadius, double aChamferRatio,
171 int aChamferCorners, int aInflate, int aError,
172 ERROR_LOC aErrorLoc );
173
185void TransformArcToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aStart, const VECTOR2I& aMid,
186 const VECTOR2I& aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc );
187
198void TransformRingToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aCentre, int aRadius,
199 int aWidth, int aError, ERROR_LOC aErrorLoc );
200
201#endif // CONVERT_BASIC_SHAPES_TO_POLYGON_H
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
void TransformRingToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aCentre, int aRadius, int aWidth, int aError, ERROR_LOC aErrorLoc)
Convert arcs to multiple straight segments.
int ConvertArcToPolyline(SHAPE_LINE_CHAIN &aPolyline, VECTOR2I aCenter, int aRadius, const EDA_ANGLE &aStartAngleDeg, const EDA_ANGLE &aArcAngleDeg, double aAccuracy, ERROR_LOC aErrorLoc)
Generate a polyline to approximate a arc.
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aBuffer, const VECTOR2I &aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a circle to a polygon, using multiple straight lines.
void TransformArcToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc)
Convert arc to multiple straight segments.
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aPosition, const VECTOR2I &aSize, const EDA_ANGLE &aRotation, int aCornerRadius, double aChamferRatio, int aChamferCorners, int aInflate, int aError, ERROR_LOC aErrorLoc)
Convert a rectangle with rounded corners and/or chamfered corners to a polygon.
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.
void TransformTrapezoidToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aPosition, const VECTOR2I &aSize, const EDA_ANGLE &aRotation, int aDeltaX, int aDeltaY, int aInflate, int aError, ERROR_LOC aErrorLoc)
Convert a rectangle or trapezoid to a polygon.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708