Parallel Transport Convolution (PTC) visual demos, mini-games, and mesh utilities.
This repository contains:
- Manim animations for geometric PTC concepts on curved surfaces.
- Interactive Pygame (and PyVista + Pygame) games that make holonomy/PTC behavior playable.
- A utility to clean STL meshes into manifold triangle meshes.
ptc_demo_spherical_holonomy_manim.py- Scene:
PTCSphericalHolonomyDemo - Shows holonomy from parallel transport around a closed loop on a sphere.
- Scene:
ptc_demo_convolution_chase_game_manim.py- Scene:
PTCConvolutionChaseGame - Greedy kernel walk guided by local convolution score on a sphere.
- Scene:
ptc_demo_rigid_motion_invariance_manim.py- Scene:
PTCRigidMotionInvarianceDemo - Side-by-side rigid-motion invariance/equivariance visualization.
- Scene:
moving_ptc_hemisphere_manim.py- Scenes:
MovingParallelTransportKernelHemisphereMovingParallelTransportKernelChart
- Parallel transport kernel motion on a hemisphere and its chart view.
- Scenes:
moving_gmm_kernel_manim.py- Scene:
MovingGaussianKernel2D - 2D moving Gaussian kernel baseline visualization.
- Scene:
holonomy_lock.py- Pygame-only holonomy lock puzzle on sphere coordinates.
filter_hunter.py- Single-player PTC target hunting game.
filter_hunter_2p.py- Two-player competitive PTC racing/hunting game.
holonomy_lock_pyvista_pygame.py- PyVista 3D view + Pygame HUD/controls for interactive holonomy lock.
stl_to_manifold_mesh.py- Loads STL and repairs/exports manifold-friendly triangle mesh.
data/for source meshes (e.g. STL files).output/for generated mesh and media artifacts.
Use the provided Conda environment file:
conda env create -f req.yaml
conda activate ptcCore dependencies are pinned in req.yaml:
- Python 3.9
- NumPy, SciPy
- Manim
- PyTorch
- PyVista
- Pygame
- Trimesh
conda run -n ptc manim -pql ptc_demo_spherical_holonomy_manim.py PTCSphericalHolonomyDemo
conda run -n ptc manim -pql ptc_demo_convolution_chase_game_manim.py PTCConvolutionChaseGame
conda run -n ptc manim -pql ptc_demo_rigid_motion_invariance_manim.py PTCRigidMotionInvarianceDemo
conda run -n ptc manim -pql moving_ptc_hemisphere_manim.py MovingParallelTransportKernelHemisphere
conda run -n ptc manim -pql moving_ptc_hemisphere_manim.py MovingParallelTransportKernelChart
conda run -n ptc manim -pql moving_gmm_kernel_manim.py MovingGaussianKernel2DNotes:
- Scene scripts set their own render config (resolution/frame rate) in code.
- Replace
-pqlwith higher quality flags if needed.
conda run -n ptc python holonomy_lock.py
conda run -n ptc python filter_hunter.py
conda run -n ptc python filter_hunter_2p.pyconda run -n ptc python holonomy_lock_pyvista_pygame.pyIf running in a headless environment:
PTC_HEADLESS=1 conda run -n ptc python holonomy_lock_pyvista_pygame.pyLeft/Right: steerUp: moveDown: brakeSpace: evaluate lock1/2/3: window size (1280x720 / 2560x1440 / 3840x2160)R: reset levelEscorQ: quit
Left/Right: steerUp: moveDown: rotate kernel scan clockwise1/2/3: window size (1280x720 / 2560x1440 / 3840x2160)R: respawn targets/reset scoreEscorQ: quit
- Player 1:
Left/Rightsteer,Upmove,Downscan clockwise - Player 2:
A/Dsteer,Wmove,Sscan clockwise - Global:
1/2/3: window size (1280x720 / 2560x1440 / 3840x2160)R: restartEscorQ: quit
Basic usage:
conda run -n ptc python stl_to_manifold_mesh.pyOptional flags:
conda run -n ptc python stl_to_manifold_mesh.py \
--input data/YourMesh.stl \
--output output/YourMesh_manifold.ply \
--merge-digits 6 \
--strictBy default:
- Input is the first
.stlfound indata/. - Output goes to
output/<name>_manifold.ply.
- This repo is focused on concise, visual PTC intuition and interactive geometry.
- For reproducible results, run everything from the
ptcConda environment.