Crates.io | rust-3d |
lib.rs | rust-3d |
version | 0.34.0 |
source | src |
created_at | 2017-01-08 19:28:58.693597 |
updated_at | 2020-08-07 10:03:48.026181 |
description | 2D/3D library written in rust |
homepage | https://github.com/I3ck/rust-3d |
repository | https://github.com/I3ck/rust-3d |
max_upload_size | |
id | 7987 |
size | 941,786 |
3D/2D library written in Rust. Offering useful containers, structures and algorithms for 2D and 3D space. Meant as basis for numeric algorithms, viewers, game engines, ...
Note that the module structure changed. There's now only submodules for io
and impls
.
Also prelude
was removed.
If you were using the prelude via rust_3d::prelude::*;
you should now be able to just switch to
rust_3d::*;
.
If you were using explicit paths such as rust_3d::filters::combinators::FilterAll
you should now use rust_3d::FilterAll
.
Note that io
and impls
are still part of the module path.
This should make future usage easier, but might be painful for existing users.
Here's a little overview of some of rust-3d
's features.
The snippets / names might not be up-to-date, so please check tests/
for compiling examples.
No .unwrap()
where it's not 100% safe.
There's strong types for everything that might get mixed up easily.
This way e.g. ids of faces can't be mistaken for ids of vertices.
fn edges_of_face(&self, faceid: FId) -> Result<(EId, EId, EId)>;
There's also smart types which restrict the values they can hold.
This way distances can never be < 0.0
, sizes can be enfored to be > 0.0
etc.
Positive
NonNegative
I try and keep all algorithms and types as generic as possible.
Is2D
are split into several versions: IsEditable2D
, IsBuildable2D
IsMesh
is defined for any vertex type and any number of vertices / faceVec
)This makes it possible to require as little implementation work as possible if you want to use your own types.
Any IsFilter<T>
can be combined via FilterAND
, FilterOR
, FilterAny
, FilterNegate
...
Any IsFilter<T>
can be transformed to work for any collection of T
s (IsFilterRandomAccessible
).
IsDirectionField2D
might be transformed to an IsFilter<Is2D>
, which can then be transformed to an IsFilterRandomAccessible<Is2D>
.
Any IO
method is defined on traits, so if you implement these, you'll get read/write of different file formats for free.
You can find the documentation here.
Please take a look at the tests in tests/
. These will be up-to-date and compiling.
I might add extensive tutorials / examples / demo projects in the future.
Feel free to open an issue in case you're missing something or found a bug. Please avoid directly contributing since I might be working on breaking changes or the feature you want to implement. Open an issue or email me beforehand.
MIT (see LICENSE)