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
@@ -365,6 +365,47 @@ The content of <code class="paramref">tris</code> is copied by <code>this.tris =
<a id="Hi_Geom_Stl__ctor_" data-uid="Hi.Geom.Stl.#ctor*"></a>
<h3 id="Hi_Geom_Stl__ctor_System_IO_Stream_Hi_Geom_Stl_StlType_System_Threading_CancellationToken_" data-uid="Hi.Geom.Stl.#ctor(System.IO.Stream,Hi.Geom.Stl.StlType,System.Threading.CancellationToken)">
Stl(Stream, StlType, CancellationToken)
</h3>
<div class="markdown level1 summary"><p>Ctor by stream with cooperative cancellation. The reading loops observe
<code class="paramref">cancel</code> periodically.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Stl(Stream stream, Stl.StlType stlType, CancellationToken cancel)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>stream</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></dt>
<dd><p>stl data stream</p>
</dd>
<dt><code>stlType</code> <a class="xref" href="Hi.Geom.Stl.html">Stl</a>.<a class="xref" href="Hi.Geom.Stl.StlType.html">StlType</a></dt>
<dd><p>stl data format</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; cancelling throws
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.operationcanceledexception">OperationCanceledException</a> and leaves this instance unusable.</p>
</dd>
</dl>
<a id="Hi_Geom_Stl__ctor_" data-uid="Hi.Geom.Stl.#ctor*"></a>
<h3 id="Hi_Geom_Stl__ctor_System_Int32_" data-uid="Hi.Geom.Stl.#ctor(System.Int32)">
@@ -434,6 +475,85 @@ The content of <code class="paramref">tris</code> is copied by <code>this.tris =
<a id="Hi_Geom_Stl__ctor_" data-uid="Hi.Geom.Stl.#ctor*"></a>
<h3 id="Hi_Geom_Stl__ctor_System_String_Hi_Geom_Stl_StlType_System_Threading_CancellationToken_" data-uid="Hi.Geom.Stl.#ctor(System.String,Hi.Geom.Stl.StlType,System.Threading.CancellationToken)">
Stl(string, StlType, CancellationToken)
</h3>
<div class="markdown level1 summary"><p>Ctor by file with cooperative cancellation. The reading loops observe
<code class="paramref">cancel</code> periodically, so aborting a large file load
(hundreds of MB) takes effect promptly instead of running to completion.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Stl(string file, Stl.StlType stlType, CancellationToken cancel)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>file</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>stl file</p>
</dd>
<dt><code>stlType</code> <a class="xref" href="Hi.Geom.Stl.html">Stl</a>.<a class="xref" href="Hi.Geom.Stl.StlType.html">StlType</a></dt>
<dd><p>stl file format</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; cancelling throws
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.operationcanceledexception">OperationCanceledException</a> and leaves this instance unusable.</p>
</dd>
</dl>
<h2 class="section" id="fields">Fields
</h2>
<h3 id="Hi_Geom_Stl_DegenerateCrossTolerance" data-uid="Hi.Geom.Stl.DegenerateCrossTolerance">
DegenerateCrossTolerance
</h3>
<div class="markdown level1 summary"><p>Cross-product length below which a triangle counts as degenerate for
<a class="xref" href="Hi.Geom.Stl.html#Hi_Geom_Stl_RemoveDegenerateTris_System_Double_">RemoveDegenerateTris(double)</a> (1e-12 mm², i.e. two edges
collinear or a vertex pair coincident to ~1e-6 mm).</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const double DegenerateCrossTolerance = 1E-12</code></pre>
</div>
<h4 class="section">Field Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd></dd>
</dl>
<h2 class="section" id="properties">Properties
</h2>
@@ -678,6 +798,46 @@ This function is usually used to compute the bounding box of elements.</p>
<a id="Hi_Geom_Stl_RemoveDegenerateTris_" data-uid="Hi.Geom.Stl.RemoveDegenerateTris*"></a>
<h3 id="Hi_Geom_Stl_RemoveDegenerateTris_System_Double_" data-uid="Hi.Geom.Stl.RemoveDegenerateTris(System.Double)">
RemoveDegenerateTris(double)
</h3>
<div class="markdown level1 summary"><p>Drops triangles whose cross product is (numerically) the zero vector.
A mesh consumer that orients triangles exactly — the native sweep —
aborts on such a triangle, and it contributes no surface anyway.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public int RemoveDegenerateTris(double crossTolerance = 1E-12)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>crossTolerance</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The number of triangles removed.</p>
</dd>
</dl>
<a id="Hi_Geom_Stl_Transform_" data-uid="Hi.Geom.Stl.Transform*"></a>
<h3 id="Hi_Geom_Stl_Transform_Hi_Geom_Mat4d_" data-uid="Hi.Geom.Stl.Transform(Hi.Geom.Mat4d)">