Skip to content

Commit

Permalink
Merge pull request #1024 from hannobraun/cycle
Browse files Browse the repository at this point in the history
Validate that all cycle edges are in same surface
  • Loading branch information
hannobraun authored Sep 1, 2022
2 parents b2768e0 + 02ff2f9 commit 9998f58
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/fj-kernel/src/objects/cycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ impl Cycle {
) -> Self {
let edges = edges.into_iter().collect::<Vec<_>>();

// Verify, that the curves of all edges are defined in the correct
// surface.
for edge in &edges {
assert_eq!(
&surface,
edge.curve().surface(),
"Edges in cycle not defined in same surface"
);
}

if edges.len() != 1 {
// If the length is one, we might have a cycle made up of just one
// circle. If that isn't the case, we are dealing with line segments
Expand Down

0 comments on commit 9998f58

Please sign in to comment.