Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up fj-interop crate #2165

Merged
merged 11 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/fj-core/src/algorithms/approx/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use std::{collections::BTreeSet, ops::Deref};

use fj_interop::mesh::Color;
use fj_interop::Color;

use crate::{
objects::{Face, Handedness, ObjectSet},
Expand Down
4 changes: 2 additions & 2 deletions crates/fj-core/src/algorithms/triangulate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
mod delaunay;
mod polygon;

use fj_interop::mesh::Mesh;
use fj_interop::Mesh;
use fj_math::Point;

use self::polygon::Polygon;
Expand Down Expand Up @@ -74,7 +74,7 @@ impl Triangulate for FaceApprox {

#[cfg(test)]
mod tests {
use fj_interop::mesh::Mesh;
use fj_interop::Mesh;
use fj_math::{Point, Scalar};

use crate::{
Expand Down
3 changes: 2 additions & 1 deletion crates/fj-core/src/objects/kinds/region.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! A single, continues 2d region
use fj_interop::mesh::Color;

use fj_interop::Color;

use crate::{
objects::{Cycle, ObjectSet},
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-core/src/operations/sweep/cycle.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use fj_interop::mesh::Color;
use fj_interop::Color;
use fj_math::Vector;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-core/src/operations/sweep/half_edge.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use fj_interop::{ext::ArrayExt, mesh::Color};
use fj_interop::{ext::ArrayExt, Color};
use fj_math::{Point, Scalar, Vector};

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-core/src/operations/sweep/region.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use fj_interop::mesh::Color;
use fj_interop::Color;
use fj_math::Vector;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-export/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{fs::File, path::Path};

use thiserror::Error;

use fj_interop::mesh::Mesh;
use fj_interop::Mesh;
use fj_math::{Point, Triangle};

/// Export the provided mesh to the file at the given path.
Expand Down
10 changes: 8 additions & 2 deletions crates/fj-interop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
//!
//! [Fornjot]: https://www.fornjot.app/

mod mesh;
mod model;

pub mod ext;
pub mod mesh;
pub mod model;

pub use self::{
mesh::{Color, Index, Mesh, Triangle},
model::Model,
};
2 changes: 0 additions & 2 deletions crates/fj-interop/src/mesh.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! A triangle mesh

use std::{collections::HashMap, hash::Hash};

use fj_math::Point;
Expand Down
2 changes: 0 additions & 2 deletions crates/fj-interop/src/model.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! An approximated model

use fj_math::{Aabb, Point};

use crate::mesh::Mesh;
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-viewer/src/camera.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Viewer camera module
use std::f64::consts::FRAC_PI_2;

use fj_interop::{mesh::Mesh, model::Model};
use fj_interop::{Mesh, Model};
use fj_math::{Aabb, Point, Scalar, Transform, Vector};

use crate::screen::NormalizedScreenPosition;
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-viewer/src/graphics/vertices.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bytemuck::{Pod, Zeroable};
use fj_interop::mesh::{Index, Mesh};
use fj_interop::{Index, Mesh};

#[derive(Debug)]
pub struct Vertices {
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-viewer/src/viewer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use fj_interop::model::Model;
use fj_interop::Model;
use tracing::warn;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-window/src/display.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use fj_interop::model::Model;
use fj_interop::Model;
use fj_viewer::{
InputEvent, NormalizedScreenPosition, RendererInitError, Screen,
ScreenSize, Viewer,
Expand Down
2 changes: 1 addition & 1 deletion crates/fj/src/handle_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use fj_core::{
services::Services,
validate::ValidationErrors,
};
use fj_interop::model::Model;
use fj_interop::Model;
use fj_math::{Aabb, Point, Scalar};
use tracing_subscriber::prelude::*;

Expand Down