-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: store spatial elements within fragment group
- Loading branch information
Showing
9 changed files
with
75 additions
and
16 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
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
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
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
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
31 changes: 31 additions & 0 deletions
31
packages/core/src/fragments/IfcLoader/src/spatial-ids-finder.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,31 @@ | ||
import * as FRAGS from "@thatopen/fragments"; | ||
import * as WEBIFC from "web-ifc"; | ||
|
||
export class SpatialIdsFinder { | ||
static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI) { | ||
const spatialTypes = [ | ||
WEBIFC.IFCPROJECT, | ||
WEBIFC.IFCSITE, | ||
WEBIFC.IFCBUILDING, | ||
WEBIFC.IFCBUILDINGSTOREY, | ||
WEBIFC.IFCSPACE, | ||
WEBIFC.IFCROAD, | ||
WEBIFC.IFCFACILITY, | ||
WEBIFC.IFCFACILITYPART, | ||
WEBIFC.IFCBRIDGE, | ||
]; | ||
|
||
const data = model.data; | ||
|
||
for (const category of spatialTypes) { | ||
const ids = webIfc.GetLineIDsWithType(0, category); | ||
const size = ids.size(); | ||
for (let i = 0; i < size; i++) { | ||
const id = ids.get(i); | ||
if (!data.has(id)) { | ||
data.set(id, [[], [0, category]]); | ||
} | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.