fj_core/objects/kinds/
curve.rs

1/// A curve
2///
3/// `Curve` represents a curve in space, but holds no data to define that curve.
4/// It is referenced by [`HalfEdge`], which defines the curve in the coordinates
5/// of its surface.
6///
7/// `Curve` exists to allow identifying which [`HalfEdge`]s are supposed to be
8/// coincident in global space.
9///
10/// # Equality
11///
12/// `Curve` contains no data and exists purely to be referenced via a `Handle`,
13/// where `Handle::id` can be used to compare different instances of `Curve`.
14///
15/// If `Curve` had `Eq`/`PartialEq` implementations, it containing no data would
16/// mean that all instances of `Curve` would be considered equal. This would be
17/// very error-prone.
18///
19/// If you need to reference a `Curve` from a struct that needs to derive
20/// `Eq`/`Ord`/..., you can use `HandleWrapper<Curve>` to do that. It will use
21/// `Handle::id` to provide those `Eq`/`Ord`/... implementations.
22///
23/// [`HalfEdge`]: crate::objects::HalfEdge
24#[derive(Clone, Debug, Default, Hash)]
25pub struct Curve {}
26
27impl Curve {
28    /// Create a new instance
29    pub fn new() -> Self {
30        Self::default()
31    }
32}