simulationapps / app.py
karthikmn's picture
Update app.py
02526f8 verified
raw
history blame
711 Bytes
import gradio as gr
from utils.ansys_utils import run_simulation
from utils.cnc_utils import generate_gcode
def automate_workflow(cad_file):
# Step 1: Run Simulation in ANSYS
simulation_results = run_simulation(cad_file)
# Step 2: Generate G-Code
gcode_file = generate_gcode(cad_file)
return simulation_results, gcode_file
# Gradio Interface
interface = gr.Interface(
fn=automate_workflow,
inputs=[
gr.File(label="Upload CAD File (.step format)")
],
outputs=[
gr.Text(label="Simulation Results"),
gr.File(label="Generated G-Code File")
],
title="ANSYS Simulation and G-Code Generation"
)
if __name__ == "__main__":
interface.launch()