Skip to content

Commit

Permalink
feat: add catch for property streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Feb 26, 2024
1 parent 2eb6dd3 commit 5bca000
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openbim-components",
"version": "1.4.2",
"version": "1.4.4",
"main": "src/index.js",
"author": "harry collin, antonio gonzalez viegas",
"license": "MIT",
Expand Down
26 changes: 18 additions & 8 deletions resources/openbim-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -108538,11 +108538,16 @@ class FragmentPropsStreamConverter extends Component {
count++;
// finalCount++;
const nextProperty = ids.get(i + j);
const property = this._webIfc.GetLine(0, nextProperty, isSpatial);
if (relationTypes.includes(type)) {
this.getIndices(property, nextProperty, propertyIndices);
try {
const property = this._webIfc.GetLine(0, nextProperty, isSpatial);
if (relationTypes.includes(type)) {
this.getIndices(property, nextProperty, propertyIndices);
}
data[property.expressID] = property;
}
catch (e) {
console.log(`Could not get property: ${nextProperty}`);
}
data[property.expressID] = property;
}
await this.onPropertiesStreamed.trigger({ type, data });
}
Expand All @@ -108552,11 +108557,16 @@ class FragmentPropsStreamConverter extends Component {
for (let i = count; i < idCount; i++) {
// finalCount++;
const nextProperty = ids.get(i);
const property = this._webIfc.GetLine(0, nextProperty, isSpatial);
if (relationTypes.includes(type)) {
this.getIndices(property, nextProperty, propertyIndices);
try {
const property = this._webIfc.GetLine(0, nextProperty, isSpatial);
if (relationTypes.includes(type)) {
this.getIndices(property, nextProperty, propertyIndices);
}
data[property.expressID] = property;
}
catch (e) {
console.log(`Could not get property: ${nextProperty}`);
}
data[property.expressID] = property;
}
await this.onPropertiesStreamed.trigger({ type, data });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,17 @@ export class FragmentPropsStreamConverter
// finalCount++;
const nextProperty = ids.get(i + j);

const property = this._webIfc.GetLine(0, nextProperty, isSpatial);
try {
const property = this._webIfc.GetLine(0, nextProperty, isSpatial);

if (relationTypes.includes(type)) {
this.getIndices(property, nextProperty, propertyIndices);
}
if (relationTypes.includes(type)) {
this.getIndices(property, nextProperty, propertyIndices);
}

data[property.expressID] = property;
data[property.expressID] = property;
} catch (e) {
console.log(`Could not get property: ${nextProperty}`);
}
}
await this.onPropertiesStreamed.trigger({ type, data });
}
Expand All @@ -158,14 +162,20 @@ export class FragmentPropsStreamConverter
for (let i = count; i < idCount; i++) {
// finalCount++;
const nextProperty = ids.get(i);
const property = this._webIfc.GetLine(0, nextProperty, isSpatial);

if (relationTypes.includes(type)) {
this.getIndices(property, nextProperty, propertyIndices);
}
try {
const property = this._webIfc.GetLine(0, nextProperty, isSpatial);

data[property.expressID] = property;
if (relationTypes.includes(type)) {
this.getIndices(property, nextProperty, propertyIndices);
}

data[property.expressID] = property;
} catch (e) {
console.log(`Could not get property: ${nextProperty}`);
}
}

await this.onPropertiesStreamed.trigger({ type, data });
}

Expand Down
1 change: 0 additions & 1 deletion src/utils/GeometryUtils/bbox.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as THREE from "three";
import { ConvexHull } from "three/examples/jsm/math/ConvexHull";
import ArrayLike = jasmine.ArrayLike;

// src: https://github.com/Mugen87/yuka/blob/844b2581d29de0105336be80eb2fe4cc8dca4ede/src/math/OBB.js#L409-L597

Expand Down

0 comments on commit 5bca000

Please sign in to comment.