MCPcopy Create free account
hub / github.com/assimp/assimp / areClose

Function areClose

code/AssetLib/IFC/IFCGeometry.cpp:499–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497const auto closeDistance = ai_epsilon;
498
499bool 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
516bool areClose(IfcVector3 pt1,IfcVector3 pt2) {
517 return (std::fabs(pt1.x - pt2.x) < closeDistance &&

Callers 1

ProcessExtrudedAreaFunction · 0.85

Calls 3

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected