Skip to content

Commit

Permalink
Merge pull request #2355 from hannobraun/geometry
Browse files Browse the repository at this point in the history
Define curve geometry for new face when sweeping sketch
  • Loading branch information
hannobraun committed May 13, 2024
2 parents 631f24d + 58c58ab commit 8df4a27
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion crates/fj-core/src/operations/sweep/sketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8df4a27

Please sign in to comment.