Shopbot Machine Code and Visualization

The objective of this tutorial is to present the process of machine code generation for the Shopbot router and to demonstrate how to visualize the path using basic animation techniques.


Code Generation Phase

The above pictured diagram shows the setup required for processing a list of polylines into machine code for the Shopbot. The code below initializes the machine, emits an entry/exit point per polyline setting the Z coordinate to the clearance plane to ensure clean transfers. Each point of each polyline is emitted as text and also collected in the geometry list.

Visualization Phase

The goal of this script is to create a persistent counter which can be used in conjuntion with the List Item component and Timer component to sequentially play back simple animations. This is a general purpose strategy and it can be adapted for many other types of simulations and visualizations.

The following program contains effectively two lines of code. A class scope declaration of a counter variable is used to retain the value before/after the script execution is complete. The script itself increments and resets the internal counter variable and exports the value through the index reference parameter.