refactor(posts): move post-processor projects under Posts/
Group the Cincinnati and GravographIS plugin projects in a Posts/ folder so new machine posts have one home. Project names, namespaces, and the runtime Posts/ deploy target are unchanged; only relative paths in the solution and project references move.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
namespace OpenNest.Posts.Cincinnati
|
||||
{
|
||||
public sealed class SpeedClassifier
|
||||
{
|
||||
public double FastThreshold { get; set; } = 0.5;
|
||||
public double SlowThreshold { get; set; } = 0.1;
|
||||
|
||||
public string Classify(double contourLength, double sheetDiagonal)
|
||||
{
|
||||
var ratio = contourLength / sheetDiagonal;
|
||||
if (ratio >= FastThreshold)
|
||||
return "FAST";
|
||||
if (ratio <= SlowThreshold)
|
||||
return "SLOW";
|
||||
return "MEDIUM";
|
||||
}
|
||||
|
||||
public string FormatCutDist(double contourLength, double sheetDiagonal)
|
||||
{
|
||||
return $"CutDist={FormatValue(contourLength)}/{FormatValue(sheetDiagonal)}";
|
||||
}
|
||||
|
||||
private static string FormatValue(double value)
|
||||
{
|
||||
// Cincinnati convention: no leading zero for values < 1 (e.g., ".8702" not "0.8702")
|
||||
var rounded = System.Math.Round(value, 4);
|
||||
var str = rounded.ToString("0.####", System.Globalization.CultureInfo.InvariantCulture);
|
||||
if (rounded > 0 && rounded < 1 && str.StartsWith("0."))
|
||||
return str.Substring(1);
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user