#vector-graphics #quaternions #geometry #graphics #transformation

nightly aloe-geometry

Aloe Geometry is a Rust crate providing advanced functionality for 2D/3D geometric operations, including path manipulation, affine transforms, and quaternion support for graphical applications. This crate is a translation of the c++ juce module serving the same function.

2 releases

Uses new Rust 2024

new 0.1.1 Apr 2, 2025
0.1.0 Apr 2, 2025

#38 in #quaternions

Download history 84/week @ 2025-03-28

84 downloads per month
Used in 166 crates (58 directly)

GPL-3.0 license

695KB
5.5K SLoC

aloe-geometry

Aloe Geometry is a sophisticated Rust library designed to handle complex 2D and 3D geometric transformations, providing a robust set of APIs for graphical applications.

Features

  • Justification and Border Manipulation: Utilize enums like JustificationFlags to manage text and element alignment efficiently. BorderSize allows you to add exact pixel-sized borders to shapes.

  • Quaternion for Rotations: The library supports Quaternion, which facilitates smooth 3D rotations and interpolations, crucial for 3D graphics.

  • Advanced Shape Handling: Path, Line, and Rectangle structures allow complex shape manipulations, from creating simple lines to managing intricate path shapes using quadratic and cubic curves with support from Line and PathStrokeType structs.

  • Affine Transforms: Perform a wide array of affine transformations (AffineTransform), such as scaling, rotations, translations, and shearing, perfectly suitable for 2D graphic manipulation.

  • Utility for Rectangles and Polygons: Easily handle geometric operations on rectangles and parallelograms using Rectangle and Parallelogram with functions for intersection, unions, and clipping.

  • 3D Orientation: Rotate 3D objects interactively with Draggable3DOrientation.

Usage Example

Here's a small example on using some core features of the library:

use aloe_geometry::{Path, AffineTransform, JustificationFlags};

let mut my_path = Path::default();
my_path.start_new_sub_path(10.0, 10.0);
my_path.line_to(100.0, 200.0);
my_path.close_sub_path();

let transform = AffineTransform::rotation_about_the_origin(45.0);
my_path.apply_transform(&transform);

License

This project is licensed under the GNU General Public License v3.0.

Contribution

We welcome contributions to enhance ALEO's capabilities filled with edge vectors.

Repository

GitHub

Note: This README.md file was generated by an AI model and may not be 100% accurate; however, it should provide a good overview.

This crate is a translation of the JUCE module.

JUCE is a c++ software framework for developing high performance audio applications.

Usage falls under the GPLv3 as well as the JUCE commercial license.

See github.com/juce-framework/JUCE and the JUCE license page for details.

This crate is in the process of being translated from c++ to rust. For progress updates, please see the workspacer rust project. designed specifically for rust projects.

Dependencies

~12–26MB
~357K SLoC