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

adding 3d ray trace plots #242

Open
shimwell opened this issue Aug 31, 2023 · 0 comments
Open

adding 3d ray trace plots #242

shimwell opened this issue Aug 31, 2023 · 0 comments

Comments

@shimwell
Copy link
Member

With the PR for raytracing plots going into openmc it would be nice to add an example, here is one I started

import openmc

#todo add geoemtry

mat1 = openmc.Material(name="mat1")
mat1.add_nuclide("C12", 1)
mat1.set_density("g/cm3", 0.5)
mat2 = openmc.Material(name="mat2")
mat2.add_nuclide("C12", 1)
mat2.set_density("g/cm3", 0.5)
mat3 = openmc.Material(name="mat3")
mat3.add_nuclide("C12", 1)
mat3.set_density("g/cm3", 0.5)
mat4 = openmc.Material(name="mat4")
mat4.add_nuclide("C12", 1)
mat4.set_density("g/cm3", 0.5)
mat5 = openmc.Material(name="mat5")
mat5.add_nuclide("C12", 1)
mat5.set_density("g/cm3", 0.5)

plots=openmc.Plots()

p = openmc.PhongPlot()
p.camera_position = [3000, 2000, 3000]
# p.light
p.diffuse_fraction = 0.3
p.pixels = (1000, 1000)
p.filename = 'p.png'
p.color_by='material'
p.opaque_domains = [
    mat1,mat2,mat3,mat4,mat5
]
# p.colors 
plots.append(p)
plots.export_to_xml()
my_model.export_to_xml()
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

1 participant