Skip to content
Snippets Groups Projects
Commit 751a1cb5 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[GL] Remove unused Triangle::contiansPoint2D().

parent 3eeeb6c3
No related branches found
No related tags found
No related merge requests found
......@@ -34,31 +34,6 @@ bool Triangle::containsPoint(MathLib::Point3d const& q, double eps) const
return MathLib::isPointInTriangle(q, a, b, c, eps);
}
bool Triangle::containsPoint2D (Point const& pnt) const
{
GeoLib::Point const& a (*(_pnts[_pnt_ids[0]]));
GeoLib::Point const& b (*(_pnts[_pnt_ids[1]]));
GeoLib::Point const& c (*(_pnts[_pnt_ids[2]]));
// criterion: p-a = u0 * (b-a) + u1 * (c-a); 0 <= u0, u1 <= 1, u0+u1 <= 1
Eigen::Matrix2d mat;
mat(0,0) = b[0] - a[0];
mat(0,1) = c[0] - a[0];
mat(1,0) = b[1] - a[1];
mat(1,1) = c[1] - a[1];
Eigen::Vector2d y;
y << pnt[0]-a[0], pnt[1]-a[1];
y = mat.partialPivLu().solve(y);
const double delta (std::numeric_limits<double>::epsilon());
const double upper (1+delta);
// check if u0 and u1 fulfills the condition (with some delta)
return -delta <= y[0] && y[0] <= upper && -delta <= y[1] && y[1] <= upper &&
y[0] + y[1] <= upper;
}
void getPlaneCoefficients(Triangle const& tri, double c[3])
{
GeoLib::Point const& p0 (*(tri.getPoint(0)));
......
......@@ -62,14 +62,6 @@ public:
MathLib::Point3d const& q,
double eps = std::numeric_limits<float>::epsilon()) const;
/**
* projects the triangle points to the x-y-plane and
* checks if point pnt is contained into the triangle
* @param pnt the point to test for
* @return true, if the point is into the projected triangle
*/
bool containsPoint2D(Point const& pnt) const;
private:
/// a vector of pointers to points the triangle is based on
std::vector<Point*> const& _pnts;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment