Files
STPViewer/tools/SmokeTest/BBoxDump.cs
etwenandClaude Opus 4.8 3556e25e96 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>
2026-06-18 16:49:07 +08:00

29 lines
1.0 KiB
C#

// 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);
}
}