33#include "../../../3d_fastmath.h"
89 return INTERSECTION_RESULT::MISSES;
92 return INTERSECTION_RESULT::MISSES;
106 if( 0.0f > a || a > 1.0f )
112 if( 0.0f > b || b > 1.0f )
115 const float c = 1.0f - a - b;
117 return 0.0f <= c && c <= 1.0f;
122 float aBiuTo3dUnitsScale,
const BOARD_ITEM& aBoardItem )
128 const_cast<SHAPE_POLY_SET&
>( aPolyList ).CacheTriangulation(
false );
129 const double conver_d = (double)aBiuTo3dUnitsScale;
140 SFVEC2F( b.
x * conver_d, -b.
y * conver_d ),
141 SFVEC2F( c.
x * conver_d, -c.
y * conver_d ),
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void Add(OBJECT_2D *aObject)
size_t GetTriangleCount() const
void GetTriangle(int index, VECTOR2I &a, VECTOR2I &b, VECTOR2I &c) const
Represent a set of closed polygons.
const TRIANGULATED_POLYGON * TriangulatedPolygon(int aIndex) const
unsigned int TriangulatedPolyCount() const
Return the number of triangulated polygons.
bool Intersect(const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut) const override
INTERSECTION_RESULT IsBBoxInside(const BBOX_2D &aBBox) const override
Test this object if it's completely outside, intersects, or is completely inside aBBox.
bool Overlaps(const BBOX_2D &aBBox) const override
Test if the box overlaps the object.
TRIANGLE_2D(const SFVEC2F &aV1, const SFVEC2F &aV2, const SFVEC2F &aV3, const BOARD_ITEM &aBoardItem)
bool Intersects(const BBOX_2D &aBBox) const override
a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
bool IsPointInside(const SFVEC2F &aPoint) const override
Manage a bounding box defined by two SFVEC2F min max points.
SFVEC2F GetCenter() const
bool Intersects(const BBOX_2D &aBBox) const
Test if a bounding box intersects this box.
void Union(const SFVEC2F &aPoint)
Recalculate the bounding box adding a point.
bool IsInitialized() const
Check if this bounding box is already initialized.
void Reset()
Reset the bounding box to zero and uninitialize it.
void ScaleNextUp()
Scale a bounding box to the next float representation making it larger.
void ConvertPolygonToTriangles(const SHAPE_POLY_SET &aPolyList, CONTAINER_2D_BASE &aDstContainer, float aBiuTo3dUnitsScale, const BOARD_ITEM &aBoardItem)