420 for (
int tri = 0; tri < 8; tri++) {
421 for (
int v = 0;
v < 3;
v++) {
446 constexpr int resolution = 64;
451 float2 cv = ring[a % resolution];
480 verts.append(vert_strip[t + 1]);
481 verts.append(vert_strip[t + 2]);
484 constexpr int resolution = 12;
487 float2 cv1 = ring[a % resolution];
488 float2 cv2 = ring[(a + 1) % resolution];
506 for (
int tri = 0; tri < 12; tri++) {
507 for (
int v = 0;
v < 3;
v++) {
532 constexpr int lon_res = 24;
533 constexpr int lat_res = 24;
534 constexpr float lon_inc = 2.0f *
M_PI / lon_res;
535 constexpr float lat_inc =
M_PI / lat_res;
537 auto lat_lon_to_co = [](
const float lat,
const float lon) {
543 for (
int i = 0; i < lon_res; i++, lon += lon_inc) {
546 for (
int j = 0; j < lat_res; j++, lat += lat_inc) {
559 constexpr int circle_resolution = 64;
566 v0 = circle_pt((2.0f *
M_PI * -2) /
float(circle_resolution));
567 v1 = circle_pt((2.0f *
M_PI * -1) /
float(circle_resolution));
568 for (
int a = 0; a <= circle_resolution; a++, v0 = v1, v1 =
v2) {
569 v2 = circle_pt((2.0f *
M_PI * a) /
float(circle_resolution));
579 constexpr int resolution = 16;
582 auto set_vert = [&](
const float x,
const float y,
const int quarter) {
589 float z =
sinf(
M_PI_2 * i /
float(resolution - 1));
592 float x =
sinf(
M_PI_2 * j /
float(resolution - 1));
593 if (j == resolution - i) {
619 constexpr int resolution = 16 * 4;
624 float2 cv = ring[a % resolution];
649 const Array<float2> quad = {{-1.0f, 1.0f}, {1.0f, 1.0f}, {-1.0f, -1.0f}, {1.0f, -1.0f}};
673 float p[3][3] = {{0}};
679 p[1][2] = p[2][2] = 0.75f;
681 if (sides % 2 == 1) {
689 for (
int i = 0, a = 1; i < 2; i++, a++) {
715 constexpr int resolution = 64;
720 float2 cv1 = ring[(a + 0) % resolution];
721 float2 cv2 = ring[(a + 1) % resolution];
738 constexpr int resolution = 8;
743 float2 cv = ring[i % resolution];
749 float2 cv = ring[(i + j) % resolution];
759 constexpr int n_segments = 12;
767 for (
const float2 &point : ring) {
778 for (
const float2 &point : diamond) {
787 constexpr int n_segments = 24;
792 for (
const int i :
IndexRange(n_segments / 2)) {
793 const float2 &point = ring[i];
794 const float2 &next_point = ring[i + 1];
807 float2 x_axis_name_scale = {0.0215f, 0.025f};
809 float2(0.9f, 1.0f) * x_axis_name_scale,
810 float2(-1.0f, -1.0f) * x_axis_name_scale,
811 float2(-0.9f, 1.0f) * x_axis_name_scale,
812 float2(1.0f, -1.0f) * x_axis_name_scale,
815 float2 y_axis_name_scale = {0.0175f, 0.025f};
817 float2(-1.0f, 1.0f) * y_axis_name_scale,
818 float2(0.0f, -0.1f) * y_axis_name_scale,
819 float2(1.0f, 1.0f) * y_axis_name_scale,
820 float2(0.0f, -0.1f) * y_axis_name_scale,
821 float2(0.0f, -0.1f) * y_axis_name_scale,
822 float2(0.0f, -1.0f) * y_axis_name_scale,
825 float2 z_axis_name_scale = {0.02f, 0.025f};
827 float2(-0.95f, 1.00f) * z_axis_name_scale,
828 float2(0.95f, 1.00f) * z_axis_name_scale,
829 float2(0.95f, 1.00f) * z_axis_name_scale,
830 float2(0.95f, 0.90f) * z_axis_name_scale,
831 float2(0.95f, 0.90f) * z_axis_name_scale,
832 float2(-1.00f, -0.90f) * z_axis_name_scale,
833 float2(-1.00f, -0.90f) * z_axis_name_scale,
834 float2(-1.00f, -1.00f) * z_axis_name_scale,
835 float2(-1.00f, -1.00f) * z_axis_name_scale,
836 float2(1.00f, -1.00f) * z_axis_name_scale,
839 float2 axis_marker_scale = {0.007f, 0.007f};
842 float2(-1.0f, 1.0f) * axis_marker_scale,
843 float2(1.0f, 1.0f) * axis_marker_scale,
844 float2(1.0f, 1.0f) * axis_marker_scale,
845 float2(1.0f, -1.0f) * axis_marker_scale,
846 float2(1.0f, -1.0f) * axis_marker_scale,
847 float2(-1.0f, -1.0f) * axis_marker_scale,
848 float2(-1.0f, -1.0f) * axis_marker_scale,
849 float2(-1.0f, 1.0f) * axis_marker_scale,
851 float2(-1.0f, 0.0f) * axis_marker_scale,
852 float2(0.0f, 1.0f) * axis_marker_scale,
853 float2(0.0f, 1.0f) * axis_marker_scale,
854 float2(1.0f, 0.0f) * axis_marker_scale,
855 float2(1.0f, 0.0f) * axis_marker_scale,
856 float2(0.0f, -1.0f) * axis_marker_scale,
857 float2(0.0f, -1.0f) * axis_marker_scale,
858 float2(-1.0f, 0.0f) * axis_marker_scale,
871 constexpr int marker_fill_layer = 6;
872 for (
int j = 1; j < marker_fill_layer + 1; j++) {
874 verts.append({{axis_marker_vert * ((4.0f * j) / marker_fill_layer),
float(axis)},
flag});
879 for (
float2 axis_name_vert : *(axis_names[axis])) {
889 constexpr int resolution = 64;
890 constexpr float radius = 1.0f;
895 float2 cv = ring[i % resolution];
903 constexpr int segments = 16;
904 constexpr float bottom_r = 0.5f;
905 constexpr float bottom_z = -0.125f;
906 constexpr float step_z = 0.25f;
912 for (
float2 &point : ring) {
916 const float z = step_z * j + bottom_z;
920 for (
const float2 &point : diamond) {
922 verts.append(vertex);
923 vertex.pos =
float3(point * 0.5f, bottom_z + step_z);
924 verts.append(vertex);
925 verts.append(vertex);
926 vertex.pos.z += step_z;
927 verts.append(vertex);
953 const Vector<float2> rect{{-1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, -1.0f}};
958 for (
const float2 &point : rect) {
967 const Vector<float2> triangle = {{-1.0f, 1.0f}, {1.0f, 1.0f}, {0.0f, 0.0f}};
976 for (
const float2 &point : triangle) {
986 for (
const int i :
IndexRange(tri.type_length)) {
987 const int v = tri[i];
1024 verts.append({{0.0, 0.0, 1.0}, 0});
1025 verts.append({{0.0, 0.0, 0.0}, 0});
1039 const float s =
sinf(-angle);
1040 const float c =
cosf(-angle);
1048 constexpr float r = 9.0f;
1058 constexpr float r = 9.0f;
1071 constexpr int num_rays = 8;
1072 constexpr float r = 9.0f;
1074 const std::array<float, 4> scales{1.6f, 1.9f, 2.2f, 2.5f};
1077 for (
const float2 &point : ring) {
1078 for (
float scale : scales) {
1100 verts.append({{0.0, 0.0, -20.0}, 0});
1115 for (
const float2 &point : ring) {
1116 verts.append({{0.0f, 0.0f, 0.0f}, 0});
1140 const Array<float2> rect{{-0.5f, -0.5f}, {-0.5f, 0.5f}, {0.5f, 0.5f}, {0.5f, -0.5f}};
1153 constexpr int circle_resol = 32;
1155 constexpr std::array<float, 2> scales{2.0f, 0.75};
1161 for (
const float scale : scales) {
1162 for (
float2 &point : ring) {
1173 constexpr int circle_resol = 32;
1179 const float z = 0.05f *
float(i);
1188 constexpr int spiral_resol = 32;
1193 for (
const int i :
IndexRange(ring.size() * 2 + 1)) {
1195 const float r = (i - spiral_resol) /
float(spiral_resol);
1198 const float2 point = ring[
abs(spiral_resol - i) % spiral_resol] * r;
1206 constexpr int circle_resol = 32;
1218 constexpr int circle_resol = 32 * 2;
1230 constexpr int circle_resol = 32;
1231 constexpr int side_stipple = 32;
1239 const float z = i * 2.0f - 1.0f;
1243 for (
const float2 &point : diamond) {
1244 for (
const int i :
IndexRange(side_stipple)) {
1245 const float z = (i /
float(side_stipple)) * 2.0f - 1.0f;
1255 constexpr int circle_resol = 32;
1256 constexpr int side_stipple = 32;
1264 const float z = i * 2.0f - 1.0f;
1268 for (
const float2 &point : diamond) {
1269 for (
const int i :
IndexRange(side_stipple)) {
1270 const float z = (i /
float(side_stipple)) * 2.0f - 1.0f;
1280 constexpr float r = 14.0f;
1283 constexpr float sin_pi_3 = 0.86602540378f;
1284 constexpr float cos_pi_3 = 0.5f;
1287 float2(sin_pi_3, cos_pi_3) * r,
1288 float2(sin_pi_3, -cos_pi_3) * r,
1290 float2(-sin_pi_3, -cos_pi_3) * r,
1291 float2(-sin_pi_3, cos_pi_3) * r,
1298 const float2 &point = points[i * 2 + 1];
1305 const std::string axes =
"zZyYxX";
1306 for (
const char axis : axes) {
1315 constexpr float r = 20.0f;
1317 constexpr float sin_pi_3 = 0.86602540378f;
1320 float2(sin_pi_3, 0.0f) * r,
1322 float2(-sin_pi_3, 0.0f) * r,
1333 constexpr float r = 14.0f;
1336 constexpr float sin_pi_3 = 0.86602540378f;
1337 constexpr float cos_pi_3 = 0.5f;
1339 float2(sin_pi_3, cos_pi_3) * r,
1340 float2(sin_pi_3, -cos_pi_3) * r,
1342 float2(-sin_pi_3, -cos_pi_3) * r,
1343 float2(-sin_pi_3, cos_pi_3) * r};
1349 const float2 tr = points[(i / 2) * 2 + 1] * -0.5f;
1350 const float2 t1 = points[i] + tr;
1351 const float2 t2 = points[(i + 1) % 6] + tr;
1356 const float2 &point = points[i * 2 + 1];
1362 const std::string axes =
"zZyYxX";
1363 for (
const char axis : axes) {
1372 constexpr int resolution = 8;
1373 std::array<float, resolution + 1>
steps;
1375 for (
const int i :
IndexRange(resolution + 1)) {
1376 steps[i] = -1.0f +
float(i * 2) / resolution;