Ultimately I want to try and build a version of the Bungui triangular expansion algorithm for visibility polygons/isovists: https://arxiv.org/pdf/1403.3905.pdf. I have a version of the Asano algorithm working since way back, and it performs really well, but by the looks of it the triangle expansion approach absolutely leaves it in the dust for speed.
I was thinking that extracting the mesh from an ofPath is a neat first step for getting the triangular solution of the space, and the technique after that seems to be a recursive ray walk across the mesh triangles. I thought if the mesh structure allows me to know which triangle is next each ray step, this makes for a real nice efficient search.
So I wanted to start simple, by making a quick proof test of walking a line across a triangular mesh, and pinging each triangle in turn (maybe turning it a different colour or something)…
update: from calling getMode() on the getTessellation() mesh result for some of my spaces, it looks like they are always mode 0 (OF_PRIMITIVE_TRIANGLES?), so I guess it might be a question of searching through the triangles after all.
So then I did this, to call out the indices, am I on the right track?
catcher = accessibleMesh.getIndices();
for(int i = 0; i<catcher.size(); i+=3) cout<<catcher[i]<<"-"<<catcher[i+1]<<"-"<<catcher[i+2]<<endl;
Seems to print a string of vertex ids, which is promising