live plot example and screenToPlot helper
This commit is contained in:
+10
-2
@@ -184,13 +184,21 @@ Write one G-code line and wait for Marlin `ok`.
|
||||
|
||||
Send pen G-code and wait the pen delay. By default, no-op if already in that state. Pass `true` to always send (used by `P` and on connect) so you can test the configured angles.
|
||||
|
||||
### `screenToPlot(px, py, options?)`
|
||||
|
||||
Convert canvas pixel coordinates to plot coordinates in mm.
|
||||
|
||||
- `px`, `py` (number): screen/canvas pixel coordinates.
|
||||
- `options.clamp` (boolean, default `true`): clamp result to bounds.
|
||||
- `options.useDisplayBounds` (boolean, default `false`): use current display bounds (preview when disconnected) instead of machine bounds.
|
||||
|
||||
### `moveTo(x, y)`
|
||||
|
||||
Pen up, travel to `(x, y)` mm immediately (not queued). Requires home.
|
||||
Pen up, travel to `(x, y)` mm immediately (not queued), then wait for motion completion (`M400`). Requires home.
|
||||
|
||||
### `drawTo(x, y)`
|
||||
|
||||
Pen down, draw to `(x, y)` mm immediately. Requires home.
|
||||
Pen down, draw to `(x, y)` mm immediately, then wait for motion completion (`M400`). Requires home.
|
||||
|
||||
### `goToZero()`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user