4. Export Components - machineagency/Vespidae GitHub Wiki

Export Components

Export components are responsible for turning Vespidae Objects into printer-readable G-Code, setting up machine parameters into G-Code headers, and exporting this G-Code through various upload or streaming options. These components include:

Vespidae Objects to G-Code
Machine Parameters
Upload G-Code
Stream COM


Vespidae Objects to G-Code

This converts Vespidae objects to final G-Code to send to a printer. The G-Code can either be sent directly to a printer using the Upload or StreamCOM components, or manually copy-and-pasted into a file to save to a USB. If you would like to manually copy and paste, attach the output to a panel, right-click the panel, click "Copy Data Only", and paste it into a text editor. Save the file with a .gcode filename.

Inputs

VObj (Vespidae Object): Vespidae Objects to be converted into G-Code. h (string): Additional strings to append to the beginning of the G-Code. Useful for setting up machine headers, comments, or additional setup procedures. f (string): Additional strings to append to the end of the G-Code. useful for setting up machine footers, comments, or additional shutdown procedures. abs (boolean): Sets if the G-Code should use absolute extrusion for E commands. If false, uses relative extrusion. toolchange? (boolean): Sets if the G-Code should account for tool-changing. Defaults to false. If true, adds appropriate T# commands based on Tool ID.

Outputs

Gcode (string): G-Code output.

Vespidae Objects to G-Code


Machine Parameters

Defines relevant machine settings to auto-generate a G-Code header.

Inputs

Max XY Accel (mm/s2) (double): XY max acceleration. Max Z Accel (mm/s2) (double): Z max acceleration. Max E Accel (mm/s2) (double): For extruder. Max XY Feedrate (mm/s) (double): XY max feedrate/speed. Max Z Feedrate (mm/s) (double): Z max feedrate/speed. Max E Feedrate (mm/s) (double): E max feedrate/speed. Starting Print Accel (mm/s2) (double): Starting print acceleration. Starting Retract Accel (mm/s2) (double): Starting retract acceleration. Starting Travel Accel (mm/s2) (double): Starting travel acceleration. Jerk XY Limits (mm/s) (double): Jerk XY limits. Jerk Z Limits (mm/s) (double): Jerk Z limits. Jerk E Limits (mm/s) (double): Jerk E limits. Bed Temp (degC) (int): Starting bed temp (degC). Toolchanger? (bool): Determines if printer is tool-changer. Absolute XYZ Coordinates (bool): Determines if coordinates should be in absolute or relative coordinates. Absolute Extrusion (bool): Determines if extrusion should be in absolute.

Outputs

Gcode (string): A header to add to generated G-Code.

Machine Parameters


Upload G-Code

Uploads the G-Code to a machine as a .gcode file through an IP connection.

Inputs

gcode (string): G-Code to upload to machine. fn (string): Filename for the G-Code. ip (string): IP Address of the machine to upload to. Defaults to 127.0.0.1. dir (string): Directory to upload the file at the IP address specified. send (bool): When true, begins the upload process. testDir (bool): When true, returns the directory at the IP address specified. Used for helping to determine correct directory for upload.

Outputs

res (string): Returns null or the directory at the specified IP address.

Upload G-Code


Stream COM

Streams the G-Code in real-time to a device using a COM serial port connection.
NOTE: This is a single-threaded operation, so Grasshopper will not respond while it is streaming. To stop the stream you will need to wait for the print to finish or unplug the connection. This is due to Grasshopper being a single-threaded process, but we will look into ways to make this asynchronous with button interrupts in the future.
NOTE: To set the COM port, right-click on the component and select the COM port you want to connect to.

Inputs

gcode (string): G-Code to upload to machine. send (bool): When true, begins the upload process.

Outputs

res (string): Currently returns null. Can be used for outputting exceptions in the future.

Stream COM


⚠️ **GitHub.com Fallback** ⚠️