1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use crate::objects::{Curve, GlobalCurve};

use super::Reverse;

impl Reverse for Curve {
    /// Reverse the curve
    ///
    /// # Implementation Note
    ///
    /// Right now, the orientation of a face is defined by the orientation of
    /// its surface. By extension, the orientation of a surface is defined by
    /// the orientation of the curve it was swept from. This leads to some
    /// complications. See this issue for context:
    /// <https://github.com/hannobraun/Fornjot/issues/695>
    ///
    /// It would probably be much better, if `Surface`s were without
    /// orientation, which would then make it possible for curves to be without
    /// direction. Then this implementation would not exist.
    fn reverse(self) -> Self {
        Curve::new(
            *self.surface(),
            self.kind().reverse(),
            self.global().reverse(),
        )
    }
}

impl Reverse for GlobalCurve {
    /// Reverse the curve
    ///
    /// # Implementation Note
    ///
    /// Right now, the orientation of a face is defined by the orientation of
    /// its surface. By extension, the orientation of a surface is defined by
    /// the orientation of the curve it was swept from. This leads to some
    /// complications. See this issue for context:
    /// <https://github.com/hannobraun/Fornjot/issues/695>
    ///
    /// It would probably be much better, if `Surface`s were without
    /// orientation, which would then make it possible for curves to be without
    /// direction. Then this implementation would not exist.
    fn reverse(self) -> Self {
        Self::from_kind(self.kind().reverse())
    }
}