Skip to content

Commit

Permalink
feat(core): changes and improves IfcPropertiesIndexer to IfcRelations…
Browse files Browse the repository at this point in the history
…Indexer (#380)

* IfcPropertiesIndexer improved

* IfcPropertiesIndexer renamed to IfcRelationsIndexer to better reflect what it does

* IfcRelationsIndexer tutorial complete
  • Loading branch information
HoyosJuan authored May 6, 2024
1 parent f0decef commit bd68aa6
Show file tree
Hide file tree
Showing 8 changed files with 480 additions and 238 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,20 +238,20 @@ export class FragmentStreamLoader
types,
};

const { indexesFile } = properties;
const fetched = await fetch(this.url + indexesFile);
const data = await fetched.json();

const first = Object.keys(data.entries)[0];
const indices = await data.entries[first].json();

const indexer = this.components.get(OBC.IfcPropertiesIndexer);
const { indexMap } = indexer;
indexMap[group.uuid] = {};
for (const index of indices) {
const id = index.shift();
indexMap[group.uuid][id] = new Set(index);
}
// const { indexesFile } = properties;
// const fetched = await fetch(this.url + indexesFile);
// const data = await fetched.json();

// const first = Object.keys(data.entries)[0];
// const indices = await data.entries[first].json();

// const indexer = this.components.get(OBC.IfcRelationsIndexer);
// const { indexMap } = indexer;
// indexMap[group.uuid] = {};
// for (const index of indices) {
// const id = index.shift();
// indexMap[group.uuid][id] = new Set(index);
// }
}

this.culler.needsUpdate = true;
Expand Down
221 changes: 0 additions & 221 deletions packages/components/src/ifc/IfcPropertiesIndexer/index.ts

This file was deleted.

14 changes: 14 additions & 0 deletions packages/components/src/ifc/IfcRelationsIndexer/example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IfcRelationsIndexer</title>
</head>

<body>
<script type="module" src="./example.ts"></script>
</body>

</html>
Loading

0 comments on commit bd68aa6

Please sign in to comment.