-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Shell and Solid validation #1695
Changes from 9 commits
92609d2
e23a0fc
a7455ca
ccee909
ec669d2
44f606f
ae2a3ab
edcfffb
c88ac6c
f6cd58a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,11 @@ impl Sweep for Handle<Vertex> { | |
.clone(); | ||
|
||
let vertices = [a, b]; | ||
let global_edge = GlobalEdge::new().insert(objects); | ||
let global_edge = cache | ||
.global_edge | ||
.entry(self.id()) | ||
.or_insert_with(|| GlobalEdge::new().insert(objects)) | ||
.clone(); | ||
Comment on lines
-29
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I swear, I was looking for exactly this code yesterday. I found the vertex caching code instead, and my brain was like "oh, so we do have the required caching". I'm pretty stupid sometimes 😄 In any case, good find! |
||
|
||
// The vertices of the returned `GlobalEdge` are in normalized order, | ||
// which means the order can't be relied upon by the caller. Return the | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ impl Face { | |
self.interiors.iter() | ||
} | ||
|
||
/// Access all cycles of the face | ||
/// Access all cycles of the face (both exterior and interior) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the unrelated change to the docs, just wanted to clear it up There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's fine! In general, I prefer to have unrelated changes in different commits, as I think that makes things a bit clearer overall, but that is a weak preference. We can leave it as-is. |
||
pub fn all_cycles(&self) -> impl Iterator<Item = &Handle<Cycle>> + '_ { | ||
[self.exterior()].into_iter().chain(self.interiors()) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have a more general caching solution. This seems to work for now but IDK if it's ideal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, this seems fine to me. If you come up with something better, feel free to suggest it of course, but I think we can keep it as-is.