SVGOCODE logo, containing the program's name as text with an incomplete border. A pen is shown at the top of the border, making it look like the border is currently being drawn.

3D printers can do a whole lot – and I’m not the first person to convert one into a penplotter. While starting my conversion project, however, I was quickly dissatisfied with the tools available online.

For this reason, I both designed my own pen-holder for Longer LK5 Pro printers and, more importantly, created a decent SVG to GCODE converter, allowing me to quickly materialize any vector graphics. With this blog post, I release SVGOCODE, the versatile SVG to GCODE converter.

SVGOCODE#

SVGOCODE is written entirely in Go and boasts its own SVG parsing capabilities. For installation instructions and the full feature set, check out the GitHub repository .

I found existing SVG to GCODE converters to each lack crucial features, such as

  • conversion of full SVG files,
  • customization for own printer settings, or
  • support for transform attributes.

While SVGOCODE doesn’t implement the complete SVG standard either, it does all of the points above - and more:

  • Its support for custom plotter profile facilitates calibration (pen draw / pen retract height, offsets, boundaries, speed) and offers the definition of custom Gcode initialization / exit commands.
  • To reduce travel distance in-between Gcode-converted SVG shapes, users can choose from multiple optimization / sorting algorithms.
  • Its modular implementation allows easy extension with additional conversion / optimization modules.
  • Its SVG parser (and other parts) can be used as Go library in your own projects.

Please refer to the repository for instructions on defining plotter profiles, choosing optimization algorithms, etc.

So far, I could produce prints via SVGOCODE very easily. I plan to extend this blog post with a corresponding gallery in the near future.

However, I cannot claim that SVGOCODE gets its job done universally, as my testset only covers a fraction of what is possible with SVG (cf. the elaborate disclaimer in the repository). For any bug you find, please raise issues or create pull requests on GitHub.

Pen Holder#

I gladly share my pen holder design for the Longer LK5 Pro printer. The design is illustrated in the following picture:

Rendering of the 3D-printed penholder

It consists of a moving part (red) that grips to a pen using the two triangular wedges. The base can be attached to two screw holes at the printing head.

Downloads:

Please note: between the pen holder base and the printing head, some spacers (\(\geq 1\)cm) are required to prevent collisions with one of the printer’s homing sensors. The generic hexagon brass spacers do the job perfectly.

The moving part and base both have notches that allow the installation of a rubber band - a cheap way to apply tension on the system, pressing the pen’s tip against paper with a controllable force.

I recommend to print the wedges in the orientation pictured in the rendering above. This way, the filament layers create a stepped slope that, during mounting in the moving part, allow each wedge to click into place - securing the pen and itself.

Conveniently, SVGOCODE is equipped with a default plotter profile for the Longer LK5 Pro printer, so minimal calibration is required for your new pen plotter.

So far, I have tested the setup with STABILO®’s point 88 F pens and find them perfectly suited for the task.

Note that this design is in its very first iteration. I plan to improve it in the future and fix some problems. E.g., the current design is prone to some lateral slack that one must counter manually.