Commit graph

3 commits

Author SHA1 Message Date
Maximus Gorog
c011af0414 Add visibility filter and output only visible elements
Added Point::is_visible() to explosion.rs:
- A point at geom_dim d is visible iff coords[d..] are all singular
- Matches homotopy.io's visibility filter (mesh.rs:111-115)

Updated render_braiding.rs:
- Filter to visible elements only (7 of 23 points for half_braid)
- Compute layout coordinates: x=time, y=height, z=depth
- Wires spread at z = [-1, 0, 1], vertices at z = [-0.5, 0.5]
- No volumes in output (not rendered)

Visible elements for half_braid:
- 2 vertices: (s0,s0,s0), (s1,s0,s0)
- 3 wires: (r0,s0,s0), (r1,s0,s0), (r2,s0,s0)
- 2 surfaces: (r0,r0,s0), (r0,r1,s0)

Updated web/zigzag-renderer.jsx with new geometry data.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-08 02:16:36 -06:00
Maximus Gorog
2f33791809 Fix render_braiding.rs: transitive for wire endpoints, direct for surface boundaries
Wire endpoints and surface boundaries require different computation methods:

- Wire endpoints: TRANSITIVE reachability to vertices
  A strand spans between vertices even if poset path has intermediate points.
  Most wires connect both v₀ and v₁; only wire 14 is a self-loop.

- Surface boundary_wires: DIRECT covering relations only
  The immediate boundary of a surface is its direct predecessor/successor wires.
  Surfaces have 1-3 boundary wires (was 1-7 with transitive).

Updated:
- examples/render_braiding.rs: restored reachable_from for wire endpoints
- fixtures/half_braid_geometry.json: correct wire endpoints + direct surface boundaries
- web/zigzag-renderer.jsx: updated embedded geometry data

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-08 01:25:50 -06:00
Maximus Gorog
d679eeba6b Add Three.js renderer for half_braid geometry with variational elastic curves
- web/zigzag-renderer.jsx: React component with full variational curve solver
  - Minimizes E = τ·Σ|Δp|² + β·Σ|Δ²p|² + κ·|p_mid - waypoint|²
  - Solves tridiagonal + pentadiagonal linear system via Gaussian elimination
  - Self-loops rendered as parametric curves offset toward waypoint
  - Wire coloring by group: input (blue), crossing (purple), output (green)

- web/index.html: Minimal HTML loading React/Three.js from CDN

Features:
  - Interactive orbit controls (drag + wheel zoom)
  - Control panel with sliders: Tension τ, Bending β, Waypoint κ, Resolution
  - Toggles for waypoints, surfaces, labels
  - Dark theme with gold accents

Coordinate mapping: coord[0]→z, coord[1]→y, coord[2]→x with scale 1.2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-08 01:07:06 -06:00