A set of workflows to transform geometric objects and voxel-based models into 3D-printable G-code instructions.
Voxel2GCode
is a project which aims for a flexible, customizable workflow for 3D printing, which started as part of the Material Gradients with Monolith project by Nono Martínez Alonso while working with the Autodesk Generative Design Group, during the summer of 2016.
The project facilitates the generation of custom printing and slicing workflows, in an effort to simplify the delivery of instructions to 3D printers and the fabrication of artifacts from geometric objects and voxel-based models with low cost multi-material 3D printers.
In a nutshell, Voxel2GCode provides five tools:
- Voxel2GCodeCore as a standalone .NET library.
- Voxel2GCodeRhinoCommon for scripting with C# using RhinoCommon.
- Voxel2GCodeGH as a Grasshopper for Rhino plugin.
- Voxel2GCodeDesignScript for scripting with C# using DesignScript.
- Voxel2GCodeDynamo as a Dynamo package.
- Voxel2GCode.zip
- The voxel utilities of V2G require you to install Monolith, everything else should work fine without it.
- Copy and paste all files inside the
Voxel2GCode for Grasshopper
into your Grasshopper components folder -- accessible viaGrasshopper > File > Special Folders > Components Folder
. - (In case you want to use the voxel components you'd have to install Monolith.)
- Open a new Dynamo document.
- Under the nodes tab, click on
Import
, and select theVoxel2GCode for Dynamo.dll
library. - (In case you want to use the voxel components you'd have to install Monolith.)
- You can use the
Voxel2GCodeCore.dll
library, for instance, as a reference in your C# project, or to script inside Grasshopper components. - (In case you want to use the voxel components you'd have to install Monolith.)
A .NET library to write G-code instructions from geometric objects.
- V2GModel
- V2GPath
- V2GSettings
- V2GSlice
- V2GState
- V2GPoint
- V2GLine
- V2GCurve
- V2GVoxelPoint
Geometric objects augmented with printing metadata.
- V2GPrintable
- V2GPrintPosition
- V2GPrintPolyline
- V2GInstruction
- V2GMovement
- V2GPrintSegment
- V2GGeometry
- V2GMath
- V2GPrint
- V2GVoxel
A .NET library for RhinoCommon-specific functions of Voxel2GCode. It subclasses and expands classes of the Core library to use specific RhinoCommon functions.
- V2GRhinoCurve
- V2GRhinoGeometry
A Grasshopper for Rhino plugin.
- Construct PrintPoint
- Construct PrintPolyline
- Construct Printer
- Construct Printing Settings
- Construct Printer
- PrintingBoundaries (TODO)
- Export G-code (TODO)
- Extract PrintPolylineData
- Sort Curves
- Get Bounding Frames
- Get Slice Planes
- Construct VoxelPoint
- Get VoxelCurvePoints
Implementation of Voxel2GCodeLib for Grasshopper.
A .NET library for DesignScript-specific functions of Voxel2GCode.
- V2GDesignScriptCurve
- V2GDesignScriptGeometry
A ZeroTouch Dynamo package.
- PrintPoint
- PrintPolyline
- PrintPolylineData
- Printer
- PrintSettings
- Export
- CurveSort
- CurveSinusoidalPoints
Here are a few examples on how to use the library for scripting, with Grasshopper for Rhino, and with Dynamo. More in detail examples are being developed.
// Create a printer
V2GState printer = new V2GState();
// Create a printable model
V2GModel model = new V2GModel();
// Create a list of points to hold positions
List<V2GPoint> positions = new List<V2GPoint>();
// Add positions
positions.Add(new V2GPoint(25.0, 40.0, 0.0));
positions.Add(new V2GPoint(30.0, 45.0, 0.0));
positions.Add(new V2GPoint(35.0, 40.0, 0.0));
// Create a printable polyline
V2GPrintPolyline printPolyline = new V2GPrintPolyline();
foreach(V2GPoint position in positions) {
Print(position.ToString() + " " + position.X);
printPolyline.AddPrintPosition(position);
}
// Append the printable polylines as paths to the model
model.AppendAsPath(printPolyline);
// Create a StringBuilder to store G-code
System.Text.StringBuilder sb = new System.Text.StringBuilder();
model.GenerateGCode(sb, printer);
// Create a string with G-code
string GCode = sb.ToString();
// Create a printer
V2GState printer = new V2GState();
// Create printing settings
V2GSettings settings = new V2GSettings();
// Override some parameters
settings.T0Temperature = 220.0;
settings.BedTemperature = 80.0;
settings.ZOffset = 0.5;
settings.Retraction_Length = 0.3;
// Attach the settings to the printer
printer.SetSettings(settings);
Grasshopper and Dynamo sample files will be posted soon.
The development of Voxel2GCode was sponsored by Autodesk Inc, as part of a summer research residency project in Boston, 2016. Please take a look at the detailed list of acknowledgments.
Voxel2GCode was created and is maintained by Nono Martínez Alonso.
Voxel2GCode is licensed under the MIT license.
I'm Nono Martínez Alonso (nono.ma), a computational designer and architect with a penchant for simplicity.
I tweet at @nonoesp and write at Getting Simple. If you use Voxel2GCode, I would love to hear about it. Thanks!
In its early stages, Voxel2GCode sets a base structure for growth and flexibility. Any kind of contribution or collaboration is welcome. If you are interested in playing around with this library shoot me a tweet.