Skip to content

Phase1 working branch#6

Merged
Abraxas3d merged 4 commits into
mainfrom
phase1-working-branch
Apr 18, 2026
Merged

Phase1 working branch#6
Abraxas3d merged 4 commits into
mainfrom
phase1-working-branch

Conversation

@sconklin
Copy link
Copy Markdown
Contributor

Phase 1 complete

Implement Phase 1 geometry crate (arcanum-geometry)

Completes the full Phase 1 pipeline: MeshInput → Mesh.

**Data structures** (mesh.rs, errors.rs)
- Segment, CurveParams (Linear/Arc/Helix), Junction, GroundDescriptor,
  TagMap, Mesh output types
- GeometryError / GeometryWarnings distinct from nec-import error types

**Wire discretization** (discretize.rs)
- Closed-form parametric evaluation for straight, arc, and helix wires
- Endpoints computed at t = k/N — no incremental accumulation

**Geometry transforms** (transforms.rs)
- GS global scale (coordinates only; wire_radius not scaled)
- GM rotation (ROX→ROY→ROZ), translation, and n_copies generation
  with incremented tags

**Junction detection** (junctions.rs)
- Union-find over all segment endpoint pairs
- Intra-wire adjacent boundaries excluded (not junctions)
- Near-coincident warning: gap in [ε, 10ε] where ε = min(r_a,r_b)×0.01
- Self-loop detection for full-circle arcs

**PEC image generation** (images.rs)
- Reflects z → -z for all segments not in the z=0 plane
- WireInGroundPlane warning for segments entirely at z=0
- Bug fix: image segments inherit wire_index from their source segment
  (was incorrectly set to the loop counter, producing false junctions
  between adjacent image segments)

**Tag map** (tagmap.rs)
- Maps NEC wire tags to segment index ranges; image segments excluded

**Public API** (lib.rs)
- build_mesh(input: MeshInput, ground_electrical: Option<GroundElectrical>)
    -> Result<(Mesh, GeometryWarnings), GeometryError>

**Tests** (23 cases across 7 files)
- V-LIN-001 through V-LIN-006, V-ARC-001 through V-ARC-003
- V-HEL-001 through V-HEL-003, V-TRF-001 through V-TRF-004
- V-GND-001 through V-GND-004, V-TAG-001, V-WARN-001 through V-WARN-002
- Junction count assertions added to V-GND-002, V-GND-004, V-HEL-003
  to prevent regression of the wire_index bug

Exposed geometry types and build_mesh() via PyO3:
- GeometryError exception, GeometryWarning, Segment, Junction,
  GroundDescriptor, Mesh
- build_mesh(mesh_input, ground_electrical=None) -> (Mesh, [GeometryWarning])

- design.md (→ Rev 0.2): added Section 5.2 "What a Junction Is Not";
  valence-counting clarification; renumbered subsections
- validation.md (→ Rev 0.4): corrected V-LIN-001/003/004 junction
  semantics; fixed GH card strings in V-HEL-001/002/003; added junction
  expectations to V-GND-002/004 and V-HEL-003; removed convergence
  plots requirement (closed-form evaluation makes it unnecessary)

examples/mesh_inspect.py: end-to-end example that parses a NEC deck,
calls build_mesh, and prints a human-readable mesh summary (segment
table, tag map, junctions, ground descriptor, warnings).
@Abraxas3d Abraxas3d merged commit b63fefb into main Apr 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants