Skip to content

Boxes WIP #137

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

Merged
merged 6 commits into from
Apr 29, 2025
Merged

Boxes WIP #137

merged 6 commits into from
Apr 29, 2025

Conversation

simoneotelie
Copy link
Contributor

Description

Problems:

  • The mcs has a problem with the width when l1 != 0. In the other seg/traj it was because we got s1, ... directly without getting it from func_s(seg, l1). I cannot see anything like that here.
  • Circle: It works wonderfully except at 2 pi (should be an easy fix, probably related to the bigger problem). Bigger problem is when the angles are exactly from 0, pi. or -pi, 0. It manages 180 deg perfectly in any other case. It seems to be a problem with how the angles are set in the beginning. The code further down must be correct, because it is general, and works for all other cases. When I change the sus angle the x-coord of the vertices (which are printed) are correct, but suddenly the s is wrong. And vice versa. Idk why. Also, the box will look like it's even more wrong in the plotter, but this is because the way we generally define w and l in the bounding box class for the vertices does not always match with the circle, so at the end on the function I have to decide If I'm gonna send w=w or w = l etc. You'll see. It depends on the orientation of the segment/traj. So, often if something else is wrong, it will not rotate the box correctly in the plotter because of that. So instead you should look at the printout where I print the calculated vertices; they show the "true" box while debugging.
    Closes # .

Checklist

Mandatory:

  • I have added tests to cover my changes
  • All the tests are passing, including my new ones
  • I described my changes in this PR description

Optional:

  • The code I wrote follows good style practices (see PEP 8 and PEP 20).
  • I have updated the docs in relation to my changes, if applicable
  • I have tested also GPU contexts

@simoneotelie
Copy link
Contributor Author

Also, atm for deg > 180 (not atm), it calculated all the vertices to find the smallest. I had a dream last night about how not to do that, so I'll try to change that to something faster later on:)

@freddieknets freddieknets merged commit 005a9d5 into xsuite:NewSegments Apr 29, 2025
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.

2 participants