fix: address review issues in get_wire_connections
- Fix critical bug: use pin_data[0]/[1] instead of pin_data["x"]/["y"] (get_all_symbol_pins returns List[float], not dict) - Use index-based wire tracking to avoid fragile float list equality - Check all polyline points (not just endpoints) during flood-fill - Add spatial index (0.05mm grid) to replace O(n²) frontier scan - Skip already-processed refs to avoid redundant calls for multi-unit symbols - Include wires_out in early return when schematic has no symbols - Add get_wire_connections schema entry to tool_schemas.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1471,6 +1471,29 @@ SCHEMATIC_TOOLS = [
|
||||
"required": ["schematicPath", "netName"],
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "get_wire_connections",
|
||||
"title": "Get Wire Connections",
|
||||
"description": "Returns all wires and component pins connected to the wire at a given point, by flood-filling through touching wires.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schematicPath": {
|
||||
"type": "string",
|
||||
"description": "Path to schematic file"
|
||||
},
|
||||
"x": {
|
||||
"type": "number",
|
||||
"description": "X coordinate of the point on the wire"
|
||||
},
|
||||
"y": {
|
||||
"type": "number",
|
||||
"description": "Y coordinate of the point on the wire"
|
||||
}
|
||||
},
|
||||
"required": ["schematicPath", "x", "y"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_schematic_pin_locations",
|
||||
"title": "Get Schematic Pin Locations",
|
||||
|
||||
Reference in New Issue
Block a user