pip install mecode_viewer
All that is needed to run mecode_viewer
is to provide a path to your gcode file. By default, mecode_viewer
assumes you're using a Nordson pressure controller to control ink extrusion.
from mecode_viewer import mecode_viewer
mecode_viewer(file_name='gcode_file.pgm')
Linear actuators are also often used to control ink extrusion during printing. This example shows how we can provide a custom extrude_cmd
to specify when extrusion starts and stops. E.g., if linear actuator #5 is typically run using FREERUN PDISP5 2.5
and stopped using FREERUN PDISP5 STOP
, we can simply set extrude_cmd='FREERUN PDISP5'
.
from mecode_viewer import mecode_viewer
mecode_viewer(file_name='gcode_file.pgm', extrude_cmd='FREERUN PDISP5')
By default mecode_viewer
will display a 3D figure of your gcode toolpath. If you would like to view an animated version, set animate=True
.
from mecode_viewer import mecode_viewer
mecode_viewer(file_name='gcode_file.pgm', animate=True)
If extrude_cmd
is provided with a list or tuple with more than one entry, mecode_viewer
will generate a figure color coded for each extrusion source.
from mecode_viewer import mecode_viewer
mecode_viewer('gcode_file.pgm',
extrude_cmd=('PDISP1', 'PDISP2'),
extrude_stop_cmd=('PDISP1 STOP', 'PDISP2 STOP'))
!!! warning
This currently only work for two extrusion sources. We plan to add support for more extruders / more colors.
Full documenation of mecode_viewer
available at API Reference.
mecode_viewer
is distributed under the terms of the MIT license.