Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate that all cycle edges are in same surface #1024

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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