KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_target3001_arc.cpp
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 modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * 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
21
23
24
25static double sweep( float aStart, float aEnd )
26{
28 arc.startAngle = aStart;
29 arc.endAngle = aEnd;
30 return arc.Sweep();
31}
32
33
34BOOST_AUTO_TEST_SUITE( Target3001Arc )
35
36
37BOOST_AUTO_TEST_CASE( SweepStaysWithinOneTurn )
38{
39 BOOST_CHECK_CLOSE( sweep( 10.0f, 400.0f ), 30.0, 1e-9 );
40
41 double huge = sweep( 0.0f, 1e30f );
42
43 BOOST_CHECK( huge > 0.0 && huge <= 360.0 );
44}
45
46
Stroked arc or circle. The base position is the start point.
double Sweep() const
Counter-clockwise sweep in (0, 360]; equal angles give a full circle.
float startAngle
degrees, counter-clockwise from +X
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
static double sweep(float aStart, float aEnd)