Crates.io | procedural_modelling |
lib.rs | procedural_modelling |
version | 0.2.0 |
source | src |
created_at | 2024-02-28 10:56:54.235823 |
updated_at | 2024-07-08 07:20:56.271646 |
description | A framework-agnostic Procedural Modelling crate. |
homepage | https://bevy-procedural.org/modelling |
repository | https://github.com/bevy-procedural/modelling |
max_upload_size | |
id | 1156332 |
size | 497,016 |
A Framework-Agnostic Procedural Modelling Library.
Uses a datastructure based on half-edge meshes to represent (open) manifold meshes with optional non-manifold vertices. Our goal is to implement operations like Boolean Operations, Subdivisions, Curved Surfaces, and Stitching. The library aims to support the tesselation of 2d surfaces in a modular way that can be used without any of the 3d features.
Currently there are quite a few crates that implement boolean operations and tesselation to achieve some other goal. We want to provide a common implementation to satisfy these very similar requirements and improve code-reuse among these projects so they can focus on their original goal.
This crate is still in a very early stage of development. Expect frequent API modifications, bugs, and missing features. Feel free to contribute by opening issues, pull requests or sharing your ideas in Github Discussion.
Install using cargo add procedural_modelling
.
let mut mesh = MeshVec3::regular_star(1.0, 0.8, 30);
mesh.transform(
&Transform::from_translation(Vec3::new(0.0, -0.99, 0.0))
.with_rotation(Quat::from_rotation_z(PI)),
);
let trans = Transform::from_rotation(Quat::from_rotation_y(0.3))
.with_translation(Vec3::new(0.4, 0.3, 0.0));
let mut f = mesh.extrude_ex(mesh.edge_between(1, 0).unwrap().id(), trans, true, true);
for _ in 0..5 {
f = mesh.extrude_face_ex(f, trans, true, true);
}
mesh.to_bevy(RenderAssetUsages::default())
Or run the examples on your computer like, e.g., cargo run --features="bevy bevy/bevy_pbr" --profile fast-dev --example box
.
For package development, we recommend using the editor
-subcrate. This example has a little egui-editor. Run it using cargo watch -w editor/src -w src -x "run -p editor --profile fast-dev"
. The fast-dev
profile will enable optimizations for the dependencies, but not for the package itself. This will slow down the first build significantly, but incremental builds are slightly faster and bevy's performance (bevy is used as the renderer in the examples) improves a lot.
Bevy
wgpu
The following features are available:
meshopt
-- Use Meshopt to optimize the performance of generated meshes.bevy
-- Compiles with support for bevy. Necessary for the examples and the editor.The following table shows the compatibility of procedural_modelling
with certain versions of Bevy:
bevy | bevy_procedural_meshes |
---|---|
0.14 | 0.2.*, main |
0.13 | 0.1.* |
Except where noted (below and/or in individual files), all code in these repositories is dual-licensed, allowing you the flexibility to choose between:
The MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
The Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.