From 036c4c1634b2e056da722b21302608ccfe05a298 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 7 Nov 2022 06:30:02 -0500 Subject: Build tools --- src/chilbert_obj.cpp | 40 ---------------------------------------- src/chilbert_svg.cpp | 49 ------------------------------------------------- 2 files changed, 89 deletions(-) delete mode 100644 src/chilbert_obj.cpp delete mode 100644 src/chilbert_svg.cpp (limited to 'src') diff --git a/src/chilbert_obj.cpp b/src/chilbert_obj.cpp deleted file mode 100644 index 76039d0..0000000 --- a/src/chilbert_obj.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2018-2022 David Robillard -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "chilbert/chilbert.hpp" - -#include -#include -#include -#include - -int -main(int argc, char** argv) -{ - if (argc != 2) { - fprintf(stderr, "Usage: %s NUM_POINTS\n", argv[0]); - return 1; - } - - const unsigned long num_points = std::strtoul(argv[1], nullptr, 10); - if (num_points == 0 || num_points == ULONG_MAX) { - fprintf(stderr, "Usage: %s NUM_POINTS\n", argv[0]); - return 1; - } - - // Vertices - for (uint64_t i = 0; i < num_points; ++i) { - std::array point; - chilbert::index_to_coords(point, 16, 3, i); - printf("v %u %u %u\n", point[0], point[1], point[2]); - } - - // One polyline through all vertices - printf("\nl"); - for (unsigned i = 0; i < num_points - 1; ++i) { - printf(" %u", i + 1); - } - printf("\n"); - - return 0; -} diff --git a/src/chilbert_svg.cpp b/src/chilbert_svg.cpp deleted file mode 100644 index a572f68..0000000 --- a/src/chilbert_svg.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2018-2022 David Robillard -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "chilbert/chilbert.hpp" - -#include -#include -#include -#include -#include - -int -main(int argc, char** argv) -{ - if (argc != 2) { - fprintf(stderr, "Usage: %s NUM_POINTS\n", argv[0]); - return 1; - } - - const unsigned long num_points = std::strtoul(argv[1], nullptr, 10); - if (num_points == 0 || num_points == ULONG_MAX) { - fprintf(stderr, "Usage: %s NUM_POINTS\n", argv[0]); - return 1; - } - - const uint32_t w = - uint32_t(sqrt(1 << uint32_t(ceil(log2(double(num_points)))))) - 1; - - // Header - printf("\n", - w, - w); - printf("Hilbert Curve\n"); - printf("\n\n"); - - return 0; -} -- cgit v1.2.1