chore: Add --bbox SmokeTest diagnostic and v0.3.1 release notes

BBoxDump prints per-leaf world-space bounding boxes (to work out each
connector's mating-face axis); wired as `SmokeTest --bbox <file>`. Also tracks
the previously untracked v0.3.1 release notes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-18 16:49:07 +08:00
co-authored by Claude Opus 4.8
parent e27fd17eb8
commit 3556e25e96
3 changed files with 87 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
// One-shot diagnostic: print per-leaf world-space bounding boxes so we can
// figure out each connector's mating-face normal (axis the guide posts / holes point).
using STPViewer.Services;
namespace SmokeTest;
internal static class BBoxDump
{
public static int Run(string path)
{
var svc = new StepImportService();
ImportedFileData data = svc.Import(path);
System.Console.WriteLine($"=== {System.IO.Path.GetFileName(path)} ===");
Print(data.Root, 0);
return 0;
}
private static void Print(ImportedNode n, int depth)
{
var b = n.Bounds;
string box = b.IsEmpty
? "(empty)"
: $"X[{b.X,8:F1}..{b.X + b.SizeX,8:F1}] Y[{b.Y,8:F1}..{b.Y + b.SizeY,8:F1}] Z[{b.Z,8:F1}..{b.Z + b.SizeZ,8:F1}] " +
$"size {b.SizeX,7:F1} x {b.SizeY,7:F1} x {b.SizeZ,7:F1}";
System.Console.WriteLine($"{new string(' ', depth * 2)}{n.Name,-28} {box}");
foreach (ImportedNode c in n.Children) Print(c, depth + 1);
}
}
+3
View File
@@ -32,6 +32,9 @@ if (args[0] == "--interference-test")
if (args[0] == "--align-test")
return SmokeTest.AlignTest.Run() == 0 ? 0 : 2;
if (args[0] == "--bbox")
return SmokeTest.BBoxDump.Run(args[1]);
var service = new StepImportService { Progress = s => Console.WriteLine($" [階段] {s}") };
int failed = 0;