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

feat: Minkowski penalties for Ellipse-Ellipse #977

Merged
merged 57 commits into from Aug 25, 2022
Merged

Conversation

jiriminarcik
Copy link
Contributor

@jiriminarcik jiriminarcik commented May 17, 2022

Description

Related PR: #911

This PR implements Minkowski constraints for Ellipses using root solver from #906. It also covers penalties for Ellipse-Circle combination as a special case.

Implementation strategy and design decisions

The helper functions for computations involving implicit shapes are now in a new file packages/core/src/contrib/ImplicitShapes.ts.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new ESLint warnings
  • I have reviewed any generated changes to the diagrams/ folder

Open questions

There is only one remaining family of shapes to be covered by Minkowski penalties: Bezier curves.

@codecov
Copy link

codecov bot commented May 17, 2022

Codecov Report

Merging #977 (80e7fde) into main (854873c) will increase coverage by 0.57%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #977      +/-   ##
==========================================
+ Coverage   64.15%   64.73%   +0.57%     
==========================================
  Files          59       59              
  Lines        7412     7471      +59     
  Branches     1675     1678       +3     
==========================================
+ Hits         4755     4836      +81     
+ Misses       2556     2535      -21     
+ Partials      101      100       -1     
Impacted Files Coverage Δ
...e/src/contrib/__testfixtures__/TestShapes.input.ts 100.00% <ø> (ø)
packages/core/src/contrib/Constraints.ts 83.07% <100.00%> (+0.81%) ⬆️
packages/core/src/contrib/ConstraintsUtils.ts 84.61% <100.00%> (+2.35%) ⬆️
packages/core/src/contrib/Functions.ts 29.80% <100.00%> (-0.18%) ⬇️
packages/core/src/contrib/ImplicitShapes.ts 100.00% <100.00%> (ø)
packages/core/src/contrib/Minkowski.ts 99.17% <100.00%> (-0.03%) ⬇️
packages/core/src/contrib/Queries.ts 100.00% <100.00%> (ø)
packages/core/src/contrib/Utils.ts 39.06% <100.00%> (+6.30%) ⬆️
packages/core/src/index.ts 62.12% <0.00%> (-0.57%) ⬇️
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@cloudflare-pages
Copy link

cloudflare-pages bot commented May 17, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 80e7fde
Status: ✅  Deploy successful!
Preview URL: https://421a43d0.penrose-72l.pages.dev
Branch Preview URL: https://ellipse-ellipse.penrose-72l.pages.dev

View logs

Copy link
Collaborator

@samestep samestep left a comment

Choose a reason for hiding this comment

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

Looks amazing, thank you so much for doing this! I had a few comments.

packages/core/src/contrib/ImplicitShapes.ts Show resolved Hide resolved
packages/core/src/contrib/ImplicitShapes.ts Outdated Show resolved Hide resolved
packages/core/src/contrib/ImplicitShapes.ts Show resolved Hide resolved
packages/core/src/contrib/ImplicitShapes.ts Outdated Show resolved Hide resolved
packages/core/src/contrib/ImplicitShapes.ts Outdated Show resolved Hide resolved
packages/core/src/contrib/Minkowski.ts Outdated Show resolved Hide resolved
packages/core/src/contrib/Queries.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@samestep samestep left a comment

Choose a reason for hiding this comment

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

Looks good to me! Awesome work, thank you :)

@samestep
Copy link
Collaborator

Oh actually it looks like the tests are failing; I'm guessing once you fix those we should be good to merge this?

@jiriminarcik jiriminarcik merged commit 2be787c into main Aug 25, 2022
@@ -370,7 +370,7 @@ describe("polyRoots tests", () => {
expect(gradient[2]).toBeCloseTo(-1 / 3);
});

test("quintic", () => {
test("quartic", () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @jiriminarcik, I just noticed that you erroneously changed this test description in this PR. The polynomial is indeed quintic, since the fifth-degree coefficient is implicitly 1. I'm opening a PR to change this line back.

@samestep samestep deleted the ellipse-ellipse branch March 15, 2023 17:25
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.

None yet

4 participants