
*****IMPORTANT *****

Make sure there's no filament loaded when plotting!

Pay attention to the print and be ready to switch off printer if simething goes wrong (eg. going too low and scratching the plate). This should not happen with default configs, but be careful regardless.

Use at your own risk! This is an experimental project that can potentially cause damage if there's a config error. I take no responsibility for any damages incurred while using this software.

Tested with default Bambu Studio 2.7.1.57 settings (factory defaults for gcode generation).

Visit harvestsoon.xyz for further information.

This is a Beta version, made available to the public for testing purposes.

Harvest Soon ToolBox Plotter
--------------------------------------
This project turns your 3D printer into a more versatile DIY machine by using a special toolhead support (that can remain installed even while 3D printing) combined with a processing application (runs standalone or within your slicer).
It is currently in Beta development stage.
Right now it provides the core plotting functionality with a pen. It also has a preview mode, calibrating and setting height (Z axis) and a speed factor option.
It can take input data from the slicer (ie. set and tweak your design in the slicer, as you would normally do for 3D, and let the processor turn it into a 2D project).

No cloud or account required. This software runs locally without sending any of your data to the internet.

A1 and A1 Mini support only, for now.

One neat extra feature: the kit extends the original print area so, the A1 Mini for example, will be able to plot up to 200 by 185mm (as opposed to the normal 180x180)

This is what's coming next:
- improved preview (to better mimic the final result of each tool)
- multiple color management (with manual switch)
- improved preview editing, including mixing multiple inputs to compose complex multi-tool projects
- cutter and engraver tweaks
- dual tool head with automated switching (combining same or different tools, like two colors or a color and a cutter)
- support for more printers
- more customisation options
- experimental features

Requirements
------------
A1 or A1 mini printer
Windows
BambuStudio or compatible slicer with post-processing scripting option

Install
-------
Unzip into a folder, eg D:\toolbox

Note that your slicer might warn you about running third party scripts. That's a fair warning.
This program intends no harm, but a configuration mistake or bug could force the stepper motors out of bounds (be ready to quickly cancel / switch off the printer for that scenario).

You can use the simplified tool holder straight from the slicer (some settings will need to be tweaked manually) without using the Toolbox software, but you won't get the extended features it provides.

Usage
-----
While the Toolbox Plotter can run as standalone, generating gcode files that you then manually send to the printer (or integrate within your  own ecosystem, off-line corporate clouds),
the recommended route is to add the Toolbox into your slicer (as a post-processor) so that it runs automatically when you slice, ready to send to the (now temporarily 2D) printer.

Then there are two ways you can use the Toolbox Plotter: 

*** Method 1: Processing the 3D input generated by Bambu Studio (or other slicer) to convert it into a suitable 2D project (with settings tweaked to the tool in use), slice and send to print
	
Create a new project in your slicer and add the following line to your Post-processing scripts list (in Bambu Studio with dev mode enabled, this list is available from Global>Others):
"D:\toolbox\ToolboxCrafts.exe" profile="D:\toolbox\profiles\BambuA1.cfg" verbose preview zMinMax=1.3#4 osmPath="D:\toolbox\tmp.osm"

There are some parameters you can add (see Profiles section below), right before the profile path.

For example, you can activate a preview that gives a better aproximation of the resulting print (but remember to remove this option and slicing again before sending to print!):
"D:\toolbox\ToolboxCrafts.exe" profile="D:\toolbox\profiles\BambuA1.cfg" preview

Or change zMinMax values:
"D:\toolbox\ToolboxCrafts.exe" profile="D:\toolbox\profiles\BambuA1.cfg" zMinMax=0.9#3 preview 


Add svg or stl files to your project. Only the first layer will be printed. The rest will be ignored.

The printer will pause after each object so that you can swap the pen to a different color/size for the next object.
Each object is printed in the order it was added (keep that in mind when planning color changes)

Your slicer will give you plenty of options to tweak the look of your printed design.
Use Strength>Wall size, bottom paint layers, infill type and density, for example, to do so. 
You will need to use the preview option to see those effects.

Setting the line width to the minimum will slice at maximum definition (best for small fonts and details), but results will depend on the actual tool tip width.
Note that the width needs to apply to the first layer, as that's the only one that will be printed.
In the same way, only effects on the first layer will be applied. For example, changing top layer pattern won't do anything, as only the bottom layer pattern option will be taken.

In general, it is easier to obtain highly detailed results using the Toolbox conversions instead of the slicer project data, particularly for technnical projects.
For less precise (art?) work, both workflows are suitable, although currently using the familiar slicer UI is the easiest to create a composition.
That said, I'd highly recommend using other external tools like Inkscape or Gimp to create the source project and then export into the slicer / Toolbox.

Keep in mind the pen is drawing with an offset from the hot end. This means about 1-2cm of the plate bottom side cannot be used for printing.

When slicing, make sure the toolbox processor ran correctly, without errors (a console window opens up while running, indicating processing steps, if the verbose paramater is set).

*** Method 2: Use the internal conversion options to skip the output generated by the slicer and replace it with a 2D project based on the conversion.
	The Toolbox can convert images (PNGs), cad files (DXF) and maps (OSM)
	
Aside from taking input from your slicer, the ToolboxPlotter can also directly convert pngs, dxfs... and even map addresses, into beautiful plots.
Using this method, you can better integrate design tools (like Inkscape or Gimp) into the creative workflow. Or go with a quick project and produce an idea in minutes, using an existing asset.

Image conversion:
Set image path, threshold (to convert into black and white) and trace type (edge or centerline), slice, review and send to printer.

ToolboxCrafts.exe verbose preview zMinMax=1.5#4 profile=A1Mini.cfg pngPath="edge#0.7#C:\Images\HolidaysInBlackAndWhite.png"

DXF conversion:
Dxf is a high precision format that can deliver high definition plots. Set dxf file path, slice, review and send to printer.

ToolboxCrafts.exe verbose preview zMinMax=1.5#4 profile=A1Mini.cfg dxfPath="C:\cad\plumbus.dxf"

Map conversion:
Option A:
Set OSM file path (map data exported from openstreetmaps.org), slice, review and send to printer.

ToolboxCrafts.exe verbose preview zMinMax=1.5#4 profile=./A1Mini.cfg osmPath="C:\documents\trailRoute.osm"

Option B:
Set an address, radius in meters and type (walk, drive, bike, all), slice (the Toolbox will fetch the OSM map automatically), review and send to printer.

ToolboxCrafts.exe verbose preview zMinMax=1.5#4 profile=./A1Mini.cfg mapAddress="2500#bike#Montserrat Catalunya"

By default, the print will cover the whole printable area (set in the printer profile). You can change that by adding the boundary parameter, so for example, the following line:

"D:\toolbox\ToolboxCrafts.exe" profile="D:\toolbox\profiles\BambuA1.cfg" zMinMax=0.9#3 preview verbose boundary=40#140#45#150 pngPath=./test.png

Will print saling to fit the defined box going from x, y -> 40, 45 to x, y 140, 150

Calibration
-----------
The kit is designed to require minimal calibration (results may vary depending on the quality and tolerances of the printed parts).

The printed parts include calibration and adjustment tools to help the process. You can easily mount the calibration part for a quick test to ensure distances are right.

The first time you use a tool, make sure you calibrate (you have measuring parts for 0.5, 1, 1.5 and 3mm) and adjust the zMinMax parameter accordingly.
For example, if the calibration tool touches both extruder and tool tip at 1mm, then you set zMinMax=1,3 (second number is the jumping height between movements with inactive tool)
Better yet, you start with some margin, like zMinMax=1.1,4, slice and send to print. The toolhead should slightly miss the material to print, then adjust to a lower zMin.

If zMin is set to high the tool won't touch the material, or barely do, leaving some traces.
If zMin is set too low the tool will hit the material too hard, possibly damaging the tool tip and or the material. The spring system does give 1-2mm of margin for error, but best to tune each specific tool, taking into account width, bending, etc...

If you want to use other, custom tools, you will need to calibrate accordingly. If you already have other tool mounts (there are actually quite a few mounts available for plotting) you can use them as long as you properly calibrate for them.


Profiles
--------
There's a settings profile file for each printer supported by the Toolbox. Currently there's BambuA1Mini.cfg and BambuA1.cfg, but virtually any other printer can be added, adjusting the profile settings (check section below, advanced settings).
In this file, you can also add the same parameters that you can also add as execution parameters (execution parameters takes priority, so if you have zMinMax=1.5,6 in BambuA1.cfg and execute with 'harvestSoonToolboxPlotter.exe verbose preview zMinMax=0.9,2 profile=./profiles/BambuA1.cfg source.gcode' it will use the latter, 0.9 and 2 values.

You can edit the profile config (in installFolder\profiles) to change the following parameters:

zMinMax
Z values (height in mm, where 0 is low enough to cause damage to the bed plate, careful!) for drawing (pen in low position) and not drawing (pen in high position)

speedFactor
Speed multiplier, a convenient way to speed up or down the whole process. Somewhere between 0.5 and 1.5 should be file

You can also include the parameters described to convert content for printing.

Advanced Profile Settings
-------------------------
***Warning*** These settings are for users with good understanding of how 3D printers work, down to its gcode movements language.

The default profiles provide printer specific settings for BambuLab A1 and A1 Mini printers. If you have access to other printer models (and slicers), you can change these settings to suite them.

usefulBlocksIdentifiers
Will include the gcode blocks marked with START / END for processing. Any other gcode will be discarded

startBlock, endBlock
Sets the initialization gcode to use right before the processed useful blocks and the end gcode to use right after the processed useful blocks

boundarySafe
Sets the print area where projects can be safely printed as per the original specifications, and accounting for the added offsets of the Toolbox support.

boundaryExtended
Sets a larger print area, exceeding original printer limits (for printing) and making use of the '3D printing feature' margins.
For example, by removing the purge wiper and placing a larger print plate on the A1 Mini, you gain 20mm for printing on the left side.
The larger plate will also cover the toolhead offset and add an extra 5mm print are on the front (Y axis).

Hardware
--------
Print the parts included and install. Tolerances are low. Make sure there are no blobs or imperfections sticking out of the moving parts. Sand if moving parts are not moving smoothly as they should.

Main Parts:
- Extruder front cover
Designed to replace A1 and A1 mini extruder cover. It has rails to easily add or remove a casing.

- Sliding tool holder casing
Casing for the springed toolholder.

- Sliding tool holder with spring
Springed holder. Different versions to match different tools.
Using the Toolbox and this tool holder provides an improved user experience, with easier calibration and tool switches mid-project (eg. combine multiple colors or pen widths, draw then cut, etc.)

- Non-Sliding tool holder with spring
Simplified version. Works without the Toolbox software, just using your slicer (but the slicing settings need to be carefully adapted).
When the printer does a homing calibration, the tool tip will hit the. The spring mechanism will absorb the impact, but you should place a protective sheet on the material to be printed or use a cap on the tool tip (as otherwise it'll leave a mark).
One of the advantages of using the Toolbox is it changes the calibration step to account for the tool in use (hiding it during the calibration).


See included pictures for details on assembly and installation.

The currently supported pens are the following:
Pilot V5
Carioca Birello double tip felt pens

More will be added (open to requests), not just pens but cutters, small drills, etc

Known bugs
----------
- The end block needs some fixing as it is not currently being executed properly (it does complete the print though).
- Haven't found a way to avoid bed / hot end heat up at certain points. It is shut down as soon as possible, but unable to cancel completely.
- If the post-processor is set (in General>Objects>Post-processing) while changing Bambu Studio profile (eg. default 0.20 to fine quality 0.08), Bambu Studio will crash. Current workaround is to remove the processor, do the change and then add it back.

Tips
-----
Print size can be a bit larger than for 3d printing, and you can recover the lost Y margin by placing the plate past the bed. Recommended to buy a plate slightly larger than the ones for your printer to maximize print area.
Disable brims, supports, rafts...
Best to use a smooth PEI plate, not a textured one.

Show and tell
-------------
I'm not an artist, I'm an engineer, but I love the creative possibilities this Toolbox brings. And I'm looking forward to see what creative minds can come up with.
If you create something using this Toolbox, please share! Send me some photos and details about the project, or a link to social media (@loxai0)

I hope you bring a lot of ideas to life with the Toolbox, stay tuned for updates!

Third party libraries
---------------------
Uses fonts from https://github.com/Stypox/text-to-gcode
Uses matplotlib, numpy, scipi, ezdxf, opencv2
Uses openstreetmaps and nominatim