79788000

Date: 2025-10-11 12:25:42
Score: 1
Natty:
Report link

Convert mesh to graph by merging nearby vertices during triangle processing

Instead of building adjacency after the whole mesh is processed, you can build it incrementally as you iterate through triangles.

1. For each triangle, create a small local graph of its 3 vertices (fully connected).

2. Clamp or round vertex positions to a fixed precision (e.g. 0.01 or 0.1 units) to handle float errors.

3. Use a hash table (keyed by clamped position) to cache vertices.

Key format can be a packed integer or a string fallback like "x_y_z".

4. When a new vertex reuses an existing key, merge it —

"steal" its existing connections and link the current triangle’s vertices to it.

This automatically stitches triangles together without needing a second pass.

This method builds the navigation graph in one pass, with automatic adjacency discovery, tolerance for float noise, and minimal overhead.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Termisher Tf2