Skip to content

Commit

Permalink
add more specific error in halfedge_to
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendzae committed Jul 14, 2024
1 parent 3f9a319 commit 9aefdfa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/smesh/mesh_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ fn eval_vertex_op(c: &Connectivity, id: VertexId, op: QueryOp) -> SMeshResult<Qu
let initial_he = id.halfedge().run(c)?;
let mut he = initial_he;

if id == dst_vertex {
bail!("HalfedgeTo: Inital and dst vertex are the same");
}

let r = loop {
match he.dst_vert().run(c) {
Ok(id) => {
Expand All @@ -327,7 +331,7 @@ fn eval_vertex_op(c: &Connectivity, id: VertexId, op: QueryOp) -> SMeshResult<Qu
}
he = he.cw_rotated_neighbour().run(c)?;
if he == initial_he {
break Err(SMeshError::DefaultError);
bail!("HalfedgeTo: No connecting halfedge found");
}
}
Err(e) => {
Expand Down

0 comments on commit 9aefdfa

Please sign in to comment.