STP/STEP 3D viewer (WPF, .NET 8) - CADability + HelixToolkit.Wpf: - Multi-file import (STEP/STL/DXF) with STEP assembly tree (per-node visibility/color cascade, zoom-to) - Measurements: point / distance / edge / face / circle / angle / face-to-face distance (B-rep exact where available) - Assembly verification: two-point align (translate), 3-point align (rotate+translate via RigidAlign), axis rotate 90, interference check (tri-tri intersection + min gap) - Section view (CPU mesh clipping, originals preserved) - mm/inch toggle, CSV export (UTF-8 BOM), 2x PNG screenshot - Performance: per-file merged edge lines, per-leaf merged mesh in browse mode, no BackMaterial on closed solids, edge suspend during camera interaction, parallel leaf triangulation with retry - SmokeTest CLI: import pipeline, --tree, --clip-test, --interference-test, --align-test (all passing) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
33 lines
1012 B
C#
33 lines
1012 B
C#
// 實驗工具:印出 STEP 匯入後的物件階層(HierarchyToBlocks=true)
|
||
using CADability;
|
||
using CADability.GeoObject;
|
||
|
||
namespace SmokeTest;
|
||
|
||
internal static class TreeDump
|
||
{
|
||
public static void Run(string path)
|
||
{
|
||
var imp = new ImportStep { HierarchyToBlocks = true };
|
||
GeoObjectList list = imp.Read(path);
|
||
Console.WriteLine($"top-level objects: {list?.Count}");
|
||
if (list is null) return;
|
||
foreach (IGeoObject go in list) Dump(go, 0);
|
||
}
|
||
|
||
private static void Dump(IGeoObject go, int indent)
|
||
{
|
||
string name = go switch
|
||
{
|
||
Block b => b.Name,
|
||
Solid s => s.NameOrEmpty,
|
||
Shell sh => sh.NameOrEmpty,
|
||
_ => "",
|
||
};
|
||
Console.WriteLine($"{new string(' ', indent * 2)}{go.GetType().Name} '{name}' children={go.NumChildren}");
|
||
if (indent > 6) return;
|
||
for (int i = 0; i < go.NumChildren; i++)
|
||
if (go.Child(i) is IGeoObject c) Dump(c, indent + 1);
|
||
}
|
||
}
|