Is there a maximum number of lines of gcode processed per second?

WASM should only be contemplated as a compilation target, not as a language to write in directly (although you can of course). But what it gives you is substantially better performance in the browser than Javascript.
There are still some limitations with the various implementations of WASM, in terms of what the developer can access (as provided by the browser). But these are being gradually worked on. So it’s a good target language to consider for new projects. There’s only a limited number of tools that can generate wasm currently. But those that do exist are pretty competent.

It is a very good general purpose language, and it does enforce some better programming practices (which is definitely a good thing). So in one sense I would recommend it for someone to learn programming, because you can start small and ‘build up’. But for me, having worked with so many other languages, I do find those ‘little inconsistencies’ constantly tedious.

1 Like

Is it a simplifier and combines a bunch of short commands into a single command that can fit within a given tolerance?

Kind of. :wink:
It’s set up as a kind of pipeline of various steps, that way I can swap steps in or out as I figure things out.
Currently it does four things specifically related to ‘cleaning’ the gcode:

  • Clip reduces the decimal places for each numeric token (1dp for mm, 2dp for inches)
  • Augment takes any line with X or Y tokens and makes it a complete set of X, Y, Z (to improve later processing)
  • Dedup gets rid of actual duplicates
  • DedupLinear gets rid of lines of gcode that are colinear with the lines of gcode before and after. This is done to a tolerance. This is repeated to progressively eliminate colinear points without screwing up the ‘resolution’ of the overall path.

I want to add a DedupTokens to eliminate redundant tokens (effectively undo what Augment does)
And eventually a DedupArc to figure out if points are on an arc and then eliminate lines of gcode that way.

1 Like

be careful about doing this with arcs, if the beginning and end of an arc end up
being the same coordinates, it becomes a circle instead of a tiny arc

you should also look at a few other things

  1. reduce clearance (eliminate vertical movemetn more than a defined safe height
    above 0)

  2. reorder paths (can segments below Z=0 be re-ordered to minimize the movement
    between them)

  3. eliminate redundant vertical motion. a lot of CAM softare will cut at a
    level, then retract to the safe distance and then plunge back down, resulting it
    a lot of wasted Z motion (hich is extremely slow for the stock maslow). After
    you re-order segments, there will be a lot of retracting to safe height and then
    plunging back down to the where you left off.

There may need to be an option/switch on this to let peck drilling still work.
peck drilling may only be appropriate if there is no X/Y movement at the bottom.

David Lang

be careful about doing this with arcs

I will be, this is a bit lower down on my priorities.

reduce clearance (eliminate vertical movemetn more than a defined safe height
above 0)

This is a high priority for me. It’s so simple to do.

eliminate redundant vertical motion.

I sure will. I have some ideas for this.

reorder paths

There’s some low hanging fruit here. But it pretty quickly can start turning into the “Travelling Salesman” problem, which is … ‘tricky’

be careful about doing this with arcs

I will be, this is a bit lower down on my priorities.

lots of tiny arcs are common on lettering.

reorder paths

There’s some low hanging fruit here. But it pretty quickly can start turning into the “Travelling Salesman” problem, which is … ‘tricky’

start by just chaining segments together to avoid moving from one area to
another and then come back.

then worry about optimizing where you leave one and enter the next as a separate
step.

Along similar lines, re-order to depth first rather than cutting all shapes at
one depth, then all shapes at the next depth (note that unless there are tabs,
the order of cuts can be an issue with parts getting loose, so this needs to be
able to be disabled)

David Lang

Awesome work!!