opencascade.js
opencascade.js copied to clipboard
How to iterate over NCollection_List?
I can't use the iterator from NCollection_List.begin(), because of UnboundTypeError
I made this somewhat hacky workaround:
function MoveListToJs(list: TopTools_ListOfShape){
let res = []
while(list.Size() > 0){
res.push(list.First_1())
list.RemoveFirst()
}
list.delete()
return res
}
Is there a better solution?
Even I am facing a crash when iterating over BRepCheck_ListOfStatus (using opencascade.js)
const statusList: BRepCheck_ListOfStatus = res.Status();
const it = statusList.begin(); //Crash
while (!it.isEqual(statusList.end())) {
const status = it.Value();
console.log("Status code or enum:", status);
it.Next();
}
Have you found a solution to this problem?