15 #include "Base/Util/Assert.h"
17 #include <QQuaternion>
28 for (
float x : {-1, +1})
29 for (
float y : {-1, +1})
30 for (
float z : {-1, +1})
33 for (
float g1 : {-G1, +G1})
34 for (
float g : {-GR, +GR}) {
40 ASSERT(20 == vs_.count());
43 float const F = .5f / vs_.at(0).length();
49 cross(vs_.at(8) - vs_.at(0), vs_.at(10) - vs_.at(0)));
50 for (
int i = 0; i < 20; ++i) {
51 vs_[i] = q.rotatedVector(vs_.at(i));
52 vs_[i].z += 0.5f * std::sqrt(G1);
58 auto add5 = [&](
unsigned i1,
unsigned i2,
unsigned i3,
unsigned i4,
unsigned i5) {
59 vs.
addFan(vs_, {i1, i2, i3, i4, i5, i1});
62 add5(1, 11, 17, 3, 16);
63 add5(1, 16, 10, 0, 9);
64 add5(16, 3, 12, 2, 10);
65 add5(3, 17, 7, 18, 12);
66 add5(17, 11, 5, 19, 7);
67 add5(11, 1, 9, 15, 5);
70 add5(14, 8, 0, 10, 2);
71 add5(6, 14, 2, 12, 18);
72 add5(13, 6, 18, 7, 19);
73 add5(4, 13, 19, 5, 15);
74 add5(4, 8, 14, 6, 13);
76 ASSERT(144 == vs.count());
static Mesh makeMesh(const Vertices &vs, Vertices const *ns=nullptr)
QVector< Vert_Normal > Mesh
static Mesh meshDodecahedron()
Vector3D cross(const Vector3D &v1, const Vector3D &v2)
void addFan(const Vertices &, const Indices &)