MeshLib
MeshLib copied to clipboard
Add overload to find closest intersections for computeSkyViewFactor
Hi @Fedr & @Grantim,
could we please add an overload to the computeSkyViewFactor
functions to return the closest intersections? I understand that it could slow things down that's why it's set to false by default, but in certain situations I care about finding the closest point. One example is a view analysis, where I want to visualize the field of view from a specific point. Here you can see that sometimes the backfaces are returned as hit points.
https://github.com/MeshInspector/MeshLib/blob/523fb4679100e22d5a474c378bd8dc99f6cd9189/source/MRCuda/MRCudaSolarRadiation.cpp#L84-L87
https://github.com/MeshInspector/MeshLib/blob/523fb4679100e22d5a474c378bd8dc99f6cd9189/source/MRMesh/MRSolarRadiation.cpp#L51
Hmm, it might be even simpler. Each time we return std::vectorMR::MeshIntersectionResult* outIntersections, these should be always the closest intersection. If we only care about occlusion tests, we wouldn’t return the intersection points.
Hello, @mariuszhermansdorfer! @egrebenchenko has updated the functions, so in new version of meshlib it should return closest intersection if outIntersections
is not nullptr
Thanks @Grantim, I can see the commit addressed the CPU logic but not the Cuda version of this function. Could this be changed as well?
https://github.com/MeshInspector/MeshLib/commit/555e43c243b2b281a651e2dccea0c55d311f8cdc here it is
Super! Thanks a million!