Spatial Querying: Implementation of BVH tree for IFC files using NCollection_UBTree (#130)

* Implementation of BVH tree for IFC files using NCollection_UBTree

* Fixes for gcc and OCCT < v6.8

* Enable BVH selection by TopoDS_Shape

* Small fixes to tree

* Merge conflicted files and other changes

* Eliminate one warning (some remain) + add tree test
This commit is contained in:
Thomas Krijnen
2017-09-13 13:16:58 +02:00
committed by GitHub
parent ee16deabe5
commit 96ec925f31
10 changed files with 447 additions and 14 deletions
+8
View File
@@ -23,6 +23,7 @@ import os
import uuid
import ifcopenshell
import ifcopenshell.geom
import ifcopenshell.guid
f = ifcopenshell.open("input/acad2010_walls.ifc")
@@ -91,6 +92,13 @@ assert f[288].ConnectedTo == (rel,)
# Some operations on ifcopenshell.guid
assert len(ifcopenshell.guid.compress(uuid.uuid1().hex)) == 22
# Test the BVH tree
tree_settings = ifcopenshell.geom.settings()
tree_settings.set(tree_settings.DISABLE_OPENING_SUBTRACTIONS, True)
t = ifcopenshell.geom.tree(f, tree_settings)
# This wall is connected to two other walls
assert len(t.select_box(f[48], extend=0.1)) == 3
# Test serialization
f.write("output.ifc")
with open("output.ifc") as txt: