This commit is contained in:
2026-09-09 17:35:23 +08:00
parent 2a98ae7556
commit 161af68fe3
1271 changed files with 58251 additions and 98639 deletions
@@ -593,6 +593,51 @@ This function is usually used to compute the bounding box of elements.</p>
<a id="Hi_Geom_StlFile_LoadStlByFile_" data-uid="Hi.Geom.StlFile.LoadStlByFile*"></a>
<h3 id="Hi_Geom_StlFile_LoadStlByFile_System_String_System_Threading_CancellationToken_" data-uid="Hi.Geom.StlFile.LoadStlByFile(System.String,System.Threading.CancellationToken)">
LoadStlByFile(string, CancellationToken)
</h3>
<div class="markdown level1 summary"><p>Loads an STL file from the specified base directory into the cache, with
cooperative cancellation of the underlying read. A cancelled load throws
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.operationcanceledexception">OperationCanceledException</a> and leaves <a class="xref" href="Hi.Geom.StlFile.html#Hi_Geom_StlFile_CacheStl">CacheStl</a>
unchanged (the previous cache, if any, stays valid).</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Stl LoadStlByFile(string baseDirectory, CancellationToken cancel)</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 where the file is located</p>
</dd>
<dt><code>cancel</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a></dt>
<dd><p>Token to cancel the read</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Stl.html">Stl</a></dt>
<dd><p>The loaded STL object, or null if the file path is empty</p>
</dd>
</dl>
<a id="Hi_Geom_StlFile_MakeXmlSource_" data-uid="Hi.Geom.StlFile.MakeXmlSource*"></a>
<h3 id="Hi_Geom_StlFile_MakeXmlSource_System_String_System_String_System_Boolean_" data-uid="Hi.Geom.StlFile.MakeXmlSource(System.String,System.String,System.Boolean)">
@@ -707,6 +752,13 @@ Since the folder can be moving with the configuration file.</p>
<h4 class="section" id="Hi_Geom_StlFile_SaveStlToFile_System_String__remarks">Remarks</h4>
<div class="markdown level1 remarks"><p>Does nothing when there is no path or no cached mesh. A source file that
was never loaded (missing on disk) must stay missing — the read side
then reports a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.filenotfoundexception">FileNotFoundException</a> naming the path —
rather than be replaced by a 0-byte STL, which reads back as an opaque
&ldquo;Stl Loading failed&rdquo; and gets committed into project repositories.</p>
</div>