Files
phy/tritet/struct.Trigen.html
Orion Kindel 0ce894e6b0 doc
2025-03-18 10:30:23 -05:00

401 lines
75 KiB
HTML
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.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Implements high-level functions to call Shewchuks Triangle C-Code"><title>Trigen in tritet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tritet" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tritet/index.html">tritet</a><span class="version">0.4.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Trigen</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a><ul><li><a href="#delaunay-triangulation" title="Delaunay triangulation">Delaunay triangulation</a></li><li><a href="#voronoi-tessellation" title="Voronoi tessellation">Voronoi tessellation</a></li><li><a href="#mesh-generation" title="Mesh generation">Mesh generation</a></li></ul></li><li><a href="#definition-of-geometric-terms--by-jrshewchuk" title="Definition of geometric terms by J.R.Shewchuk">Definition of geometric terms by J.R.Shewchuk</a></li><li><a href="#boundary-markers--by-jrshewchuk" title="Boundary markers by J.R.Shewchuk">Boundary markers by J.R.Shewchuk</a></li><li><a href="#references" title="References">References</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.draw_triangles" title="draw_triangles">draw_triangles</a></li><li><a href="#method.draw_voronoi" title="draw_voronoi">draw_voronoi</a></li><li><a href="#method.generate_delaunay" title="generate_delaunay">generate_delaunay</a></li><li><a href="#method.generate_mesh" title="generate_mesh">generate_mesh</a></li><li><a href="#method.generate_voronoi" title="generate_voronoi">generate_voronoi</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.out_cell_attribute" title="out_cell_attribute">out_cell_attribute</a></li><li><a href="#method.out_cell_npoint" title="out_cell_npoint">out_cell_npoint</a></li><li><a href="#method.out_cell_point" title="out_cell_point">out_cell_point</a></li><li><a href="#method.out_ncell" title="out_ncell">out_ncell</a></li><li><a href="#method.out_npoint" title="out_npoint">out_npoint</a></li><li><a href="#method.out_nsegment" title="out_nsegment">out_nsegment</a></li><li><a href="#method.out_point" title="out_point">out_point</a></li><li><a href="#method.out_point_marker" title="out_point_marker">out_point_marker</a></li><li><a href="#method.out_segment_marker" title="out_segment_marker">out_segment_marker</a></li><li><a href="#method.out_segment_point" title="out_segment_point">out_segment_point</a></li><li><a href="#method.out_voronoi_edge_point_a" title="out_voronoi_edge_point_a">out_voronoi_edge_point_a</a></li><li><a href="#method.out_voronoi_edge_point_b" title="out_voronoi_edge_point_b">out_voronoi_edge_point_b</a></li><li><a href="#method.out_voronoi_nedge" title="out_voronoi_nedge">out_voronoi_nedge</a></li><li><a href="#method.out_voronoi_npoint" title="out_voronoi_npoint">out_voronoi_npoint</a></li><li><a href="#method.out_voronoi_point" title="out_voronoi_point">out_voronoi_point</a></li><li><a href="#method.set_hole" title="set_hole">set_hole</a></li><li><a href="#method.set_point" title="set_point">set_point</a></li><li><a href="#method.set_region" title="set_region">set_region</a></li><li><a href="#method.set_segment" title="set_segment">set_segment</a></li><li><a href="#method.write_vtu" title="write_vtu">write_vtu</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Drop-for-Trigen" title="Drop">Drop</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Send-for-Trigen" title="!Send">!Send</a></li><li><a href="#impl-Sync-for-Trigen" title="!Sync">!Sync</a></li><li><a href="#impl-Freeze-for-Trigen" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Trigen" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Unpin-for-Trigen" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Trigen" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate tritet</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">tritet</a></span><h1>Struct <span class="struct">Trigen</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tritet/trigen.rs.html#254-264">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Trigen { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implements high-level functions to call Shewchuks Triangle C-Code</p>
<p><strong>Note:</strong> All indices are are zero-based.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2><h3 id="delaunay-triangulation"><a class="doc-anchor" href="#delaunay-triangulation">§</a>Delaunay triangulation</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>plotpy::Plot;
<span class="kw">use </span>tritet::{StrError, Trigen};
<span class="kw">const </span>SAVE_FIGURE: bool = <span class="bool-val">false</span>;
<span class="kw">fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), StrError&gt; {
<span class="comment">// allocate data for 10 points
</span><span class="kw">let </span><span class="kw-2">mut </span>trigen = Trigen::new(<span class="number">10</span>, <span class="prelude-val">None</span>, <span class="prelude-val">None</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
<span class="comment">// set points
</span>trigen
.set_point(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0.478554</span>, <span class="number">0.00869692</span>)<span class="question-mark">?
</span>.set_point(<span class="number">1</span>, <span class="number">0</span>, <span class="number">0.13928</span>, <span class="number">0.180603</span>)<span class="question-mark">?
</span>.set_point(<span class="number">2</span>, <span class="number">0</span>, <span class="number">0.578587</span>, <span class="number">0.760349</span>)<span class="question-mark">?
</span>.set_point(<span class="number">3</span>, <span class="number">0</span>, <span class="number">0.903726</span>, <span class="number">0.975904</span>)<span class="question-mark">?
</span>.set_point(<span class="number">4</span>, <span class="number">0</span>, <span class="number">0.0980015</span>, <span class="number">0.981755</span>)<span class="question-mark">?
</span>.set_point(<span class="number">5</span>, <span class="number">0</span>, <span class="number">0.133721</span>, <span class="number">0.348832</span>)<span class="question-mark">?
</span>.set_point(<span class="number">6</span>, <span class="number">0</span>, <span class="number">0.648071</span>, <span class="number">0.369534</span>)<span class="question-mark">?
</span>.set_point(<span class="number">7</span>, <span class="number">0</span>, <span class="number">0.230951</span>, <span class="number">0.558482</span>)<span class="question-mark">?
</span>.set_point(<span class="number">8</span>, <span class="number">0</span>, <span class="number">0.0307942</span>, <span class="number">0.459123</span>)<span class="question-mark">?
</span>.set_point(<span class="number">9</span>, <span class="number">0</span>, <span class="number">0.540745</span>, <span class="number">0.331184</span>)<span class="question-mark">?</span>;
<span class="comment">// generate Delaunay triangulation
</span>trigen.generate_delaunay(<span class="bool-val">false</span>)<span class="question-mark">?</span>;
<span class="comment">// draw triangles
</span><span class="kw">if </span>SAVE_FIGURE {
<span class="kw">let </span><span class="kw-2">mut </span>plot = Plot::new();
trigen.draw_triangles(<span class="kw-2">&amp;mut </span>plot, <span class="bool-val">true</span>, <span class="bool-val">true</span>, <span class="bool-val">true</span>, <span class="bool-val">true</span>, <span class="prelude-val">None</span>, <span class="prelude-val">None</span>, <span class="prelude-val">None</span>);
plot.set_equal_axes(<span class="bool-val">true</span>)
.set_figure_size_points(<span class="number">600.0</span>, <span class="number">600.0</span>)
.save(<span class="string">"/tmp/tritet/doc_triangle_delaunay_1.svg"</span>)<span class="question-mark">?</span>;
}
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
<p><img src="https://raw.githubusercontent.com/cpmech/tritet/main/data/figures/doc_triangle_delaunay_1.svg" alt="doc_triangle_delaunay_1.svg" /></p>
<h3 id="voronoi-tessellation"><a class="doc-anchor" href="#voronoi-tessellation">§</a>Voronoi tessellation</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>plotpy::Plot;
<span class="kw">use </span>tritet::{StrError, Trigen};
<span class="kw">const </span>SAVE_FIGURE: bool = <span class="bool-val">false</span>;
<span class="kw">fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), StrError&gt; {
<span class="comment">// allocate data for 10 points
</span><span class="kw">let </span><span class="kw-2">mut </span>trigen = Trigen::new(<span class="number">10</span>, <span class="prelude-val">None</span>, <span class="prelude-val">None</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
<span class="comment">// set points
</span>trigen
.set_point(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0.478554</span>, <span class="number">0.00869692</span>)<span class="question-mark">?
</span>.set_point(<span class="number">1</span>, <span class="number">0</span>, <span class="number">0.13928</span>, <span class="number">0.180603</span>)<span class="question-mark">?
</span>.set_point(<span class="number">2</span>, <span class="number">0</span>, <span class="number">0.578587</span>, <span class="number">0.760349</span>)<span class="question-mark">?
</span>.set_point(<span class="number">3</span>, <span class="number">0</span>, <span class="number">0.903726</span>, <span class="number">0.975904</span>)<span class="question-mark">?
</span>.set_point(<span class="number">4</span>, <span class="number">0</span>, <span class="number">0.0980015</span>, <span class="number">0.981755</span>)<span class="question-mark">?
</span>.set_point(<span class="number">5</span>, <span class="number">0</span>, <span class="number">0.133721</span>, <span class="number">0.348832</span>)<span class="question-mark">?
</span>.set_point(<span class="number">6</span>, <span class="number">0</span>, <span class="number">0.648071</span>, <span class="number">0.369534</span>)<span class="question-mark">?
</span>.set_point(<span class="number">7</span>, <span class="number">0</span>, <span class="number">0.230951</span>, <span class="number">0.558482</span>)<span class="question-mark">?
</span>.set_point(<span class="number">8</span>, <span class="number">0</span>, <span class="number">0.0307942</span>, <span class="number">0.459123</span>)<span class="question-mark">?
</span>.set_point(<span class="number">9</span>, <span class="number">0</span>, <span class="number">0.540745</span>, <span class="number">0.331184</span>)<span class="question-mark">?</span>;
<span class="comment">// generate Voronoi tessellation
</span>trigen.generate_voronoi(<span class="bool-val">false</span>)<span class="question-mark">?</span>;
<span class="comment">// draw Voronoi diagram
</span><span class="kw">if </span>SAVE_FIGURE {
<span class="kw">let </span><span class="kw-2">mut </span>plot = Plot::new();
trigen.draw_voronoi(<span class="kw-2">&amp;mut </span>plot);
plot.set_equal_axes(<span class="bool-val">true</span>)
.set_figure_size_points(<span class="number">600.0</span>, <span class="number">600.0</span>)
.save(<span class="string">"/tmp/tritet/doc_triangle_voronoi_1.svg"</span>)<span class="question-mark">?</span>;
}
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
<p><img src="https://raw.githubusercontent.com/cpmech/tritet/main/data/figures/doc_triangle_voronoi_1.svg" alt="doc_triangle_voronoi_1.svg" /></p>
<h3 id="mesh-generation"><a class="doc-anchor" href="#mesh-generation">§</a>Mesh generation</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>plotpy::Plot;
<span class="kw">use </span>tritet::{StrError, Trigen};
<span class="kw">const </span>SAVE_FIGURE: bool = <span class="bool-val">false</span>;
<span class="kw">fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), StrError&gt; {
<span class="comment">// allocate data for 12 points, 10 segments, 2 regions, and 1 hole
</span><span class="kw">let </span><span class="kw-2">mut </span>trigen = Trigen::new(<span class="number">12</span>, <span class="prelude-val">Some</span>(<span class="number">10</span>), <span class="prelude-val">Some</span>(<span class="number">2</span>), <span class="prelude-val">Some</span>(<span class="number">1</span>))<span class="question-mark">?</span>;
<span class="comment">// set points
</span>trigen
.set_point(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0.0</span>, <span class="number">0.0</span>)<span class="question-mark">?
</span>.set_point(<span class="number">1</span>, <span class="number">0</span>, <span class="number">1.0</span>, <span class="number">0.0</span>)<span class="question-mark">?
</span>.set_point(<span class="number">2</span>, <span class="number">0</span>, <span class="number">1.0</span>, <span class="number">1.0</span>)<span class="question-mark">?
</span>.set_point(<span class="number">3</span>, <span class="number">0</span>, <span class="number">0.0</span>, <span class="number">1.0</span>)<span class="question-mark">?
</span>.set_point(<span class="number">4</span>, <span class="number">0</span>, <span class="number">0.2</span>, <span class="number">0.2</span>)<span class="question-mark">?
</span>.set_point(<span class="number">5</span>, <span class="number">0</span>, <span class="number">0.8</span>, <span class="number">0.2</span>)<span class="question-mark">?
</span>.set_point(<span class="number">6</span>, <span class="number">0</span>, <span class="number">0.8</span>, <span class="number">0.8</span>)<span class="question-mark">?
</span>.set_point(<span class="number">7</span>, <span class="number">0</span>, <span class="number">0.2</span>, <span class="number">0.8</span>)<span class="question-mark">?
</span>.set_point(<span class="number">8</span>, <span class="number">0</span>, <span class="number">0.0</span>, <span class="number">0.5</span>)<span class="question-mark">?
</span>.set_point(<span class="number">9</span>, <span class="number">0</span>, <span class="number">0.2</span>, <span class="number">0.5</span>)<span class="question-mark">?
</span>.set_point(<span class="number">10</span>, <span class="number">0</span>, <span class="number">0.8</span>, <span class="number">0.5</span>)<span class="question-mark">?
</span>.set_point(<span class="number">11</span>, <span class="number">0</span>, <span class="number">1.0</span>, <span class="number">0.5</span>)<span class="question-mark">?</span>;
<span class="comment">// set segments
</span>trigen
.set_segment(<span class="number">0</span>, -<span class="number">1</span>, <span class="number">0</span>, <span class="number">1</span>)<span class="question-mark">?
</span>.set_segment(<span class="number">1</span>, -<span class="number">1</span>, <span class="number">1</span>, <span class="number">2</span>)<span class="question-mark">?
</span>.set_segment(<span class="number">2</span>, -<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>)<span class="question-mark">?
</span>.set_segment(<span class="number">3</span>, -<span class="number">1</span>, <span class="number">3</span>, <span class="number">0</span>)<span class="question-mark">?
</span>.set_segment(<span class="number">4</span>, -<span class="number">1</span>, <span class="number">4</span>, <span class="number">5</span>)<span class="question-mark">?
</span>.set_segment(<span class="number">5</span>, -<span class="number">1</span>, <span class="number">5</span>, <span class="number">6</span>)<span class="question-mark">?
</span>.set_segment(<span class="number">6</span>, -<span class="number">1</span>, <span class="number">6</span>, <span class="number">7</span>)<span class="question-mark">?
</span>.set_segment(<span class="number">7</span>, -<span class="number">1</span>, <span class="number">7</span>, <span class="number">4</span>)<span class="question-mark">?
</span>.set_segment(<span class="number">8</span>, -<span class="number">1</span>, <span class="number">8</span>, <span class="number">9</span>)<span class="question-mark">?
</span>.set_segment(<span class="number">9</span>, -<span class="number">1</span>, <span class="number">10</span>, <span class="number">11</span>)<span class="question-mark">?</span>;
<span class="comment">// set regions
</span>trigen
.set_region(<span class="number">0</span>, <span class="number">1</span>, <span class="number">0.1</span>, <span class="number">0.1</span>, <span class="prelude-val">None</span>)<span class="question-mark">?
</span>.set_region(<span class="number">1</span>, <span class="number">2</span>, <span class="number">0.1</span>, <span class="number">0.9</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
<span class="comment">// set holes
</span>trigen.set_hole(<span class="number">0</span>, <span class="number">0.5</span>, <span class="number">0.5</span>)<span class="question-mark">?</span>;
<span class="comment">// generate o2 mesh without constraints
</span>trigen.generate_mesh(<span class="bool-val">false</span>, <span class="bool-val">true</span>, <span class="bool-val">false</span>, <span class="prelude-val">None</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
<span class="macro">assert_eq!</span>(trigen.out_ncell(), <span class="number">12</span>);
<span class="comment">// draw mesh
</span><span class="kw">if </span>SAVE_FIGURE {
<span class="kw">let </span><span class="kw-2">mut </span>plot = Plot::new();
trigen.draw_triangles(<span class="kw-2">&amp;mut </span>plot, <span class="bool-val">true</span>, <span class="bool-val">true</span>, <span class="bool-val">true</span>, <span class="bool-val">true</span>, <span class="prelude-val">None</span>, <span class="prelude-val">None</span>, <span class="prelude-val">None</span>);
plot.set_equal_axes(<span class="bool-val">true</span>)
.set_figure_size_points(<span class="number">600.0</span>, <span class="number">600.0</span>)
.save(<span class="string">"/tmp/tritet/doc_triangle_mesh_1.svg"</span>)<span class="question-mark">?</span>;
}
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
<p><img src="https://raw.githubusercontent.com/cpmech/tritet/main/data/figures/doc_triangle_mesh_1.svg" alt="doc_triangle_mesh_1.svg" /></p>
<h2 id="definition-of-geometric-terms--by-jrshewchuk"><a class="doc-anchor" href="#definition-of-geometric-terms--by-jrshewchuk">§</a>Definition of geometric terms by J.R.Shewchuk</h2>
<p>For convenience, the following definitions are mirrored from <a href="https://www.cs.cmu.edu/~quake/triangle.defs.html#ccdt">J. R. Shewchuk Triangle Website</a>.</p>
<p>A Delaunay triangulation of a vertex set is a triangulation of the vertex set with the property that no vertex in the vertex set falls in the interior of the circumcircle (circle that passes through all three vertices) of any triangle in the triangulation.</p>
<p>A Voronoi diagram of a vertex set is a subdivision of the plane into polygonal regions (some of which may be infinite), where each region is the set of points in the plane that are closer to some input vertex than to any other input vertex. (The Voronoi diagram is the geometric dual of the Delaunay triangulation.)</p>
<p>A Planar Straight Line Graph (PSLG) is a collection of vertices and segments. Segments are edges whose endpoints are vertices in the PSLG, and whose presence in any mesh generated from the PSLG is enforced.</p>
<p>A constrained Delaunay triangulation of a PSLG is similar to a Delaunay triangulation, but each PSLG segment is present as a single edge in the triangulation. A constrained Delaunay triangulation is not truly a Delaunay triangulation. Some of its triangles might not be Delaunay, but they are all constrained Delaunay.</p>
<p>A conforming Delaunay triangulation (CDT) of a PSLG is a true Delaunay triangulation in which each PSLG segment may have been subdivided into several edges by the insertion of additional vertices, called Steiner points. Steiner points are necessary to allow the segments to exist in the mesh while maintaining the Delaunay property. Steiner points are also inserted to meet constraints on the minimum angle and maximum triangle area.</p>
<p>A constrained conforming Delaunay triangulation (CCDT) of a PSLG is a constrained Delaunay triangulation that includes Steiner points. It usually takes fewer vertices to make a good-quality CCDT than a good-quality CDT, because the triangles do not need to be Delaunay (although they still must be constrained Delaunay).</p>
<h2 id="boundary-markers--by-jrshewchuk"><a class="doc-anchor" href="#boundary-markers--by-jrshewchuk">§</a>Boundary markers by J.R.Shewchuk</h2>
<p>Boundary markers are tags used mainly to identify which output vertices and edges are associated with which PSLG segment, and to identify which vertices and edges occur on a boundary of the triangulation. A common use is to determine where boundary conditions should be applied to a finite element mesh. You can prevent boundary markers from being written into files produced by Triangle by using the -B switch.</p>
<p>The boundary marker associated with each segment in an output .poly file and each edge in an output .edge file is chosen as follows:</p>
<ul>
<li>If an output edge is part or all of a PSLG segment with a nonzero boundary marker, then the edge is assigned the same marker as the segment.</li>
<li>Otherwise, if the edge occurs on a boundary of the triangulation (including boundaries of holes), then the edge is assigned the marker one (1).</li>
<li>Otherwise, the edge is assigned the marker zero (0).</li>
</ul>
<p>The boundary marker associated with each vertex in an output .node file is chosen as follows:</p>
<ul>
<li>If a vertex is assigned a nonzero boundary marker in the input file, then it is assigned the same marker in the output .node file.</li>
<li>Otherwise, if the vertex lies on a PSLG segment (including the segments endpoints) with a nonzero boundary marker, then the vertex is assigned the same marker. If the vertex lies on several such segments, one of the markers is chosen arbitrarily.</li>
<li>Otherwise, if the vertex occurs on a boundary of the triangulation, then the vertex is assigned the marker one (1).</li>
<li>Otherwise, the vertex is assigned the marker zero (0).</li>
</ul>
<p>If you want Triangle to determine for you which vertices and edges are on the boundary, assign them the boundary marker zero (or use no markers at all) in your input files. In the output files, all boundary vertices, edges, and segments will be assigned the value one.</p>
<h2 id="references"><a class="doc-anchor" href="#references">§</a>References</h2>
<p>See also <a href="https://www.cs.cmu.edu/~quake/triangle.html">J. R. Shewchuk Triangle Website</a>.</p>
<ul>
<li><strong>Jonathan Richard Shewchuk</strong>, Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator, in Applied Computational Geometry: Towards Geometric Engineering (Ming C. Lin and Dinesh Manocha, editors), volume 1148 of Lecture Notes in Computer Science, pages 203-222, Springer-Verlag, Berlin, May 1996.</li>
<li><strong>Jonathan Richard Shewchuk</strong>, Delaunay Refinement Algorithms for Triangular Mesh Generation, Computational Geometry: Theory and Applications 22(1-3):21-74, May 2002.</li>
</ul>
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Trigen" class="impl"><a class="src rightside" href="../src/tritet/trigen.rs.html#275-1013">Source</a><a href="#impl-Trigen" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Trigen.html" title="struct tritet::Trigen">Trigen</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#284-328">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>(
npoint: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>,
nsegment: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>&gt;,
nregion: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>&gt;,
nhole: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, <a class="type" href="type.StrError.html" title="type tritet::StrError">StrError</a>&gt;</h4></section></summary><div class="docblock"><p>Allocates a new instance</p>
<h5 id="input"><a class="doc-anchor" href="#input">§</a>Input</h5>
<ul>
<li><code>npoint</code> is the number of points in the input PSLG</li>
<li><code>nsegment</code> (only for <a href="struct.Trigen.html#method.generate_mesh" title="method tritet::Trigen::generate_mesh">Trigen::generate_mesh</a>) is the number of segments in the input PSLG</li>
<li><code>nregion</code> (only for <a href="struct.Trigen.html#method.generate_mesh" title="method tritet::Trigen::generate_mesh">Trigen::generate_mesh</a>) is the number of regions in the input PSLG</li>
<li><code>nhole</code> (only for <a href="struct.Trigen.html#method.generate_mesh" title="method tritet::Trigen::generate_mesh">Trigen::generate_mesh</a>) is the number of holes in the input PSLG</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_point" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#347-369">Source</a><h4 class="code-header">pub fn <a href="#method.set_point" class="fn">set_point</a>(
&amp;mut self,
index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>,
marker: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i32.html">i32</a>,
x: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>,
y: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&amp;mut Self, <a class="type" href="type.StrError.html" title="type tritet::StrError">StrError</a>&gt;</h4></section></summary><div class="docblock"><p>Sets the point coordinates</p>
<h5 id="input-1"><a class="doc-anchor" href="#input-1">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the point and goes from <code>0</code> to <code>npoint</code> (specified in <a href="struct.Trigen.html#method.new" title="associated function tritet::Trigen::new">Trigen::new</a>)</li>
<li><code>marker</code> is a marker for the point</li>
<li><code>x</code> is x-coordinate of the point</li>
<li><code>y</code> is y-coordinate of the point</li>
</ul>
<h5 id="note-about-boundary-markers--by-jrshewchuk"><a class="doc-anchor" href="#note-about-boundary-markers--by-jrshewchuk">§</a>Note about boundary markers by J.R.Shewchuk</h5>
<p>The boundary marker associated with each vertex in the output is chosen as follows:</p>
<ul>
<li>If a vertex is assigned a nonzero boundary marker in the input, then it is assigned the same marker in the output.</li>
<li>Otherwise, if the vertex lies on a PSLG segment (including the segments endpoints) with a nonzero boundary marker, then the vertex is assigned the same marker. If the vertex lies on several such segments, one of the markers is chosen arbitrarily.</li>
<li>Otherwise, if the vertex occurs on a boundary of the triangulation, then the vertex is assigned the marker one (1).</li>
<li>Otherwise, the vertex is assigned the marker zero (0).</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_segment" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#387-416">Source</a><h4 class="code-header">pub fn <a href="#method.set_segment" class="fn">set_segment</a>(
&amp;mut self,
index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>,
marker: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i32.html">i32</a>,
a: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>,
b: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&amp;mut Self, <a class="type" href="type.StrError.html" title="type tritet::StrError">StrError</a>&gt;</h4></section></summary><div class="docblock"><p>Sets the segment endpoint IDs</p>
<h5 id="input-2"><a class="doc-anchor" href="#input-2">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the segment and goes from 0 to <code>nsegment</code> (passed down to <code>new</code>)</li>
<li><code>marker</code> a marker to identify the segment (e.g., a boundary segment)</li>
<li><code>a</code> is the ID (index) of the first point on the segment</li>
<li><code>b</code> is the ID (index) of the second point on the segment</li>
</ul>
<h5 id="note-about-boundary-markers--by-jrshewchuk-1"><a class="doc-anchor" href="#note-about-boundary-markers--by-jrshewchuk-1">§</a>Note about boundary markers by J.R.Shewchuk</h5>
<p>The boundary marker associated with each segment in the output is chosen as follows:</p>
<ul>
<li>If an output edge is part or all of a PSLG segment with a nonzero boundary marker, then the edge is assigned the same marker as the segment.</li>
<li>Otherwise, if the edge occurs on a boundary of the triangulation (including boundaries of holes), then the edge is assigned the marker one (1).</li>
<li>Otherwise, the edge is assigned the marker zero (0).</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_region" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#427-464">Source</a><h4 class="code-header">pub fn <a href="#method.set_region" class="fn">set_region</a>(
&amp;mut self,
index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>,
attribute: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>,
x: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>,
y: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>,
max_area: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&amp;mut Self, <a class="type" href="type.StrError.html" title="type tritet::StrError">StrError</a>&gt;</h4></section></summary><div class="docblock"><p>Marks a region within the Planar Straight Line Graph (PSLG)</p>
<h5 id="input-3"><a class="doc-anchor" href="#input-3">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the region and goes from 0 to <code>nregion</code> (passed down to <code>new</code>)</li>
<li><code>attribute</code> is the attribute ID to group the triangles belonging to this region</li>
<li><code>x</code> is the x-coordinate of the region</li>
<li><code>y</code> is the y-coordinate of the region</li>
<li><code>max_area</code> is the maximum area constraint for the triangles belonging to this region</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_hole" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#473-499">Source</a><h4 class="code-header">pub fn <a href="#method.set_hole" class="fn">set_hole</a>(
&amp;mut self,
index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>,
x: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>,
y: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&amp;mut Self, <a class="type" href="type.StrError.html" title="type tritet::StrError">StrError</a>&gt;</h4></section></summary><div class="docblock"><p>Marks a hole within the Planar Straight Line Graph (PSLG)</p>
<h5 id="input-4"><a class="doc-anchor" href="#input-4">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the hole and goes from 0 to <code>nhole</code> (passed down to <code>new</code>)</li>
<li><code>x</code> is the x-coordinate of the hole</li>
<li><code>y</code> is the y-coordinate of the hole</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.generate_delaunay" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#506-523">Source</a><h4 class="code-header">pub fn <a href="#method.generate_delaunay" class="fn">generate_delaunay</a>(&amp;self, verbose: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.unit.html">()</a>, <a class="type" href="type.StrError.html" title="type tritet::StrError">StrError</a>&gt;</h4></section></summary><div class="docblock"><p>Generates a Delaunay triangulation</p>
<h5 id="input-5"><a class="doc-anchor" href="#input-5">§</a>Input</h5>
<ul>
<li><code>verbose</code> Prints Triangles messages to the console</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.generate_voronoi" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#530-547">Source</a><h4 class="code-header">pub fn <a href="#method.generate_voronoi" class="fn">generate_voronoi</a>(&amp;self, verbose: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.unit.html">()</a>, <a class="type" href="type.StrError.html" title="type tritet::StrError">StrError</a>&gt;</h4></section></summary><div class="docblock"><p>Generates a Voronoi tessellation and Delaunay triangulation</p>
<h5 id="input-6"><a class="doc-anchor" href="#input-6">§</a>Input</h5>
<ul>
<li><code>verbose</code> Prints Triangles messages to the console</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.generate_mesh" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#558-606">Source</a><h4 class="code-header">pub fn <a href="#method.generate_mesh" class="fn">generate_mesh</a>(
&amp;self,
verbose: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>,
quadratic: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>,
allow_new_points_on_bry: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>,
global_max_area: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>&gt;,
global_min_angle: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.unit.html">()</a>, <a class="type" href="type.StrError.html" title="type tritet::StrError">StrError</a>&gt;</h4></section></summary><div class="docblock"><p>Generates a conforming constrained Delaunay triangulation with some quality constraints</p>
<h5 id="input-7"><a class="doc-anchor" href="#input-7">§</a>Input</h5>
<ul>
<li><code>verbose</code> Prints Triangles messages to the console</li>
<li><code>quadratic</code> Generates the middle nodes; e.g., nnode = 6</li>
<li><code>allow_new_points_on_bry:bool</code> Allow the insertion of new (Steiner) points on the boundary</li>
<li><code>global_max_area</code> The maximum area constraint for all generated triangles</li>
<li><code>global_min_angle</code> The minimum angle constraint is given in degrees (the default minimum angle is twenty degrees)</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_npoint" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#609-611">Source</a><h4 class="code-header">pub fn <a href="#method.out_npoint" class="fn">out_npoint</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the number of (output) points of the Delaunay triangulation (constrained or not)</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_nsegment" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#616-618">Source</a><h4 class="code-header">pub fn <a href="#method.out_nsegment" class="fn">out_nsegment</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the number of (output) segments generated on the PSLG (not the interior)</p>
<p><strong>Note:</strong> This option is only available when calling <a href="struct.Trigen.html#method.generate_mesh" title="method tritet::Trigen::generate_mesh">Trigen::generate_mesh</a></p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_ncell" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#621-623">Source</a><h4 class="code-header">pub fn <a href="#method.out_ncell" class="fn">out_ncell</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the number of (output) triangles (aka cells) on the Delaunay triangulation (constrained or not)</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_cell_npoint" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#626-628">Source</a><h4 class="code-header">pub fn <a href="#method.out_cell_npoint" class="fn">out_cell_npoint</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the number of nodes on a triangle (e.g., 3 or 6)</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_point" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#644-646">Source</a><h4 class="code-header">pub fn <a href="#method.out_point" class="fn">out_point</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>, dim: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a></h4></section></summary><div class="docblock"><p>Returns the (output) generated point</p>
<h5 id="input-8"><a class="doc-anchor" href="#input-8">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the point and goes from <code>0</code> to <code>out_npoint</code></li>
<li><code>dim</code> is the space dimension index: 0 or 1</li>
</ul>
<h5 id="output"><a class="doc-anchor" href="#output">§</a>Output</h5>
<p>Returns <code>x</code> or <code>z</code></p>
<h5 id="warning"><a class="doc-anchor" href="#warning">§</a>Warning</h5>
<p>This function will return zero values if either <code>index</code> is out of range.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_point_marker" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#666-668">Source</a><h4 class="code-header">pub fn <a href="#method.out_point_marker" class="fn">out_point_marker</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i32.html">i32</a></h4></section></summary><div class="docblock"><p>Returns the marker of an output point</p>
<h5 id="input-9"><a class="doc-anchor" href="#input-9">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the point and goes from <code>0</code> to <code>out_npoint</code></li>
</ul>
<h5 id="warning-1"><a class="doc-anchor" href="#warning-1">§</a>Warning</h5>
<p>This function will return zero values if either <code>index</code> is out of range.</p>
<h5 id="note-about-boundary-markers--by-jrshewchuk-2"><a class="doc-anchor" href="#note-about-boundary-markers--by-jrshewchuk-2">§</a>Note about boundary markers by J.R.Shewchuk</h5>
<p>The boundary marker associated with each vertex in the output is chosen as follows:</p>
<ul>
<li>If a vertex is assigned a nonzero boundary marker in the input, then it is assigned the same marker in the output.</li>
<li>Otherwise, if the vertex lies on a PSLG segment (including the segments endpoints) with a nonzero boundary marker, then the vertex is assigned the same marker. If the vertex lies on several such segments, one of the markers is chosen arbitrarily.</li>
<li>Otherwise, if the vertex occurs on a boundary of the triangulation, then the vertex is assigned the marker one (1).</li>
<li>Otherwise, the vertex is assigned the marker zero (0).</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_segment_point" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#680-682">Source</a><h4 class="code-header">pub fn <a href="#method.out_segment_point" class="fn">out_segment_point</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>, side: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the ID of a point of a segment generated on the PSLG</p>
<h5 id="input-10"><a class="doc-anchor" href="#input-10">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the PSLG segment and goes from <code>0</code> to <code>out_nsegment</code></li>
<li><code>side</code> <code>0</code> or <code>1</code>; corresponds to the “side” of the segment</li>
</ul>
<h5 id="warning-2"><a class="doc-anchor" href="#warning-2">§</a>Warning</h5>
<p>This function will return zero values if the <code>index</code> or <code>side</code> is out of range.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_segment_marker" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#701-703">Source</a><h4 class="code-header">pub fn <a href="#method.out_segment_marker" class="fn">out_segment_marker</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i32.html">i32</a></h4></section></summary><div class="docblock"><p>Returns the marker attached to the output segment</p>
<h5 id="input-11"><a class="doc-anchor" href="#input-11">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the PSLG segment and goes from <code>0</code> to <code>out_nsegment</code></li>
</ul>
<h5 id="warning-3"><a class="doc-anchor" href="#warning-3">§</a>Warning</h5>
<p>This function will return zero values if the <code>index</code> is out of range.</p>
<h5 id="note-about-boundary-markers--by-jrshewchuk-3"><a class="doc-anchor" href="#note-about-boundary-markers--by-jrshewchuk-3">§</a>Note about boundary markers by J.R.Shewchuk</h5>
<p>The boundary marker associated with each segment in the output is chosen as follows:</p>
<ul>
<li>If an output edge is part or all of a PSLG segment with a nonzero boundary marker, then the edge is assigned the same marker as the segment.</li>
<li>Otherwise, if the edge occurs on a boundary of the triangulation (including boundaries of holes), then the edge is assigned the marker one (1).</li>
<li>Otherwise, the edge is assigned the marker zero (0).</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_cell_point" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#726-731">Source</a><h4 class="code-header">pub fn <a href="#method.out_cell_point" class="fn">out_cell_point</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>, m: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the ID of a point on the triangle (aka cell)</p>
<div class="example-wrap"><pre class="language-text"><code> NODES
2
/ \ The middle nodes are
/ \ only generated if the
5 4 quadratic flag is true
/ \
/ \
0-----3-----1</code></pre></div><h5 id="input-12"><a class="doc-anchor" href="#input-12">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the triangle and goes from 0 to <code>out_ncell</code></li>
<li><code>m</code> is the local index of the node and goes from 0 to <code>out_cell_npoint</code></li>
</ul>
<h5 id="warning-4"><a class="doc-anchor" href="#warning-4">§</a>Warning</h5>
<p>This function will return 0 if <code>index</code> or <code>m</code> is out of range.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_cell_attribute" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#738-740">Source</a><h4 class="code-header">pub fn <a href="#method.out_cell_attribute" class="fn">out_cell_attribute</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the attribute ID of a triangle (aka cell)</p>
<h5 id="warning-5"><a class="doc-anchor" href="#warning-5">§</a>Warning</h5>
<p>This function will return 0 if the <code>index</code> is out of range.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_voronoi_npoint" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#743-745">Source</a><h4 class="code-header">pub fn <a href="#method.out_voronoi_npoint" class="fn">out_voronoi_npoint</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the number of points of the Voronoi tessellation</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_voronoi_point" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#757-759">Source</a><h4 class="code-header">pub fn <a href="#method.out_voronoi_point" class="fn">out_voronoi_point</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>, dim: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a></h4></section></summary><div class="docblock"><p>Returns the x-y coordinates of a point on the Voronoi tessellation</p>
<h5 id="input-13"><a class="doc-anchor" href="#input-13">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the point and goes from 0 to <code>out_voronoi_npoint</code></li>
<li><code>dim</code> is the space dimension index: 0 or 1</li>
</ul>
<h5 id="warning-6"><a class="doc-anchor" href="#warning-6">§</a>Warning</h5>
<p>This function will return 0.0 if <code>index</code> or <code>dim</code> is out of range.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_voronoi_nedge" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#762-764">Source</a><h4 class="code-header">pub fn <a href="#method.out_voronoi_nedge" class="fn">out_voronoi_nedge</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the number of edges on the Voronoi tessellation</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_voronoi_edge_point_a" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#775-777">Source</a><h4 class="code-header">pub fn <a href="#method.out_voronoi_edge_point_a" class="fn">out_voronoi_edge_point_a</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the index of the first endpoint on a Voronoi edge</p>
<h5 id="input-14"><a class="doc-anchor" href="#input-14">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the edge and goes from 0 to <code>out_voronoi_nedge</code></li>
</ul>
<h5 id="warning-7"><a class="doc-anchor" href="#warning-7">§</a>Warning</h5>
<p>This function will return 0 if <code>index</code> is out of range.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.out_voronoi_edge_point_b" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#788-800">Source</a><h4 class="code-header">pub fn <a href="#method.out_voronoi_edge_point_b" class="fn">out_voronoi_edge_point_b</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="enum.VoronoiEdgePoint.html" title="enum tritet::VoronoiEdgePoint">VoronoiEdgePoint</a></h4></section></summary><div class="docblock"><p>Returns the index of the second endpoint on a Voronoi edge or the direction of the Voronoi edge</p>
<h5 id="input-15"><a class="doc-anchor" href="#input-15">§</a>Input</h5>
<ul>
<li><code>index</code> is the index of the edge and goes from 0 to <code>out_voronoi_nedge</code></li>
</ul>
<h5 id="warning-8"><a class="doc-anchor" href="#warning-8">§</a>Warning</h5>
<p>This function will return Index(0) if <code>index</code> is out of range.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.draw_triangles" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#803-925">Source</a><h4 class="code-header">pub fn <a href="#method.draw_triangles" class="fn">draw_triangles</a>(
&amp;self,
plot: &amp;mut <a class="struct" href="../plotpy/plot/struct.Plot.html" title="struct plotpy::plot::Plot">Plot</a>,
set_range: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>,
with_point_ids: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>,
with_triangle_ids: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>,
with_attribute_ids: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>,
fontsize_point_ids: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>&gt;,
fontsize_triangle_ids: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>&gt;,
fontsize_attribute_ids: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>&gt;,
)</h4></section></summary><div class="docblock"><p>Draw triangles</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.draw_voronoi" class="method"><a class="src rightside" href="../src/tritet/trigen.rs.html#928-1012">Source</a><h4 class="code-header">pub fn <a href="#method.draw_voronoi" class="fn">draw_voronoi</a>(&amp;self, plot: &amp;mut <a class="struct" href="../plotpy/plot/struct.Plot.html" title="struct plotpy::plot::Plot">Plot</a>)</h4></section></summary><div class="docblock"><p>Draws Voronoi diagram</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Trigen-1" class="impl"><a class="src rightside" href="../src/tritet/trigen_paraview.rs.html#10-165">Source</a><a href="#impl-Trigen-1" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Trigen.html" title="struct tritet::Trigen">Trigen</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.write_vtu" class="method"><a class="src rightside" href="../src/tritet/trigen_paraview.rs.html#16-164">Source</a><h4 class="code-header">pub fn <a href="#method.write_vtu" class="fn">write_vtu</a>&lt;P&gt;(&amp;self, full_path: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&amp;P</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.unit.html">()</a>, <a class="type" href="type.StrError.html" title="type tritet::StrError">StrError</a>&gt;<div class="where">where
P: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.0/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>&gt; + ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Writes a VTU file to visualize the mesh with Paraview</p>
<h5 id="input-16"><a class="doc-anchor" href="#input-16">§</a>Input</h5>
<ul>
<li><code>full_path</code> may be a String, &amp;str, or Path</li>
</ul>
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Drop-for-Trigen" class="impl"><a class="src rightside" href="../src/tritet/trigen.rs.html#266-273">Source</a><a href="#impl-Drop-for-Trigen" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.Trigen.html" title="struct tritet::Trigen">Trigen</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.drop" class="method trait-impl"><a class="src rightside" href="../src/tritet/trigen.rs.html#268-272">Source</a><a href="#method.drop" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/ops/drop/trait.Drop.html#tymethod.drop" class="fn">drop</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Tells the c-code to release memory</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Trigen" class="impl"><a href="#impl-Freeze-for-Trigen" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Trigen.html" title="struct tritet::Trigen">Trigen</a></h3></section><section id="impl-RefUnwindSafe-for-Trigen" class="impl"><a href="#impl-RefUnwindSafe-for-Trigen" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Trigen.html" title="struct tritet::Trigen">Trigen</a></h3></section><section id="impl-Send-for-Trigen" class="impl"><a href="#impl-Send-for-Trigen" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Trigen.html" title="struct tritet::Trigen">Trigen</a></h3></section><section id="impl-Sync-for-Trigen" class="impl"><a href="#impl-Sync-for-Trigen" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Trigen.html" title="struct tritet::Trigen">Trigen</a></h3></section><section id="impl-Unpin-for-Trigen" class="impl"><a href="#impl-Unpin-for-Trigen" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Trigen.html" title="struct tritet::Trigen">Trigen</a></h3></section><section id="impl-UnwindSafe-for-Trigen" class="impl"><a href="#impl-UnwindSafe-for-Trigen" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Trigen.html" title="struct tritet::Trigen">Trigen</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>