src/layers/craters/shaping/irregularity.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | |||
| 3 | #include "terraingen/layers/craters/shaping/irregularity.h" | ||
| 4 | |||
| 5 | #include "terraingen/layers/craters/crater_fields.h" | ||
| 6 | #include "terraingen/layers/fade.h" | ||
| 7 | #include "terraingen/random/samplers.h" | ||
| 8 | #include "terraingen/util/bits.h" | ||
| 9 | #include "util/fft.h" | ||
| 10 | |||
| 11 | #include <algorithm> | ||
| 12 | #include <cmath> | ||
| 13 | #include <complex> | ||
| 14 | #include <cstddef> | ||
| 15 | #include <cstdint> | ||
| 16 | #include <stdexcept> | ||
| 17 | |||
| 18 | namespace terraingen { | ||
| 19 | |||
| 20 | namespace { | ||
| 21 | |||
| 22 | /// How far a periodic Catmull-Rom spline can overshoot its knots, as a share of their largest | ||
| 23 | /// magnitude. | ||
| 24 | constexpr double kSplineOvershoot = 1.25; | ||
| 25 | |||
| 26 | /// The steepest slope of `Smoothstep`. | ||
| 27 | constexpr double kSmoothstepSlope = 1.5; | ||
| 28 | |||
| 29 | constexpr std::size_t kTableSize = 1024; | ||
| 30 | |||
| 31 | /// y = a D + b in a crater's diameter D (km), with one line up to 20 km and another above, as Du et | ||
| 32 | /// al. (2024, Table 2) fit their breakpoints; and its 1-sigma misfit on each side. | ||
| 33 | struct PiecewiseFit { | ||
| 34 | double a1, b1, sigma1, a2, b2, sigma2; | ||
| 35 | |||
| 36 | 275 | double At(double kilometers, double z) const { | |
| 37 | 15 | return kilometers <= 20.0 ? a1 * kilometers + b1 + z * sigma1 | |
| 38 | 260 | : a2 * kilometers + b2 + z * sigma2; | |
| 39 | } | ||
| 40 | }; | ||
| 41 | |||
| 42 | /// The rim crest radial distance fits of Du et al. (2024, Table 2). | ||
| 43 | constexpr PiecewiseFit kSlope12{-0.022, 3.3, 0.54, -0.00019, 2.9, 0.22}; | ||
| 44 | constexpr PiecewiseFit kLogWavelength2{0.010, -0.57, 0.27, -0.00035, -0.36, 0.27}; | ||
| 45 | constexpr PiecewiseFit kLogPower2{0.043, 0.59, 0.55, 0.010, 1.2, 0.75}; | ||
| 46 | constexpr PiecewiseFit kLogPower3{0.055, 2.3, 0.58, -0.0026, 3.5, 0.44}; | ||
| 47 | constexpr PiecewiseFit kLogPower4{0.066, -1.1, 1.00, 0.0062, 0.059, 0.69}; | ||
| 48 | constexpr double kSpectrumSigma = 0.55; | ||
| 49 | constexpr double kSpectrumVertices = 5000.0; | ||
| 50 | |||
| 51 | /// The breakpoints of one crater's rim spectrum, from the fits at its diameter. | ||
| 52 | struct DuSpectrum { | ||
| 53 | double slope; | ||
| 54 | double logWavelength2; | ||
| 55 | double logPower2; | ||
| 56 | double logPower3; | ||
| 57 | double logPower4; | ||
| 58 | |||
| 59 | /// log10 power of harmonic `k`. | ||
| 60 | 28105 | double LogPower(std::size_t k) const { | |
| 61 | 28105 | if (k == 1) { | |
| 62 | 55 | return logPower4; | |
| 63 | } | ||
| 64 | 28050 | if (k == 2) { | |
| 65 | 55 | return logPower3; | |
| 66 | } | ||
| 67 | 27995 | const double logPi = std::log10(kPi); | |
| 68 | 27995 | const double logWavelength = std::log10(2.0 * kPi / static_cast<double>(k)); | |
| 69 | 27995 | if (logWavelength >= logWavelength2) { | |
| 70 | 942 | return logPower2 + (logWavelength - logWavelength2) / (logPi - logWavelength2) * | |
| 71 | 942 | (logPower3 - logPower2); | |
| 72 | } | ||
| 73 | 27053 | return logPower2 + slope * (logWavelength - logWavelength2); | |
| 74 | } | ||
| 75 | }; | ||
| 76 | |||
| 77 | /// `table` scaled down so that no value exceeds `maxDeviation` in magnitude. | ||
| 78 | 55 | void LimitDeviation(std::vector<double>& table, double maxDeviation) { | |
| 79 | 55 | double largest = 0.0; | |
| 80 | 56375 | for (const double value : table) { | |
| 81 | 56320 | largest = std::fmax(largest, std::fabs(value)); | |
| 82 | } | ||
| 83 | 55 | if (largest > maxDeviation) { | |
| 84 | 53300 | for (double& value : table) { | |
| 85 | 53248 | value *= maxDeviation / largest; | |
| 86 | } | ||
| 87 | } | ||
| 88 | 55 | } | |
| 89 | |||
| 90 | 55 | std::vector<double> DuRimTable(double diameter, bool scatter, double maxDeviation, | |
| 91 | RandomStream& random) { | ||
| 92 | 55 | const double kilometers = std::clamp(diameter / 1000.0, 1.0, 140.0); | |
| 93 | 275 | const auto draw = [&] { return scatter ? StandardNormal(random) : 0.0; }; | |
| 94 | 55 | DuSpectrum fit{}; | |
| 95 | 55 | fit.slope = kSlope12.At(kilometers, draw()); | |
| 96 | 55 | fit.logWavelength2 = kLogWavelength2.At(kilometers, draw()); | |
| 97 | 55 | fit.logPower2 = kLogPower2.At(kilometers, draw()); | |
| 98 | 55 | fit.logPower3 = kLogPower3.At(kilometers, draw()); | |
| 99 | 55 | fit.logPower4 = kLogPower4.At(kilometers, draw()); | |
| 100 | 55 | std::vector<std::complex<double>> spectrum(kTableSize); | |
| 101 | 28160 | for (std::size_t k = 1; k < kTableSize / 2; ++k) { | |
| 102 | 28105 | const double noise = scatter ? kSpectrumSigma * StandardNormal(random) : 0.0; | |
| 103 | 28105 | const double amplitude = | |
| 104 | 28105 | std::sqrt(std::pow(10.0, fit.LogPower(k) + noise) * 2.0 * kPi) / kSpectrumVertices; | |
| 105 | 28105 | const double phase = 2.0 * kPi * random.NextDouble(); | |
| 106 | 28105 | spectrum[k] = std::complex<double>(0.0, -1.0) * std::polar(amplitude, phase); | |
| 107 | } | ||
| 108 | 55 | Fft(spectrum, 1.0); | |
| 109 | 55 | std::vector<double> table(kTableSize); | |
| 110 | 56375 | for (std::size_t n = 0; n < kTableSize; ++n) { | |
| 111 | 56320 | table[n] = spectrum[n].real(); | |
| 112 | } | ||
| 113 | 55 | LimitDeviation(table, maxDeviation); | |
| 114 | 55 | return table; | |
| 115 | 55 | } | |
| 116 | |||
| 117 | /// Harmonics of a rim table the crater kernel follows toward the center one by one, as it does a | ||
| 118 | /// power-law outline's; the table's finer rest fades as fast as the first harmonic past them. Set | ||
| 119 | /// by eye to match the default highest power-law harmonic, not from a measurement. | ||
| 120 | constexpr int kTableBroadHarmonics = 12; | ||
| 121 | |||
| 122 | /// Appends the (amplitude, phase) pairs of harmonics 1 to `kTableBroadHarmonics` of the periodic | ||
| 123 | /// `table` to `data`, as cosines of the angle plus the phase, the way the kernel reads harmonics. | ||
| 124 | 22478 | void AppendBroadHarmonics(const std::vector<double>& table, std::vector<float>& data) { | |
| 125 | 22478 | const double size = static_cast<double>(table.size()); | |
| 126 | 292214 | for (int k = 1; k <= kTableBroadHarmonics; ++k) { | |
| 127 | double re = 0.0; | ||
| 128 | double im = 0.0; | ||
| 129 | 276479400 | for (std::size_t n = 0; n < table.size(); ++n) { | |
| 130 | 276209664 | const double angle = 2.0 * kPi * k * static_cast<double>(n) / size; | |
| 131 | 276209664 | re += table[n] * std::cos(angle); | |
| 132 | 276209664 | im -= table[n] * std::sin(angle); | |
| 133 | } | ||
| 134 | 269736 | data.push_back(static_cast<float>(2.0 * std::hypot(re, im) / size)); | |
| 135 | 269736 | data.push_back(static_cast<float>(std::atan2(im, re))); | |
| 136 | } | ||
| 137 | 22478 | } | |
| 138 | |||
| 139 | /// sum over k of k^-slope squared, from `first` to `last`. | ||
| 140 | 316732 | double PowerSum(int first, int last, double slope) { | |
| 141 | 316732 | double sum = 0.0; | |
| 142 | 3800229 | for (int k = first; k <= last; ++k) { | |
| 143 | 3483497 | sum += std::pow(static_cast<double>(k), -2.0 * slope); | |
| 144 | } | ||
| 145 | 316732 | return sum; | |
| 146 | } | ||
| 147 | |||
| 148 | /// The uniforms an outline is drawn from, in the order drawn. | ||
| 149 | struct OutlineDraws { | ||
| 150 | double rough, elongated, r1, r2, s1, s2, e1, e2, h; | ||
| 151 | }; | ||
| 152 | |||
| 153 | 336717 | OutlineDraws DrawOutline(RandomStream& random) { | |
| 154 | 336717 | OutlineDraws draws{}; | |
| 155 | 6395438 | for (double* draw : {&draws.rough, &draws.elongated, &draws.r1, &draws.r2, &draws.s1, &draws.s2, | |
| 156 | 3366125 | &draws.e1, &draws.e2, &draws.h}) { | |
| 157 | 3029313 | *draw = random.NextDouble(); | |
| 158 | } | ||
| 159 | 336812 | return draws; | |
| 160 | } | ||
| 161 | |||
| 162 | /// Adds the power-law harmonics of `irregularity` to `outline`. | ||
| 163 | 316682 | void AddHarmonics(CraterOutline& outline, const CraterIrregularity& irregularity, | |
| 164 | const OutlineDraws& draws, RandomStream& random) { | ||
| 165 | 316682 | const double roughness = irregularity.roughness.Sample(draws.r1, draws.r2); | |
| 166 | 316724 | const double slope = irregularity.spectralSlope.Sample(draws.s1, draws.s2); | |
| 167 | 633521 | const double norm = roughness * std::sqrt(2.0 / PowerSum(irregularity.minHarmonic, | |
| 168 | 316734 | irregularity.maxHarmonic, slope)); | |
| 169 | 316787 | outline.firstHarmonic = irregularity.minHarmonic; | |
| 170 | 316787 | if (roughness > 0.0) { | |
| 171 | 3797016 | for (int k = irregularity.minHarmonic; k <= irregularity.maxHarmonic; ++k) { | |
| 172 | 3480312 | outline.amplitudes.push_back(norm * std::pow(static_cast<double>(k), -slope)); | |
| 173 | 3479884 | outline.phases.push_back(2.0 * kPi * random.NextDouble()); | |
| 174 | } | ||
| 175 | } | ||
| 176 | 316704 | } | |
| 177 | |||
| 178 | /// Checks the radial marks of crater irregularity. | ||
| 179 | /// @throws std::invalid_argument as `ValidateCraterIrregularity`. | ||
| 180 | 161500 | void ValidateRadialMarks(const CraterIrregularity& irregularity) { | |
| 181 | 161500 | ValidateValueDistribution(irregularity.marksAmplitude); | |
| 182 | 161692 | const double fade = irregularity.marksFadeRadii; | |
| 183 | 161692 | if (!(irregularity.marksInnerRadii - fade >= 0.0 && | |
| 184 | 161691 | irregularity.marksInnerRadii <= irregularity.marksOuterRadii && | |
| 185 | 161690 | irregularity.marksOuterRadii + fade <= 1.0)) { | |
| 186 | 3 | throw std::invalid_argument("Crater marks need 0 <= inner - fade, inner <= outer and " | |
| 187 | 3 | "outer + fade <= 1 radii"); | |
| 188 | } | ||
| 189 | 161689 | if (!(irregularity.marksAmplitude.Lowest() >= 0.0 && | |
| 190 | 161678 | 2.0 * kSplineOvershoot * kSmoothstepSlope * irregularity.marksAmplitude.Highest() < | |
| 191 | fade)) { | ||
| 192 | 2 | throw std::invalid_argument("Crater mark amplitude must not be negative, and below fade / " | |
| 193 | 2 | "3.75 radii so walls cannot fold"); | |
| 194 | } | ||
| 195 | 161689 | } | |
| 196 | |||
| 197 | } // namespace | ||
| 198 | |||
| 199 | 161330 | void ValidateCraterIrregularity(const CraterIrregularity& irregularity) { | |
| 200 | 161330 | CheckRanges(irregularity); | |
| 201 | 161786 | ValidateValueDistribution(irregularity.roughness); | |
| 202 | 161672 | ValidateValueDistribution(irregularity.spectralSlope); | |
| 203 | 161684 | ValidateValueDistribution(irregularity.ellipticity); | |
| 204 | 161626 | ValidateCraterSelection(irregularity.selection, "Crater irregularity"); | |
| 205 | 160986 | if (irregularity.minHarmonic > irregularity.maxHarmonic) { | |
| 206 | ✗ | throw std::invalid_argument("Crater min_harmonic must be at most max_harmonic"); | |
| 207 | } | ||
| 208 | 160986 | const int harmonics = irregularity.maxHarmonic - irregularity.minHarmonic + 1; | |
| 209 | 160986 | if (!(irregularity.roughness.Lowest() >= 0.0 && | |
| 210 | 161613 | irregularity.roughness.Highest() * std::sqrt(2.0 * harmonics) < 0.5)) { | |
| 211 | 2 | throw std::invalid_argument( | |
| 212 | "Crater roughness must not be negative, and at most 0.5 / sqrt(2 n) radii for n " | ||
| 213 | 2 | "harmonics, so rims cannot fold"); | |
| 214 | } | ||
| 215 | 161266 | if (!(irregularity.ellipticity.Lowest() >= 1.0)) { | |
| 216 | 1 | throw std::invalid_argument("Crater ellipticity must be at least 1"); | |
| 217 | } | ||
| 218 | 161511 | ValidateRadialMarks(irregularity); | |
| 219 | 161666 | } | |
| 220 | |||
| 221 | 93249 | double CraterOutline::Scale(double dx, double dy) const { | |
| 222 | 93249 | return Round() ? 1.0 : KernelOutline(*this, 1.0).Scale({dx, dy}); | |
| 223 | } | ||
| 224 | |||
| 225 | 29276 | double CraterOutline::MarkShift(double dx, double dy, double radii) const { | |
| 226 | 29276 | return marks.empty() ? 0.0 : KernelOutline(*this, 1.0).MarkShift({dx, dy}, radii); | |
| 227 | } | ||
| 228 | |||
| 229 | 4615103 | double CraterOutline::MaxScale() const { | |
| 230 | 4615103 | double sum = 1.0; | |
| 231 | 4666303 | for (const double deviation : table) { | |
| 232 | 51200 | sum = std::fmax(sum, 1.0 + deviation); | |
| 233 | } | ||
| 234 | 48947083 | for (const double amplitude : amplitudes) { | |
| 235 | 44331980 | sum += std::fabs(amplitude); | |
| 236 | } | ||
| 237 | 4615103 | return std::sqrt(ellipticity) * sum; | |
| 238 | } | ||
| 239 | |||
| 240 | 824323 | CraterOutline IrregularOutline(const Crater& crater, const CraterIrregularity& irregularity) { | |
| 241 | 824323 | CraterOutline outline; | |
| 242 | 824398 | if (!irregularity.enabled || !irregularity.selection.Includes(crater)) { | |
| 243 | return outline; | ||
| 244 | } | ||
| 245 | 336766 | const IdWords id = SplitId(crater.id); | |
| 246 | 638176 | RandomStream random(irregularity.seed.value_or(0u), kCraterIrregularityStream, id.low, id.high); | |
| 247 | 336727 | const OutlineDraws draws = DrawOutline(random); | |
| 248 | 336721 | if (draws.elongated < irregularity.elongatedShare) { | |
| 249 | 23261 | outline.ellipticity = irregularity.ellipticity.Sample(draws.e1, draws.e2); | |
| 250 | 23260 | outline.heading = | |
| 251 | 23260 | irregularity.headingDegrees | |
| 252 | 23260 | ? (*irregularity.headingDegrees * kDegree) + | |
| 253 | 1608 | (irregularity.headingSpreadDegrees * kDegree) * (2.0 * draws.h - 1.0) | |
| 254 | 21652 | : kPi * draws.h; | |
| 255 | } | ||
| 256 | 336720 | if (draws.rough < irregularity.roughShare && irregularity.model == RimRoughnessModel::Du2024) { | |
| 257 | 110 | outline.table = | |
| 258 | 55 | DuRimTable(crater.diameter, irregularity.scatter, irregularity.maxDeviation, random); | |
| 259 | 336665 | } else if (draws.rough < irregularity.roughShare) { | |
| 260 | 316652 | AddHarmonics(outline, irregularity, draws, random); | |
| 261 | } | ||
| 262 | 336771 | if (irregularity.marksShare > 0.0) { | |
| 263 | 4605 | RandomStream marks(irregularity.seed.value_or(0u), kCraterMarkStream, id.low, id.high); | |
| 264 | 4605 | const double share = marks.NextDouble(); | |
| 265 | 4605 | const double amplitude = irregularity.marksAmplitude.Draw(marks); | |
| 266 | 4605 | if (share < irregularity.marksShare && amplitude > 0.0) { | |
| 267 | 1571 | outline.marks.resize(static_cast<std::size_t>(irregularity.marksKnots)); | |
| 268 | 72233 | for (double& knot : outline.marks) { | |
| 269 | 70662 | knot = amplitude * (2.0 * marks.NextDouble() - 1.0); | |
| 270 | } | ||
| 271 | 1571 | outline.marksInnerRadii = irregularity.marksInnerRadii; | |
| 272 | 1571 | outline.marksOuterRadii = irregularity.marksOuterRadii; | |
| 273 | 1571 | outline.marksFadeRadii = irregularity.marksFadeRadii; | |
| 274 | } | ||
| 275 | } | ||
| 276 | return outline; | ||
| 277 | } | ||
| 278 | |||
| 279 | 4193 | double MaxOutlineScale(const CraterIrregularity& irregularity) { | |
| 280 | 4193 | if (!irregularity.enabled) { | |
| 281 | return 1.0; | ||
| 282 | } | ||
| 283 | 3482 | const int harmonics = irregularity.maxHarmonic - irregularity.minHarmonic + 1; | |
| 284 | 3482 | double rough = 1.0; | |
| 285 | 3482 | if (irregularity.roughShare > 0.0) { | |
| 286 | 3482 | rough = irregularity.model == RimRoughnessModel::Du2024 | |
| 287 | 3482 | ? 1.0 + irregularity.maxDeviation | |
| 288 | 3481 | : 1.0 + irregularity.roughness.Highest() * std::sqrt(2.0 * harmonics); | |
| 289 | } | ||
| 290 | 3482 | const double elongated = | |
| 291 | 3482 | irregularity.elongatedShare > 0.0 ? std::sqrt(irregularity.ellipticity.Highest()) : 1.0; | |
| 292 | 3482 | return rough * elongated; | |
| 293 | } | ||
| 294 | |||
| 295 | 2088667 | void AppendKernelOutline(const CraterOutline& outline, CraterRecord& record, | |
| 296 | std::vector<float>& data) { | ||
| 297 | 2088667 | record.ellipticity = static_cast<float>(outline.ellipticity); | |
| 298 | 2088667 | record.heading = static_cast<float>(outline.heading); | |
| 299 | 2088667 | record.harmonicOffset = static_cast<std::uint32_t>(data.size()); | |
| 300 | 2088667 | if (outline.table.empty()) { | |
| 301 | 2066189 | record.firstHarmonic = static_cast<std::uint32_t>(outline.firstHarmonic); | |
| 302 | 2066189 | record.harmonicCount = static_cast<std::uint32_t>(outline.amplitudes.size()); | |
| 303 | 9409101 | for (std::size_t n = 0; n < outline.amplitudes.size(); ++n) { | |
| 304 | 7342926 | data.push_back(static_cast<float>(outline.amplitudes[n])); | |
| 305 | 7342883 | data.push_back(static_cast<float>(outline.phases[n])); | |
| 306 | } | ||
| 307 | } else { | ||
| 308 | 22478 | record.firstHarmonic = 1u; | |
| 309 | 22478 | record.harmonicCount = static_cast<std::uint32_t>(kTableBroadHarmonics); | |
| 310 | 22478 | AppendBroadHarmonics(outline.table, data); | |
| 311 | } | ||
| 312 | 2088713 | record.tableCount = static_cast<std::uint32_t>(outline.table.size()); | |
| 313 | 2088713 | record.tableOffset = static_cast<std::uint32_t>(data.size()); | |
| 314 | 25106185 | for (const double deviation : outline.table) { | |
| 315 | 23017476 | data.push_back(static_cast<float>(deviation)); | |
| 316 | } | ||
| 317 | 2088709 | record.markCount = static_cast<std::uint32_t>(outline.marks.size()); | |
| 318 | 2088709 | record.markOffset = static_cast<std::uint32_t>(data.size()); | |
| 319 | 2088709 | if (!outline.marks.empty()) { | |
| 320 | 534660 | for (const double radii : | |
| 321 | 305520 | {outline.marksInnerRadii, outline.marksOuterRadii, outline.marksFadeRadii}) { | |
| 322 | 229140 | data.push_back(static_cast<float>(radii)); | |
| 323 | } | ||
| 324 | 3372466 | for (const double knot : outline.marks) { | |
| 325 | 3296086 | data.push_back(static_cast<float>(knot)); | |
| 326 | } | ||
| 327 | } | ||
| 328 | 2088709 | } | |
| 329 | |||
| 330 | 1744910 | KernelOutline::KernelOutline(const CraterOutline& outline, double diameter) | |
| 331 | 1744910 | : m_round(outline.Round()) { | |
| 332 | 1745137 | m_record.diameter = static_cast<float>(diameter); | |
| 333 | 1745137 | m_data.clear(); | |
| 334 | 1745121 | AppendKernelOutline(outline, m_record, m_data); | |
| 335 | 1745150 | if (m_data.empty()) { | |
| 336 | 1092526 | m_data.push_back(0.0f); | |
| 337 | } | ||
| 338 | 1745103 | } | |
| 339 | |||
| 340 | 93249 | double KernelOutline::Scale(const Vec2d& offset) const { | |
| 341 | 186498 | return static_cast<double>(KernelOutlineScale(Data(), m_record, static_cast<float>(offset.x), | |
| 342 | 93249 | static_cast<float>(offset.y))); | |
| 343 | } | ||
| 344 | |||
| 345 | 29278 | double KernelOutline::MarkShift(const Vec2d& offset, double radii) const { | |
| 346 | 29278 | if (m_record.markCount == 0u) { | |
| 347 | return 0.0; | ||
| 348 | } | ||
| 349 | 29277 | return static_cast<double>(KernelMarkShift(Data(), m_record, static_cast<float>(offset.x), | |
| 350 | 29277 | static_cast<float>(offset.y), | |
| 351 | 29277 | static_cast<float>(radii))); | |
| 352 | } | ||
| 353 | |||
| 354 | 2727768 | double KernelOutline::ProfileDistance(const Vec2d& offset) const { | |
| 355 | 2727768 | if (m_round) { | |
| 356 | 2113773 | return std::sqrt(offset.x * offset.x + offset.y * offset.y); | |
| 357 | } | ||
| 358 | 613995 | return static_cast<double>(KernelProfileDistance(Data(), m_record, static_cast<float>(offset.x), | |
| 359 | 613995 | static_cast<float>(offset.y))); | |
| 360 | } | ||
| 361 | |||
| 362 | 135802 | double CraterProfileDistance(const Crater& crater, const CraterOutline& outline, double x, double y, | |
| 363 | const Surface& surface) { | ||
| 364 | 135802 | return CraterProfileDistance(crater, outline, surface.Offset({crater.x, crater.y}, {x, y})); | |
| 365 | } | ||
| 366 | |||
| 367 | 135803 | double CraterProfileDistance(const Crater& crater, const CraterOutline& outline, | |
| 368 | const Vec2d& offset) { | ||
| 369 | 135803 | return KernelOutline(outline, crater.diameter).ProfileDistance(offset); | |
| 370 | } | ||
| 371 | |||
| 372 | } // namespace terraingen | ||
| 373 |