-
Notifications
You must be signed in to change notification settings - Fork 279
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
fix: halfPlaneSDF
and padding
#1360
Merged
Merged
Conversation
This file contains 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
± Registry diff
📊 PerformanceKeyNote that each bar component rounds up to the nearest 100ms, so each full bar is an overestimate by up to 400ms.
Data
|
Codecov Report
@@ Coverage Diff @@
## main #1360 +/- ##
=======================================
Coverage 62.70% 62.70%
=======================================
Files 70 70
Lines 8738 8738
Branches 2110 2110
=======================================
Hits 5479 5479
Misses 3116 3116
Partials 143 143
|
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.
Description
Resolves #1359.
This is an attempt to resolve the issue using the fix I talked about in the comment. It might not be correct.
Implementation strategy and design decisions
halfPlaneSDF
has the effect of addingpadding
instead of subtracting.containsPolygonCircle
now callscontainsPolygonPoints
withadd(padding, s2.r.contents)
. (Detailed below)Broken Test Case
The bad test case involved is as follows:
Under the prescribed changes, the
halfPlaneSDF
function should output7
instead of-13
.As far as I understand it, checking whether or not a point
p
is within the halfplane defined withlineSegment
and interior vectorcenter
is essentially checking whether or notSo, calling
is essentially checking whether or not points
[-point2, -point4]
is within the half-plane defined using line segment[point2, point3]
with interior pointpoint5
, under padding 10.Graphically,
Adding instead of subtracting paddings
Originally, the function
containsPolygonCircle
is defined as follows:I was confused as to why we subtract the radius from the padding.
Checking whether or not a Polygon contains a circle is essentially checking whether the Polygon contains the center of the circle, with padding
r
. So the new padding should beadd(padding, s2.r.contents)
. But as I made that change, other parts of the Penrose stopped working. With the other parts fixed (as above), I changedsub
toadd
.Checklist
Open questions
Questions that require more discussion or to be addressed in future development: