Skip to main content

Simple GCode Viewer

Project description

Welcome to mecode_viewer

Unit Tests Hatch project

PyPI - Version PyPI - Downloads PyPI - Python Version

Installation

pip install mecode_viewer

Getting Started

Example: simplest case

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')

Example: custom extrusion command

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')

Example: animated visualization

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)

Example: mixing, multimaterial printing

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_examples/LineTest_Div_3LinDist182_short.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.

Want to learn more?

Full documenation of mecode_viewer available at API Reference.

License

mecode_viewer is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mecode_viewer-0.2.10.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

mecode_viewer-0.2.10-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file mecode_viewer-0.2.10.tar.gz.

File metadata

  • Download URL: mecode_viewer-0.2.10.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.2

File hashes

Hashes for mecode_viewer-0.2.10.tar.gz
Algorithm Hash digest
SHA256 10a2f81ffeea6f69459e038e09abc9408d8cfe05fff4d3fc169c3d07351f26b2
MD5 dba78d7f3ef5200ea9af8270c981fdfa
BLAKE2b-256 f871c1c7bd77ef18a936f860af525796cabff117e444007653ec954a7e179e5d

See more details on using hashes here.

File details

Details for the file mecode_viewer-0.2.10-py3-none-any.whl.

File metadata

File hashes

Hashes for mecode_viewer-0.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 4c10fe2e8ecd1bc801a09326a6282f69051b0be3ed2ae4b67c4932e7bcfb82c1
MD5 b5e9adcd8508f625e163c3ecf1da7cea
BLAKE2b-256 30bf68948c2c0d9c14963308b0a44f6074578a56da983dca486b126a5a1c8a26

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page