Commit bdd8f3fa authored by kraus's avatar kraus
Browse files

fix polygon for case when rotated

parent f0af5788
......@@ -345,9 +345,11 @@ namespace mslang {
}
bool Triangle::isInside(const Vector_t &R) const {
bool test0 = (crossProduct(R, 0) <= 0.0);
bool test1 = (crossProduct(R, 1) <= 0.0);
bool test2 = (crossProduct(R, 2) <= 0.0);
Vector_t X = trafo_m.transformTo(R);
bool test0 = (crossProduct(X, 0) <= 0.0);
bool test1 = (crossProduct(X, 1) <= 0.0);
bool test2 = (crossProduct(X, 2) <= 0.0);
return test0 && test1 && test2;
}
......
......@@ -192,6 +192,9 @@ namespace mslang {
virtual Base* clone() const;
virtual void writeGnuplot(std::ofstream &out) const;
virtual void computeBoundingBox();
// double crossProduct(const Vector_t &pt,
// const Vector_t &start,
// const Vector_t &end) const;
double crossProduct(const Vector_t &pt, unsigned int nodeNum) const;
virtual bool isInside(const Vector_t &R) const;
void orientNodesCCW();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment