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

#1462 - Fix minkowski sum for VPolygons #1474

Merged
merged 13 commits into from
Jun 25, 2019
Merged

#1462 - Fix minkowski sum for VPolygons #1474

merged 13 commits into from
Jun 25, 2019

Conversation

SebastianGuadalupe
Copy link
Member

Closes #1462.

src/VPolygon.jl Outdated Show resolved Hide resolved
test/unit_Polygon.jl Outdated Show resolved Hide resolved
test/unit_Polygon.jl Outdated Show resolved Hide resolved
j = 1
σP = σ(N[1, 0], P)
σQ = σ(N[1, 0], Q)
k = findfirst(==(σP), vlistP)
Copy link
Member

@mforets mforets Jun 25, 2019

Choose a reason for hiding this comment

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

⚠️ Equality check doesn't play well with floating point. In this case it won't hurt since we get a vertex from VPolygon's list of vertices here by asking the support vector, but this is very specific to polygons.

So i think a cleaner (and slightly more efficient) approach would be to get directly the corresponding index from VPolygon's support vector function. It suffices to outsource the algorithm in https://github.com/JuliaReach/LazySets.jl/blob/master/src/VPolygon.jl#L256 to an independent helper function.

EDIT: i've opened #1482 as follow-up.

@mforets mforets changed the title #1462 - fix minkowski_sum for VPolygons #1462 - Fix minkowski_sum for VPolygons Jun 25, 2019
@mforets mforets changed the title #1462 - Fix minkowski_sum for VPolygons #1462 - Fix minkowski sum for VPolygons Jun 25, 2019
@mforets mforets merged commit 028a260 into JuliaReach:master Jun 25, 2019
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.

minkowski_sum for VPolygons depends on order of vertices
3 participants