From 60dd654b13c364e2aac53f2cb76a368d388bf070 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 22 Sep 2024 23:32:40 +0200 Subject: Added basic setup --- c++/ico.hpp | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 c++/ico.hpp (limited to 'c++/ico.hpp') diff --git a/c++/ico.hpp b/c++/ico.hpp new file mode 100644 index 0000000..0ac1a91 --- /dev/null +++ b/c++/ico.hpp @@ -0,0 +1,70 @@ +#pragma once + +#include +#include + +namespace kel { +namespace impl { +struct ico_surface_helper { + /** + * On each triangle we assume a ccw order and we start on the top-left part of the + * triangle. The orientation of the triangle is determined by the horizontal line + * (on the 2D foldout of the icosahedron) which is the down direction. + */ + static constexpr std::array, 20u> neighbour_map { + {1,4,5},//0 + {2,0,6},//1 + {3,1,7},//2 + {4,2,8},//3 + {0,3,9},//4 + {14,10,0},//5 + {10,11,1},//6 + {11,12,2},//7 + {12,13,3},//8 + {13,14,4},//9 + {6,5,15},//10 + {7,6,16},//11 + {8,7,17},//12 + {9,8,18},//13 + {5,9,19},//14 + {19,16,10},//15 + {15,17,11},//16 + {16,18,12},//17 + {17,19,13},//18 + {18,15,14} //19 + }; +}; +} + +template +class ico_addr { +private: + std::array vals_; +public: + template + ico_addr
slice() const { + return {}; + } +}; + +template +class ico_triangle { +private: + std::array> subdivs_; +public: +}; + +template +class ico_triangle final { +private: + T val_; +public: +}; + +template +class icosahedron final { +private: + std::array,20u> surfaces_; +public: +}; +} -- cgit v1.2.3