diff --git a/src/blenderbim/Makefile b/src/blenderbim/Makefile index f6ce39e6af..7277fa9446 100644 --- a/src/blenderbim/Makefile +++ b/src/blenderbim/Makefile @@ -21,6 +21,7 @@ BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/linux-64/boost endif ASSIMP_URL:=https://anaconda.org/conda-forge/assimp/5.0.1/download/linux-64/assimp-5.0.1-hedfc422_6.tar.bz2 OCTOMAP_URL:=https://anaconda.org/conda-forge/octomap/1.9.7/download/linux-64/octomap-1.9.7-h4bd325d_0.tar.bz2 +ZLIB_URL:=https://anaconda.org/conda-forge/zlib/1.2.11/download/linux-64/zlib-1.2.11-h516909a_1010.tar.bz2 endif ifeq ($(PLATFORM), macos) @@ -36,6 +37,7 @@ BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/osx-64/boost-1 endif ASSIMP_URL:=https://anaconda.org/conda-forge/assimp/5.0.1/download/osx-64/assimp-5.0.1-h1224e73_6.tar.bz2 OCTOMAP_URL:=https://anaconda.org/conda-forge/octomap/1.9.7/download/osx-64/octomap-1.9.7-h940c156_0.tar.bz2 +ZLIB_URL:=https://anaconda.org/conda-forge/zlib/1.2.11/download/osx-64/zlib-1.2.11-h7795811_1010.tar.bz2 endif ifeq ($(PLATFORM), win) @@ -51,6 +53,7 @@ BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/win-64/boost-1 endif ASSIMP_URL:=https://anaconda.org/conda-forge/assimp/5.0.1/download/win-64/assimp-5.0.1-hc2aa0de_6.tar.bz2 OCTOMAP_URL:=https://anaconda.org/conda-forge/octomap/1.9.7/download/win-64/octomap-1.9.7-h5362a0b_0.tar.bz2 +ZLIB_URL:=https://anaconda.org/conda-forge/zlib/1.2.11/download/win-64/zlib-1.2.11-h62dcd97_1010.tar.bz2 endif .PHONY: dist @@ -229,15 +232,16 @@ endif mkdir dist/working cd dist/working && wget $(HPPFCL_URL) cd dist/working && tar -xf hpp-fcl* - cp -r dist/working/lib/$(PYLIBDIR)/site-packages/hppfcl dist/blenderbim/libs/site/packages/ ifeq ($(PLATFORM), linux) + cp -r dist/working/lib/$(PYLIBDIR)/site-packages/hppfcl dist/blenderbim/libs/site/packages/ cp -r dist/working/lib/*.so* dist/blenderbim/libs/ endif ifeq ($(PLATFORM), macos) + cp -r dist/working/lib/$(PYLIBDIR)/site-packages/hppfcl dist/blenderbim/libs/site/packages/ cp -r dist/working/lib/*.dylib dist/blenderbim/libs/ endif ifeq ($(PLATFORM), win) - cp -r dist/working/Library/lib/*.lib dist/blenderbim/libs/site/packages/hppfcl/ + cp -r dist/working/Lib/site-packages/hppfcl dist/blenderbim/libs/site/packages/ cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/ endif rm -rf dist/working @@ -253,7 +257,6 @@ ifeq ($(PLATFORM), macos) cp -r dist/working/lib/*.dylib dist/blenderbim/libs/ endif ifeq ($(PLATFORM), win) - cp -r dist/working/Library/bin/*.lib dist/blenderbim/libs/site/packages/hppfcl/ cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/ endif rm -rf dist/working @@ -269,7 +272,6 @@ ifeq ($(PLATFORM), macos) cp -r dist/working/lib/*.dylib dist/blenderbim/libs/ endif ifeq ($(PLATFORM), win) - cp -r dist/working/Library/bin/*.lib dist/blenderbim/libs/site/packages/hppfcl/ cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/ endif rm -rf dist/working @@ -285,8 +287,7 @@ ifeq ($(PLATFORM), macos) cp -r dist/working/lib/*.dylib dist/blenderbim/libs/ endif ifeq ($(PLATFORM), win) - cp -r dist/working/Library/bin/*.lib dist/blenderbim/libs/site/packages/hppfcl/ - cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/ + # Uh, do nothing, apparently? No DLLs are shipped. endif rm -rf dist/working @@ -301,7 +302,21 @@ ifeq ($(PLATFORM), macos) cp -r dist/working/lib/*.dylib dist/blenderbim/libs/ endif ifeq ($(PLATFORM), win) - cp -r dist/working/Library/bin/*.lib dist/blenderbim/libs/site/packages/hppfcl/ + cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/ +endif + rm -rf dist/working + + # Required by hpp-fcl + mkdir dist/working + cd dist/working && wget $(ZLIB_URL) + cd dist/working && tar -xf zlib* +ifeq ($(PLATFORM), linux) + cp -r dist/working/lib/*.so* dist/blenderbim/libs/ +endif +ifeq ($(PLATFORM), macos) + cp -r dist/working/lib/*.dylib dist/blenderbim/libs/ +endif +ifeq ($(PLATFORM), win) cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/ endif rm -rf dist/working diff --git a/src/blenderbim/blenderbim/bim/module/root/operator.py b/src/blenderbim/blenderbim/bim/module/root/operator.py index f67b472151..d0a5910a84 100644 --- a/src/blenderbim/blenderbim/bim/module/root/operator.py +++ b/src/blenderbim/blenderbim/bim/module/root/operator.py @@ -287,7 +287,7 @@ class CopyClass(bpy.types.Operator): bpy.ops.bim.assign_type(relating_type=relating_type.id(), related_object=obj.name) else: bpy.ops.bim.add_representation(obj=obj.name) - if result.is_a("IfcSpatialElement") or element.is_a("IfcSpatialStructureElement"): + if result.is_a("IfcSpatialElement") or result.is_a("IfcSpatialStructureElement"): self.place_in_spatial_collection(old_element, obj) return {"FINISHED"} diff --git a/src/blenderbim/blenderbim/libs/site/packages/hppfcl.pth b/src/blenderbim/blenderbim/libs/site/packages/hppfcl.pth new file mode 100644 index 0000000000..c0d165217a --- /dev/null +++ b/src/blenderbim/blenderbim/libs/site/packages/hppfcl.pth @@ -0,0 +1,3 @@ +# expose hppfcl as site-package + +hppfcl diff --git a/src/ifcclash/ifcclash/collider.py b/src/ifcclash/ifcclash/collider.py index a2fd0314d4..b04dc3a9f7 100644 --- a/src/ifcclash/ifcclash/collider.py +++ b/src/ifcclash/ifcclash/collider.py @@ -82,7 +82,7 @@ class Collider: mesh_faces = [(int(f[i]), int(f[i + 1]), int(f[i + 2])) for i in range(0, len(f), 3)] bvh = hppfcl.BVHModelOBB() - bvh.beginModel(num_tris=len(mesh.faces), num_vertices=len(mesh_verts)) + bvh.beginModel(len(mesh_faces), len(mesh_verts)) vertices = hppfcl.StdVec_Vec3f() [vertices.append(v) for v in mesh_verts] triangles = hppfcl.StdVec_Triangle() diff --git a/src/ifcclash/ifcclash/ifcclash.py b/src/ifcclash/ifcclash/ifcclash.py index c966311213..89baee1b5b 100644 --- a/src/ifcclash/ifcclash/ifcclash.py +++ b/src/ifcclash/ifcclash/ifcclash.py @@ -155,14 +155,14 @@ class Clasher: return np.linalg.inv(look_at_transform) def export_json(self): - results = self.clash_sets.copy() - for result in results: - for ab in ["a", "b"]: - for data in result[ab]: - if "ifc" in data: - del data["ifc"] + clash_sets = self.clash_sets.copy() + for clash_set in clash_sets: + for source in clash_set["a"]: + del source["ifc"] + for source in clash_set.get("b", []): + del source["ifc"] with open(self.settings.output, "w", encoding="utf-8") as clashes_file: - json.dump(results, clashes_file, indent=4) + json.dump(clash_sets, clashes_file, indent=4) def get_element(self, clash_set, global_id): for source in clash_set: