fix bug of cubetree init SAT and triangles-tip-cube-corner margin case.

This commit is contained in:
2026-03-25 12:40:37 +08:00
parent ff2cfa6210
commit 8aa17a0280
58 changed files with 1123 additions and 986 deletions
@@ -269,96 +269,6 @@ Class PathUtil
<a id="Hi_Common_PathUtils_PathUtil_CombineAsSubDirectory_" data-uid="Hi.Common.PathUtils.PathUtil.CombineAsSubDirectory*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_CombineAsSubDirectory_System_String_System_String_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.CombineAsSubDirectory(System.String,System.String,System.String)">
CombineAsSubDirectory(string, string, string)
</h3>
<div class="markdown level1 summary"><p>Combines a base directory with a relative file path and appends a suffix
to derive a sub-directory path. The suffix is only appended when
<code class="paramref">relFile</code> is not null or whitespace.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string CombineAsSubDirectory(string baseDirectory, string relFile, string suffixIfAdded = &quot;-src&quot;)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The base directory.</p>
</dd>
<dt><code>relFile</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The relative file path.</p>
</dd>
<dt><code>suffixIfAdded</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The suffix appended to the combined path
when <code class="paramref">relFile</code> is not null or whitespace.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The combined sub-directory path with forward slashes as directory separators.</p>
</dd>
</dl>
<a id="Hi_Common_PathUtils_PathUtil_GetConcatedDirectoryName_" data-uid="Hi.Common.PathUtils.PathUtil.GetConcatedDirectoryName*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_GetConcatedDirectoryName_System_String_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.GetConcatedDirectoryName(System.String,System.String)">
GetConcatedDirectoryName(string, string)
</h3>
<div class="markdown level1 summary"><p>Gets the directory name from a combined base directory and relative file path.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string GetConcatedDirectoryName(string baseDirectory, string relFile)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The base directory</p>
</dd>
<dt><code>relFile</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The relative file path</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The directory name of the combined path with forward slashes as directory separators</p>
</dd>
</dl>
<a id="Hi_Common_PathUtils_PathUtil_GetDirectoryName_" data-uid="Hi.Common.PathUtils.PathUtil.GetDirectoryName*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_GetDirectoryName_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.GetDirectoryName(System.String)">
@@ -398,10 +308,52 @@ when <code class="paramref">relFile</code> is not null or whitespace.</p>
<a id="Hi_Common_PathUtils_PathUtil_GetParentIgnoreTailSlash_" data-uid="Hi.Common.PathUtils.PathUtil.GetParentIgnoreTailSlash*"></a>
<a id="Hi_Common_PathUtils_PathUtil_GetFileDirectory_" data-uid="Hi.Common.PathUtils.PathUtil.GetFileDirectory*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_GetParentIgnoreTailSlash_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.GetParentIgnoreTailSlash(System.String)">
GetParentIgnoreTailSlash(string)
<h3 id="Hi_Common_PathUtils_PathUtil_GetFileDirectory_System_String_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.GetFileDirectory(System.String,System.String)">
GetFileDirectory(string, string)
</h3>
<div class="markdown level1 summary"><p>Gets the directory name from a combined base directory and relative file path.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string GetFileDirectory(string baseDirectory, string relFile)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The base directory</p>
</dd>
<dt><code>relFile</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The relative file path</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The directory name of the combined path with forward slashes as directory separators</p>
</dd>
</dl>
<a id="Hi_Common_PathUtils_PathUtil_GetParentDirectory_" data-uid="Hi.Common.PathUtils.PathUtil.GetParentDirectory*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_GetParentDirectory_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.GetParentDirectory(System.String)">
GetParentDirectory(string)
</h3>
@@ -410,7 +362,7 @@ when <code class="paramref">relFile</code> is not null or whitespace.</p>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string GetParentIgnoreTailSlash(this string path)</code></pre>
<pre><code class="lang-csharp hljs">public static string GetParentDirectory(this string path)</code></pre>
</div>
<h4 class="section">Parameters</h4>
@@ -527,10 +479,10 @@ when <code class="paramref">relFile</code> is not null or whitespace.</p>
<a id="Hi_Common_PathUtils_PathUtil_GetRelativePathIfIsDescendant_" data-uid="Hi.Common.PathUtils.PathUtil.GetRelativePathIfIsDescendant*"></a>
<a id="Hi_Common_PathUtils_PathUtil_GetRelativePathIfDescendant_" data-uid="Hi.Common.PathUtils.PathUtil.GetRelativePathIfDescendant*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_GetRelativePathIfIsDescendant_System_String_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.GetRelativePathIfIsDescendant(System.String,System.String)">
GetRelativePathIfIsDescendant(string, string)
<h3 id="Hi_Common_PathUtils_PathUtil_GetRelativePathIfDescendant_System_String_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.GetRelativePathIfDescendant(System.String,System.String)">
GetRelativePathIfDescendant(string, string)
</h3>
@@ -539,7 +491,7 @@ when <code class="paramref">relFile</code> is not null or whitespace.</p>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string GetRelativePathIfIsDescendant(string relativeTo, string path)</code></pre>
<pre><code class="lang-csharp hljs">public static string GetRelativePathIfDescendant(string relativeTo, string path)</code></pre>
</div>
<h4 class="section">Parameters</h4>
@@ -570,6 +522,54 @@ Forward slashes are used as directory separators in either case.</p>
<a id="Hi_Common_PathUtils_PathUtil_GetResourceDirectory_" data-uid="Hi.Common.PathUtils.PathUtil.GetResourceDirectory*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_GetResourceDirectory_System_String_System_String_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.GetResourceDirectory(System.String,System.String,System.String)">
GetResourceDirectory(string, string, string)
</h3>
<div class="markdown level1 summary"><p>Combines a base directory with a relative file path and appends a suffix
to derive a sub-directory path. The suffix is only appended when
<code class="paramref">relFile</code> is not null or whitespace.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string GetResourceDirectory(string baseDirectory, string relFile, string suffixIfAdded = &quot;-src&quot;)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The base directory.</p>
</dd>
<dt><code>relFile</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The relative file path.</p>
</dd>
<dt><code>suffixIfAdded</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The suffix appended to the combined path
when <code class="paramref">relFile</code> is not null or whitespace.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The combined sub-directory path with forward slashes as directory separators.</p>
</dd>
</dl>
<a id="Hi_Common_PathUtils_PathUtil_IsDescendant_" data-uid="Hi.Common.PathUtils.PathUtil.IsDescendant*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_IsDescendant_System_IO_DirectoryInfo_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.IsDescendant(System.IO.DirectoryInfo,System.String)">
@@ -654,91 +654,10 @@ Forward slashes are used as directory separators in either case.</p>
<a id="Hi_Common_PathUtils_PathUtil_IsDescendantByRelPath_" data-uid="Hi.Common.PathUtils.PathUtil.IsDescendantByRelPath*"></a>
<a id="Hi_Common_PathUtils_PathUtil_NormalizeToForwardSlash_" data-uid="Hi.Common.PathUtils.PathUtil.NormalizeToForwardSlash*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_IsDescendantByRelPath_System_String_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.IsDescendantByRelPath(System.String,System.String)">
IsDescendantByRelPath(string, string)
</h3>
<div class="markdown level1 summary"><p>Determines whether a path is a descendant of a specified directory using relative path calculation.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool IsDescendantByRelPath(string ascendentDirectory, string descendantPath)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>ascendentDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The potential ancestor directory path</p>
</dd>
<dt><code>descendantPath</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The path to check</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>True if the path is a descendant of the directory; otherwise, false</p>
</dd>
</dl>
<a id="Hi_Common_PathUtils_PathUtil_RemoveTailSlashIfExisted_" data-uid="Hi.Common.PathUtils.PathUtil.RemoveTailSlashIfExisted*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_RemoveTailSlashIfExisted_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.RemoveTailSlashIfExisted(System.String)">
RemoveTailSlashIfExisted(string)
</h3>
<div class="markdown level1 summary"><p>Removes the trailing slash or backslash from a path if it exists.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string RemoveTailSlashIfExisted(this string path)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>path</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The path to process</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The path without a trailing slash or backslash</p>
</dd>
</dl>
<a id="Hi_Common_PathUtils_PathUtil_ReplaceDirectorySeparator_" data-uid="Hi.Common.PathUtils.PathUtil.ReplaceDirectorySeparator*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_ReplaceDirectorySeparator_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.ReplaceDirectorySeparator(System.String)">
ReplaceDirectorySeparator(string)
<h3 id="Hi_Common_PathUtils_PathUtil_NormalizeToForwardSlash_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.NormalizeToForwardSlash(System.String)">
NormalizeToForwardSlash(string)
</h3>
@@ -747,7 +666,7 @@ Forward slashes are used as directory separators in either case.</p>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string ReplaceDirectorySeparator(this string src)</code></pre>
<pre><code class="lang-csharp hljs">public static string NormalizeToForwardSlash(this string src)</code></pre>
</div>
<h4 class="section">Parameters</h4>
@@ -782,9 +701,9 @@ Forward slashes are used as directory separators in either case.</p>
</h3>
<div class="markdown level1 summary"><p>Resolves the sub-directory for loading with legacy fallback.
Returns the <a class="xref" href="Hi.Common.PathUtils.PathUtil.html#Hi_Common_PathUtils_PathUtil_CombineAsSubDirectory_System_String_System_String_System_String_">CombineAsSubDirectory(string, string, string)</a> path if it exists;
otherwise falls back to the legacy <a class="xref" href="Hi.Common.PathUtils.PathUtil.html#Hi_Common_PathUtils_PathUtil_GetConcatedDirectoryName_System_String_System_String_">GetConcatedDirectoryName(string, string)</a> path
if it exists; otherwise defaults to the <a class="xref" href="Hi.Common.PathUtils.PathUtil.html#Hi_Common_PathUtils_PathUtil_CombineAsSubDirectory_System_String_System_String_System_String_">CombineAsSubDirectory(string, string, string)</a> path.</p>
Returns the <a class="xref" href="Hi.Common.PathUtils.PathUtil.html#Hi_Common_PathUtils_PathUtil_GetResourceDirectory_System_String_System_String_System_String_">GetResourceDirectory(string, string, string)</a> path if it exists;
otherwise falls back to the legacy <a class="xref" href="Hi.Common.PathUtils.PathUtil.html#Hi_Common_PathUtils_PathUtil_GetFileDirectory_System_String_System_String_">GetFileDirectory(string, string)</a> path
if it exists; otherwise defaults to the <a class="xref" href="Hi.Common.PathUtils.PathUtil.html#Hi_Common_PathUtils_PathUtil_GetResourceDirectory_System_String_System_String_System_String_">GetResourceDirectory(string, string, string)</a> path.</p>
</div>
<div class="markdown level1 conceptual"></div>
@@ -822,6 +741,45 @@ if it exists; otherwise defaults to the <a class="xref" href="Hi.Common.PathUtil
<a id="Hi_Common_PathUtils_PathUtil_TrimTrailingSlash_" data-uid="Hi.Common.PathUtils.PathUtil.TrimTrailingSlash*"></a>
<h3 id="Hi_Common_PathUtils_PathUtil_TrimTrailingSlash_System_String_" data-uid="Hi.Common.PathUtils.PathUtil.TrimTrailingSlash(System.String)">
TrimTrailingSlash(string)
</h3>
<div class="markdown level1 summary"><p>Removes the trailing slash or backslash from a path if it exists.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string TrimTrailingSlash(this string path)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>path</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The path to process</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The path without a trailing slash or backslash</p>
</dd>
</dl>
</article>