feat(schematic): reposition and auto-place Ref/Value field labels

Adds field-placement tools:
- set_schematic_property_position / batch_set_schematic_property_positions:
  move a symbol's Reference/Value field labels
- autoplace_schematic_fields: place every symbol's fields clear of its body
  and nearby net labels (the #1 readability problem in generated schematics)
- check_schematic_layout: audit out-of-bounds / fields-in-body / duplicate
  labels (note: overlaps upstream find_overlapping_elements etc. — reuse or
  drop on request)

Generic .kicad_sch text helpers are factored into commands/schematic_text_utils.py
so the batch/hierarchy modules don't import from one another.

- python/commands/schematic_text_utils.py: shared text/S-expr helpers
- python/commands/schematic_field_layout.py: SchematicFieldLayoutCommands
- src/tools/schematic-layout.ts + registry 'schematic_layout' category
- python/kicad_interface.py: import + instantiate + dispatch routes
- tests/test_schematic_field_layout.py: 23 unit tests incl. end-to-end on real .kicad_sch

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ravi
2026-06-02 19:38:54 -07:00
committed by mixelpixx
parent 2dcfc0f4c2
commit 7c385b993f
7 changed files with 1073 additions and 0 deletions

View File

@@ -128,6 +128,16 @@ export const toolCategories: ToolCategory[] = [
description: "Hierarchical schematic sheets: insert a sheet, scaffold a sub-sheet",
tools: ["add_hierarchical_sheet", "create_hierarchical_subsheet"],
},
{
name: "schematic_layout",
description:
"Schematic field placement: move Ref/Value fields and autoplace them clear of bodies and labels",
tools: [
"set_schematic_property_position",
"batch_set_schematic_property_positions",
"autoplace_schematic_fields",
],
},
{
name: "routing",
description: "Advanced routing operations: vias, copper pours",