Реализация HalfEdge с использованием std::vector
Мне нужно создать HalfEdge по такому скелету:
struct HalfEdgeHandle { int64_t index = -1; };
struct VertexHandle { int64_t index = -1; };
struct FaceHandle { int64_t index = -1; };
struct HalfEdge
{
//The face it belongs to, is invalid (== -1) if a boundary half-edge
FaceHandle fh;
//The vertex it points to is always valid VertexHandle dst;
//The twin half-edge is always VALID. Even for boundary half-edges!
HalfEdgeHandle twin;
//The next HalfEdge in the CCW order is always valid
НalfEdgeHandle next;
//The previous HalfEdge in the CCW order can be stored for the optimization purposes.
HalfEdgeHandle prev;
};
struct Face{
//One of the HalfEdges belonging to the Face, always valid
HalfEdgeHandle heh;
};
struct Vertex{
//An outgoing HalfEdge from this vertex. It is == -1 if the vertex is isolated
HalfEdgeHandle heh;
};
Данные у меня поступаю в треугольниках (по три вершины). Правильно ли я понял, что, например, если ввести такой квадрат, то структура массивов должна быть такой или где-то у меня есть опечатки?
