# setup a hemisphere to measure the lightsources spatial power distribution measureSurf = oe.hemisphere(center=[0, 0, 0, 0], radius=1000.0) measureSurf.setMaterial(mat_type="measure") meshes = [measureSurf] m2 = oe.cube(center=(0, 0, 20, 0), size=[10, 10, 10, 0]) m2.setMaterial(mat_type="refractive", IOR=1.0, dissipation=1.0) meshes.append(m2) time2 = time() prep_time = time2 - time1 # setup the tracer and select the CL platform and device to run the tracer on # if platform_name or and device_name are incorrect then the first device of the first platform will be used tr = it.CL_Tracer(platform_name="NVIDIA", device_name="460") #INIT properly time1 = time() # run the iterative tracer tr.iterative_tracer(light_source=ls, meshes=meshes, trace_iterations=iterations, trace_until_dissipated=power_dissipated, max_ray_len=max_ray_len, ior_env=ior_env) time2 = time() sim_time = time2 - time1 # fetch results for further processing resulting_rays = tr.results
#NOTE: parabolic_mirror initializes material parameters as the name says mirror. #rotate parabolic mirror to face in z direction m2.rotate(axis="y",angle=-np.pi/2,pivot = (0,0,0,0)) # append parabolic mirror to scene meshes.append(m2) # measure lightsource and geometry setup time. time2 = time() prep_time = time2 - time1 # setup the tracer and select the CL platform and device to run the tracer on # if platform_name or and device_name are incorrect then the first device of the first platform will be used print "Initializing raytracer ... " tr = it.CL_Tracer(platform_name="AMD",device_name="i5") #INIT properly time1 = time() # run the iterative tracer print "Starting raytracer ..." tr.iterative_tracer(light_source=ls,meshes=meshes,trace_iterations=iterations,trace_until_dissipated=power_dissipated,max_ray_len=max_ray_len,ior_env=ior_env) time2 = time() sim_time = time2 - time1 # fetch results for further processing print "Processing Results ..." resulting_rays = tr.results proc_ray_count=0 for res in resulting_rays: