Skip to content

Commit

Permalink
Merge pull request #1370 from hannobraun/cleanup
Browse files Browse the repository at this point in the history
Make some small cleanups in the kernel code
  • Loading branch information
hannobraun authored Nov 19, 2022
2 parents 4273b40 + 8004755 commit 8cb8694
Show file tree
Hide file tree
Showing 15 changed files with 389 additions and 368 deletions.
1 change: 0 additions & 1 deletion crates/fj-kernel/src/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::{

/// Convenience trait to insert objects into their respective stores
pub trait Insert: Sized + Validate {
// TASK: Make error more specific.
/// Insert the object into its respective store
fn insert(
self,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use crate::{
geometry::path::SurfacePath,
get::Get,
objects::Surface,
storage::{Handle, HandleWrapper},
};

use super::Surface;

/// A curve, defined in local surface coordinates
#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct Curve {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ use std::slice;
use fj_interop::ext::SliceExt;
use fj_math::{Scalar, Winding};

use crate::{geometry::path::SurfacePath, storage::Handle};

use super::{HalfEdge, Surface};
use crate::{
geometry::path::SurfacePath,
objects::{HalfEdge, Surface},
storage::Handle,
};

/// A cycle of connected half-edges
#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ use std::fmt;

use crate::{
get::Get,
objects::{Curve, GlobalCurve, GlobalVertex, Surface, Vertex},
storage::{Handle, HandleWrapper},
};

use super::{Curve, GlobalCurve, GlobalVertex, Surface, Vertex};

/// A half-edge
#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct HalfEdge {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ use std::collections::{btree_set, BTreeSet};
use fj_interop::mesh::Color;
use fj_math::Winding;

use crate::storage::Handle;

use super::{Cycle, Surface};
use crate::{
objects::{Cycle, Surface},
storage::Handle,
};

/// A face of a shape
///
Expand All @@ -29,8 +30,8 @@ use super::{Cycle, Surface};
/// means that all [`HalfEdge`]s that bound a `Face` have the interior of the
/// face on their left side (on the face's front side).
///
/// [`HalfEdge`]: super::HalfEdge
/// [`Shell`]: super::Shell
/// [`HalfEdge`]: crate::objects::HalfEdge
/// [`Shell`]: crate::objects::Shell
#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct Face {
exterior: Handle<Cycle>,
Expand Down
9 changes: 9 additions & 0 deletions crates/fj-kernel/src/objects/full/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pub mod curve;
pub mod cycle;
pub mod edge;
pub mod face;
pub mod shell;
pub mod sketch;
pub mod solid;
pub mod surface;
pub mod vertex;
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::{builder::ShellBuilder, storage::Handle};

use super::{face::FaceSet, Face, Objects};
use crate::{
builder::ShellBuilder,
objects::{Face, FaceSet, Objects},
storage::Handle,
};

/// A 3-dimensional closed shell
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::{builder::SketchBuilder, storage::Handle};

use super::{face::FaceSet, Face, Objects};
use crate::{
builder::SketchBuilder,
objects::{Face, FaceSet, Objects},
storage::Handle,
};

/// A 2-dimensional shape
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use std::collections::BTreeSet;

use crate::{builder::SolidBuilder, storage::Handle};

use super::{Face, Objects, Shell};
use crate::{
builder::SolidBuilder,
objects::{Face, Objects, Shell},
storage::Handle,
};

/// A 3-dimensional shape
///
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use fj_math::Point;

use crate::{get::Get, storage::Handle};

use super::{Curve, GlobalCurve, Surface};
use crate::{
get::Get,
objects::{Curve, GlobalCurve, Surface},
storage::Handle,
};

/// A vertex
///
Expand Down
Loading

0 comments on commit 8cb8694

Please sign in to comment.