43 using VertexType = MeshType::VertexType;
44 using PositionType = VertexType::PositionType;
45 using ScalarType = PositionType::ScalarType;
49 const ScalarType
fi = (1 + std::sqrt(5)) / 2;
50 const ScalarType
s0 = 0;
51 const ScalarType
s1 =
fi;
52 const ScalarType
s2 = std::pow(
fi, 2);
53 const ScalarType
s3 = 1;
55 log.log(0,
"Adding vertices to PolyMesh...");
58 PositionType(-
s1, -
s1,
s1),
62 PositionType(-
s2, -
s3,
s0),
66 PositionType(-
s3,
s0, -
s2),
67 PositionType(
s0, -
s2, -
s3),
73 PositionType(-
s1,
s1, -
s1),
75 PositionType(
s1, -
s1, -
s1),
77 PositionType(-
s1, -
s1, -
s1));
79 log.log(50,
"Vertices added to PolyMesh.");
80 log.log(50,
"Adding faces to PolyMesh...");
82 mesh.reserveFaces(12);
83 mesh.addFace(14, 11, 18, 2, 1);
84 mesh.addFace(2, 17, 7, 13, 1);
85 mesh.addFace(15, 8, 19, 4, 3);
86 mesh.addFace(4, 0, 12, 16, 3);
87 mesh.addFace(16, 5, 6, 15, 3);
88 mesh.addFace(13, 6, 5, 14, 1);
89 mesh.addFace(18, 10, 9, 17, 2);
90 mesh.addFace(19, 9, 10, 0, 4);
91 mesh.addFace(17, 9, 19, 8, 7);
92 mesh.addFace(13, 7, 8, 15, 6);
93 mesh.addFace(16, 12, 11, 14, 5);
94 mesh.addFace(18, 11, 12, 0, 10);
96 log.log(100,
"Faces added to PolyMesh.");
std::vector< uint > earCut(Iterator begin, Iterator end)
Triangulates a simple polygon with no holes using the ear-cutting algorithm.
Definition ear_cut.h:90
MeshType createDodecahedron(LogType &log=nullLogger)
Creates and returns a Polygon Mesh containing a Dodecahedron.
Definition dodecahedron.h:41