Files
STPViewer/tools/SmokeTest/TreeDump.cs
T
etwenandClaude Opus 5.5 c65fc4e67f docs: restore Chinese design-rationale comments after i18n merge
PR #1 condensed the existing Chinese comments into shorter English,
dropping the 'why / don't revert to X' notes the project relies on
(merged-mesh face lookup, Identity-not-null transforms, background
section clip, ...). Restore the original comments verbatim where the
code is unchanged; new i18n code keeps its English comments. Two
FacesContent/MergedContent notes are corrected to the current render
modes. Comment-only change (verified: comment-stripped code identical).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 09:48:56 +08:00

33 lines
1012 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 實驗工具:印出 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);
}
}