threecrate-core 0.7.1

Core data structures and traits for threecrate
Documentation

ThreeCrate Core

Crates.io Documentation License

Core data structures and traits for the threecrate library ecosystem.

Features

  • Point Types: Point3f, ColoredPoint3f, NormalPoint3f, ColoredNormalPoint3f
  • Point Cloud: Generic PointCloud<T> with spatial operations
  • Mesh: TriangleMesh with vertices, faces, normals, and optional UV coordinates
  • Transformations: Transform3D for rotation, translation, and scaling
  • Traits: Drawable, Transformable, NearestNeighborSearch
  • Error Handling: Comprehensive error types for 3D processing operations
  • Bevy Integration: Optional Bevy game engine interop via the bevy feature flag

Usage

Add this to your Cargo.toml:

[dependencies]
threecrate-core = "0.6.0"

For Bevy integration:

[dependencies]
threecrate-core = { version = "0.6.0", features = ["bevy"] }

Example

use threecrate_core::{PointCloud, Point3f, TriangleMesh};

// Create a point cloud
let points = vec![
    Point3f::new(0.0, 0.0, 0.0),
    Point3f::new(1.0, 0.0, 0.0),
    Point3f::new(0.0, 1.0, 0.0),
];
let cloud = PointCloud::from_points(points);

// Create a triangle mesh
let vertices = vec![
    Point3f::new(0.0, 0.0, 0.0),
    Point3f::new(1.0, 0.0, 0.0),
    Point3f::new(0.0, 1.0, 0.0),
];
let faces = vec![[0, 1, 2]];
let mesh = TriangleMesh::from_vertices_and_faces(vertices, faces);

License

This project is licensed under either of

at your option.