Skip to content

Commit

Permalink
Merge pull request #1853 from hannobraun/fj
Browse files Browse the repository at this point in the history
Add new `fj` crate
  • Loading branch information
hannobraun authored May 30, 2023
2 parents 135841d + 2be9a88 commit 25881a5
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 25 deletions.
17 changes: 13 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
resolver = "2"
members = [
"crates/fj",
"crates/fj-core",
"crates/fj-export",
"crates/fj-interop",
Expand All @@ -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",
]


Expand Down Expand Up @@ -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"
19 changes: 19 additions & 0 deletions crates/fj/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions crates/fj/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
13 changes: 2 additions & 11 deletions models/cuboid/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
16 changes: 9 additions & 7 deletions models/cuboid/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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<Solid> {
let mut services = Services::new();
Expand Down
6 changes: 3 additions & 3 deletions models/cuboid/src/main.rs
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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(())
Expand Down

0 comments on commit 25881a5

Please sign in to comment.