#pragma once #include "linalg.h" #include typedef std::vector Polygon; typedef std::vector Polygons; typedef std::vector IndexedFace; typedef Vector3i IndexedTriangle; struct IndexedPolygons { std::vector vertices; std::vector faces; }; struct IndexedTriangleMesh { std::vector vertices; std::vector triangles; }; // Indexed polygon mesh, where each polygon can have holes struct IndexedPolyMesh { std::vector vertices; std::vector > polygons; }; namespace GeometryUtils { bool tessellatePolygon(const Polygon &polygon, Polygons &triangles, const Vector3f *normal = NULL); bool tessellatePolygonWithHoles(const Vector3f *vertices, const std::vector &faces, std::vector &triangles, const Vector3f *normal = NULL); int findUnconnectedEdges(const std::vector > &polygons); int findUnconnectedEdges(const std::vector &triangles); }