Skip to content

narmesh/formflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

FormFlow

Where Mathematics Shapes Organic Art

FormFlow is a generative art web application that transforms mathematical equations into flowing, organic vector forms. Each generation creates unique, abstract shapes that feel alive โ€” like something between a sea creature, a biological cell, or an alien sculpture โ€” yet they're purely math-driven.

FormFlow Banner Version License


๐ŸŒ€ What is FormFlow?

FormFlow explores organic beauty through computational design โ€” the harmony of chaos and form. It's a single-page application that generates deterministic, mathematically-driven organic shapes on demand. Think of it as a daily playground where geometry meets nature.

Core Philosophy

  • Mathematical Foundation: Every curve, every flow is generated from parametric equations, noise functions, and wave interference
  • Organic Aesthetics: Despite being 100% algorithmic, forms feel natural and alive
  • Deterministic Creativity: Same seed = same form, ensuring reproducibility
  • Infinite Variety: Billions of unique combinations through advanced entropy systems

โœจ Features

๐ŸŽจ Six Aesthetic Palettes

Each palette is carefully curated to evoke different moods and emotions:

  1. Cyan Wave โ€” Serene mint greens and teals (signature palette)
  2. Coral Flame โ€” Warm reds and coral tones
  3. Violet Depth โ€” Rich purples and lavenders
  4. Solar Gold โ€” Vibrant yellows and oranges
  5. Ice Blue โ€” Cool, crystalline blues
  6. Rose Pink โ€” Soft pinks and magentas

๐Ÿงฎ Eight Form Algorithms

Each generation randomly selects from eight distinct mathematical approaches:

  1. Radial Organic โ€” Multi-frequency sinusoidal patterns with symmetrical structures
  2. Spiral Flow โ€” Expanding spirals with noise-driven perturbations
  3. Cellular Blob โ€” Biology-inspired cellular structures with multiple growth points
  4. Parametric Wave โ€” Lissajous-style parametric equations (sin/cos combinations)
  5. Fractal Branch โ€” Self-similar branching patterns with recursive frequency multiplication
  6. Interference Pattern โ€” Wave interference creating complex harmonic structures
  7. Geometric Morph โ€” Polygons morphing into organic shapes through interpolation
  8. Turbulent Field โ€” Multi-octave noise creating chaotic, flowing forms

๐ŸŽฏ Style Presets

Five personality modes that modify all algorithms:

  • Smooth โ€” Gentle, flowing forms with minimal turbulence
  • Chaotic โ€” Wild, unpredictable shapes with high noise intensity
  • Dense โ€” High point count for intricate, detailed structures
  • Minimal โ€” Clean, simple forms with reduced complexity
  • Textured โ€” Rich surface detail through multi-octave noise

๐Ÿ”€ Advanced Generation Features

  • Hybrid Blending (30% chance) โ€” Combines two different algorithms for unique crossover forms
  • Geometric Transformations โ€” Random rotation and potential mirroring
  • Noise-Based Coloring (40% chance) โ€” Color mapped to noise field for natural gradients
  • Multi-Layer Rendering โ€” Optional inner forms for added depth
  • High-Entropy Seeding โ€” Virtually infinite unique seeds (2ยณยฒ combinations)

๐Ÿง  The Mathematics Behind FormFlow

Mulberry32 PRNG

FormFlow uses the Mulberry32 pseudorandom number generator instead of basic Math.random(). This provides:

  • Determinism: Same seed always produces identical results
  • High Entropy: Uniform distribution across 4.3 billion possible seeds
  • Non-Repetition: Eliminates pattern clustering from periodic functions
random() {
  let t = this.seed += 0x6D2B79F5;
  t = Math.imul(t ^ t >>> 15, t | 1);
  t ^= t + Math.imul(t ^ t >>> 7, t | 61);
  return ((t ^ t >>> 14) >>> 0) / 4294967296;
}

Multi-Octave Simplex Noise

Natural-looking organic detail comes from fractal noise:

noiseOctaves(x, y, octaves = 4, falloff = 0.5) {
  let value = 0, amp = 1, freq = 1, maxValue = 0;
  for (let i = 0; i < octaves; i++) {
    value += this.noise(x * freq, y * freq) * amp;
    maxValue += amp;
    freq *= 2;
    amp *= falloff;
  }
  return value / maxValue;
}

