From 3d67800609dccead9f55c5d29cde34b48027b8ff Mon Sep 17 00:00:00 2001 From: Hugo Ledoux Date: Wed, 13 Mar 2024 17:32:51 +0100 Subject: [PATCH] Add function to update the z-value of a vertex --- src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index f996f47..e221d37 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -1750,6 +1750,20 @@ impl Triangulation { } } + /// Set/update the z-value for a given vertex + pub fn set_vertex_z_value(&mut self, vi: usize, z: f64) -> Result { + if vi == 0 { + return Ok(false); + } + match self.is_vertex_removed(vi) { + Err(why) => Err(why), + Ok(_b) => { + self.stars[vi].pt[2] = z; + Ok(true) + } + } + } + pub fn has_garbage(&self) -> bool { self.number_of_removed_vertices() > 0 }