mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user