KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_fillet.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <qa_utils/geometry/line_chain_construction.h>
#include <geometry/shape_poly_set.h>
#include <geometry/shape_line_chain.h>
#include <algorithm>
#include "geom_test_utils.h"

Go to the source code of this file.

Classes

struct  FilletFixture
 
struct  SquareFilletTestCase
 

Functions

void TestFilletSegmentConstraints (const SEG &aSeg, VECTOR2I aRadCentre, int aRadius, int aError)
 Declares the FilletFixture struct as the boost test fixture.
 
void TestSquareFillet (int aSquareSize, int aRadius, int aError)
 : Create a square, fillet it, and check a corner for correctness
 
void TestConcaveSquareFillet (int aSquareSize, int aRadius, int aError)
 : Create a square concave corner, fillet and check correctness
 
 BOOST_AUTO_TEST_CASE (SquareFillet)
 Tests the SHAPE_POLY_SET::FilletPolygon method against certain geometric constraints.
 
 BOOST_AUTO_TEST_CASE (SquareConcaveFillet)
 

Variables

const std::vector< SquareFilletTestCasesquareFilletCases
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( SquareConcaveFillet  )

Definition at line 202 of file test_fillet.cpp.

References squareFilletCases, and TestConcaveSquareFillet().

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( SquareFillet  )

Tests the SHAPE_POLY_SET::FilletPolygon method against certain geometric constraints.

Definition at line 194 of file test_fillet.cpp.

References squareFilletCases, and TestSquareFillet().

◆ TestConcaveSquareFillet()

void TestConcaveSquareFillet ( int  aSquareSize,
int  aRadius,
int  aError 
)

◆ TestFilletSegmentConstraints()

void TestFilletSegmentConstraints ( const SEG aSeg,
VECTOR2I  aRadCentre,
int  aRadius,
int  aError 
)

Declares the FilletFixture struct as the boost test fixture.

Definition at line 53 of file test_fillet.cpp.

References ANGLE_90.

Referenced by TestConcaveSquareFillet(), and TestSquareFillet().

◆ TestSquareFillet()

void TestSquareFillet ( int  aSquareSize,
int  aRadius,
int  aError 
)

: Create a square, fillet it, and check a corner for correctness

Definition at line 80 of file test_fillet.cpp.

References SHAPE_POLY_SET::AddOutline(), KI_TEST::BuildSquareChain(), SHAPE_POLY_SET::IterateSegments(), SHAPE_POLY_SET::OutlineCount(), and TestFilletSegmentConstraints().

Referenced by BOOST_AUTO_TEST_CASE().

Variable Documentation

◆ squareFilletCases

const std::vector<SquareFilletTestCase> squareFilletCases
Initial value:
{
{ 1000, 120, 10 },
{ 1000, 10, 1 },
{ 1000, 10, 5 },
{ 70000, 1000, 1 },
}

Definition at line 179 of file test_fillet.cpp.

Referenced by BOOST_AUTO_TEST_CASE().