Getting Started
To get started with Plexus, add a dependency to the Cargo.toml
manifest.
The documentation on this website is based on work on the master
branch. Because Plexus is in its initial development phase, published crates may differ significantly from what is documented here. Consider taking a dependency on a master
revision.
Prelude Module¶
Some features are exposed largely via traits. It can sometimes be cumbersome to import these traits, so it is recommended to import the contents of the prelude
module.
The prelude
module re-exports commonly used types and traits. Collisions are avoided by importing traits anonymously. In particular, the prelude
module re-exports traits used for tessellation and iterator expressions that manipulate iterators of topological data.
Note
Most code examples in the user guide do not include imports. See the API documentation for import paths.
Integrations¶
Plexus integrates with the [theon
][] crate to abstract Euclidean spaces and provide geometric traits that support various mathematics crates in the Rust ecosystem. Any mathematics crate can be used and, if it is supported by Theon, Plexus provides geometric APIs.
Geometric traits are optionally implemented for types in various crates by enabling Cargo features.
Feature | Default | Crate | Support |
---|---|---|---|
geometry-cgmath | No | [cgmath ][] | Complete |
geometry-glam | No | [glam ][] | Complete |
geometry-mint | No | [mint ][] | Partial |
geometry-nalgebra | No | [nalgebra ][] | Complete |
geometry-ultraviolet | No | [ultraviolet ][] | Partial |
If using one of these supported crates, it is highly recommended to enable the corresponding feature. To configure features, specify a dependency on Plexus in Cargo.toml
as seen below.
Plexus also integrates with the [decorum
][] crate for floating-point representations that can be hashed for fast indexing. The R64
type is a (totally ordered) real number with an f64
representation that cannot be NaN
nor infinity, for example. Geometric conversion traits are implemented for supported types to allow for implicit conversions of scalars.
Plexus re-exports integrated crates in sub-modules of the integration
module. When using integrated crates, a direct dependency or an import from integration
can be used. Using the integration
module avoids version conflicts.