From 61e6fdf9f7dcc69d9e097c7d95aa0abd0966953c Mon Sep 17 00:00:00 2001 From: me-it-is <188520719+me-it-is@users.noreply.github.com> Date: Mon, 27 Jul 2026 19:47:51 -0700 Subject: [PATCH] fix: Ensure neither point of an arc is at the center before trying to add an arc Fixes: https://github.com/dimforge/rapier/issues/969 --- src/transformation/utils.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/transformation/utils.rs b/src/transformation/utils.rs index 62dfc41f..ee379ac4 100644 --- a/src/transformation/utils.rs +++ b/src/transformation/utils.rs @@ -646,13 +646,14 @@ pub fn push_arc_and_idx( out_idx: &mut Vec<[u32; 2]>, ) { let base = out_vtx.len() as u32; - push_arc( - center, - out_vtx[start as usize], - out_vtx[end as usize], - nsubdivs, - out_vtx, - ); + let start_point = out_vtx[start as usize]; + let end_point = out_vtx[end as usize]; + // This check is already performed inside of push_arc + // but cant be performed inside of push_arc_idx because it doesnt have access to the actual vertices + if start_point == center || end_point == center { + return; + } + push_arc(center, start_point, end_point, nsubdivs, out_vtx); push_arc_idx(start, base..base + nsubdivs - 1, end, out_idx); }