FragmentGroup.getFragmentMap returns "FragmentMap", but APIs such as OBC.Highlighter.highlightByID requests "FragmentIdMap". Therefore, I need to write the following conversion code myself. I think this is a bug because "FragmentMap" and "FragmentIdMap" are the same concept.
const item: any = OBC.IfcPropertiesUtils.findItemByGuid(this.groups[0].properties!, guid);
const expressID = item.expressID as number;
const found = this.groups[0].getFragmentMap([expressID]);
const result: OBC.FragmentIdMap = {};
for (const fragmentId in found) {
const expressIds = new Set<string>();
const expressIdsInNumber = found[fragmentId];
for (const expressIdInNumber of expressIdsInNumber) {
expressIds.add(expressIdInNumber.toString());
}
result[fragmentId] = expressIds;
}
this.highlighter.highlightByID('default', result);
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a IFC.js components issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
[X] Check that this is a concrete bug. For Q&A join our Community.
As a quick solution, I will better update FragmentMap from bim-fragment to be a set of strings rather than a set of numbers to match the existing type in openbim-components. The reason is because less needs to be changed this way as opposed to updating the type in openbim-components to be a set of numbers.
As a result of the first point, I will transfer this issue to fragment.
Later on, I guess will be better to change everything to be a set of numbers as it can lower the memory needed.
Describe the bug 📝
FragmentGroup.getFragmentMap returns "FragmentMap", but APIs such as OBC.Highlighter.highlightByID requests "FragmentIdMap". Therefore, I need to write the following conversion code myself. I think this is a bug because "FragmentMap" and "FragmentIdMap" are the same concept.
Reproduction ▶️
No response
Steps to reproduce 🔢
No response
System Info 💻
Used Package Manager 📦
npm
Error Trace/Logs 📃
No response
Validations ✅