Horizon
Loading...
Searching...
No Matches
pns_utils.h
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2014 CERN
5 * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6 * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef __PNS_UTILS_H
23#define __PNS_UTILS_H
24
25#include <math/vector2d.h>
26#include <math/box2.h>
27#include <geometry/shape_line_chain.h>
28#include <geometry/shape_segment.h>
29#include <geometry/shape_rect.h>
30#include <geometry/shape_simple.h>
31
32namespace PNS {
33
34constexpr int HULL_MARGIN = 10;
35
36class ITEM;
37class LINE;
38
41const SHAPE_LINE_CHAIN ArcHull( const SHAPE_ARC& aSeg, int aClearance, int aWalkaroundThickness );
42
43const SHAPE_LINE_CHAIN OctagonalHull( const VECTOR2I& aP0, const VECTOR2I& aSize,
44 int aClearance, int aChamfer );
45
46const SHAPE_LINE_CHAIN SegmentHull( const SHAPE_SEGMENT& aSeg, int aClearance,
47 int aWalkaroundThickness );
48
57const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_SIMPLE& aConvex, int aClearance );
58
59SHAPE_RECT ApproximateSegmentAsRect( const SHAPE_SEGMENT& aSeg );
60
61OPT_BOX2I ChangedArea( const ITEM* aItemA, const ITEM* aItemB );
62OPT_BOX2I ChangedArea( const LINE& aLineA, const LINE& aLineB );
63
64void HullIntersection( const SHAPE_LINE_CHAIN& hull, const SHAPE_LINE_CHAIN& line,
65 SHAPE_LINE_CHAIN::INTERSECTIONS& ips );
66
67
68}
69
70#endif // __PNS_UTILS_H
Definition shape_arc.h:36
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Definition shape_line_chain.h:81
Definition shape_rect.h:37
Definition shape_segment.h:36
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
Definition shape_simple.h:42