| 497 | const auto closeDistance = ai_epsilon; |
| 498 | |
| 499 | bool areClose(Schema_2x3::IfcCartesianPoint pt1,Schema_2x3::IfcCartesianPoint pt2) { |
| 500 | if(pt1.Coordinates.size() != pt2.Coordinates.size()) { |
| 501 | IFCImporter::LogWarn("unable to compare differently-dimensioned points"); |
| 502 | return false; |
| 503 | } |
| 504 | auto coord1 = pt1.Coordinates.begin(); |
| 505 | auto coord2 = pt2.Coordinates.begin(); |
| 506 | // we're just testing each dimension separately rather than doing euclidean distance, as we're |
| 507 | // looking for very close coordinates |
| 508 | for(; coord1 != pt1.Coordinates.end(); coord1++,coord2++) { |
| 509 | if(std::fabs(*coord1 - *coord2) > closeDistance) { |
| 510 | return false; |
| 511 | } |
| 512 | } |
| 513 | return true; |
| 514 | } |
| 515 | |
| 516 | bool areClose(IfcVector3 pt1,IfcVector3 pt2) { |
| 517 | return (std::fabs(pt1.x - pt2.x) < closeDistance && |
no test coverage detected