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

Move ProcessedShape to fj-interop #809

Merged
merged 1 commit into from
Jul 13, 2022
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
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions crates/fj-interop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@

pub mod debug;
pub mod mesh;
pub mod processed_shape;
17 changes: 17 additions & 0 deletions crates/fj-interop/src/processed_shape.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//! A processed shape

use fj_math::{Aabb, Point};

use crate::{debug::DebugInfo, mesh::Mesh};

/// A processed shape
pub struct ProcessedShape {
/// The axis-aligned bounding box of the shape
pub aabb: Aabb<3>,

/// The triangle mesh that approximates the original shape
pub mesh: Mesh<Point<3>>,

/// The debug info generated while processing the shape
pub debug_info: DebugInfo,
}
18 changes: 2 additions & 16 deletions crates/fj-operations/src/shape_processor.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! API for processing shapes

use fj_interop::{debug::DebugInfo, mesh::Mesh};
use fj_interop::{debug::DebugInfo, processed_shape::ProcessedShape};
use fj_kernel::{
algorithms::{triangulate, InvalidTolerance, Tolerance},
validation::{ValidationConfig, ValidationError},
};
use fj_math::{Aabb, Point, Scalar};
use fj_math::Scalar;

use crate::ToShape as _;

Expand Down Expand Up @@ -51,20 +51,6 @@ impl ShapeProcessor {
}
}

/// A processed shape
///
/// Created by [`ShapeProcessor::process`].
pub struct ProcessedShape {
/// The axis-aligned bounding box of the shape
pub aabb: Aabb<3>,

/// The triangle mesh that approximates the original shape
pub mesh: Mesh<Point<3>>,

/// The debug info generated while processing the shape
pub debug_info: DebugInfo,
}

/// A shape processing error
#[allow(clippy::large_enum_variant)]
#[derive(Debug, thiserror::Error)]
Expand Down
4 changes: 0 additions & 4 deletions crates/fj-viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ path = "../fj-interop"
version = "0.7.0"
path = "../fj-math"

[dependencies.fj-operations]
version = "0.7.0"
path = "../fj-operations"

[dependencies.egui]
version = "0.18.1"

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,8 +1,8 @@
//! Viewer camera module
use std::f64::consts::FRAC_PI_2;

use fj_interop::processed_shape::ProcessedShape;
use fj_math::{Aabb, Point, Scalar, Transform, Triangle, Vector};
use fj_operations::shape_processor::ProcessedShape;

use crate::screen::NormalizedPosition;

Expand Down