mirror of
https://github.com/hannobraun/Fornjot
synced 2025-09-03 16:06:53 +00:00
Set geometry when transforming curve
This commit is contained in:
parent
b143ffb8cf
commit
8d0739f0d5
@ -18,7 +18,27 @@ impl TransformObject for Handle<Curve> {
|
|||||||
// must be created to represent the new and transformed curve.
|
// must be created to represent the new and transformed curve.
|
||||||
cache
|
cache
|
||||||
.entry(self)
|
.entry(self)
|
||||||
.or_insert_with(|| Curve::new().insert(core))
|
.or_insert_with(|| {
|
||||||
|
// We don't actually need to transform the curve, as its
|
||||||
|
// geometry is locally defined on a surface. We need to set that
|
||||||
|
// geometry for the new object though, that we created here to
|
||||||
|
// represent the transformed curve.
|
||||||
|
|
||||||
|
let curve = Curve::new().insert(core);
|
||||||
|
|
||||||
|
let curve_geom = core.layers.geometry.of_curve(self).cloned();
|
||||||
|
if let Some(curve_geom) = curve_geom {
|
||||||
|
for (surface, local_definition) in curve_geom.definitions {
|
||||||
|
core.layers.geometry.define_curve(
|
||||||
|
curve.clone(),
|
||||||
|
surface,
|
||||||
|
local_definition,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
curve
|
||||||
|
})
|
||||||
.clone()
|
.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user