def load_cad(self, load_full=False): from raysect.primitive.mesh import Mesh from raysect.optical.material.absorber import AbsorbingSurface from raysect.optical import World import os world = World() if load_full: MESH_PARTS = MASTU_FULL_MESH + VACUUM_VESSEL + \ UPPER_DIVERTOR_NOSE + UPPER_DIVERTOR_ARMOUR + UPPER_DIVERTOR + \ LOWER_DIVERTOR_NOSE + LOWER_DIVERTOR_ARMOUR + LOWER_DIVERTOR + \ LOWER_ELM_COILS + LOWER_GAS_BAFFLE + \ UPPER_ELM_COILS + UPPER_GAS_BAFFLE + \ ELM_COILS + PF_COILS + \ T5_LOWER + T4_LOWER + T3_LOWER + T2_LOWER + T1_LOWER + \ T5_UPPER + T4_UPPER + T3_UPPER + T2_UPPER + T1_UPPER + \ C6_TILES + C5_TILES + C4_TILES + C3_TILES + C2_TILES + C1_TILE + \ B1_UPPER + B2_UPPER + B3_UPPER + B4_UPPER + \ B1_LOWER + B2_LOWER + B3_LOWER + B4_LOWER + \ BEAM_DUMPS + SXD_BOLOMETERS else: MESH_PARTS = CENTRE_COLUMN + LOWER_DIVERTOR_ARMOUR #MESH_PARTS=VACUUM_VESSEL for cad_file in MESH_PARTS: directory, filename = os.path.split(cad_file[0]) name, ext = filename.split('.') print("importing {} ...".format(filename)) Mesh.from_file(cad_file[0], parent=world, material=AbsorbingSurface(), name=name) return world
from raysect.core import Vector3D, Point3D from raysect.optical import World, translate, rotate_basis from raysect.optical.observer import FibreOptic, SpectralPipeline0D from raysect.primitive.mesh import Mesh plt.ion() world = World() MESH_PARTS = CENTRE_COLUMN + LOWER_DIVERTOR_ARMOUR for cad_file in MESH_PARTS: directory, filename = os.path.split(cad_file) name, ext = filename.split('.') print("importing {} ...".format(filename)) Mesh.from_file(cad_file, parent=world, material=AbsorbingSurface(), name=name) # Load plasma from SOLPS model mds_server = 'solps-mdsplus.aug.ipp.mpg.de:8001' ref_number = 69636 sim = SOLPSSimulation.load_from_mdsplus(mds_server, ref_number) plasma = sim.plasma mesh = sim.mesh vessel = mesh.vessel # Setup deuterium lines d_alpha = Line(deuterium, 0, (3, 2), wavelength=656.19) d_beta = Line(deuterium, 0, (4, 2), wavelength=486.1) d_gamma = Line(deuterium, 0, (5, 2), wavelength=433.99) d_delta = Line(deuterium, 0, (6, 2), wavelength=410.2)
from cherab.tools.observers import load_calcam_calibration from cherab.solps import load_solps_from_mdsplus from cherab.openadas import OpenADAS from cherab.mastu.machine import CENTRE_COLUMN, LOWER_DIVERTOR_ARMOUR world = World() MESH_PARTS = CENTRE_COLUMN + LOWER_DIVERTOR_ARMOUR for cad_file in MESH_PARTS: directory, filename = os.path.split(cad_file) name, ext = filename.split('.') print("importing {} ...".format(filename)) Mesh.from_file(cad_file, parent=world, material=AbsorbingSurface(), name=name) # material=Lambert(ConstantSF(0.25)) # Load plasma from SOLPS model mds_server = 'solps-mdsplus.aug.ipp.mpg.de:8001' ref_number = 69636 #69637 sim = load_solps_from_mdsplus(mds_server, ref_number) plasma = sim.create_plasma(parent=world) plasma.atomic_data = OpenADAS(permit_extrapolation=True) mesh = sim.mesh vessel = mesh.vessel # Pick emission models # d_alpha = Line(deuterium, 0, (3, 2)) # plasma.models = [ExcitationLine(d_alpha), RecombinationLine(d_alpha)]
the cartesian hit point of the ray with the materials in the scene (rabit and floor) is recorded. In Figure 1 the 3D hit point for each ray in the camera is plotted in 3D space. In Figure 2 the z coordinate of each hit point is scaled and plotted to indicate distance from the camera. Both methods allow simple visualisation of a scene and extraction of intersection geometry data. Bunny model source: Stanford University Computer Graphics Laboratory http://graphics.stanford.edu/data/3Dscanrep/ Converted to obj format using MeshLab """ world = World() mesh_path = path.join(path.dirname(__file__), "../resources/stanford_bunny.rsm") mesh = Mesh.from_file(mesh_path, parent=world, transform=rotate(180, 0, 0)) # LIGHT BOX padding = 1e-5 enclosure_thickness = 0.001 + padding glass_thickness = 0.003 light_box = Node(parent=world) enclosure_outer = Box(Point3D(-0.10 - enclosure_thickness, -0.02 - enclosure_thickness, -0.10 - enclosure_thickness), Point3D(0.10 + enclosure_thickness, 0.0, 0.10 + enclosure_thickness)) enclosure_inner = Box(Point3D(-0.10 - padding, -0.02 - padding, -0.10 - padding), Point3D(0.10 + padding, 0.001, 0.10 + padding)) enclosure = Subtract(enclosure_outer, enclosure_inner, material=Lambert(ConstantSF(0.2)), parent=light_box) glass_outer = Box(Point3D(-0.10, -0.02, -0.10),
'inner_heat_shield_s06.rsm', 'inner_heat_shield_s07.rsm', 'inner_heat_shield_s08.rsm', 'inner_heat_shield_s09.rsm', 'inner_heat_shield_s10.rsm', 'inner_heat_shield_s11.rsm', 'inner_heat_shield_s12.rsm', 'inner_heat_shield_s13.rsm', 'inner_heat_shield_s14.rsm', 'inner_heat_shield_s15.rsm', 'inner_heat_shield_s16.rsm' ] machine_material = AbsorbingSurface() # Mesh with perfect absorber for path in MESH_PARTS: path = MESH_PATH + path print("importing {} ...".format(os.path.split(path)[1])) directory, filename = os.path.split(path) name, ext = filename.split('.') Mesh.from_file(path, parent=world, material=machine_material, name=name) # Load simulation from MDSplus mds_server = 'solps-mdsplus.aug.ipp.mpg.de:8001' ref_number = 40195 sim = SOLPSSimulation.load_from_mdsplus(mds_server, ref_number) # Load simulation from raw output files # SIM_PATH = '/home/mcarr/mst1/aug_2016/solps_testcase/' # sim = SOLPSSimulation.load_from_output_files(SIM_PATH) plasma = sim.plasma mesh = sim.mesh plasma_cylinder = solps_total_radiated_power(world, sim, step=0.001) X_WIDTH = 0.01