Create main.py
Browse files
main.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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=[
|
| 9 |
+
gr.Number(label="Circle Center X (a)", value=20),
|
| 10 |
+
gr.Number(label="Circle Center Y (b)", value=20),
|
| 11 |
+
gr.Number(label="Radius (r)", value=15),
|
| 12 |
+
gr.Slider(minimum=1, maximum=1000, step=1, label="Number of Rays", value=50)
|
| 13 |
+
],
|
| 14 |
+
outputs="image",
|
| 15 |
+
live=True
|
| 16 |
+
title="Channel domination",
|
| 17 |
+
description=description1,
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
combinedInterface = gr.TabbedInterface([iface1],
|
| 21 |
+
['Channel domination']
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
combinedInterface.launch(share=False)
|