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
use fj_math::Transform;
use crate::{
objects::{Objects, Solid},
storage::Handle,
validate::ValidationError,
};
use super::TransformObject;
impl TransformObject for Handle<Solid> {
fn transform(
self,
transform: &Transform,
objects: &Objects,
) -> Result<Self, ValidationError> {
let faces = self
.shells()
.cloned()
.map(|shell| -> Result<_, ValidationError> {
shell.transform(transform, objects)
})
.collect::<Result<Vec<_>, _>>()?;
Ok(Solid::builder(objects).with_shells(faces).build())
}
}