-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): IfcRelationsIndexer is between 2 and 5 times faster when …
…processing a model
- Loading branch information
Showing
3 changed files
with
132 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/core/src/ifc/IfcRelationsIndexer/src/newVersion.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const actual = { | ||
186: { | ||
7: [250, 253, 257], | ||
}, | ||
250: { | ||
8: [186], | ||
}, | ||
253: { | ||
8: [186], | ||
}, | ||
257: { | ||
8: [186], | ||
}, | ||
}; | ||
|
||
// This new version of the relations map easily allows to delete relations | ||
const newVersion = { | ||
186: { | ||
// 7 is IsDefinedBy | ||
7: [{ 259: [250] }, { 263: [253] }, { 266: [257] }], // 259, 263 and 266 are IfcRelDefinesByProperties | 250, 253 and 257 are IfcPropertySet | ||
}, | ||
190: { | ||
// 7 is IsDefinedBy | ||
7: [{ 259: [250] }], // 259 is IfcRelDefinesByProperties | 250 is IfcPropertySet | ||
}, | ||
250: { | ||
// 8 is DefinesOcurrence | ||
8: [{ 259: [186, 190] }], // 259 is IsRelDefinesByProperties | 186 and 190 are IfcProduct | ||
}, | ||
}; | ||
|
||
interface V2Schema { | ||
[expressID: number]: { | ||
[invAttrIndex: number]: { | ||
[IfcRelationship: number]: number[]; | ||
}; | ||
}; | ||
} | ||
|
||
type RelationsMap = Map<number, Map<number, { [ifcRel: number]: number[] }>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters