KiCad PCB EDA Suite
Loading...
Searching...
No Matches
arc_construction.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <math/vector2d.h>
23
31namespace KIGEOM
32{
33
43
44
46VECTOR2I ProjectToChordBisector( const VECTOR2I& aStart, const VECTOR2I& aEnd, const VECTOR2I& aCursor );
47
48
50ARC_SOLUTION ArcThroughPoints( const VECTOR2I& aStart, const VECTOR2I& aOnArc, const VECTOR2I& aEnd );
51
52
58ARC_SOLUTION ArcFromStartEndMidDrag( const VECTOR2I& aStart, const VECTOR2I& aEnd, const VECTOR2I& aCursor );
59
60
67ARC_SOLUTION ArcFromStartEndCenterDrag( const VECTOR2I& aStart, const VECTOR2I& aEnd, const VECTOR2I& aCursor,
68 bool aMajor );
69
70
76ARC_SOLUTION ArcFromStartTangentEnd( const VECTOR2I& aStart, const VECTOR2D& aTangent, const VECTOR2I& aEnd );
77
78} // namespace KIGEOM
Construction helpers for the interactive arc drawing modes.
ARC_SOLUTION ArcFromStartEndCenterDrag(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCursor, bool aMajor)
Arc from aStart to aEnd centered on aCursor projected onto the chord bisector.
VECTOR2I ProjectToChordBisector(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCursor)
Project aCursor onto the perpendicular bisector of the chord aStart - aEnd.
ARC_SOLUTION ArcFromStartTangentEnd(const VECTOR2I &aStart, const VECTOR2D &aTangent, const VECTOR2I &aEnd)
Arc leaving aStart along aTangent and ending at aEnd.
ARC_SOLUTION ArcFromStartEndMidDrag(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCursor)
Arc from aStart to aEnd whose midpoint is aCursor projected onto the chord bisector.
ARC_SOLUTION ArcThroughPoints(const VECTOR2I &aStart, const VECTOR2I &aOnArc, const VECTOR2I &aEnd)
Arc from aStart to aEnd that passes through aOnArc.
bool valid
False for degenerate input (collinear points, zero chord, etc)
VECTOR2I mid
The point on the arc halfway along the sweep.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708
VECTOR2< double > VECTOR2D
Definition vector2d.h:707