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

Consolidate redundant references to Surface #1588

Closed
hannobraun opened this issue Feb 15, 2023 · 1 comment · Fixed by #1604
Closed

Consolidate redundant references to Surface #1588

hannobraun opened this issue Feb 15, 2023 · 1 comment · Fixed by #1604
Assignees
Labels
topic: core Issues relating to core geometry, operations, algorithms type: development Work to ease development or maintenance, without direct effect on features or bugs

Comments

@hannobraun
Copy link
Owner

hannobraun commented Feb 15, 2023

(This issue is part of a larger cleanup effort. See #1589.)

As of this writing, Surface is referenced by both Curve and SurfaceVertex. Those references must be consistent: a HalfEdge is only valid, if the Curve and the SurfaceVertex instances it references all reference the same Surface. In turn, all HalfEdges in a Cycle must (transitively) reference the same Surface, and all Cycles in a Face must do so.

This redundancy makes building and modifying these objects unnecessarily hard. There also need to be validation checks on every level from HalfEdge upwards to verify consistency. I believe it would be better to reference Surface only once, in Face. This would simplify the object graph a lot.

It would also mean that Surface is farther away from where it is often needed (for example, to approximate a curve in 3D space, you need the surface that it is defined on). But I think this can be addressed by structuring the code that uses Surface differently, on a case-by-case basis. I think that overall, this will be a worthwhile trade-off, as any additional complexity in code using Surface would be largely restricted to that code, while the additional complexity in the object graph affects the whole kernel negatively.

This issue is closely related to other cleanup efforts, namely #1525, #1570, and #1586. It will probably not be possible to address each of those in isolation, as the very complexity these issues aim to address tends to hinder them. Most likely, the issues will be addressed together, by picking low-hanging fruit from each of them, until all of them have been addressed. This is something I am actively working on right now.

@hannobraun hannobraun added type: development Work to ease development or maintenance, without direct effect on features or bugs topic: core Issues relating to core geometry, operations, algorithms labels Feb 15, 2023
@hannobraun hannobraun self-assigned this Feb 15, 2023
@hannobraun
Copy link
Owner Author

This seems to be going much easier than expected! I made it most of the way there today (see the pull requests referencing this issue, listed above this comment) and I'm not aware of any serious problems that would prevent me from wrapping this up next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: core Issues relating to core geometry, operations, algorithms type: development Work to ease development or maintenance, without direct effect on features or bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant