Explore Infinite Beauty with a Web Fractal Engine

Resumo

Pixel shares an open-source, zero-dependency fractal engine that explores mathematical beauty in the browser. Its Web Worker handles intensive calculations for smooth rendering, with interactive zoom, color palettes, PNG export, bilingual controls, and nine fractal families.

DEV Community

Dreamlike Fractals. Worlds of Unimaginable and Infinite Beauty.

Dreamlike Fractals. Worlds of Unimaginable and Infinite Beauty. "Technosphere at the service of the Biosphere." — Peace Is The Way. Fractals are visual proof of how surprisingly simple mathematical rules can generate worlds of infinite complexity. However, bringing that mathematical beauty into a fluid and safe web browser poses two classic engineering challenges: blocking the main thread and safe expression execution. Today I want to introduce Fractal / Mathematical Core (Fractales de Ensueño), an open-source, zero-dependency rendering engine designed for students, teachers, and scientific computing enthusiasts. 🔗 Try the Live Demo: amurlaniakea.github.io/fractal 💻 Source Code (AGPL-3.0): https://github.com/amurlaniakea/fractal 🧠 Architecture: Real 60 FPS Without Frameworks When you increase the zoom level or raise the iterations per pixel in a Mandelbrot set, floating-point calculation (Float64) becomes intensive. If you run that loop on the browser's main thread, the interface freezes. To prevent this, the project completely separates the visual layer from the computation layer: Reactive Interface (index.html + ui-overlay.css): Manages real-time controls (zoom, color palettes, iterations, and PNG image export) while maintaining a smooth 60 FPS response. Asynchronous Core (worker.js + fractals.js): All heavy computation takes place in a dedicated background Web Worker, sending back ready-to-paint image buffers without interrupting the user experience. Zero Dependencies: No bundlers, no heavy external packages, and no vulnerable supply chains. Code audited line by line. 📚 9 Implemented Fractal Families The engine allows you to explore and compare different recurrences on the complex plane from a single bilingual panel (Spanish / English): Mandelbrot Set: The classic $z_{n+1} = z_n^2 + c$. Julia Set: Interactive exploration by fixing the complex parameter $c$. Burning Ship: Variant with absolute values that generates structures resembling burning ships. Tricorn (Mandelbar): Uses the complex conjugate $\bar{z}$. Celtic: Applies the absolute value solely to the real component. Buffalo: Applies the absolute value to both components. Multibrot $z^3$ and $z^4$: Higher-order generalizations with multiple symmetries. Phoenix: Two-step recurrence with memory of the previous state ($P = 0.5$). 🛡 Security Note: Why I Disabled Custom Equations In software architecture, security must always come ahead of a flashy feature. In early versions of the engine, I allowed users to enter custom formulas via dynamic evaluation (new Function). After auditing the design, I decided to completely disable this feature. The reason? new Function (just like eval) does not constitute a true sandbox in the browser and opens the door to code injection vectors. Until I implement a safe, isolated AST (Abstract Syntax Tree) parser that exclusively evaluates permitted mathematical operations, the engine prioritizes the integrity of the user's environment. 🚀 Run It on Your Machine in 30 Seconds If you want to study the code or experiment locally, remember that browsers block Web Workers if you open the file directly with file://. Serve it via local HTTP: git clone https://github.com.git
cd fractal
python3 -m http.server 8080
Then, open http://localhost:8080 in your browser. (Tip: use Ctrl + Shift + R if you make changes to the worker to clear the cache). 🤝 Contributions and Next Steps The project is published under the AGPL-3.0 license and is open to community improvements. Upcoming lines of work include: Implementation of an AST-based mathematical parser to safely re-enable custom formulas. Arbitrary-precision emulation (Deep Zoom) to overcome the standard Float64 limit. New dynamic color palettes inspired by astronomical spectroscopy. If you are passionate about visual mathematics, pure JavaScript performance, or secure software design, stop by the repository, try the demo, and tell me which fractal surprised you the most. 👇 What do you think of the...
Explore Infinite Beauty with a Web Fractal Engine
Powered by Readybot.io

As últimas novidades de Pixel

Stop Paying for AI Renders in Test Orders

Pixel’s announcement explains how internal test orders were accidentally triggering paid AI video renders costing just over $1 each. It details a server-side dry-run guard …

Sandblasting Grit Guide: 120 vs 220 vs 320

Pixel’s announcement explains how 120, 220, and 320 grit affect aluminium’s matte finish and reveal die-cast porosity. It also covers how pressure, blast distance, and …

NVIDIA Cosmos 3 Edge: Physical AI on Jetson

Pixel shares the first article in CAVEDU's Cosmos series, introducing NVIDIA Cosmos 3 Edge, an approximately 4-billion-parameter world model for Jetson devices. It explores multimodal …

Laravel Semantic Search with OpenAI and Pinecone

Pixel shares a practical guide to building semantic search in Laravel using OpenAI embeddings and Pinecone. It covers 1536-dimensional vectors, cosine similarity, index setup, environment …