| 659 | } |
| 660 | |
| 661 | inline Bounds getBounds(std::vector<std::vector<glm::dvec2>> input, glm::dvec2 size, glm::dvec2 offset) |
| 662 | { |
| 663 | std::vector<glm::dvec2> retval; |
| 664 | glm::dvec2 min(DBL_MAX, DBL_MAX); |
| 665 | glm::dvec2 max(-DBL_MAX, -DBL_MAX); |
| 666 | for (auto& loop : input) |
| 667 | { |
| 668 | for (auto& point : loop) |
| 669 | { |
| 670 | min = glm::min(min, point); |
| 671 | max = glm::max(max, point); |
| 672 | } |
| 673 | } |
| 674 | double width = max.x - min.x; |
| 675 | double height = max.y - min.y; |
| 676 | if (width == 0 && height == 0) |
| 677 | { |
| 678 | printf("asdf"); |
| 679 | } |
| 680 | return { min, max }; |
| 681 | } |
| 682 | |
| 683 | inline void DumpCurveToHtml(std::vector<glm::dvec3> points, std::string filename, std::vector<uint32_t> indices = {}) |
| 684 | { |