| 54 | } |
| 55 | |
| 56 | PointD GetRandomPointInsideTriangles(std::vector<TriangleD> const & v) |
| 57 | { |
| 58 | if (v.empty()) |
| 59 | return {}; |
| 60 | |
| 61 | auto const seed = static_cast<uint32_t>(std::chrono::system_clock::now().time_since_epoch().count()); |
| 62 | std::default_random_engine engine(seed); |
| 63 | std::uniform_int_distribution<size_t> distrib(0, v.size() - 1); |
| 64 | return GetRandomPointInsideTriangle(v[distrib(engine)]); |
| 65 | } |
| 66 | |
| 67 | PointD ProjectPointToTriangles(PointD const & pt, std::vector<TriangleD> const & v) |
| 68 | { |
no test coverage detected