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

Add support for edge-distances:endpoints #3163

Merged
merged 1 commit into from
Sep 28, 2023
Merged

Conversation

maxkfranz
Copy link
Member

@maxkfranz maxkfranz commented Sep 12, 2023

Cross-references to related issues.

Associated issues:

Notes re. the content of the pull request.

  • This change allows bundled bezier edges, unbundled bezier edges, and segment edges to use edge-distances: endpoints.
  • The documentation has been updated accordingly.
  • The change is minimally invasive by making a new function for the adjustment.
    • The adjustment alters the midpoint and the inverted normal vector used for middle-point calculations (e.g. bezier control points).
    • Limitation: The adjustment must happen at the middle-point phase, rather than the endpoint phase. The endpoint phase happens after the middle point phase, because many edges have automatic endpoints based on the middle points. This means that the endpoint calculations would be duplicated for edge-distances: endpoints edges. In future, this could be optimised if needed.
  • Limitation: For a bundled bezier, this implementation assumes that all beziers in the bundle have the same endpoint. [Using different endpoints within a bundle] doesn't seem like a valid use case, anyway.

This PR allows for edges like this, even when the nodes vary in width:

Screenshot 2023-09-05 at 19 01 54

Checklist

Author:

  • The proper base branch has been selected. New features go on unstable. Bug-fix patches can go on either unstable or master.
  • N/A -- Automated tests have been included in this pull request, if possible, for the new feature(s) or bug fix. Check this box if tests are not pragmatically possible (e.g. rendering features could include screenshots or videos instead of automated tests).
  • The associated GitHub issues are included (above).
  • Notes have been included (above).

Reviewers:

  • All automated checks are passing (green check next to latest commit).
  • At least one reviewer has signed off on the pull request.
  • For bug fixes: Just after this pull request is merged, it should be applied to both the master branch and the unstable branch. Normally, this just requires cherry-picking the corresponding merge commit from master to unstable -- or vice versa.

Ref: edge-distances: endpoints #3157

Notes:

- This change allows bundled bezier edges, unbundled bezier edges, and segment edges to use `edge-distances: endpoints`.
- The documentation has been updated accordingly.
- The change is minimally invasive by making a new function for the adjustment.
  - The adjustment alters the midpoint and the inverted normal vector used for middle-point calculations (e.g. bezier control points).
  - Limitation: The adjustment must happen at the middle-point phase, rather than the endpoint phase.  The endpoint phase happens after the middle point phase, because many edges have automatic endpoints based on the middle points.  This means that the endpoint calculations would be duplicated for `edge-distances: endpoints` edges.  In future, this could be optimised if needed.
- Limitation: For a bundled bezier, this implementation assumes that all beziers in the bundle have the same endpoint.  That doesn't seem like a valid use case, anyway.
@maxkfranz maxkfranz added this to the 3.27.0 milestone Sep 12, 2023
@maxkfranz maxkfranz requested a review from chrtannus September 12, 2023 17:26
@maxkfranz maxkfranz self-assigned this Sep 12, 2023
@maxkfranz maxkfranz mentioned this pull request Sep 12, 2023
4 tasks
@maxkfranz
Copy link
Member Author

@chrtannus, let me know if you notice any issues with this so we can address them prior to merging.

@stale
Copy link

stale bot commented Sep 27, 2023

This issue has been automatically marked as stale, because it has not had activity within the past 14 days. It will be closed if no further activity occurs within the next 7 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.

@stale stale bot added the stale label Sep 27, 2023
Copy link
Member

@chrtannus chrtannus left a comment

Choose a reason for hiding this comment

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

I haven't found any issues, it looks great now.
Here are some tests:
edge-distances_endpoints__TEST-1
edge-distances_endpoints__TEST-2

@stale stale bot removed the stale label Sep 28, 2023
@maxkfranz
Copy link
Member Author

Thanks. Merging

@maxkfranz maxkfranz merged commit ae20223 into unstable Sep 28, 2023
2 checks passed
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