-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbrace.py
More file actions
28 lines (19 loc) · 1.06 KB
/
brace.py
File metadata and controls
28 lines (19 loc) · 1.06 KB
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
"""Minimal example simulating the G-code of a brace from Aura-slicer on an Anisoprint Composer A4."""
import importlib.resources
from pyGCodeDecode.gcode_interpreter import simulation
from pyGCodeDecode.helpers import custom_print
from pyGCodeDecode.plotter import plot_3d
def brace_example():
"""Minimal example for the usage of pyGCodeDecode simulating the G-code of a brace."""
custom_print(
"Running pyGCD's brace example! 📎"
"\nThis example illustrates the simplest use of the package: A gcode is simulated with default presets "
"\nprovided by the package. After the simulation, an interactive 3D-plot is shown. No output is saved."
)
gcode_path = importlib.resources.files("pyGCodeDecode").joinpath("examples/data/brace.gcode")
# running the simulation by creating a simulation object using default machine parameters
brace_simulation = simulation(gcode_path=gcode_path, machine_name="anisoprint_a4")
# create a 3D-plot
plot_3d(brace_simulation, extrusion_only=True)
if __name__ == "__main__":
brace_example()