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

[BUG] - MCNPinput.points_to_coeffs has no Return #292

Open
agrieve-cfs opened this issue Dec 17, 2024 · 0 comments
Open

[BUG] - MCNPinput.points_to_coeffs has no Return #292

agrieve-cfs opened this issue Dec 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@agrieve-cfs
Copy link

Describe the bug

Primitives of type P fail conversion due to no return from the points_to_coeffs function in MCNPInput.py

To Reproduce

Convert the following file with one of the MCNP CSG to CAD methods (here using JSON):

planes of type p
c 10x10x10cm side length box
1 0 -10 -20 -30 -40 -50 -60 imp:n=1
2 0 10:20:30:40:50:60 imp:n=0

c surfaces
10 p -5  0 -1  -5 -1  0  -5 -1 -1 $ -X
20 p  5  0  1   5  1  0   5  1  1 $ +X
30 p  0 -5 -1  -1 -5  0  -1 -5 -1 $ -Y
40 p  0  5  1   1  5  0   1  5  1 $ +Y
50 p  0 -1 -5  -1  0 -5  -1 -1 -5 $ -Z
60 p  0  1  5   1  0  5   1  1  5 $ +Z

c data
sdef
mode n
nps 10

Conversion JSON:

{
"export_cad":{
    "input_filename": "plane_box_p.inp",
    "csg_format": "mcnp",
    "output_filename" : "cad_from_csg",
    "bounding_box": [-5, -5, -5, 5, 5, 5],
    "universe_start": 0,  
    "level_max": "all",  
    "cell_range_type": "all",
    "cell_range": [],
    "mat_range_type": "all", 
    "mat_range": []
    }
}

Using GEOUNED from Conda miniforge:

(geouned_env) $ pip show geouned
Name: geouned
Version: 1.4.0

Expected behavior

Expected coefficients to be returned from points_to_coeffs function.

Error message

  File "/path/to/MCNPinput.py", line 501, in Get_primitive_surfaces
    normal = FreeCAD.Vector(coeffs[0:3])
                            ~~~~~~^^^^^
TypeError: 'NoneType' object is not subscriptable

Please complete the following information):

  • OS: Linux
  • GEOUNED conda miniforge version 1.4.0
  • Python version 3.11.8
@agrieve-cfs agrieve-cfs added the bug Something isn't working label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant