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

Get translated surface coefficient #630

Open
tjlaboss opened this issue Jan 9, 2025 · 0 comments
Open

Get translated surface coefficient #630

tjlaboss opened this issue Jan 9, 2025 · 0 comments
Labels
feature request An issue that improves the user interface.

Comments

@tjlaboss
Copy link
Collaborator

tjlaboss commented Jan 9, 2025

Is your feature request related to a problem? Please describe.
Transformed surfaces can be deceptive. It is sometimes useful to know the true location of a surface in a model.

Consider the following example:

Transformed Surface Example
c Cells
1 0  -10  +11  -12  imp:n=1  $ inside cylinder
2 0  +10: -11: +12  imp:n=0  $ graveyard

c Surfaces
10   cz  1.0
11 1 pz 0.0  $ bottom surface 
12 3 pz 1.0  $ top surface

c Data Cards
tr1  0.0  0.0  -1.0  $ shift z down 1.0 cm
tr3  0.0  0.0  +3.0  $ shift z  up  3.0 cm

If one wanted to know the height of Cell 1, he would have to check for transforms and apply any relevant transform manually.

Describe the solution you'd like
Add a property that applies the (x, y, z) translation from a transform to the relevant surface coefficients.

>>> # False height
>>> model.surfaces[12].surface_constants[0] - model.surfaces[11].surface_constants[0] 
1.0
>>> # True height
>>> model.surfaces[12].translated_constants[0] - model.surfaces[11].translated_constants[0] 
5.0

Describe alternatives you've considered

  • Obviously, you could also apply the rotation, but that gets messy very quickly; translation is relatively simple.
  • You could get a shifted surface: problem.surfaces.shift_x, y, z #74

Additional context
Also related to: #73

@tjlaboss tjlaboss added the feature request An issue that improves the user interface. label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request An issue that improves the user interface.
Projects
None yet
Development

No branches or pull requests

1 participant