Spaces:
Runtime error
Runtime error
Create toolpath_generation.py
Browse files
modules/toolpath_generation.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def generate_gcode(model_path):
|
| 2 |
+
try:
|
| 3 |
+
gcode_path = model_path.replace(".scad", ".gcode")
|
| 4 |
+
with open(gcode_path, "w") as f:
|
| 5 |
+
f.write(f"(G-Code generated for {model_path})")
|
| 6 |
+
return f"G-Code generated successfully: {gcode_path}"
|
| 7 |
+
except Exception as e:
|
| 8 |
+
return f"Error in G-Code generation: {str(e)}"
|