DebasishDhal99 commited on
Commit
5ee263c
·
verified ·
1 Parent(s): c5ce868

Add reflecting plotter

Browse files
Files changed (1) hide show
  1. app.py +21 -4
app.py CHANGED
@@ -1,8 +1,9 @@
1
  import gradio as gr
2
 
3
  from backend.nonreflecting_ray_tracing import nonreflecting_plotter
 
4
 
5
- description1 = "A source of light placed at the origin. A spherical non-reflecting surface placed in front it. This interface simulates the rays interaction with the non-reflecting surface."
6
  iface1 = gr.Interface(
7
  fn = nonreflecting_plotter,
8
  inputs=[
@@ -13,12 +14,28 @@ iface1 = gr.Interface(
13
  ],
14
  outputs="image",
15
  live=True,
16
- title="Non-Reflecting Ray Tracing",
17
  description=description1,
18
  )
19
 
20
- combinedInterface = gr.TabbedInterface([iface1],
21
- ['Channel domination']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  )
23
 
24
  combinedInterface.launch(share=False)
 
1
  import gradio as gr
2
 
3
  from backend.nonreflecting_ray_tracing import nonreflecting_plotter
4
+ from backend.reflecting_ray_tracing import reflecting_plotter
5
 
6
+ description1 = "A source of light placed at the origin. A spherical non-Reflecting surface placed in front it. This interface simulates the rays interaction with the non-Reflecting surface."
7
  iface1 = gr.Interface(
8
  fn = nonreflecting_plotter,
9
  inputs=[
 
14
  ],
15
  outputs="image",
16
  live=True,
17
+ title="Non-Reflective Ray Tracing",
18
  description=description1,
19
  )
20
 
21
+ description2 = "A source of light placed at the origin. A spherical Reflecting surface placed in front it. This interface simulates the rays interaction with the Reflecting surface."
22
+ iface2 = gr.Interface(
23
+ fn = reflecting_plotter,
24
+ inputs=[
25
+ gr.Number(label="Circle Center X (a)", value=20),
26
+ gr.Number(label="Circle Center Y (b)", value=20),
27
+ gr.Number(label="Radius (r)", value=15),
28
+ gr.Slider(minimum=3, maximum=1000, step=1, label="Number of Rays", value=50)
29
+ ],
30
+ outputs="image",
31
+ live=True,
32
+ title="Reflective Ray Tracing",
33
+ description=description2,
34
+ )
35
+
36
+
37
+ combinedInterface = gr.TabbedInterface([iface1, iface2],
38
+ ['Non-Reflective Ray Tracing', 'Reflective Ray Tracing']
39
  )
40
 
41
  combinedInterface.launch(share=False)