diff --git a/docs/release-notes/v0.3.1.md b/docs/release-notes/v0.3.1.md new file mode 100644 index 0000000..494c9d0 --- /dev/null +++ b/docs/release-notes/v0.3.1.md @@ -0,0 +1,56 @@ +# v0.3.1 — First public release: 3D STEP viewer with measurement & assembly fit-check + +A lightweight Windows desktop viewer for STEP / STL / DXF — open a part, measure it, +and check how two parts fit together, without firing up a heavyweight CAD suite. + +## ✨ New features + +**View & assembly tree** +* Import multiple CAD files at once (STEP / STL / DXF) via the toolbar, drag-and-drop, + or the command line (`STPViewer.exe a.stp b.stp`). +* STEP product structure is rebuilt into an **assembly tree** — toggle visibility, recolor + (cascades to children), and zoom-to any node; whole-file remove and outline-edge toggle. +* Smooth orbit / zoom / pan even on large assemblies (hundreds of thousands of triangles). + +**Measurement** (pick a mode, click the model) +* Point (snaps to nearby vertices), two-point distance + ΔX/ΔY/ΔZ, edge length + (line / curve / arc with radius), face area + surface type, circle center / radius / + diameter / circumference, angle between two faces or edges, and face-to-face minimum gap. +* Edge length, radius and angle use **exact B-rep values**; area and gap are mesh-based. +* Switch units **mm ⇄ inch** anytime — existing measurements and 3D labels convert live. + +**Assembly fit-check** (mate a male/female pair and verify) +* **Two-point align** — click a point on the part to move, then the target point, to slide + the whole file into place. +* **Three-point align** — pick 3 feature points on each file to solve a full rotate+translate + in one shot, for parts that aren't already oriented the same way. +* **Axis rotate** — rotate the selected file ±90° about X / Y / Z to square it up. +* **Drag mode** (hand cursor) — left-press a part and drag it along the screen plane. +* **Gizmo** — XYZ arrows to move along an axis (independent of view angle, ideal for pushing + along a mating axis) and rings to rotate any angle. The gizmo always renders on top, so it + is never hidden inside a solid part. +* **Interference check** — for two visible files, shows red intersection lines where they + collide, or the minimum gap when they don't (gap ≈ 0 means a clean fit). + +**Section & export** +* Section view along X / Y / Z with a position slider and flip, to inspect mating internals. +* Export measurements to CSV (opens cleanly in Excel) and save a 2× PNG screenshot of the view. + +## 📦 Downloads + +Two builds are produced: + +| Build | Needs .NET 8 Desktop Runtime? | Notes | +|-------|-------------------------------|-------| +| **Standard** (`STPViewer_v0.3.1`) | ✅ Yes | Smaller; for machines that already have the runtime | +| **Portable** (`STPViewer_v0.3.1_portable`) | ❌ No | Runtime bundled — unzip and run, no install / admin needed | + +Run `STPViewer v0.3.1.exe`. + +## 🔗 Links +* Overview & usage: + [README.md](https://github.com/ETWen/STPViewer/blob/main/README.md) +* Architecture & design: + [ARCHITECTURE.md](https://github.com/ETWen/STPViewer/blob/main/ARCHITECTURE.md) + +**Full changelog:** first public release — [commit history](https://github.com/ETWen/STPViewer/commits/v0.3.1) diff --git a/tools/SmokeTest/BBoxDump.cs b/tools/SmokeTest/BBoxDump.cs new file mode 100644 index 0000000..5a21384 --- /dev/null +++ b/tools/SmokeTest/BBoxDump.cs @@ -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); + } +} diff --git a/tools/SmokeTest/Program.cs b/tools/SmokeTest/Program.cs index f26a8d3..7960ce9 100644 --- a/tools/SmokeTest/Program.cs +++ b/tools/SmokeTest/Program.cs @@ -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;