File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,11 +4,13 @@ use alloc::vec::Vec;
44use i_overlay:: i_float:: int:: point:: IntPoint ;
55
66impl IntDelaunay {
7+ /// Returns the vertex positions in the triangulation.
78 #[ inline]
89 pub fn points ( & self ) -> & Vec < IntPoint > {
910 & self . points
1011 }
1112
13+ /// Returns indices forming counter-clockwise triangles.
1214 #[ inline]
1315 pub fn triangle_indices < I : IndexType > ( & self ) -> Vec < I > {
1416 let mut result = Vec :: with_capacity ( 3 * self . triangles . len ( ) ) ;
@@ -23,6 +25,15 @@ impl IntDelaunay {
2325 result
2426 }
2527
28+ /// Returns the indices of each triangle's neighboring triangles.
29+ #[ inline]
30+ pub fn triangle_neighbors ( & self ) -> Vec < [ usize ; 3 ] > {
31+ self . triangles
32+ . iter ( )
33+ . map ( |triangle| triangle. neighbors )
34+ . collect ( )
35+ }
36+
2637 #[ inline]
2738 pub fn into_triangulation < I : IndexType > ( self ) -> IntTriangulation < I > {
2839 IntTriangulation {
Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ impl<P: FloatPointCompatible> Delaunay<P> {
4545 self . delaunay . triangle_indices ( )
4646 }
4747
48+ /// Returns the indices of each triangle's neighboring triangles.
49+ pub fn triangle_neighbors ( & self ) -> Vec < [ usize ; 3 ] > {
50+ self . delaunay . triangle_neighbors ( )
51+ }
52+
4853 /// Converts this refined mesh into a flat float [`Triangulation`].
4954 #[ inline]
5055 pub fn to_triangulation < I : IndexType > ( & self ) -> Triangulation < P , I > {
You can’t perform that action at this time.
0 commit comments