KiCad PCB EDA Suite
test_poly_grid_partition.cpp File Reference

Go to the source code of this file.

Classes

struct  PGPartitionFixture
 

Functions

 BOOST_AUTO_TEST_CASE (PointInside)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( PointInside  )

Definition at line 59 of file test_poly_grid_partition.cpp.

60 {
61  for( auto p : testPoints )
62  {
63  for ( auto& poly : testPolys )
64  {
65  bool fallback_in = poly.Contains( p );
66  poly.Fracture( SHAPE_POLY_SET::PM_FAST );
67  POLY_GRID_PARTITION part( poly.COutline(0), 16 );
68  bool pgp_in = part.ContainsPoint( p );
69 
70  // compare vanilla point-in-polygon with the grid partitioning.
71  BOOST_CHECK_EQUAL( fallback_in, pgp_in );
72  }
73  }
74 }
int ContainsPoint(const VECTOR2I &aP, int aClearance=0)
Class POLY_GRID_PARTITION.

References POLY_GRID_PARTITION::ContainsPoint(), and SHAPE_POLY_SET::PM_FAST.