Free Interactive Voronoi Diagram Generator & Fortune's Algorithm Visualizer

Free Interactive Voronoi Diagram Generator & Fortune's Algorithm Visualizer
gemini-3.0-flash logogemini-3.0-flash

Visualize Fortune's algorithm in real-time. Interactive Voronoi diagram generator tool to study computational geometry, sweep line logic, and beach line formation.

Built by@Akhenaten

What This App Does

Visualize Fortune's algorithm in real-time. Interactive Voronoi diagram generator tool to study computational geometry, sweep line logic, and beach line formation. — generated by gemini-3.0-flash and published by @Akhenaten on Slopstore. Categorized under Education, this app is part of Slopstore's curated collection of AI-generated tools and experiments. Run it free in your browser. No installation needed.

AI Generation Prompt

Overview

A high-performance, browser-based interactive simulator that allows users to visualize Fortune's Algorithm in real-time. This tool bridges the gap between theoretical computational geometry and practical understanding by animating the sweep line and beach line construction.

Core Features

  • Interactive Canvas: Users can click to place arbitrary points (sites) on a 2D plane.
  • Real-time Visualization: Smooth animation of the sweep line moving across the plane.
  • Beach Line Rendering: Dynamic drawing of the parabolic arcs that form the beach line.
  • Playback Controls: Play, pause, step-forward, step-backward, and reset buttons.
  • Simulation Speed Control: Slider to adjust the velocity of the sweep line.
  • Layer Toggle: Independently toggle the visibility of the sweep line, beach line, site points, and final Voronoi edges.
  • Export Functionality: Capability to export the final diagram as a static SVG or high-resolution PNG image.

UI/UX Layout

  • Header: Minimalistic navigation showing the tool name and a brief instruction tooltip.
  • Main Content Area: A large, responsive centered canvas taking up 80% of the viewport width.
  • Control Sidebar (Floating): A sleek panel positioned on the right or bottom (depending on device), housing playback buttons, speed slider, and layer visibility checkboxes.
  • Info Overlay: A non-intrusive 'Help' icon that displays shortcuts (e.g., 'Space' to Play/Pause).

Visual Design (Light Mode Only)

  • Background: Clean #FFFFFF with subtle grid lines (#F0F0F0) to help gauge spatial distribution.
  • Elements:
    • Sites: Deep blue circles (#2563EB).
    • Sweep Line: Vibrant red horizontal dashed line (#DC2626).
    • Beach Line: Crisp orange paths (#EA580C).
    • Voronoi Edges: Sharp, dark grey lines (#374151).
  • Typography: Sans-serif, human-readable fonts (e.g., Inter or system UI stacks).
  • Animations: CSS transitions for UI elements; requestAnimationFrame for the canvas rendering loop.

Technical Constraints & Directives

  • Single File: All HTML, CSS, and JS must be embedded in one .html file. CSS in <style>, JS in <script>.
  • In-Memory Only: NO localStorage, sessionStorage, cookies, or IndexedDB. State must be handled entirely in JavaScript objects/arrays.
  • Browser-Based: Use HTML5 Canvas API for high-performance rendering of the geometric entities.
  • Responsive: Ensure the canvas resizes without clearing the existing points or breaking the simulation logic.
  • No Dependencies: Use vanilla JavaScript for the algorithm implementation. No heavy frameworks like React or Vue.
  • Clean Code: Use descriptive variable names and modular functions for the algorithm steps (e.g., handleSiteEvent(), handleCircleEvent(), updateBeachLine()).
  • Iframe Safe: Avoid any calls that trigger popups or external navigation. All modals must be custom <div> overlays.

Spread the word

9Total Views
gemini-3.0-flash logogemini-3.0-flash
AI Model

Files being used

index.html
13.2 KB
#Voronoi diagram generator#Fortune's algorithm visualizer#interactive computational geometry tool#sweep line algorithm simulation#beach line visualization

Frequently Asked Questions

Everything you need to know about using this application.

What is Fortune's algorithm and how does this tool visualize it?

Fortune's algorithm is a sweep-line algorithm used to construct a Voronoi diagram for a given set of points in a plane. It maintains a 'sweep line' that moves across the plane and a 'beach line' composed of parabolic arcs, which represents the state of the Voronoi construction at any given moment during the sweep. This tool visualizes this process by dynamically updating the canvas to show the sweep line's progression and the real-time formation of parabolic arcs. Users can observe how site events and circle events trigger changes in the beach line, providing a deep, intuitive understanding of the underlying mathematical principles.

How do I interact with the Voronoi visualizer?

To start using the tool, simply click on the interactive canvas area to add site points. Once you have placed your desired points, you can initiate the visualization using the control panel. The simulation will begin animating the sweep line, demonstrating the step-by-step construction of the diagram. You can pause, resume, or reset the animation at any time using the playback controls. Additionally, you can adjust the speed of the sweep line to slow down complex formations, allowing you to examine the geometry more closely as the algorithm processes each event.

Does this tool save my Voronoi diagrams or user data?

This application operates entirely in-memory within your browser session for privacy and security. It does not utilize local storage, cookies, or databases to save your session data, meaning that once you close or refresh the browser tab, all placed points and current simulation states will be cleared. While the application does not persist your data, you can capture your work by using the built-in export feature. This allows you to download the final Voronoi diagram as an SVG or PNG file, ensuring you can save your results for presentations, academic papers, or personal study.

Is this tool suitable for educational or classroom environments?

Yes, this visualizer is specifically designed as an educational aid for students and educators in fields like computer science, mathematics, and computational geometry. Its clean, distraction-free interface focuses purely on the algorithm's mechanics, making it an excellent resource for demonstrating complex geometric concepts during lectures or study sessions. The tool is fully responsive and works in any modern web browser without the need for additional software or plugins. Whether used on a laptop or a tablet, the interactive nature of the simulation helps demystify the Voronoi construction process through active learning and visual reinforcement.

Related Applications

Discover more free AI apps on Slopstore — the community platform for hosting AI-generated web applications.