From 91517a9dd15b363dbcaa5e43ade08ea680008cc6 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 6 Aug 2020 16:02:24 +0200 Subject: [PATCH] consider extrusion matrix in taxonomy::item::less --- src/ifcgeom/taxonomy.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ifcgeom/taxonomy.cpp b/src/ifcgeom/taxonomy.cpp index 4d8043e7a8..3457068a7c 100644 --- a/src/ifcgeom/taxonomy.cpp +++ b/src/ifcgeom/taxonomy.cpp @@ -89,15 +89,20 @@ namespace { } bool compare(const extrusion& a, const extrusion& b) { - // @todo extrusions can also have non-identity matrices right? perhaps it's time - // for a dedicated transform node and not on the abstract geom_item. const int order[3] = { less_to_order(a.basis, b.basis), less_to_order(a.direction, b.direction), a.depth < b.depth ? -1 : (a.depth == b.depth ? 0 : 1) }; + // find the first non-zero integer. auto it = std::find_if(std::begin(order), std::end(order), [](int x) { return x; }); - if (it == std::end(order)) return false; + if (it == std::end(order)) { + // extrusions can have non-identity matrices + // + // @todo perhaps it's time for a dedicated transform + // node and not on the abstract geom_item. + return compare(a.matrix, b.matrix); + } return *it == -1; }