Skip to content
MathVis

MathVis

From Thought to Theorem – Instantly Visualized

Created on 28th May 2025

•

MathVis

MathVis

From Thought to Theorem – Instantly Visualized

The problem MathVis solves

🧩 The Problem It Solves

MathVis transforms the way people teach, learn, and present mathematical ideas by automating the creation of professional-grade math animations from simple natural language descriptions.

Traditionally, producing animated mathematical content requires:

  • Expertise in tools like Manim, which involves writing Python code.
  • Time-consuming manual scene design, rendering, and editing.
  • A deep understanding of both math and animation principles.

This tool eliminates those barriers, making mathematical visualization accessible to a much broader audience.

🎯 Use Cases

  • Teachers & Educators: Quickly create engaging visuals for lessons, lectures, or online courses without coding or animation experience.
  • Students: Explore abstract math topics through interactive visuals, improving comprehension and retention.
  • Content Creators: Produce high-quality educational videos for YouTube, social media, or e-learning platforms with minimal setup.
  • Tutors & Coaches: Tailor animations to different education levels and styles to better explain topics to individual learners.
  • Researchers & Professionals: Use animations to present complex mathematical models or concepts in papers, talks, or pitches.

✅ How It Helps

  • 🔤 Natural Language Input: Describe what you want in plain English, and let AI + Manim do the heavy lifting.
  • 🧠 AI-Powered Generation: Uses Google's Gemini 1.5 to intelligently interpret prompts and build accurate scenes.
  • 🎬 Automated Animation Pipeline: Eliminates manual scripting, scene management, and rendering steps.
  • 🎨 Style & Quality Options: Choose the tone (educational, fun, serious) and quality level (low, medium, high) to suit your needs.
  • 📱 Accessible Anywhere: Web-based, mobile-friendly UI allows creation and preview from any device.

In summary, Visual Math Animator democratizes mathematical animation—making it fast, easy, and powerful for anyone

Challenges we ran into

🎥 Syncing Manim Render Output with Frontend Playback

One of the most challenging hurdles we faced was syncing the backend-rendered Manim animations with the frontend playback system in real-time during development mode. Manim, by design, renders scenes frame-by-frame and outputs them as video files, which can take a few seconds depending on complexity. This caused issues like:

  • Frontend showing "loading" indefinitely if the video was not ready yet.
  • Race conditions where the frontend tried to fetch the video before it was fully saved to disk.
  • Partial or broken playback due to file system read/write mismatches.

🛠️ How We Solved It

After experimenting with multiple solutions like polling and file watchers, we implemented a robust status-checking mechanism:

  1. Job Queuing System: Each prompt was treated as a unique job with a UUID. The backend managed the state of each job: pending, rendering, completed, or failed.
  2. Progress API Endpoint: We added an endpoint (/status/<job_id>) that the frontend could query to check if rendering was complete before attempting to load the video.
  3. Deferred Playback Hook: On the frontend, we created a custom React hook that listened for job status updates and only initiated playback once the video was fully written and accessible.
  4. Fallback Messaging: We also implemented a timeout with error handling that informed users if something went wrong (e.g., "Your animation took too long to render").

This challenge pushed us to build a more reliable and scalable backend/frontend communication flow, which ultimately improved user experience and system resilience.

Discussion

Builders also viewed

See more projects on Devfolio