Skip to content

Commit

Permalink
fix: support empty geometries for fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Mar 6, 2024
1 parent 84d5b2e commit 082a3c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bim-fragment",
"version": "1.4.1",
"version": "1.4.2",
"description": "3D BIM Geometry API",
"main": "src/index.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion resources/fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5622,7 +5622,9 @@ let Fragment$1 = class Fragment {
this.id = this.mesh.uuid;
this.capacity = count;
this.mesh.count = 0;
BVH.apply(geometry);
if (this.mesh.geometry.index.count) {
BVH.apply(this.mesh.geometry);
}
}
dispose(disposeResources = true) {
this.clear();
Expand Down
5 changes: 4 additions & 1 deletion src/fragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export class Fragment {
this.id = this.mesh.uuid;
this.capacity = count;
this.mesh.count = 0;
BVH.apply(geometry);

if (this.mesh.geometry.index.count) {
BVH.apply(this.mesh.geometry);
}
}

dispose(disposeResources = true) {
Expand Down

0 comments on commit 082a3c2

Please sign in to comment.