MCPcopy Index your code
hub / github.com/Tugcga/Path-Finder

github.com/Tugcga/Path-Finder @as.2.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release as.2.4 ↗ · + Follow
1,270 symbols 3,244 edges 67 files 70 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

What is it?

This repository contains Python, WASM AssemblyScript and WASM Rust modules, which implements path finding algorithms in navigation meshes. Modules for Python and AssemblyScript based on Three Pathfinding library for navigation mesh, RVO2 library for agents moving and collision avoiding and Recast Navigation for navigation mesh baking. Module for Rust use navmesh crate for path finding in the navigation mesh. Versions for Python and AssemblyScript are very close to each other. If you would like to understand the algorithm, look to the Python code. It's more structured and contains more comments.

Navigation mesh path finding algorithm on non-Rust versions use three main concepts: * structure all polygons navigation mesh to a bvh (bounding volume hierarchy) * find closest path between centers of polygons by using A* algorithm in dual graph (vertices of this graph are centers of polygons, and two vertices are incident to one edge, iff corresponding polygons have a common edge) * combine two previous concepts to find the path between input points

It's important to understand that the path finding algorithm does not guaranteer the optimality of the generated path. In most cases the path is plausible.

Python and AssemblyScript versions of the module allows to bake navigation mesh from input geometry. The algorithm is in fact a port of one specific method from Recast Navigation. For baking purpose you can also use other solutions: * Original Recast Navigation. This is the most famous navigation mesh solution. It allows generate mesh and find path in it * PyRecastDetour This is Python bindings for some functions in Recast Navigation. Allows to output generated navigation mesh triangulation and it polygonal description * Blender, Unity and so on

More detailed descriptions

For Python version: here.

For AssemblyScript version: here.

For Rust version: here.

Core symbols most depended-on inside this repo

push
called by 118
assemblyscript/assembly/common/list.ts
x
called by 77
assemblyscript/assembly/common/utilities.ts
y
called by 77
assemblyscript/assembly/common/utilities.ts
set
called by 72
assemblyscript/assembly/common/list.ts
get_con
called by 70
python/pathfinder/navmesh_baker/rc_calcs.py
get_con
called by 70
assemblyscript/assembly/baker/rc_calcs.ts
scale
called by 49
assemblyscript/assembly/common/vector2.ts
subtract
called by 46
assemblyscript/assembly/common/vector2.ts

Shape

Method 686
Function 454
Class 129
Enum 1

Languages

TypeScript61%
Python39%
Rust1%

Modules by API surface

assemblyscript/assembly/common/binary_io.ts50 symbols
assemblyscript/assembly/rvo/rvo_simulator.ts49 symbols
python/pathfinder/pyrvo/rvo_simulator.py42 symbols
assemblyscript/assembly/pathfinder.ts40 symbols
assemblyscript/assembly/navmesh/navmesh_bvh.ts39 symbols
assemblyscript/assembly/baker/rc_classes.ts39 symbols
assemblyscript/assembly/rvo/rvo_agent.ts36 symbols
python/test.py35 symbols
assemblyscript/assembly/pathfinder_api.ts35 symbols
python/pathfinder/navmesh_baker/rc_classes.py34 symbols
python/pathfinder/pyrvo/agent.py33 symbols
assemblyscript/assembly/common/vector2.ts33 symbols

For agents

$ claude mcp add Path-Finder \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact