From d22f42d58a2aabcbff334cf1ac7184a6c5e88820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zieli=C5=84ski?= Date: Sun, 14 Apr 2024 07:25:52 +0200 Subject: [PATCH] Tweak numbers to ensure tiling covers entire map --- lib/rmg/PenroseTiling.cpp | 4 ++-- lib/rmg/PenroseTiling.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rmg/PenroseTiling.cpp b/lib/rmg/PenroseTiling.cpp index 72efce246..f382706be 100644 --- a/lib/rmg/PenroseTiling.cpp +++ b/lib/rmg/PenroseTiling.cpp @@ -134,10 +134,10 @@ void PenroseTiling::split(Triangle& p, std::vector& points, std::set PenroseTiling::generatePenroseTiling(size_t numZones, CRandomGenerator * rand) { - float scale = 100.f / (numZones * 1.5f + 20); + float scale = 173.2f / (numZones * 1.5f + 20); float polyAngle = (2 * PI_CONSTANT) / POLY; - float randomAngle = rand->nextDouble(0, 2 * PI_CONSTANT); + float randomAngle = rand->nextDouble(0.25 * PI_CONSTANT, 0.75 * PI_CONSTANT); std::vector points = { Point2D(0.0f, 0.0f), Point2D(0.0f, 1.0f).rotated(randomAngle) }; std::array, 5> indices; diff --git a/lib/rmg/PenroseTiling.h b/lib/rmg/PenroseTiling.h index 5d477a808..42d0db2c0 100644 --- a/lib/rmg/PenroseTiling.h +++ b/lib/rmg/PenroseTiling.h @@ -59,7 +59,7 @@ public: const uint32_t POLY = 10; // Number of symmetries? const float BASE_SIZE = 1.25f; - const uint32_t DEPTH = 7; //Recursion depth + const uint32_t DEPTH = 8; //Recursion depth const bool P2 = false; // Tiling type