This creates detail at multiple scales โ€” from large-scale shape to fine surface texture.

Parametric Form Generation

Forms are generated using polar coordinates:

for (let i = 0; i < numPoints; i++) {
  const angle = (i / numPoints) * Math.PI * 2;
  let r = baseRadius;
  
  // Layer mathematical transformations
  r += Math.sin(angle * symmetry) * amplitude;
  r += noise.noiseOctaves(cos(angle), sin(angle)) * intensity;
  
  // Convert to Cartesian
  points.push({
    x: centerX + Math.cos(angle) * r,
    y: centerY + Math.sin(angle) * r
  });
}

Safety Bounds

All radius values are clamped to ensure visual coherence:

r = Math.min(Math.max(r, 60), 280);

This prevents forms from collapsing to points or exploding beyond the canvas.


๐ŸŽฎ User Experience

Minimal Interface

FormFlow embraces a mathematical design language:

  • Sans-Serif Typography โ€” Space Grotesk
  • Grid Overlay โ€” Subtle graph paper aesthetic
  • Sharp Geometry โ€” No rounded corners, pure mathematical edges
  • Dark Theme โ€” Black background with cyan accent (#a3e6c8)
  • Borderless Controls โ€” Clean, functional buttons with precise hover states

Interaction

  1. Generate โ€” Create a new random form
  2. Select Palette โ€” Choose from six color schemes
  3. Export PNG โ€” Download your creation
  4. View Seed โ€” Each form displays its unique seed number

Reproducibility

Every form has a unique seed displayed at the bottom. Share this seed to recreate the exact same form later (note: palette must also match).


๐Ÿ”ฌ Technical Architecture

Technology Stack

  • Pure Vanilla JavaScript โ€” No frameworks, no dependencies
  • HTML5 Canvas โ€” Hardware-accelerated rendering
  • CSS3 โ€” Modern layout with grid and flexbox
  • Bรฉzier Curves โ€” Smooth quadratic interpolation for organic outlines

Performance

  • Efficient Rendering โ€” Single-pass canvas drawing
  • Optimized Noise โ€” Pre-computed permutation tables
  • Smart Point Distribution โ€” Adaptive point counts based on form complexity
  • Smooth Curves โ€” Quadratic curve interpolation for fluid shapes

Code Structure

โ”œโ”€โ”€ SeededRandom class      # Mulberry32 PRNG implementation
โ”œโ”€โ”€ SimplexNoise class      # Multi-octave noise generator
โ”œโ”€โ”€ Form Generators (8)     # Individual algorithm functions
โ”œโ”€โ”€ Rendering Pipeline      # Canvas drawing and styling
โ”œโ”€โ”€ Transformation Layer    # Rotation, mirroring, blending
โ””โ”€โ”€ UI Controllers          # Button handlers and palette selector

๐ŸŽจ Design Principles

1. Mathematical Integrity

Every visual element stems from genuine mathematical processes:

  • Trigonometric functions (sine, cosine)
  • Parametric equations
  • Noise fields
  • Wave interference
  • Fractal recursion

2. Organic Aesthetics

Despite mathematical origins, forms feel:

  • Alive โ€” Natural movement and flow
  • Balanced โ€” Compositional harmony
  • Textured โ€” Multi-scale detail
  • Unique โ€” Never repetitive

3. Computational Beauty

FormFlow celebrates the intersection of:

  • Precision and Chaos
  • Determinism and Randomness
  • Structure and Fluidity
  • Mathematics and Nature

๐Ÿš€ Use Cases

  • Generative Art Projects โ€” Create unique artwork programmatically
  • Design Inspiration โ€” Explore organic forms for creative projects
  • Mathematical Visualization โ€” See mathematical concepts come alive
  • Educational Tool โ€” Demonstrate parametric equations and noise functions
  • Texture Generation โ€” Export forms as design elements

๐Ÿงฉ Algorithm Deep Dive

Radial Organic

The most versatile algorithm, combining multiple sine/cosine waves with different frequencies:

r = baseRadius + ฮฃ(sin(angle ร— symmetry ร— j) / j) + noise

Creates balanced, symmetrical forms reminiscent of flowers, snowflakes, or sea creatures.

Spiral Flow

Expanding spirals with noise perturbation:

angle = t ร— spirals
r = base + t ร— expansion + noise(t, angle)

Generates forms that feel like they're rotating or flowing outward.

Cellular Blob

Multiple "growth points" that influence nearby regions:

r = base + ฮฃ(max(0, cos(angle - cellAngle)) ร— influence)

Mimics biological cell division and organic clustering.

Parametric Wave

Classic Lissajous curves with noise:

r = scale ร— (sin(aร—t) + cos(bร—t)) + noise

Creates figure-eight patterns, loops, and harmonic shapes.

Fractal Branch

Self-similar patterns at multiple scales:

r = base + ฮฃ(sin(angle ร— branches ร— 2^(level-1)) / level)

Resembles tree branches, lightning, or neural networks.

Interference Pattern

Multiple wave frequencies interfering:

r = base + ฮฃ(sin(angle ร— w ร— 2) / w + cos(angle ร— (w+1)) / w)

Creates complex harmonic structures like ripples on water.

Geometric Morph

Interpolates between circle and polygon:

r = circleR ร— (1-morph) + polygonR ร— morph + noise

Produces forms that balance geometric precision with organic flow.

Turbulent Field

High-frequency multi-octave noise dominates:

r = base + noiseOctaves(5 layers) ร— turbulence

Creates chaotic, unpredictable shapes with rich texture.


๐Ÿ“Š Statistics

  • 8 distinct form algorithms
  • 5 style personality presets
  • 6 curated color palettes
  • 2ยณยฒ possible unique seeds (4,294,967,296)
  • Infinite practical variations through hybrid blending and transformations

๐ŸŽ“ Educational Value

FormFlow serves as a practical demonstration of:

  • Parametric Equations โ€” Converting mathematical functions to visual forms
  • Noise Functions โ€” Simplex/Perlin noise in generative systems
  • Trigonometry โ€” Practical applications of sine and cosine
  • Pseudorandom Number Generation โ€” Deterministic randomness
  • Fractal Geometry โ€” Self-similarity and scale invariance
  • Wave Interference โ€” Harmonic pattern generation
  • Canvas API โ€” HTML5 graphics programming
  • Algorithm Design โ€” Balancing randomness with coherence

๐ŸŽฏ Design Goals Achieved

โœ… Minimal & Aesthetic โ€” Clean interface with mathematical precision
โœ… Easy Navigation โ€” Simple three-button control system
โœ… Dark Theme โ€” Pure black with cyan accents
โœ… Deterministic โ€” Reproducible via seeds
โœ… Infinite Variety โ€” Billions of unique forms
โœ… Natural Forms โ€” Organic despite mathematical origin
โœ… Performance โ€” Instant generation, smooth rendering
โœ… Accessible โ€” Works in any modern browser


๐Ÿ’ก Philosophy

"FormFlow explores organic beauty โ€” the harmony of chaos and form."

At its core, FormFlow is an exploration of the profound connection between mathematics and nature. It demonstrates that:

  • Order can create chaos โ€” Simple rules generate complex forms
  • Randomness has structure โ€” Noise creates natural patterns
  • Mathematics is beautiful โ€” Equations produce emotional responses
  • Code is creative โ€” Algorithms can be artistic tools

FormFlow is not just a tool; it's a meditation on computational creativity and the unexpected beauty that emerges when we let mathematics flow freely.


๐Ÿ™ Acknowledgments

FormFlow draws inspiration from:

  • Perlin Noise โ€” Ken Perlin's groundbreaking work on natural-looking noise
  • Simplex Noise โ€” Improved noise algorithm for smoother gradients
  • Generative Art Movement โ€” Artists exploring algorithmic creativity
  • Parametric Design โ€” Mathematical approaches to form generation
  • Nature โ€” The ultimate source of organic beauty

๐Ÿ“ License

MIT License โ€” Free to use, modify, and distribute.


๐ŸŒŠ Experience FormFlow

FormFlow is more than a generator โ€” it's a canvas for computational creativity. Every form is a mathematical whisper, a frozen moment of algorithmic beauty, a unique intersection of order and chaos.

Generate. Explore. Discover.


Built with mathematics, designed for beauty, created for exploration.

About

Transform equations into organic vector art.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages