0.11 #9
KAHR-Alpha
announced in
Announcements
Replies: 1 comment
-
|
Sample script: Material_0=Material()
Material_1=Material()
Material_0:name("Glass")
Material_0:refractive_index(1.5)
Material_1:name("Air")
Material_1:refractive_index(1)
optim=Optimizer()
optim:max_failures(100)
-- Objects definition
object_0=Selene_object("lens",0.01,0.1,0.3,-0.3)
object_1=Selene_object("rectangle",0.3,0.3)
object_2=Selene_object("lens",0.01,0.1,0.291165,-0.3)
light_0=Selene_light("perfect_beam")
-- Frame properties
object_0:name("Lens_0")
object_0:location(0,0,0)
object_0:rotation(0,0,0)
object_1:name("Rectangle_1")
object_1:location(0.9,0,0)
object_1:rotation(0,0,0)
object_2:name("Lens_5")
object_2:location(0.45,0,0)
object_2:rotation(0,0,0)
light_0:name("Perfect_Beam_2")
light_0:location(-0.2,0,0)
light_0:rotation(0,0,0)
-- Specific object properties
object_0:default_out_mat(Material_1)
object_0:default_in_mat(Material_0)
object_0:default_IRF(SEL_IRF_PERFECT_ANTIREFLECTOR)
object_1:default_out_mat(Material_1)
object_1:default_in_mat(Material_1)
object_1:default_IRF(SEL_IRF_FRESNEL)
object_1:sensor("transp","obj_intersection","obj_direction","obj_face")
object_2:default_out_mat(Material_1)
object_2:default_in_mat(Material_0)
object_2:default_IRF(SEL_IRF_PERFECT_ANTIREFLECTOR)
optim:optimize(object_2:reference("x"),"add",0.01,0,0,"none",0)
light_0:material(Material_1)
light_0:wavelength(5.5e-07)
light_0:extent("circle",0.05)
-- Optimization targets
target_0=Selene_target()
target_0:goal("minimize_angular_spread")
target_0:sensor(object_1)
target_0:weight(1)
optim:add_target(target_0)
-- Simulation properties
selene=MODE("selene")
selene:N_rays_total(10000)
selene:N_rays_disp(1000)
selene:output_directory("")
selene:add_object(object_0)
selene:add_object(object_1)
selene:add_object(object_2)
selene:add_light(light_0)
selene:optimize(optim) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Added an optimization system to Selene
This discussion was created from the release 0.11.
Beta Was this translation helpful? Give feedback.
All reactions