Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,11 +55,14 @@ def export_model(model, output_format):
|
|
| 55 |
"""
|
| 56 |
output_file = f"custom_profile.{output_format}"
|
| 57 |
if output_format == "step":
|
| 58 |
-
model.
|
|
|
|
| 59 |
elif output_format == "stl":
|
| 60 |
-
model.
|
|
|
|
| 61 |
elif output_format == "svg":
|
| 62 |
-
model.
|
|
|
|
| 63 |
else:
|
| 64 |
raise ValueError(f"Unsupported format: {output_format}")
|
| 65 |
return output_file
|
|
|
|
| 55 |
"""
|
| 56 |
output_file = f"custom_profile.{output_format}"
|
| 57 |
if output_format == "step":
|
| 58 |
+
model = model.val() # Get the actual shape before exporting
|
| 59 |
+
cq.exporters.export(model, output_file) # Export to STEP format
|
| 60 |
elif output_format == "stl":
|
| 61 |
+
model = model.val() # Get the actual shape before exporting
|
| 62 |
+
cq.exporters.export(model, output_file) # Export to STL format
|
| 63 |
elif output_format == "svg":
|
| 64 |
+
model = model.val() # Get the actual shape before exporting
|
| 65 |
+
cq.exporters.export(model, output_file) # Export to SVG format
|
| 66 |
else:
|
| 67 |
raise ValueError(f"Unsupported format: {output_format}")
|
| 68 |
return output_file
|