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 shell orientations #1968

Merged
merged 4 commits into from
Aug 4, 2023

Conversation

A-Walrus
Copy link
Contributor

Addresses part of #1935.

Currently bugged, so marked as draft.
The problem is how to check whether two half-edges are reverse of one another:

  • Make sure that start vertexes are different (fails on circles)
  • Make sure that boundarys are reverse of one another (fails when different paths)
  • Sample the edges?

Any help appreciated, thanks!

@hannobraun
Copy link
Owner

Thank you for the pull request, @A-Walrus! And sorry for taking a few days to get to it. I had other things on my mind over the weekend 😄

The problem is how to check whether two half-edges are reverse of one another:

  • Make sure that start vertexes are different (fails on circles)
  • Make sure that boundarys are reverse of one another (fails when different paths)
  • Sample the edges?

I think checking that the boundaries are reverse should be the answer here. That requires the coordinate systems of all local path that refer to the same curve to match each other. Which I think is a reasonable requirement, exactly because we need to address cases like this.

We already have the Shell validation check that checks edge coincidence, but it's written in such a way, that it doesn't require the path coordinate systems to match. Maybe a good next step would be to rewrite that check to require just that, see how much fails, and figure out what it would take to make it work.

@hannobraun
Copy link
Owner

To follow up on my previous comment, I've opened #1973. This directly affects my work on #1937 (as in, the code I'm currently writing is unlikely to work due to this), so I'm looking into it now.

@hannobraun
Copy link
Owner

@A-Walrus I've addressed #1973 in #1982. Unless I'm missing something, that means further work on this pull request should be un-blocked now!

@A-Walrus A-Walrus marked this pull request as ready for review August 4, 2023 07:07
Copy link
Owner

@hannobraun hannobraun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @A-Walrus, looks good!

One thing to note is that the new validation check relies on GlobalEdge, which is on its way to being removed. There is already the new Curve, which fulfills the same purpose but is more flexible.

As part of my work on #1937, I've already amended the other validation checks to also use Curve, in preparation of removing GlobalEdge at a later point.

All of that is no reason not to merge this pull request. I'm just providing some context on how the code being changed here is currently developing.

shell: &Shell,
errors: &mut Vec<ValidationError>,
) {
let mut global_to_half: HashMap<ObjectId, Vec<_>> = HashMap::new();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some additional type safety, it should be possible to replace ObjectdId with HandleWrapper<GlobalEdge> here. This was not possible before, due to a horribly shameful workaround (:grin:), but that workaround was removed in #1951.

This is just a note, not a change request. I don't think it would make a difference here.

@hannobraun hannobraun merged commit 0515f5f into hannobraun:main Aug 4, 2023
4 checks passed
@A-Walrus A-Walrus deleted the validate_orientations branch September 25, 2023 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants