Skip to main content

astrelis_geometry/
lib.rs

1//! Astrelis Geometry - Customizable 2D geometry rendering
2//!
3//! This crate provides:
4//! - Path and shape primitives for 2D vector graphics
5//! - Tessellation (converting paths/shapes to triangle meshes)
6//! - Style system (strokes, fills, gradients)
7//! - GPU-accelerated rendering with instancing
8//! - Mathematical charting (optional "chart" feature)
9//!
10//! # Example
11//!
12//! ```ignore
13//! use astrelis_geometry::*;
14//!
15//! // Create a geometry renderer
16//! let mut renderer = GeometryRenderer::new(context);
17//!
18//! // Draw shapes
19//! let style = Style::fill(Paint::solid(Color::RED));
20//! renderer.draw_shape(&Shape::circle(Vec2::new(100.0, 100.0), 50.0), &style);
21//!
22//! // Draw custom paths
23//! let path = PathBuilder::new()
24//!     .move_to(Vec2::new(0.0, 0.0))
25//!     .line_to(Vec2::new(100.0, 0.0))
26//!     .quad_to(Vec2::new(150.0, 50.0), Vec2::new(100.0, 100.0))
27//!     .close()
28//!     .build();
29//! renderer.draw_path(&path, &style);
30//!
31//! // Render to a pass
32//! renderer.render(&mut pass, viewport);
33//! ```
34
35// Core primitives
36mod curve;
37mod path;
38mod shape;
39mod transform;
40
41// Styling
42mod fill;
43mod paint;
44mod stroke;
45mod style;
46
47// Tessellation
48mod tessellator;
49mod vertex;
50
51// Rendering
52mod dirty_ranges;
53mod gpu_types;
54mod instance_buffer;
55mod pipeline;
56mod renderer;
57
58// Chart module (optional)
59#[cfg(feature = "chart")]
60pub mod chart;
61
62// Re-exports
63pub use curve::*;
64pub use path::*;
65pub use shape::*;
66pub use transform::*;
67
68pub use fill::*;
69pub use paint::*;
70pub use stroke::*;
71pub use style::*;
72
73pub use tessellator::*;
74pub use vertex::*;
75
76pub use gpu_types::*;
77pub use renderer::*;