Repository navigation
fix(utils): keep ellipse intersections on the connection ray - #7689
Draft
cangen185-sudo wants to merge 1 commit into
Draft
cangen185-sudo wants to merge 1 commit into
cangen185-sudo wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
getEllipseIntersectPoint()treats the direction's polar angle as the ellipse's parametric angle. For a non-circular ellipse, the returned boundary point is therefore off the connection ray. This affects ellipse node and elliptical port endpoints.For an ellipse centered at
(0, 0)with radii(100, 50)and a reference point(200, 150), the existing result is(80, 30). The ray intersection is approximately(55.470, 41.603).Change
Convert the ray direction to the ellipse's parametric angle using both radii. Preserve the existing circular, coincident-center and zero-radius behavior. Add 16 ray regressions across both aspect ratios, all quadrants, translated centers and reversed connections, plus five degenerate-size compatibility cases. Expected points use an independent ray-scaling formula; tests also check collinearity and the ellipse equation.
Validation
CI=truefrompackages/g6; the point suite plus these two render tests passed 45/45.git diff --checkpassed.Local environment: Windows, Node 24.16.0. The newly resolved SWC 1.16.18 carrier could not use this machine's cache ACLs. Tests used the same
@swc/jest0.2.39 with@swc/core1.15.11 (within the repository's declared range), through an untracked local configuration. No dependency or test configuration changes are included. Full monorepo CI was not run locally.Duplicate check: searched ellipse/intersection terms and inspected every open PR's file list. Historical #5485 handles circular/coincident-center behavior, which these changes preserve; it does not correct non-circular ray intersections.
AI-assisted contribution; the reproduction and validation above were run locally.