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
71int ConvertArcToPolyline( SHAPE_LINE_CHAIN& aPolyline, const VECTOR2I& aStart,
72 const VECTOR2I& aMid, const VECTOR2I& aEnd, double aAccuracy,
73 ERROR_LOC aErrorLoc, double aRadialOffset = 0.0 );
74
75
87void TransformCircleToPolygon( SHAPE_LINE_CHAIN& aBuffer, const VECTOR2I& aCenter, int aRadius,
88 int aError, ERROR_LOC aErrorLoc, int aMinSegCount = 0 );
89
101void TransformCircleToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aCenter, int aRadius,
102 int aError, ERROR_LOC aErrorLoc, int aMinSegCount = 0 );
103
104
122void TransformOvalToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aStart, const VECTOR2I& aEnd,
123 int aWidth, int aError, ERROR_LOC aErrorLoc, int aMinSegCount = 0 );
124
139void TransformTrapezoidToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aPosition,
140 const VECTOR2I& aSize, const EDA_ANGLE& aRotation, int aDeltaX,
141 int aDeltaY, int aInflate, int aError, ERROR_LOC aErrorLoc );
142
166void TransformRoundChamferedRectToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aPosition,
167 const VECTOR2I& aSize, const EDA_ANGLE& aRotation,
168 int aCornerRadius, double aChamferRatio,
169 int aChamferCorners, int aInflate, int aError,
170 ERROR_LOC aErrorLoc );
171
183void TransformArcToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aStart, const VECTOR2I& aMid,
184 const VECTOR2I& aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc );
185
196void TransformRingToPolygon( SHAPE_POLY_SET& aBuffer, const VECTOR2I& aCentre, int aRadius,
197 int aWidth, int aError, ERROR_LOC aErrorLoc );
198
199#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:683