| 981 | } |
| 982 | |
| 983 | std::vector<Surface> Space_Impl::findSurfacesWithIncorrectOrientation() const { |
| 984 | if (m_cachedNonConvexSurfaces.has_value()) { |
| 985 | return m_cachedNonConvexSurfaces.get(); |
| 986 | } |
| 987 | auto volumePoly = this->polyhedron(); |
| 988 | // Actually, its perfectly fine to lookup incorrect orientations even if the polyhedron isn't enclosed... |
| 989 | // If a Box space is missing one wall for eg, the opposite wall will be deemed incorrectly oriented if using ray casting. |
| 990 | return findSurfacesWithIncorrectOrientationPolyhedron(volumePoly); |
| 991 | // if (volumePoly.isEnclosedVolume()) { |
| 992 | // return findSurfacesWithIncorrectOrientationPolyhedron(volumePoly); |
| 993 | // } |
| 994 | // LOG(Warn, "Can't lookup surfaces with incorrect orientations for a non-enclosed Polyhedron, falling back to the Raycasting method. " |
| 995 | // "This will produce false-negatives for non-convex spaces such as H-shaped spaces."); |
| 996 | // return findSurfacesWithIncorrectOrientationRaycasting(); |
| 997 | } |
| 998 | |
| 999 | bool Space_Impl::areAllSurfacesCorrectlyOriented() const { |
| 1000 | auto surfaces = findSurfacesWithIncorrectOrientation(); |