Merge pull request #2355 from hannobraun/geometry

Define curve geometry for new face when sweeping sketch
This commit is contained in:
Hanno Braun 2024-05-13 15:26:36 +02:00 committed by GitHub
commit 8df4a27a53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,7 +38,7 @@ impl SweepSketch for Sketch {
let mut shells = Vec::new();
for region in self.regions() {
let region = {
// The following code assumes that the sketch is winded counter-
// The following code assumes that the sketch is wound counter-
// clockwise. Let's check that real quick.
assert!(region
.exterior()
@ -67,6 +67,24 @@ impl SweepSketch for Sketch {
}
};
for cycle in region.all_cycles() {
for half_edge in cycle.half_edges() {
let curve_geom = core
.layers
.geometry
.of_curve(half_edge.curve())
.unwrap()
.local_on(self.surface())
.unwrap();
core.layers.geometry.define_curve(
half_edge.curve().clone(),
surface.clone(),
curve_geom.clone(),
);
}
}
let face = Face::new(surface.clone(), region.clone()).insert(core);
let shell = face.sweep_face(path, &mut cache, core).insert(core);
shells.push(shell);