48 }
else if( nPoints == 1) {
53 }
else if(nPoints == 2) {
83 for(
unsigned int i=0; i<nPoints; ++i) {
93 calipers[0].
m_idx = 0;
103 for(
unsigned int i=1; i<nPoints; ++i) {
123 unsigned int currIdx = c.
m_idx;
131 while(!found && i < nPoints) {
133 currIdx = (currIdx + 1) % nPoints;
140 if( nextAngle > currAngle ) {
142 found = (currAngle < matchAngle && matchAngle <= nextAngle);
149 found = (std::abs(currAngle-nextAngle)>1e-10) && (currAngle < matchAngle || matchAngle <= nextAngle);
152 currAngle = nextAngle;
161 std::stringstream ss;
162 for(
auto & a :
m_angles){ ss << a <<
",";}
164 << matchAngle <<
"in angles: " << ss.str());
169 using namespace PointFunctions;
172 m_p.col(c[1].m_ptIdx), c[1].m_currAngle);
175 m_p.col(c[2].m_ptIdx), c[2].m_currAngle);
179 m_p.col(c[3].m_ptIdx), c[3].m_currAngle);
#define ApproxMVBB_ASSERTMSG(condition, message)
An Assert Macro to use within C++ code.
Vector2 m_p
first corner x = m_p0 + m_u*m_uL * u + m_v*m_vL * v , u,v in [0,1]
These are some container definitions.
#define ApproxMVBB_ERRORMSG(message)
Vector2 m_u
vector of first side (x-Axis) (normalized)
void findVertex(Caliper &c)
void updateCalipers(PREC edgeAngle, Caliper(&c)[4])
void getBox(Caliper(&c)[4], Box2d &box)
Vector2 intersectLines(const VecT1 &p1, PREC ang1, const VecT2 &p2, PREC ang2, PREC eps=1e-10)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW void reset()
std::vector< PREC > m_angles
std::vector< unsigned int > & getIndices()
const MatrixRef< const Matrix2Dyn > m_p
Vector2 m_v
vector of second side (y-Axis) (normalized)
PREC getAngle(const VecT1 &a, const VecT2 &b)
std::vector< unsigned int > m_hullIdx