move docs around

This commit is contained in:
bakedpotatolord 2025-05-17 15:02:18 -06:00
commit bf690ac2f5
15 changed files with 57 additions and 3 deletions

129
docs/kiri-moto/apis.md Normal file
View file

@ -0,0 +1,129 @@
---
description: Various ways to access Kiri:Moto's internals (2.6 and newer versions only)
---
# API, CLI, Embedding
## Javascript Slicer Engine
The latest slicing engine code is served live at `https://grid.space/code/engine.js`
This can be embedded in your page then accessed with the following API calls. An example page is [here](https://grid.space/kiri/engine.html).
| function | description |
| ---------------------- | ------------------------------------------------------------------------------------------------------- |
| load(_url_) | load an [STL](https://en.wikipedia.org/wiki/STL\_\(file\_format\)) referred to by _url_ |
| clear() | remove all objects from workspace |
| parse(_data_) | parse the text or binary contents of an [STL](https://en.wikipedia.org/wiki/STL\_\(file\_format\)) file |
| setMode(_mode_) | where _mode_ comes from:`[ "CAM", "FDM", "LASER", "SLA" ]` |
| setListener(_fn_) | a function to receive engine progress messages |
| setDevice(_options_) | change default Device options |
| setProcess(options) | change default Process options |
| setController(options) | change default Core options |
| moveTo(_x, y, z_) | absolute move the origin of the loaded object |
| move(_x, y, z_) | relative move the origin of the loaded object |
| scale(_x, y, z_) | scale axes of the loaded object |
| rotate(_x, y, z_) | relative rotate axes of loaded object (in radians) |
| slice() | async slice of loaded object |
| prepare() | async path routing of slice data |
| export() | async gcode generation from routed paths |
## Command Line API
The slicer engine is also available as a command-line utility
```
node src/kiri-run/cli --help
cli <options> <file>
--verbose | enable verbose logging
--dir=[dir] | root directory for file paths (default: '.')
--model=[file] | model file to load (or last parameter)
--source=[file] | source file list (defaults to kiri engine)
--device=[file] | device definition file (json)
--process=[file] | process definition file (json)
--controller=[file] | controller definition file (json)
--output=[file] | gcode output to file or '-' for stdout
--position=x,y,z | move loaded model to position x,y,z
--rotate=x,y,z | rotate loaded model x,y,z radians
--scale=x,y,z | scale loaded model in x,y,z
--move=x,y,z | move loaded model x,y,z millimeters
```
Example [Device](https://github.com/GridSpace/grid-apps/blob/master/src/cli/kiri-fdm-device.json) and [Process](https://github.com/GridSpace/grid-apps/blob/master/src/cli/kiri-fdm-process.json) settings which are defined in [init.js](https://github.com/GridSpace/grid-apps/blob/master/src/kiri/conf.js) around line `250`
JSON dictionaries can be used for reference from the [CLI package](https://github.com/GridSpace/grid-apps/tree/master/src/cli)
## Embedding Kiri:Moto with an IFrame
Kiri:Moto is designed to be embedded in a page using an IFrame. The look and feel and other controls are available for the loaded page using a messaging API. An example page is [here](https://grid.space/kiri/frame.html).
| function | description |
| --------------------------- | ------------------------------------------------------------------------------------------------------- |
| setFrame(_id\_obj_) | id or object of IFrame with Kiri:Moto loaded |
| load(_url_) | load an [STL](https://en.wikipedia.org/wiki/STL\_\(file\_format\)) referred to by _url_ |
| clear() | remove all objects from workspace |
| parse(_data_) | parse the text or binary contents of an [STL](https://en.wikipedia.org/wiki/STL\_\(file\_format\)) file |
| setMode(_mode_) | where _mode_ comes from:`[ "CAM", "FDM", "LASER", "SLA" ]` |
| setDevice(_options_) | change default Device options |
| setProcess(options) | change default Process options |
| setController(options) | change default Core options |
| slice() | async slice of loaded object |
| prepare() | async path routing of slice data |
| export() | async gcode generation from routed paths |
| onmessage(_fn_) | function will receive all IFrame messages |
| onevent(_event, data_) | function will receive named messages |
| emit(_event, data_) | send named event with data payload |
| alert(_msg, time_) | show alert message with optional time in seconds |
| process(_percent, message_) | set progress bar (0.0 to 1.0) with optional message |
## Events
| Key | Output | Description |
| ---------------- | ------ | ---------------------------------------------- |
| animate | | CNC Animation Started |
| boolean.update | | Boolean checkbox values sync'd |
| code.load | | GCode or SVG code is being loaded / parsed |
| code.loaded | | GCode / SVG code parsing complete |
| device.set | | A new machine / device was selected |
| export | | GCode / SVG export dialog is open |
| help.show | | A Help dialog is open |
| init-done | | App is fully initialized |
| init.one | | App is starting to initialize |
| init.two | | App is binding UI elements |
| key.esc | | \[ESC] key was pressed |
| keypress | | A non-control or meta key was pressed |
| load.lib | | A script extension was loaded |
| modal.show | | A modal dialog is showing |
| mode.set | | App mode changed: `FDM, CNC, Laser, SLA` |
| mouse.hover | | Mouse is hovering over a feature of interest |
| mouse.hover.down | | Mouse down on a feature of interest |
| mouse.hover.up | | Mouse up on a feature of interest |
| platform.layout | | Platform auto-layout was performed |
| preview.begin | | Preview Mode calculations started |
| preview.end | | Preview Mode calculations complete |
| preview.error | | Preview Mode calculations encountered an error |
| print | | Legacy: same as `preview.end` |
| range.updates | | FDM Range records were changed |
| reload | | App page will reload in 100ms |
| resize | | App page was resized |
| selection.drag | | Generated during object drag |
| selection.move | | After object drag completes |
| selection.rotate | | Selected objects were rotated |
| selection.scale | | Selected objects were scaled |
| settings | | Settings object changed |
| settings.load | | Settings object was replaced |
| settings.saved | | Settings object was saved |
| slice | | Deprecated |
| slice.begin | | Slicing calculations started |
| slice.end | | Slicing calculations complete |
| slice.error | | Slicing calculations encountered and error |
| slider.label | | Slider labels changed |
| slider.pos | | Slider position changed |
| slider.set | | Slider values changed |
| view.set | | View mode changed: `slice, preview, animate` |
| widget.add | | An object was added to the workspace |
| widget.delete | | An object was deleted from the workspace |
| widget.deselect | | An object was de-selected |
| widget.rotate | | An object was rotated |
| widget.select | | An object was selected |

View file

@ -0,0 +1,61 @@
---
description: Keyboard Shortcuts and Mouse Controls
---
# Controls
| Key | Action | Notes |
| ---------------- | ----------------------------------------- | --------------------------------------- |
| e | Device Dialog | Select and customize devices |
| o | CNC Tool Dialog | CNC mode only |
| c | Grid.Local Dialog | Find GridBot devices on your network |
| q | Preference Dialog | Change application behaviors |
| l | Work Profile Dialog | Load, Save, Rename work profiles |
| | | |
| a | Arrange | Switch to layout view from other views |
| | | or perform an automatic layout when |
| | | already in layout view |
| s | Slice Object | Slice workspace objects |
| p | Preview Paths | Do route planning for sliced objects |
| g | CNC Animation | Enter milling animation mode |
| x | Export Paths as GCode, SVG, DXF | Produce downloadable files |
| | | |
| i | File Import Dialog | |
| r | Recent Files Dialog | |
| | | |
| h | Home View | Default 45 degree view of objects |
| t | Top View | Top-down view of objects |
| f | Front View | Direct side-view (front) |
| z | Reset View | Default zoom and Home |
| < > | Cycle Side Views | Front, Right, Back, Left |
| v | Focus on Selection (arrange mode) | Camera points to object center |
| v | Toggle Single Slice View (preview mode) | Toggle single vs range of slices |
| | | |
| \~,1-9,0 | Select layer in 10% increments | Slice and Preview modes |
| | | |
| d | Duplicate Selected Objects | Create a copy of selected objects |
| m | Mirror Selected Objects | Mirror vertices of selected objects |
| \[delete] | Delete Selected Objects | Remove selected object from workspace |
| \[arrow] | Rotate 90 degrees | Rotate selected object |
| \[shift + arrow] | Rotate 5 degrees | Rotate selected object |
| \[ctrl + a] | Select All Objects | Select all objects |
| | | |
| \[shit + click] | Toggle Selection | Select or Deselect a single object |
| \[shift + wheel] | Cycle through layers (preview mode) | Use mouse wheel as range slider |
| \[meta + drag] | Pan View | Move focus of camera |
| \[right + drag] | Pan View | |
| \[left + drag] | Rotate | Move camera around a focal point |
| \[mouse wheel] | Zoom | Move camera closer / farther from focus |
| \[middle + drag] | Zoom | |
| | | |
| \[ctrl + click] | Align face of selected object to platform | Rotate object face toward work surface |
| \[meta + click] | Align face of selected object to platform | |
| | | |
| \[shift + z] | Reset all preferences to stock | Reload page afterward |
| | | |
| **Mouse** | **FDM Support Controls** | **Version Notes** |
| \[left click] | Toggle add / remove column | |
| \[ctrl + drag] | Erase support columns | 2.7+ |
| \[cmd + drag] | Erase support columns | 2.7+ |
| \[opt + drag] | Draw on support columns | 2.7+ |
| \[alt + drag] | Draw on support columns | 2.7+ |

45
docs/kiri-moto/faq.md Normal file
View file

@ -0,0 +1,45 @@
---
description: Frequently Asked Questions
---
# FAQ
## Is Kiri:Moto free? Open Source?
Entirely.
The source code is on [GitHub](https://github.com/GridSpace/grid-apps) if you want to install and run it yourself. It is available under the [MIT](https://en.wikipedia.org/wiki/MIT\_License) license, which is one of the most liberal in terms of allowing you to do what you want with the code without restriction.
Multiple live [versions](https://grid.space/choose) (including current development branches) are served free of charge and free of ads on [Grid.Space](https://grid.space/kiri/).
## How does it compare to other slicers?
It has similar capabilities to other 3D printing slicers like Cura, Simplify3D, and PrusaSlicer.
It is very different in several important ways:
* There is no software to install or maintain. It's just a web page.
* As a web app, it runs in a security sandbox and cannot access data on your hard drive
* It offers several modes of operation for most of the common maker tools, like CNC mills
* It is updated quite frequently (several times a week) with bug fixes and new features
## What language is it written in?
It is almost entirely Javascript. There are a few minor modules compiled into WASM for performance.
## What file types are supported?
[STL](https://en.wikipedia.org/wiki/STL\_\(file\_format\)), [OBJ](https://en.wikipedia.org/wiki/Wavefront\_.obj\_file), and [3MF](https://github.com/3MFConsortium/spec\_core/blob/master/3MF%20Core%20Specification.md) files are supported for 3D part import. [SVG](https://en.wikipedia.org/wiki/Scalable\_Vector\_Graphics) files import and auto-convert into 3D models. [PNG](https://en.wikipedia.org/wiki/Portable\_Network\_Graphics) files are supported for 2D image to 3D model conversion.
## What if my printer isn't supported?
You can either find a device close to yours and "customize" it in the device dialog. Or you can import a PrusaSlicer .ini file and it will auto-convert into Device + Profile settings. Caveat: macro logic is not automatically converted.
## How can I get involved?
Start with the [forum](https://forum.grid.space/) discussions. If you want to get involved with Kiri:Moto development, download the [code](https://github.com/GridSpace/grid-apps) and join the Discord [server](https://discord.com/invite/suyCCgr).
## Where does the name come from?
Kiri comes from Kiri-e, which is the Japanese art of paper-cutting. Moto is short for "modeling tool".

View file

@ -0,0 +1,108 @@
---
description: Variable Substitutions and Expressions in GCode Macros
---
# GCode Macros
**FDM (3D Printing) variable substitutions**
_All Modes "pre" and "post" (header/footer)_
- \{top\} = offset in mm of bed top Y axis
- \{left\} = offset in mm of bed left X axis
- \{right\} = offset in mm of bed right X axis
- \{bottom\} = offset in mm of bed bottom Y axis
_All Modes "post" (footer)_
- \{time\} = job run time (printing/milling) in seconds (fractional)
- \{print-time\} = alias for \{time\} ... deprecated after 2.8
- \{print_time\} = alias for \{time\} ... 2.9 and beyond
_3D printing / FDM mode only_
"feature" macro only (as of 3.4)
- \{feature\} = feature region of the print (brims, infill, etc)
- \{minx|miny|maxx|maxy\} = position in mm of extents of the print area
"pre", "post", and other macros
- \{temp\} = hot end temperature
- \{bed_temp\} = bed temperature
- \{fan_speed\} = active cooling fan speed (usually 0-255)
- \{material\} = length in mm of material (filament) used
- \{layers\} = total # of layers
- \{layer\} = current layer number
- \{height\} = current layer height in mm
- \{range(_from_,_to_)\} = evaluated using \{layer\} and \{layers\}
- \{pos_x\} = last output X position
- \{pos_y\} = last output Y position
- \{pos_z\} = last output Z position
- \{progress\} = 0-100% state of print output
- \{tool\} | \{nozzle\} = current tool in use
- \{tool_count\} = number of tools used in print
- \{tool_used\__n_\} = whether tool # _n_ is used in print
- \{z_max\} = max build height in mm
- \{z\} = current z position
- \{e\} = amount of filament extruded
_Logical Code Flow (IF / ELIF / ELSE / END)_
```
;; IF { layer >= 10 && layer <= 20 }
;; ..... inside 10-20 layer={layer}
;; ELIF { layer >= 15 && layer <= 25 }
;; ..... inside 15-25 layer={layer}
;; ELSE
;; ..... did not match previous tests layer={layer}
;; END
```
_PREAMBLE control (v3.4+) allows for intro comment and config list to be re-positioned after the header or disabled. This was introduced to allow GCode output to work with Ultimaker._
_`;; PREAMBLE OFF`_
_`;; PREAMBLE END`_
_Axis Remapping (v3.5+) allows for over-riding the default axis names. Useful for swapping axes and changing output for specific firmware targets. The format of the map is a JSON object._
_`;; AXISMAP {"X":"Y", "Y":"Z", "E":"E1"}`_
#### CAM Header Directives
Comments Rewrite (v3.8+) converts `;` comments into `()` parenthesis format
_`;; COMMENT_REWRITE_PARENS`_
Minimize the size of GCode output (v3.8+)
_`;; COMPACT-OUTPUT`_
Set decimal precision (n = integer) (v3.8+)
_`;; DECIMALS = n`_
**CAM variable substitutions**
- \{tool\} = CAM tool #
- \{tool_name\} = CAM tool name
- \{time\} = dwell time in seconds
- \{time_ms\} = dwell time in milliseconds
- \{time_sec\} = dwell time in seconds
- \{speed\} = spindle speed
- \{spindle\}, \{rpm\} = spindle speed (v2.7+)
- \{feed\} = last output feed rate
- \{pos_x\} = last output X position
- \{pos_y\} = last output Y position
- \{pos_z\} = last output Z position
_Axis Scaling (v3.7+) allows for a factor to be applied to X,Y,Z coordinates. Useful for some machines like the Roland MDX-40A that uses an unusual coordinate space. Default axis scale is `1`_
_`;; SCALE { "X":100, "Y":100, "Z":100 }`_
**CAM & FDM : simple algebraic expression support**
- Text inside `{}` is evaluated algebraically with access to JS classes and methods
- `{Math.min(layer/layers, 0.5) + 1}`
- `{token+n} {token-n}`

32
docs/kiri-moto/index.md Normal file
View file

@ -0,0 +1,32 @@
---
description: >-
A Browser-Based Slicer for 3D FDM and SLA printing, CNC Milling, and Laser
cutting
---
# Kiri:Moto
Available as a free, web-based application, [Kiri:Moto](https://grid.space/kiri/) offers a unique combination of maker-tools in a single, clean, fast interface. For an introduction or overview, check out [this video](https://youtu.be/08795Sj22QE).
Kiri:Moto is focused on privacy, performance, and ease-of-use.
Kiri:Moto has been in continuous development since 2013. It typically gets new development releases a few times a week and major releases every 4-8 weeks.
Please consider supporting this project with a [donation](https://paypal.me/gridspace3d?locale.x=en\_US).
## Privacy
Kiri:Moto is served free of ads, trackers, and any collection of personal data ([PII](https://en.wikipedia.org/wiki/Personal\_data)). Don't trust that? You can also install and run it yourself from [source](https://github.com/GridSpace/grid-apps).
Because Kiri:Moto runs in a browser's security sandbox, it does not have access to the personal and private data on your local hard drive the way installed desktop software does.
Kiri:Moto does all processing in the browser. None of your data is sent to or stored in the cloud.
## Performance
Kiri:Moto is a compact, fast-loading page free of bloat. This is achieved by minimizing external package dependencies. With a few notable exceptions, most of the code-based is written entirely from-scratch.&#x20;
## Ease of Use
Creating an interface that is usable for new to advanced users can be a challenge. Kiri:Moto takes a strong editorial stance on complexity. Much of the software in the maker universe is riddled with parameters and controls that are duplicative and work at cross-purposes.

View file

@ -0,0 +1,33 @@
---
description: >-
Kiri:Moto is designed to be embedded in or accessible through other web-based
applications
---
# Integrations
## OctoPrint
Use the [GridSpace OctoPrint](https://plugins.octoprint.org/plugins/gridspace/) plugin to spool jobs directly from Kiri:Moto to any printer on your local network
## Onshape
Kiri:Moto is available inside of [Onshape](https://onshape.com/) as a web-app extension. Once [installed](https://www.youtube.com/watch?v=AbbZjj5FMGE) through Onshape's App store, Kiri:Moto can be added as a tab (just like a Part Studio) inside of any document in which you have edit capabilities. In this mode, Kiri:Moto's import function is replaced to bring up Onshape's part dialog. This makes it easy to load parts directly for slicing without first having to export them.
## Lychee Slicer
Kiri:Moto's FDM engine is used to power the FDM mode of Mango 3D's [Lychee Slicer](https://lychee.mango3d.io/)
## SimplyPrint.io
Kiri:Moto is the slicing engine behind [SimplyPrint's](https://simplyprint.io/) web-based printer management system.
## Sienci's CAMLab
[CAMLab](http://camlab.sienci.com/camlab) is a fork of an earlier version of Kiri:Moto.
## Thingiverse
Like Onshape, Kiri:Moto is integrated as a native [Thing-app](https://www.thingiverse.com/apps/kirimoto) into Thingiverse. As a user of Thingiverse, you can elect to have Kiri:Moto show up as a "way to open" a Thing file. This provides the convenience of directly accessing, slicing, and printing parts on Thingiverse without first having to download them and then re-import them into a slicer.
Unfortunately, as of this writing, Thingiverse Thing Apps are broken (again)

View file

@ -0,0 +1,30 @@
---
description: A tour of Kiri:Moto's web-based interface
---
# Interface
Kiri:Moto's interface is designed for maximum access to the workspace and to present only the options that are necessary and relevant to the current action.
The left menus control workspace, work mode, and objects while.
The right menus control the behavior and settings for slicing, path routing, and path to code exports.
[OBJ](https://www.cs.cmu.edu/\~mbz/personal/graphics/obj.html), [STL](https://en.wikipedia.org/wiki/STL\_\(file\_format\)), and [3MF](https://docs.fileformat.com/3d/3mf/) files import natively. [SVG](https://en.wikipedia.org/wiki/Scalable\_Vector\_Graphics), [JPG](https://en.wikipedia.org/wiki/JPEG\_File\_Interchange\_Format), and [PNG](https://en.wikipedia.org/wiki/Portable\_Network\_Graphics) are auto-extruded into a 3D parts.
![A minimalist approach](/img/kiri-moto.png)
In CNC mode, there is an additional storyboard menu at the bottom where you can plan and re-order milling operations.
![](/img/kiri-moto-cnc.png)
The Setup menu offers access to Device selection and customization.&#x20;
![Device Dialog](/img/device-dialog.png)
Application preferences are mode-dependent. For example, CNC preferences show animation controls.
![CNC Mode Preferences](/img/preferences-cam.png)
![FDM Mode Preferences](/img/preferences-fdm.png)

View file

@ -0,0 +1,18 @@
---
description: Kiri:Moto supports localization through a single easy-to-extend dictionary
---
# Localization
If you are interested in adding a new language to Kiri:Moto's interface, follow the directions on this page to setup a local dev environment:
[https://github.com/GridSpace/grid-apps](https://github.com/GridSpace/grid-apps)
Then create a copy of the [`web/kiri/lang/en.js`](https://github.com/GridSpace/grid-apps/blob/master/web/kiri/lang/en.js) file with the new file using either a two-letter or compound language-country code (like `en-us.js`) and put it in the same `lang` directory.
Replace all values with correct localized values and submit a [pull request](https://github.com/GridSpace/grid-apps/pulls) to have it included in the official Kiri:Moto code-base.
If you have the time, please consider also localizing `web/kiri/lang/en-help.html`
Test your language by appending `?ln:XX` to your local URL where `XX` is the name of your language file _without_ the `.js` extension.

View file

@ -0,0 +1,27 @@
---
description: There are two primary ways to send jobs from Kiri:Moto to OctoPrint
---
# OctoPrint
## Grid.Space OctoPrint Plugin
Available through the OctoPrint plugin interface and on [GitHub](https://github.com/GridSpace/OctoPrint-GridSpace), this plugin allow zero-configuration printing to any local OctoPrint server directly from Kiri:Moto. Grid:Local must be selected under Preferences for local servers to show up in the export dialog.
![](/img/gridlocal.png)
The `send` button will spool a print directly to OctoPrint where it will sit under local `Files`. The `admin` button will open a browser window to the OctoPrint interface.
![](/img/gridsend.png)
## Local Sending
OctoPrint has a web api endpoint that can be configured on `Export` when enabled.
![](/img/octoprint.png)
This will result in the following dialog section to appear in the export dialog.
![](/img/opexport.png)

View file

@ -0,0 +1,27 @@
---
description: For Classrooms and Shared Workstations, Maintain Consistent Setups
---
# Shared Profiles
[Kiri:Moto](https://grid.space/kiri/) stores all settings in our browser's local cache. There are times when you want to share settings between computers or setup a master config that is shared in classroom settings. In order to facilitate this, Kiri:Moto provides two hot keys and a URL short-cut for loading a default configuration at the time the application page loads.
* `U` key (uppercase) to get a unique settings key
* `u` key (lowercase) to restore a setting with a given key
* append `#key` to Kiri's URL to load the app with a given key
Using the last method, you can create a master settings configuration then give our or link to Kiri with an url that looks like:
[https://grid.space/kiri/#setting/ver](https://grid.space/kiri/#setting/ver)
where `setting/ver` comes from the unique settings dialog. You may notice that when you use the `U` hot-key, Kiri's URL changes in your browser to reflect the settings key.
## Remote Load
`https://grid.space/kiri/?wrk:[domain]/[path]`
the content _must_ be delivered over https and CORS header `Access-Control-Allow-Origin` must be set to `grid.space` or `*`
## Onshape
When using Kiri:Moto inside of Onshape, Kiri's settings are automatically persisted on the server and associated with your Onshape User ID. That way when you access Kiri in Onshape from another computer, your settings are automatically imported.