24#include <boost/test/unit_test.hpp>
47int circlePrimitiveSegmentCount(
double aDiameterMm )
61 pushValue( prim, 1.0 );
62 pushValue( prim, aDiameterMm );
63 pushValue( prim, 0.0 );
64 pushValue( prim, 0.0 );
67 prim.ConvertBasicShapeToPolygon( ¯o, buffer );
81 int smallCount = circlePrimitiveSegmentCount( 0.2 );
82 int largeCount = circlePrimitiveSegmentCount( 20.0 );
85 BOOST_CHECK_GT( largeCount, smallCount );
89 BOOST_CHECK_GE( smallCount, 8 );
110 D_CODE* dcode =
image.GetDCODEOrCreate( 10,
true );
117 emptyMacro.
m_AmName = wxT(
"EMPTY_TEST_MACRO" );
143 for(
const char*
name : {
"BrokenCircle",
"BrokenOutline" } )
149 BOOST_CHECK(
image.FindApertureMacro( lookup ) ==
nullptr );
154 BOOST_REQUIRE_EQUAL(
image.GetItems().size(), 2u );
Hold a parameter value for an "aperture macro" as defined within standard RS274X.
void PushOperator(parm_item_type aType, double aValue)
Add an operator/operand to the current stack.
An aperture macro primitive as given in gerber layer format doc.
AM_PARAMS m_Params
A sequence of parameters used by the primitive.
Support the "aperture macro" defined within standard RS274X.
wxString m_AmName
The name of the aperture macro as defined like AMVB_RECTANGLE* (name is VB_RECTANGLE)
SHAPE_POLY_SET * GetApertureMacroShape(const GERBER_DRAW_ITEM *aParent, const VECTOR2I &aShapePos)
Calculate the primitive shape for flashed items.
A gerber DCODE (also called Aperture) definition.
void SetMacro(APERTURE_MACRO *aMacro)
APERTURE_T m_ApertType
Aperture type ( Line, rectangle, circle, oval poly, macro )
void ConvertShapeToPolygon(const GERBER_DRAW_ITEM *aParent)
Convert a shape to an equivalent polygon.
GBR_BASIC_SHAPE_TYPE m_ShapeType
Hold the image data and parameters for one gerber file and layer parameters.
int PointCount() const
Return the number of points (vertices) in this line chain.
Represent a set of closed polygons.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int OutlineCount() const
Return the number of outlines in the set.
std::string GetTestDataRootDir()
BOOST_AUTO_TEST_CASE(CirclePrimitiveTessellationScalesWithSize)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST_CONTEXT("Test Clearance")
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I