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

Rmove or delete particular polytope from a region #84

Open
mvnayagam opened this issue Oct 19, 2023 · 1 comment
Open

Rmove or delete particular polytope from a region #84

mvnayagam opened this issue Oct 19, 2023 · 1 comment

Comments

@mvnayagam
Copy link

Dear Users and developers,

I have a region with almost 100 polytopes and a reference polytope. I started to compare each of the polytope from the region with the Reference polytope. I want to delete the polytope in the region if it is not in the reference polytope.
does the Polytope package offer a short way to do this operation? now i do it as follows

import polyope as PC

oldRegion # --> contains 100 polytope
newRegion = []
referencePoly=pc.Polytope(A, b) #--> the reference polytope

for i in oldRegion:

if  i <= referencePoly :
      newRegion.append(i)

the i form the new region as pc.Region([newRegion])

however if there is an option to delete a polytope within the oldRegion on the fly, that would be more helpful.

Any suggestion on this issue, is highly appreciated

Thank you

Muthu Vallinayagam
Researcher, Institute of Experimental Physics,
TU Freiberg, Germany

@necozay
Copy link
Contributor

necozay commented Oct 23, 2023

I don't remember such functionality existing in the polytope package. What you are doing makes sense to me. The closest would be to do a set difference between the oldRegion and referencePoly but it would result in a different object where the polytopes in the region overlapping with the reference will be clipped (and difference is potentially less efficient as difference of polytopes might not be polytopes themselves and will result in extra polytopes added to your object). However, you can use the code doing the difference (here) as a reference for implementation.

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

No branches or pull requests

2 participants