Skip to content

Commit

Permalink
Add function to update the z-value of a vertex
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoledoux committed Mar 13, 2024
1 parent dc45529 commit 3d67800
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool, StartinError> {
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
}
Expand Down

0 comments on commit 3d67800

Please sign in to comment.