wassily_algorithms/lib.rs
1//! # Wassily Algorithms
2//!
3//! Specialized rendering algorithms and advanced techniques for generative art.
4//! This crate provides mathematical transformations, 3D rendering capabilities,
5//! and specialized algorithms that extend the core wassily functionality with
6//! advanced artistic and computational techniques.
7//!
8//! ## Key Components
9//!
10//! - **[`endo2d`]**: 2D endomorphisms and mathematical transformations
11//! - **[`sphere`]**: 3D sphere rendering with lighting and texture mapping
12//!
13//! ## Mathematical Transformations
14//!
15//! The endomorphism functions provide various mathematical transformations
16//! commonly used in generative art and computational graphics:
17//!
18//! ```no_run
19//! use wassily_algorithms::*;
20//! use wassily_core::pt;
21//!
22//! let point = pt(0.5, 0.3);
23//!
24//! // Apply various transformations
25//! let swirled = swirl(point);
26//! let polar = to_polar(point);
27//! let heart_shaped = heart(point);
28//! ```
29//!
30//! ## 3D Rendering
31//!
32//! The sphere rendering system provides realistic 3D sphere rendering with:
33//!
34//! - **Texture Mapping**: Apply 2D textures to 3D surfaces
35//! - **Lighting**: Multiple light sources with diffuse and specular reflection
36//! - **Rotation**: 3D rotation around multiple axes
37//! - **Perspective**: Realistic perspective projection
38//!
39//! ```no_run
40//! use wassily_algorithms::*;
41//! use wassily_core::*;
42//!
43//! // Create a texture canvas
44//! let texture = Canvas::new(256, 256);
45//!
46//! // Set up 3D scene
47//! let scene = SphereScene::basic(pt3(0.0, 0.0, 100.0), &texture);
48//!
49//! // Render to output canvas
50//! let mut output = Canvas::new(800, 600);
51//! render_sphere(&scene, &mut output);
52//! ```
53//!
54//! ## Applications
55//!
56//! These algorithms are particularly useful for:
57//!
58//! - **Fractal Systems**: IFS (Iterated Function Systems) with endomorphisms
59//! - **3D Visualization**: Realistic rendering of 3D objects
60//! - **Mathematical Art**: Visualization of complex mathematical functions
61//! - **Advanced Effects**: Specialized transformations for artistic effects
62//!
63//! ## Performance Considerations
64//!
65//! These algorithms are computationally intensive and are best used for:
66//! - High-quality final renders
67//! - Specialized mathematical visualizations
68//! - Cases where the advanced features justify the computational cost
69
70pub mod endo2d;
71pub mod sphere;
72
73// Re-export key types and functions for convenience
74pub use endo2d::*;
75pub use sphere::*;