Add tolerance parm to checkParallel

This commit is contained in:
WandererFan
2017-06-13 10:31:10 -04:00
committed by wmayer
parent ed73fb6e72
commit f53a3bde8f
2 changed files with 3 additions and 3 deletions

View File

@@ -319,12 +319,12 @@ Base::Vector3d DrawUtil::toR3(const gp_Ax2 fromSystem, const Base::Vector3d from
}
//! check if two vectors are parallel
bool DrawUtil::checkParallel(const Base::Vector3d v1, Base::Vector3d v2)
bool DrawUtil::checkParallel(const Base::Vector3d v1, Base::Vector3d v2, double tolerance)
{
bool result = false;
double dot = fabs(v1.Dot(v2));
double mag = v1.Length() * v2.Length();
if (DrawUtil::fpCompare(dot,mag)) {
if (DrawUtil::fpCompare(dot,mag,tolerance)) {
result = true;
}
return result;