jithenderchoudary commited on
Commit
639c16f
·
verified ·
1 Parent(s): 97b090b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -1,7 +1,6 @@
1
  import gradio as gr
2
  import cadquery as cq
3
  from cadquery import exporters
4
- import tempfile
5
  import json
6
  import os
7
 
@@ -13,10 +12,8 @@ def generate_apdl_script(file, press_force, material_json):
13
  elastic_modulus = material.get("elastic_modulus", 2e11)
14
  poisson = material.get("poisson", 0.3)
15
 
16
- # Save uploaded STEP file temporarily
17
- with tempfile.NamedTemporaryFile(delete=False, suffix=".step") as temp_file:
18
- temp_file.write(file.read())
19
- step_file_path = temp_file.name
20
 
21
  # Load STEP file with CadQuery
22
  model = cq.importers.importStep(step_file_path)
 
1
  import gradio as gr
2
  import cadquery as cq
3
  from cadquery import exporters
 
4
  import json
5
  import os
6
 
 
12
  elastic_modulus = material.get("elastic_modulus", 2e11)
13
  poisson = material.get("poisson", 0.3)
14
 
15
+ # Get the uploaded file path
16
+ step_file_path = file.name
 
 
17
 
18
  # Load STEP file with CadQuery
19
  model = cq.importers.importStep(step_file_path)