diff options
Diffstat (limited to 'src/chilbert_obj.cpp')
-rw-r--r-- | src/chilbert_obj.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/chilbert_obj.cpp b/src/chilbert_obj.cpp index 0f31fbd..1fdd1ee 100644 --- a/src/chilbert_obj.cpp +++ b/src/chilbert_obj.cpp @@ -25,30 +25,30 @@ 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<uint32_t, 3> 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; + 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<uint32_t, 3> 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; } |