Skip to content

Commit

Permalink
Merge pull request #776 from hannobraun/docs
Browse files Browse the repository at this point in the history
Update some documentation; fix remaining doc warnings
  • Loading branch information
hannobraun committed Jul 4, 2022
2 parents 5c89c5c + 09eb89f commit db910c7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 52 deletions.
5 changes: 1 addition & 4 deletions crates/fj-kernel/src/objects/cycle.rs
Expand Up @@ -40,10 +40,7 @@ impl Cycle {
Cycle { edges }
}

/// Access the edges that this cycle refers to
///
/// This is a convenience method that saves the caller from dealing with the
/// [`Handle`]s.
/// Access this cycle's edges
pub fn edges(&self) -> impl Iterator<Item = Edge> + '_ {
self.edges.iter().cloned()
}
Expand Down
10 changes: 2 additions & 8 deletions crates/fj-kernel/src/objects/edge.rs
Expand Up @@ -76,18 +76,12 @@ impl Edge {
}
}

/// Access the curve that the edge refers to
///
/// This is a convenience method that saves the caller from dealing with the
/// [`Handle`].
/// Access this edge's curve
pub fn curve(&self) -> Curve<3> {
self.curve.global()
}

/// Access the vertices that the edge refers to
///
/// This is a convenience method that saves the caller from dealing with the
/// [`Handle`]s.
/// Access this edge's vertices
pub fn vertices(&self) -> Option<[Vertex; 2]> {
self.vertices.0
}
Expand Down
34 changes: 8 additions & 26 deletions crates/fj-kernel/src/objects/face.rs
Expand Up @@ -58,31 +58,22 @@ impl Face {
}
}

/// Access the surface that the face refers to
///
/// This is a convenience method that saves the caller from dealing with the
/// [`Handle`].
/// Access this face's surface
pub fn surface(&self) -> Surface {
self.brep().surface()
}

/// Access the exterior cycles that the face refers to
///
/// This is a convenience method that saves the caller from dealing with the
/// [`Handle`]s.
/// Access this face's exterior cycles
pub fn exteriors(&self) -> impl Iterator<Item = Cycle> + '_ {
self.brep().exteriors()
}

/// Access the interior cycles that the face refers to
///
/// This is a convenience method that saves the caller from dealing with the
/// [`Handle`]s.
/// Access this face's interior cycles
pub fn interiors(&self) -> impl Iterator<Item = Cycle> + '_ {
self.brep().interiors()
}

/// Access all cycles that the face refers to
/// Access all cycles of this face
///
/// This is equivalent to chaining the iterators returned by
/// [`Face::exteriors`] and [`Face::interiors`].
Expand Down Expand Up @@ -132,31 +123,22 @@ pub struct FaceBRep {
}

impl FaceBRep {
/// Access the surface that the face refers to
///
/// This is a convenience method that saves the caller from dealing with the
/// [`Handle`].
/// Access this face's surface
pub fn surface(&self) -> Surface {
self.surface
}

/// Access the exterior cycles that the face refers to
///
/// This is a convenience method that saves the caller from dealing with the
/// [`Handle`]s.
/// Access this face's exterior cycles
pub fn exteriors(&self) -> impl Iterator<Item = Cycle> + '_ {
self.exteriors.as_local()
}

/// Access the interior cycles that the face refers to
///
/// This is a convenience method that saves the caller from dealing with the
/// [`Handle`]s.
/// Access this face's interior cycles
pub fn interiors(&self) -> impl Iterator<Item = Cycle> + '_ {
self.interiors.as_local()
}

/// Access all cycles that the face refers to
/// Access all cycles of this face
///
/// This is equivalent to chaining the iterators returned by
/// [`Face::exteriors`] and [`Face::interiors`].
Expand Down
6 changes: 4 additions & 2 deletions crates/fj-kernel/src/objects/global_vertex.rs
Expand Up @@ -16,8 +16,10 @@ use fj_math::Point;
/// Vertices must be unique within a shape, meaning an identical vertex must not
/// exist in the same shape. In the context of vertex uniqueness, points that
/// are close to each other are considered identical. The minimum distance
/// between distinct vertices can be configured using
/// [`Shape::with_minimum_distance`].
/// between distinct vertices can be configured using the respective field in
/// [`ValidationConfig`].
///
/// [`ValidationConfig`]: crate::validation::ValidationConfig
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct GlobalVertex {
position: Point<3>,
Expand Down
13 changes: 1 addition & 12 deletions crates/fj-kernel/src/validation/mod.rs
Expand Up @@ -13,17 +13,6 @@
//!
//! Please note that not all of these validation categories are fully
//! implemented, as of this writing.
//!
//! # Implementation Note
//!
//! There is an ongoing effort to abolish [`Shape`] and replace it with a much
//! simpler data structure:
//! <https://github.com/hannobraun/Fornjot/issues/697>
//!
//! Once completed, this would make structural validation moot, and reduce the
//! scope of uniqueness validation.
//!
//! [`Shape`]: crate::shape::Shape

mod coherence;
mod uniqueness;
Expand All @@ -39,7 +28,7 @@ use fj_math::Scalar;

use crate::iter::ObjectIters;

/// Validate the given [`Shape`]
/// Validate the given object
pub fn validate<T>(
object: T,
config: &ValidationConfig,
Expand Down

0 comments on commit db910c7

Please sign in to comment.