Replace Vector3D ==/!= with difference < Precision::Confusion()
This commit is contained in:
parent
e9b5722220
commit
306ad7fcee
|
@ -479,7 +479,7 @@ std::string edgeSortItem::dump(void)
|
|||
/*static*/bool edgeSortItem::edgeLess(const edgeSortItem& e1, const edgeSortItem& e2)
|
||||
{
|
||||
bool result = false;
|
||||
if (e1.start != e2.start) {
|
||||
if ((e1.start - e2.start).Length() < Precision::Confusion()) {
|
||||
if ( DrawUtil::vectorLess(e1.start, e2.start)) {
|
||||
result = true;
|
||||
}
|
||||
|
@ -501,8 +501,11 @@ std::string edgeSortItem::dump(void)
|
|||
/*static*/bool edgeSortItem::edgeEqual(const edgeSortItem& e1, const edgeSortItem& e2)
|
||||
{
|
||||
bool result = false;
|
||||
if ( (e1.start == e2.start) &&
|
||||
(e1.end == e2.end) &&
|
||||
double startDif = (e1.start - e2.start).Length();
|
||||
double endDif = (e1.end - e2.end).Length();
|
||||
|
||||
if ( (startDif < Precision::Confusion()) &&
|
||||
(endDif < Precision::Confusion()) &&
|
||||
(DrawUtil::fpCompare(e1.startAngle,e2.startAngle)) &&
|
||||
(DrawUtil::fpCompare(e1.endAngle,e2.endAngle)) ) {
|
||||
result = true;
|
||||
|
|
|
@ -281,7 +281,7 @@ std::string DrawUtil::formatVector(const Base::Vector3d& v)
|
|||
bool DrawUtil::vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2)
|
||||
{
|
||||
bool result = false;
|
||||
if (v1 != v2) {
|
||||
if ((v1 - v2).Length() > Precision::Confusion()) { //ie v1 != v2
|
||||
if (!DrawUtil::fpCompare(v1.x,v2.x)) {
|
||||
result = v1.x < v2.x;
|
||||
} else if (!DrawUtil::fpCompare(v1.y,v2.y)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user