Closed cdiggins closed 1 year ago
Agreed. Check out this coming PR for including a testing harness that we can use to do what you suggest.
This issue is now a bounty. Whoever solves this will get $200. More information here.
::take
::take
Hi, @TxTony! Thanks for taking this bounty! The due date is October 7, 2022 UTC.
If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bountyβs status will automatically changed to done.
If you do not need to make a PR, tell the manager @agviegas to run ::done
command after your tasks is confirmed to be done.
Good luck!
Hi @agviegas,
about the functions below. I admit the returns are actually correct. The return types are good. But I don't know if this is the expected result. do you think i can considered the test ok if the return type is good ? ( without checking the expected result)
GetCoordinationMatrix(modelID: number): Array<number>
{
return this.wasmModule.GetCoordinationMatrix(modelID) as Array<number>;
}
GetVertexArray(ptr: number, size: number): Float32Array
{
return this.getSubArray(this.wasmModule.HEAPF32, ptr, size);
}
GetIndexArray(ptr: number, size: number): Uint32Array
{
return this.getSubArray(this.wasmModule.HEAPU32, ptr, size);
}
getSubArray(heap, startPtr, sizeBytes) {
return heap.subarray(startPtr / 4, startPtr / 4 + sizeBytes).slice(0);
}
/**
* Load geometry for a single element
* @modelID Model handle retrieved by OpenModel
*/
GetFlatMesh(modelID: number, expressID: number): FlatMesh
{
return this.wasmModule.GetFlatMesh(modelID, expressID);
}
By the way could you tell me in which case we can use these function ?
If I'm right these function give me informations about geometries applied on one entity like this exemple.
let flatMesh = IfcApi.GetFlatMesh(0, expressID);
let geometrieSize = flatMesh.geometries.size();
for (let index = 0; index < geometrieSize; ++index) {
let geometries = IfcApi.GetGeometry(0, flatMesh.geometries.get(index).geometryExpressID);
let geometryVertexArray = IfcApi.GetVertexArray(geometries.GetVertexData(), geometries.GetVertexDataSize());
let geometryIndexData = IfcApi.GetIndexArray(geometries.GetIndexData(), geometries.GetIndexDataSize());
}
Do not hesistate to tell if your busy in this case I will release a first draft with the minimum for theses functions. and we'll discuss later :relaxed:
Thanks
Hi @TxTony!
First question: I think that it would be great if we could test values. What do you think of using a minimal IFC file? We can provide you with one.
Second question: exactly, the functions are used to get the geometric data of a mesh. You can see how we use it in web-ifc-three. If we use the basic IFC file to test, we could request a specific mesh, and then check if the data returned is correct.
Let me know if you have any other question. Thanks a lot for your work on this. π
This is a first draft https://github.com/TxTony/web-ifc/blob/main/tests/functional/WebIfcApi.spec.ts
Do not hesitate to tell me if it smells bad :laughing: .
I think it covers all the functions inside web-ifc-api.js,
except the functions with the comment // must be reviewed
. they are not tested yet or tested the bad way.
@agviegas could you provide me a minimalist IFC4 file ? these tests are based on a IFC2x3 File.
If you think these tests are correctly written I will continue with the helpers folder to cover Properties.js and try with different ifc files.
By the way if you got some ifc files making ifcApi failed please could you add the links here.
::extend
::extend
Hi, @TxTony! The due date is successfully extended by 21 days to October 28, 2022 UTC.
Hey, sorry for the late response, this looks great! You can find some files here. I think that the tests are correctly written. π
Hi @agviegas thanks. don't worry i will publish them soon . My timetable is busy i just need to clean the code and include some known faillures. Thanks for the files
Hi, @TxTony! The date is past due, your assignment has been revoked. Itβs now available for anyone to take.
Hi @agviegas could you change the status to done if it is ok.
Thanks
::done
::expense::105012
This project would benefit from an automated test suite, even including some known failures. Perhaps using the files posted here https://github.com/IFCjs/test-ifc-files . Adding some of the files submitted in Github issues could be added to a "failing" folder.