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 fj_math::Transform;
use crate::{
objects::Objects,
partial::{PartialCurve, PartialGlobalCurve},
validate::ValidationError,
};
use super::TransformObject;
impl TransformObject for PartialGlobalCurve {
fn transform(
self,
_: &Transform,
_: &Objects,
) -> Result<Self, ValidationError> {
Ok(self)
}
}
impl TransformObject for PartialCurve {
fn transform(
self,
transform: &Transform,
objects: &Objects,
) -> Result<Self, ValidationError> {
let surface = self
.surface
.map(|surface| surface.transform(transform, objects))
.transpose()?;
let global_form = self.global_form.transform(transform, objects)?;
Ok(PartialCurve {
path: self.path,
surface,
global_form,
})
}
}