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
|
||||
log.workspace = true
|
||||
petgraph.workspace = true
|
||||
ron = "0.10"
|
||||
rstar.workspace = true
|
||||
serde.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> {
|
||||
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)]
|
||||
pub fn resolve_edge_data(
|
||||
&self,
|
||||
|
|
|
|||
|
|
@ -86,6 +86,19 @@ impl<M: AccessMesadata + Clone> ExecutionStepper<M> {
|
|||
.board
|
||||
.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((
|
||||
Some(autoroute.last_recorder.clone()),
|
||||
"finished topo-autorouting".to_string(),
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ pub use router::*;
|
|||
#[derive(Clone, Copy, Debug)]
|
||||
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 end_points: EdgeIndex<FixedDotIndex>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,6 +202,11 @@ impl PolygonRouting {
|
|||
break;
|
||||
}
|
||||
}
|
||||
log::debug!(
|
||||
"route_to_exit on {:?} finished, head = {:?}",
|
||||
self.apex,
|
||||
active_head,
|
||||
);
|
||||
Ok((active_head, route_length))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue