39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using System;
|
|
using System.IO;
|
|
|
|
public static class ShaftBreakLineClearanceTests
|
|
{
|
|
public static int Main()
|
|
{
|
|
try
|
|
{
|
|
ShaftDrawerUsesClearanceAroundBreakLines("Cad", "ShaftRawFreeForgeRoundShaftDrawer.cs");
|
|
ShaftDrawerUsesClearanceAroundBreakLines("Cad", "ShaftRawFreeForgeSquareShaftDrawer.cs");
|
|
Console.WriteLine("Shaft break-line clearance tests passed.");
|
|
return 0;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.Error.WriteLine(ex.Message);
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
private static void ShaftDrawerUsesClearanceAroundBreakLines(params string[] pathParts)
|
|
{
|
|
var sourcePath = Path.Combine(pathParts);
|
|
var source = File.ReadAllText(sourcePath);
|
|
|
|
if (!source.Contains("FeatureDrivenDrawer.GetSBreakLineXAtY("))
|
|
{
|
|
throw new InvalidOperationException(sourcePath + ": shaft break gaps must calculate the exact S break-line intersection at each horizontal line Y.");
|
|
}
|
|
|
|
if (source.Contains("xBreak - breakClearance") ||
|
|
source.Contains("xBreak + breakWidth + breakClearance"))
|
|
{
|
|
throw new InvalidOperationException(sourcePath + ": shaft break gaps must not use fixed clearance offsets.");
|
|
}
|
|
}
|
|
}
|