... | ... | @@ -90,11 +90,11 @@ The setting's value can then be queried in file ```printer.lua``` of the printer |
|
|
|
|
|
This file specifies how the profile produces g-code that is specific to the printer. This is done through lua functions that are called by IceSL whenever the print process demands it. The list of functions to implement are the following:
|
|
|
|
|
|
| Function| Description |
|
|
|
| Function | Description |
|
|
|
| ------ | ------ |
|
|
|
| ```header()``` | called at beginning of gcode file creation |
|
|
|
| ```footer()``` | called at end of gcode file creation |
|
|
|
| ```comment(c)``` | called when outputting a comment ```c``` in the gcode file |
|
|
|
| ```header()``` | called at beginning of the G-code creation |
|
|
|
| ```footer()``` | called at end of the G-code creation |
|
|
|
| ```comment(c)``` | called when outputting a comment ```c``` |
|
|
|
| ```layer_start(z)``` | called at the start of a layer at height ```z``` |
|
|
|
| ```layer_stop()``` | called at the end of a layer |
|
|
|
| ```extruder_start()``` | called before extruding |
|
... | ... | @@ -113,9 +113,64 @@ This file specifies how the profile produces g-code that is specific to the prin |
|
|
| ```set_and_wait_extruder_temperature(ext,temp)``` | called when setting the extruder ```ext``` temperature to ```temp``` while waiting |
|
|
|
| ```set_mixing_ratios(ratios)``` | called when setting the mixing ratios of each filament feeding onto the mixing extruder; ```ratios``` is a table containing the ratio for each filament. This function is only called when using color mixing |
|
|
|
|
|
|
### Helper functions
|
|
|
|
|
|
IceSL provides a number of lua helper functions to facilitate the writing to gcode. These function can be used in ```printer.lua```. The following is a list detailing these functions:
|
|
|
|
|
|
| Function | Description |
|
|
|
| ------ | ------ |
|
|
|
| ```file(filename)``` | returns the contents of file ```filename``` as a string |
|
|
|
| ```error(string)``` | outputs error ```string``` to the console (only available in IceSL-Slicer) |
|
|
|
| ```f(number)``` | converts ```number``` to string with precision of three (3) decimals |
|
|
|
| ```ff(number)``` | converts ```number``` to string with precision of six (6) decimals |
|
|
|
| ```fff(number)``` | converts ```number``` to string with precision of nine (9) decimals. It is recommended to use this function when outputting the quantity to extrude |
|
|
|
|
|
|
### State variables
|
|
|
|
|
|
When implementing the lua functions for G-code production, the user can access all printing settings used while slicing. Settings with *boolean*, *integer* or *float* values as well as custom settings defined in ```features.lua``` can be queried/polled.
|
|
|
|
|
|
Additionally, IceSL provides other useful variables that are also accessible. We detail them next:
|
|
|
|
|
|
| Variable | Type | Description |
|
|
|
| ------ | ------ | ------ |
|
|
|
| ```number_of_extruders``` | integer | number of extruder on the printer |
|
|
|
| ```extruders``` | table of integers | extrudes assigned to tools |
|
|
|
| ```filament_diameter_mm``` | table of floats | filament diameter for each extruder |
|
|
|
| ```filament_priming_mm``` | table of floats | filament priming for each extruder |
|
|
|
| ```number_of_layers``` | integer | total layers of print |
|
|
|
| ```layer_id``` | integer | current layer |
|
|
|
| ```filament_tot_length_mm``` | float | current filament consumed |
|
|
|
| ```time_sec``` | integer | current (estimated) printing time |
|
|
|
|
|
|
Variables that specify the printing geometry also exist:
|
|
|
|
|
|
| Variable | Type | Description |
|
|
|
| ------ | ------ | ------ |
|
|
|
| ```min_corner_x``` | float | lower-left corner of geometry to be printer (X coordinate) |
|
|
|
| ```min_corner_y``` | float | lower-left corner of geometry to be printer (Y coordinate) |
|
|
|
| ```extent_x``` | float | size of geometry to be printer (X coordinate) |
|
|
|
| ```extent_y``` | float | size of geometry to be printer (Y coordinate) |
|
|
|
| ```extent_z``` | float | size of geometry to be printer (Z coordinate) |
|
|
|
| ```gcode_to_model_x``` | float | distance transformation from G-code view to geometry view (X coordinate) |
|
|
|
| ```gcode_to_model_y``` | float | distance transformation from G-code view to geometry view (Y coordinate) |
|
|
|
| ```gcode_to_model_z``` | float | distance transformation from G-code view to geometry view (Z coordinate) |
|
|
|
|
|
|
|
|
|
|
|
|
Utility information is also available by means of variables:
|
|
|
|
|
|
| Variable | Type | Description |
|
|
|
| ------ | ------ | ------ |
|
|
|
| ```printer_name``` | string | printer name |
|
|
|
| ```filename``` | string | G-code output file name |
|
|
|
| ```Path``` | string | path to ```printer.lua``` |
|
|
|
| ```slicer_name``` | string | name of slicer used (i.e., 'IceSL') |
|
|
|
| ```slicer_version``` | string | slicer version used |
|
|
|
| ```slicer_build_date``` | string | build date of slicer used |
|
|
|
|
|
|
## Material and Profiles
|
|
|
|
|
|
These are specialized printing settings for specific situations or materials. They are located in either ```profiles``` or ```materials``` subdirectories inside the printer profile folder.
|
|
|
These are specialized printing settings (similar to ```features.lua```) for specific situations or materials. They are located in either ```profiles``` or ```materials``` subdirectories inside the printer profile folder.
|
|
|
|
|
|
They do not possess a naming convention but they do have to keep a ```.lua``` extension.
|
|
|
|
... | ... | |