Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G-Code format? #171

Open
robin-swift opened this issue Nov 4, 2021 · 1 comment
Open

G-Code format? #171

robin-swift opened this issue Nov 4, 2021 · 1 comment

Comments

@robin-swift
Copy link
Member

Copied from old to do list.

@robin-swift robin-swift transferred this issue from Embroidermodder/Embroidermodder Nov 4, 2021
@tatarize
Copy link

tatarize commented Nov 4, 2021

The few people with Gcode embroidery machines tend to hook their Z axis to stitching. They do this by setting up an old sewing machine and hooking a motor to the hand-crank and an x-y plotter to the sewing field. This gives them an embroidery machine out of an old sewing machine and the important commands for the embroidery machine tend to be +Z for stitch and X and Y for switch locations. Though there are many other designs and more gcode formats that might be needed than could be expressed in a hard-coded definition.

I did develop a solution to this for pen plotters, https://github.com/plottertools/vpype-gcode/

The main trick is that you save some profiles of settings for how to write a particular format. Then we cycle through them in the standard block formats:

<document_start>
  <layer_start>
    <line_start>
      <segment_first>
      <segment>
      <segment>
      <segment>
      <segment>
      <segment_last>
    <line_end>
    <line_join>
    <line_start>
      <segment_first>
      <segment>
      <segment>
      <segment>
      <segment>
      <segment_last>
    <line_end>
    <line_join>
    <line_start>
      <segment_first>
      <segment>
      <segment>
      <segment>
      <segment>
      <segment_last>
    <line_end>
 <layer_end>
 <layer_join>
 <layer_start>
    <line_start>
      <segment_first>
      <segment>
      <segment>
      <segment>
      <segment>
      <segment_last>
    <line_end>
    <line_join>
    <line_start>
      <segment_first>
      <segment>
      <segment>
      <segment>
      <segment>
      <segment_last>
    <line_end>
    <line_join>
    <line_start>
      <segment_first>
      <segment>
      <segment>
      <segment>
      <segment>
      <segment_last>
    <line_end>
 <layer_end>
<document_end>

Then the user defines particular bits and how that bit should be formatted. Like the could be * STITCH {dx:%f}, {dy:%f}\n and it could potentially provide a bunch of other bits of information but doesn't need to. This sort of writing scheme is actually good enough to write gcode, but actually broad enough that it can write any ascii text based formats. I've had it write everything from CSV to JSON to SVG.

This is actually as broad as things need to be to write gcode because hobbyists could hook things up in a lot of different ways.

@robin-swift robin-swift added this to the Version 1.0 milestone Nov 5, 2021
@robin-swift robin-swift removed this from the Version 1.0 milestone Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants