Skip to content

Commit

Permalink
Remove Vertex
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jan 20, 2023
1 parent b6be89c commit 65aabb4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
38 changes: 0 additions & 38 deletions crates/fj-kernel/src/objects/full/vertex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,6 @@ use fj_math::Point;

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

/// A vertex
///
/// `Vertex` is defined in terms of a 1-dimensional position on a curve. Each
/// `Vertex` has an associated [`SurfaceVertex`], which defines the 2D position
/// on the surface, and a [`GlobalVertex`] which defines the global 3D position.
///
/// Both can be accessed through [`Vertex::surface_form`].
#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct Vertex {
position: Point<1>,
surface_form: Handle<SurfaceVertex>,
}

impl Vertex {
/// Construct an instance of `Vertex`
pub fn new(
position: impl Into<Point<1>>,
surface_form: Handle<SurfaceVertex>,
) -> Self {
let position = position.into();

Self {
position,
surface_form,
}
}

/// Access the position of the vertex on the curve
pub fn position(&self) -> Point<1> {
self.position
}

/// Access the surface form of this vertex
pub fn surface_form(&self) -> &Handle<SurfaceVertex> {
&self.surface_form
}
}

/// A vertex, defined in surface (2D) coordinates
#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct SurfaceVertex {
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-kernel/src/objects/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub use self::{
sketch::Sketch,
solid::Solid,
surface::Surface,
vertex::{GlobalVertex, SurfaceVertex, Vertex},
vertex::{GlobalVertex, SurfaceVertex},
},
object::{Bare, BehindHandle, Form, Object, WithHandle},
stores::{Objects, Surfaces},
Expand Down

0 comments on commit 65aabb4

Please sign in to comment.