zigzag-engine/web/index.html
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

56 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zigzag Renderer - Half Braid Geometry</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
overflow: hidden;
background: #0a0a0f;
}
#root {
width: 100vw;
height: 100vh;
}
#loading {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #f0c040;
font-family: monospace;
font-size: 18px;
}
</style>
</head>
<body>
<div id="root">
<div id="loading">Loading Three.js...</div>
</div>
<!-- React from CDN -->
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<!-- Three.js from CDN -->
<script src="https://unpkg.com/three@0.160.0/build/three.min.js"></script>
<!-- Babel for JSX transformation (development only) -->
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<!-- Our renderer component -->
<script type="text/babel" src="zigzag-renderer.jsx"></script>
<!-- Mount the app -->
<script type="text/babel">
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(React.createElement(ZigzagRenderer));
</script>
</body>
</html>