Geometry NodeSet
Deliberately cross-method geometry utilities. Provides the distance-measurement canvas node; the former frontier-scoring mock was split off to the quarantined mock_frontier nodeset (other/mock_frontier.py) in the 2026-06-11 role-directory migration (ADR-platform-008).
1. Overview
The Geometry NodeSet (geometry, at workspace/nodesets/common/geometry.py) provides lightweight utility tools that complement domain-specific nodesets. The companion Mock Frontier NodeSet (mock_frontier) is documented here too until it is promoted or deleted:
| Node | Purpose | Category |
|---|---|---|
| Measure Distance | Compute Euclidean distance between 3D points | Spatial Math |
| Score Frontier | Rank exploration frontiers by priority | Exploration |
These nodes are self-contained — they do not require environment initialization or external service dependencies.
2. Canvas Nodes
| Node Type | Display Name | Input Ports | Output Ports | Description |
|---|---|---|---|---|
geometry__measure_distance |
Measure Distance | point_a (TEXT), point_b (TEXT) |
result (TEXT) |
Calculate Euclidean distance between two 3D points. Inputs are JSON-formatted coordinate arrays [x, y, z]. Returns JSON result. |
mock_frontier__score_frontier |
[Mock] Score Frontier | frontiers (TEXT) |
result (TEXT) |
Score a list of frontiers by exploration priority. Mock implementation — returns random placeholder scores. Sorts results by priority. |
UI Colors: - Both nodes use emerald color
Measure Distance
Computes the Euclidean distance between two 3D points.
Input format:
{
"point_a": "[x1, y1, z1]",
"point_b": "[x2, y2, z2]"
}
Points can be supplied as:
- JSON string: "[1.0, 2.0, 3.0]"
- Python list (if wired from another node): [1.0, 2.0, 3.0]
Output:
{
"result": "{\"distance\": 5.1962}"
}
Distance is rounded to 4 decimal places.
Example:
point_a = [0, 0, 0]
point_b = [3, 4, 0]
distance = sqrt(3² + 4²) = 5.0
Score Frontier
Ranks exploration frontiers by priority. This is a mock implementation for development and testing — scores are randomly assigned rather than based on real frontier evaluation.
Input format:
{
"frontiers": "[{\"id\": 1, \"center\": [0, 0, 0]}, {\"id\": 2, \"center\": [1, 1, 0]}]"
}
Expects a JSON string containing a list of frontier objects (e.g., from a frontier detection node).
Output:
{
"result": "{\"scored_frontiers\": [{\"id\": 1, \"center\": [...], \"score\": 0.85, \"priority\": \"high\"}, ...], \"total\": 2}"
}
Each frontier receives:
- score: Random value 0.1–1.0 (rounded to 3 decimals)
- priority: Derived from score:
- score > 0.7 → "high"
- score > 0.4 → "medium"
- score ≤ 0.4 → "low"
Results are sorted by score in descending order (highest score first).
Note on mock status: This node is intended as a placeholder for future frontier evaluation methods (visual saliency, distance, semantic importance, etc.). For production use, replace with a learned or heuristic scoring function.
3. Usage
Loading the NodeSet
Send a POST request to the backend:
POST /api/components/nodesets/geometry/load
Both nodes become available in the canvas UI under their respective categories (Spatial Math, Exploration).
Wiring Patterns
Pattern 1: Distance-Based Navigation
[Agent State] → extract position A
→ [Measure Distance] ← position B from target
→ [LLM: Distance-aware decision]
Pattern 2: Frontier Exploration (Development)
[Frontier Detector] → frontiers JSON
→ [Score Frontier] (mock)
→ [LLM: Select next frontier]
Caution: The frontier scorer is a mock. Do not rely on its output for production exploration strategies.
Pattern 3: Combining Both
[Frontier List] → [Score Frontier] → [Select top-ranked frontier]
→ [Measure Distance] to agent position
→ [Navigation Decision]
Error Handling
- Invalid JSON: The nodes accept both string and list inputs; malformed JSON will raise an exception.
- Missing keys: Frontier scorer gracefully handles missing fields by copying them unchanged.
- Empty frontiers: Empty input returns
{\"scored_frontiers\": [], \"total\": 0}.