mirror of https://codeberg.org/topola/topola.git
feat: Debug print various TopoNavmesh structures / updates
- feat(autorouter/execution): Debug-print the whole TopoNavmesh on completion - feat(router/ng/poly): Emit log output on route_to_exit success
This commit is contained in:
parent
a561b278fc
commit
ed06170db5
|
|
@ -55,6 +55,7 @@ enum_dispatch = "0.3"
|
||||||
geo.workspace = true
|
geo.workspace = true
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
petgraph.workspace = true
|
petgraph.workspace = true
|
||||||
|
ron = "0.10"
|
||||||
rstar.workspace = true
|
rstar.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
spade.workspace = true
|
spade.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -393,6 +393,14 @@ impl<'a, B: NavmeshBase + 'a> NavmeshRefMut<'a, B> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, B: NavmeshBase + 'a> NavmeshRef<'a, B> {
|
impl<'a, B: NavmeshBase + 'a> NavmeshRef<'a, B> {
|
||||||
|
pub fn to_owned(&self) -> Navmesh<B> {
|
||||||
|
Navmesh {
|
||||||
|
nodes: Arc::new(self.nodes.clone()),
|
||||||
|
edges: Arc::new(self.edges.clone()),
|
||||||
|
edge_paths: self.edge_paths.to_vec().into_boxed_slice(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn resolve_edge_data(
|
pub fn resolve_edge_data(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,19 @@ impl<M: AccessMesadata + Clone> ExecutionStepper<M> {
|
||||||
.board
|
.board
|
||||||
.try_set_band_between_nodes(source, target, *band);
|
.try_set_band_between_nodes(source, target, *band);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let topo_navmesh = autoroute.maybe_topo_navmesh().unwrap().to_owned();
|
||||||
|
let mut pretty_config = ron::ser::PrettyConfig::new();
|
||||||
|
pretty_config.depth_limit = 2;
|
||||||
|
log::debug!(
|
||||||
|
"topo navmesh result: {}",
|
||||||
|
ron::ser::to_string_pretty(
|
||||||
|
&ng::pie::navmesh::NavmeshSer::from(topo_navmesh),
|
||||||
|
pretty_config
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
);
|
||||||
|
|
||||||
ControlFlow::Break((
|
ControlFlow::Break((
|
||||||
Some(autoroute.last_recorder.clone()),
|
Some(autoroute.last_recorder.clone()),
|
||||||
"finished topo-autorouting".to_string(),
|
"finished topo-autorouting".to_string(),
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,9 @@ pub use router::*;
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub struct PieNavmeshBase;
|
pub struct PieNavmeshBase;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, serde::Deserialize, serde::Serialize,
|
||||||
|
)]
|
||||||
pub struct EtchedPath {
|
pub struct EtchedPath {
|
||||||
pub end_points: EdgeIndex<FixedDotIndex>,
|
pub end_points: EdgeIndex<FixedDotIndex>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,11 @@ impl PolygonRouting {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log::debug!(
|
||||||
|
"route_to_exit on {:?} finished, head = {:?}",
|
||||||
|
self.apex,
|
||||||
|
active_head,
|
||||||
|
);
|
||||||
Ok((active_head, route_length))
|
Ok((active_head, route_length))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue