diff --git a/Cargo.lock b/Cargo.lock index 1c7ccad10..fb5abc2c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -630,10 +630,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "fj-core", - "fj-export", - "fj-math", - "fj-window", + "fj", "itertools", ] @@ -779,6 +776,18 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "fj" +version = "0.46.0" +dependencies = [ + "fj-core", + "fj-export", + "fj-interop", + "fj-math", + "fj-viewer", + "fj-window", +] + [[package]] name = "fj-core" version = "0.46.0" diff --git a/Cargo.toml b/Cargo.toml index 7c7f27545..09bfa3286 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] resolver = "2" members = [ + "crates/fj", "crates/fj-core", "crates/fj-export", "crates/fj-interop", @@ -17,11 +18,13 @@ members = [ "tools/release-operator", ] default-members = [ + "crates/fj", "crates/fj-core", "crates/fj-export", "crates/fj-interop", "crates/fj-math", "crates/fj-viewer", + "crates/fj-window", ] @@ -73,3 +76,7 @@ path = "crates/fj-proc" [workspace.dependencies.fj-viewer] version = "0.46.0" path = "crates/fj-viewer" + +[workspace.dependencies.fj-window] +version = "0.46.0" +path = "crates/fj-window" diff --git a/crates/fj/Cargo.toml b/crates/fj/Cargo.toml new file mode 100644 index 000000000..4d007ffdf --- /dev/null +++ b/crates/fj/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "fj" +version.workspace = true +edition.workspace = true +description.workspace = true +readme.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true + +[dependencies] +fj-core.workspace = true +fj-export.workspace = true +fj-interop.workspace = true +fj-math.workspace = true +fj-viewer.workspace = true +fj-window.workspace = true diff --git a/crates/fj/src/lib.rs b/crates/fj/src/lib.rs new file mode 100644 index 000000000..1df53c170 --- /dev/null +++ b/crates/fj/src/lib.rs @@ -0,0 +1,19 @@ +//! # Fornjot +//! +//! [Fornjot] is an early-stage b-rep CAD kernel written in Rust. The kernel is +//! split into multiple libraries that can be used semi-independently, and this +//! is one of those. +//! +//! This crate serves as a convenient entryway to Fornjot, re-exporting all +//! crates that make up Fornjot. +//! +//! [Fornjot]: https://www.fornjot.app/ + +#![warn(missing_docs)] + +pub use fj_core as core; +pub use fj_export as export; +pub use fj_interop as interop; +pub use fj_math as math; +pub use fj_viewer as viewer; +pub use fj_window as window; diff --git a/models/cuboid/Cargo.toml b/models/cuboid/Cargo.toml index 19c66e241..c542eb437 100644 --- a/models/cuboid/Cargo.toml +++ b/models/cuboid/Cargo.toml @@ -12,14 +12,5 @@ itertools = "0.10.5" version = "4.3.0" features = ["derive"] -[dependencies.fj-core] -path = "../../crates/fj-core" - -[dependencies.fj-export] -path = "../../crates/fj-export" - -[dependencies.fj-math] -path = "../../crates/fj-math" - -[dependencies.fj-window] -path = "../../crates/fj-window" +[dependencies.fj] +path = "../../crates/fj" diff --git a/models/cuboid/src/lib.rs b/models/cuboid/src/lib.rs index 2a2318d47..049c22244 100644 --- a/models/cuboid/src/lib.rs +++ b/models/cuboid/src/lib.rs @@ -1,11 +1,13 @@ -use fj_core::{ - algorithms::sweep::Sweep, - objects::{Sketch, Solid}, - operations::{BuildSketch, Insert}, - services::Services, - storage::Handle, +use fj::{ + core::{ + algorithms::sweep::Sweep, + objects::{Sketch, Solid}, + operations::{BuildSketch, Insert}, + services::Services, + storage::Handle, + }, + math::Vector, }; -use fj_math::Vector; pub fn cuboid(x: f64, y: f64, z: f64) -> Handle { let mut services = Services::new(); diff --git a/models/cuboid/src/main.rs b/models/cuboid/src/main.rs index 7324199cb..51a03f31f 100644 --- a/models/cuboid/src/main.rs +++ b/models/cuboid/src/main.rs @@ -1,6 +1,6 @@ use std::{ops::Deref, path::PathBuf}; -use fj_core::algorithms::{approx::Tolerance, triangulate::Triangulate}; +use fj::core::algorithms::{approx::Tolerance, triangulate::Triangulate}; fn main() -> anyhow::Result<()> { let args = Args::parse(); @@ -14,9 +14,9 @@ fn main() -> anyhow::Result<()> { let mesh = (cuboid.deref(), tolerance).triangulate(); if let Some(path) = args.export { - fj_export::export(&mesh, &path)?; + fj::export::export(&mesh, &path)?; } else { - fj_window::run(mesh, false)?; + fj::window::run(mesh, false)?; } Ok(())