fj_kernel/algorithms/transform/
edge.rs

1use fj_math::Transform;
2
3use crate::{
4    objects::{GlobalEdge, HalfEdge},
5    services::Services,
6};
7
8use super::{TransformCache, TransformObject};
9
10impl TransformObject for HalfEdge {
11    fn transform_with_cache(
12        self,
13        transform: &Transform,
14        services: &mut Services,
15        cache: &mut TransformCache,
16    ) -> Self {
17        // Don't need to transform curve, as that's defined in surface
18        // coordinates.
19        let curve = self.curve();
20        let boundary = self.boundary();
21        let start_vertex = self
22            .start_vertex()
23            .clone()
24            .transform_with_cache(transform, services, cache);
25        let global_form = self
26            .global_form()
27            .clone()
28            .transform_with_cache(transform, services, cache);
29
30        Self::new(curve, boundary, start_vertex, global_form)
31    }
32}
33
34impl TransformObject for GlobalEdge {
35    fn transform_with_cache(
36        self,
37        _: &Transform,
38        _: &mut Services,
39        _: &mut TransformCache,
40    ) -> Self {
41        // There's nothing to actually transform here, as `GlobalEdge` holds no
42        // data. We still need this implementation though, as a new `GlobalEdge`
43        // object must be created to represent the new and transformed edge.
44        Self::new()
45    }
46}