karthikmn commited on
Commit
02526f8
·
verified ·
1 Parent(s): 54902bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -13
app.py CHANGED
@@ -1,34 +1,27 @@
1
  import gradio as gr
2
- from utils.cad_utils import generate_cad_model
3
  from utils.ansys_utils import run_simulation
4
  from utils.cnc_utils import generate_gcode
5
 
6
- def automate_workflow(dimensions, material, tolerances):
7
- # Step 1: Generate CAD Model
8
- cad_file = generate_cad_model(dimensions)
9
-
10
- # Step 2: Run Simulation in ANSYS
11
  simulation_results = run_simulation(cad_file)
12
 
13
- # Step 3: Generate G-Code
14
  gcode_file = generate_gcode(cad_file)
15
 
16
- return simulation_results, cad_file, gcode_file
17
 
18
  # Gradio Interface
19
  interface = gr.Interface(
20
  fn=automate_workflow,
21
  inputs=[
22
- gr.Textbox(label="Dimensions (e.g., 100x50x30 mm)"),
23
- gr.Textbox(label="Material (e.g., Steel)"),
24
- gr.Textbox(label="Tolerances (e.g., ±0.05 mm)")
25
  ],
26
  outputs=[
27
  gr.Text(label="Simulation Results"),
28
- gr.File(label="Generated CAD File"),
29
  gr.File(label="Generated G-Code File")
30
  ],
31
- title="Automation Workflow for Design and Manufacturing"
32
  )
33
 
34
  if __name__ == "__main__":
 
1
  import gradio as gr
 
2
  from utils.ansys_utils import run_simulation
3
  from utils.cnc_utils import generate_gcode
4
 
5
+ def automate_workflow(cad_file):
6
+ # Step 1: Run Simulation in ANSYS
 
 
 
7
  simulation_results = run_simulation(cad_file)
8
 
9
+ # Step 2: Generate G-Code
10
  gcode_file = generate_gcode(cad_file)
11
 
12
+ return simulation_results, gcode_file
13
 
14
  # Gradio Interface
15
  interface = gr.Interface(
16
  fn=automate_workflow,
17
  inputs=[
18
+ gr.File(label="Upload CAD File (.step format)")
 
 
19
  ],
20
  outputs=[
21
  gr.Text(label="Simulation Results"),
 
22
  gr.File(label="Generated G-Code File")
23
  ],
24
+ title="ANSYS Simulation and G-Code Generation"
25
  )
26
 
27
  if __name__ == "__main__":