Returns the half-edge between the "from" and "to" vertex if it exists in the mesh
(&self, from: usize, to: usize)
| 132 | |
| 133 | /// Returns the half-edge between the "from" and "to" vertex if it exists in the mesh |
| 134 | pub fn half_edge(&self, from: usize, to: usize) -> Option<HalfEdge> { |
| 135 | let from_edges = self |
| 136 | .vertex_half_edge_map |
| 137 | .get(from) |
| 138 | .expect("vertex must be part of the mesh"); |
| 139 | for &he_idx in from_edges { |
| 140 | let he = &self.half_edges[he_idx]; |
| 141 | if he.to == to { |
| 142 | return Some(*he); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | None |
| 147 | } |
| 148 | |
| 149 | /// Returns whether the given half-edge or its opposite half-edge is a boundary edge |
| 150 | pub fn is_boundary_edge(&self, half_edge: HalfEdge) -> bool { |