Editor/Output/ArchShot.Format.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Sandbox;
namespace Sunless.Architecture;
public static partial class ArchShot {
// Feet to room scale, then metres - the units the kit and palette are authored in.
static float Step( float span ) {
var candidates = new[] { 1f, 2f, 3f, 6f, 12f, 24f, 36f, MetresToInches, MetresToInches * 2f, MetresToInches * 5f, MetresToInches * 10f, MetresToInches * 25f };
foreach ( var candidate in candidates ) {
if ( span / candidate <= 14f ) {
return candidate;
}
}
return MetresToInches * 50f;
}
static float Ceiled( float value, float step ) => MathF.Ceiling( value / step ) * step;
static string Say( Vector3 point ) => $"({point.x:0.#}, {point.y:0.#}, {point.z:0.#})";
}