KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_fillet.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <boost/test/data/test_case.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  SquareFilletTestCase
 

Functions

void TestFilletSegmentConstraints (const SEG &aSeg, VECTOR2I aRadCentre, int aRadius, int aError)
 
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_DATA_TEST_CASE (SquareConcaveFillet, boost::unit_test::data::make(squareFilletCases), testCase)
 Tests the SHAPE_POLY_SET::FilletPolygon method against certain geometric constraints.
 

Variables

const std::vector< SquareFilletTestCasesquareFilletCases
 

Function Documentation

◆ BOOST_DATA_TEST_CASE()

BOOST_DATA_TEST_CASE ( SquareConcaveFillet  ,
boost::unit_test::data::make(squareFilletCases ,
testCase   
)

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

Definition at line 200 of file test_fillet.cpp.

References TestConcaveSquareFillet().

◆ TestConcaveSquareFillet()

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

◆ TestFilletSegmentConstraints()

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

Definition at line 48 of file test_fillet.cpp.

References ANGLE_90, and BOOST_CHECK_PREDICATE().

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 75 of file test_fillet.cpp.

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

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 180 of file test_fillet.cpp.