fix(router/navmesh): Don't unionize with fillets

This commit is contained in:
Mikolaj Wielgus 2025-08-31 21:05:39 +02:00
parent 3e466960fa
commit 03e70a1a7e
1 changed files with 23 additions and 3 deletions

View File

@ -30,7 +30,7 @@ use crate::{
Drawing, Drawing,
}, },
graph::{GenericIndex, GetPetgraphIndex, MakeRef}, graph::{GenericIndex, GetPetgraphIndex, MakeRef},
layout::Layout, layout::{CompoundEntryLabel, Layout},
math::RotationSense, math::RotationSense,
router::thetastar::MakeEdgeRef, router::thetastar::MakeEdgeRef,
}; };
@ -324,8 +324,28 @@ impl Navmesh {
overlapping_prenavnodes_unions: &mut UnionFind<NodeIndex<usize>>, overlapping_prenavnodes_unions: &mut UnionFind<NodeIndex<usize>>,
prenavnode: PrenavmeshNodeIndex, prenavnode: PrenavmeshNodeIndex,
) { ) {
for overlap in layout.drawing().overlapees(prenavnode.into()) { // Ignore overlaps of a fillet.
let PrimitiveIndex::FixedDot(overlapee) = overlap.1 else { if layout
.drawing()
.compounds(GenericIndex::<()>::new(prenavnode.petgraph_index()))
.find(|(label, _)| *label == CompoundEntryLabel::Fillet)
.is_some()
{
return;
}
for overlapee in layout.drawing().overlapees(prenavnode.into()) {
// Ignore overlaps with fillets.
if layout
.drawing()
.compounds(GenericIndex::<()>::new(overlapee.1.petgraph_index()))
.find(|(label, _)| *label == CompoundEntryLabel::Fillet)
.is_some()
{
continue;
}
let PrimitiveIndex::FixedDot(overlapee) = overlapee.1 else {
continue; continue;
}; };