Spaces:
Sleeping
Sleeping
File size: 1,067 Bytes
b05c3dc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import gradio as gr
from cad_generation import create_cad_model
from simulation import run_simulation
from toolpath_generation import generate_gcode
def complete_workflow(dimensions, tolerances, materials, script_path, model_path):
# Step 1: Collect Parameters
params = {"dimensions": dimensions, "tolerances": tolerances, "materials": materials}
result_cad = create_cad_model(float(dimensions))
result_sim = run_simulation(script_path.name)
result_gcode = generate_gcode(model_path.name)
return f"""
Workflow Completed:
Parameters Collected: {params}
CAD Result: {result_cad}
Simulation Result: {result_sim}
G-Code Generation: {result_gcode}
"""
# Gradio Interface
interface = gr.Interface(
complete_workflow,
inputs=[
gr.Textbox(label="Dimensions"),
gr.Textbox(label="Tolerances"),
gr.Textbox(label="Materials"),
gr.File(label="Simulation Script"),
gr.File(label="CAD Model Path"),
],
outputs="text",
)
if __name__ == "__main__":
interface.launch()
|