Can carving templates be produced from G-code? I am looking for a way to generate 2D horizontal templates for manually carving an object. My thought was to produce an STL of the model, generate the G-code, and then transform that into slices. Appreciate any suggestions for where to start. I'm not afraid of getting my hands dirty with python, R, matlab, whatever.
Carving decorative patterns?
If your templates needs to be used like one does a stencil, that's doable... but paper-thin is not as you can't make that with an FDM printer.
But if you allow 0.2 or even better, 0.5 mm thickness, it is as simple as making a vector graphic, importing it into a suitable CAD package, then extruding it to the relevant thickness, and sending it into the printer.
If you really need it to be thinner, invest in a vinyl cutter, and use the same vector graphic to cut a foil template for one use. Upside: you could use the vinyl to etch the patterns in metal.
Carving figurines?
Yes, that's possible too, even easier! Make a 3D model of the finished object in a CAD or 3D modeling software. Either cut up the model right there and export each slice as STL for the printer, or export the whole model and use a secondary software such as MeshMixer to do plane cuts onto the model.
The slices should be at least 0.5 mm thick to allow handling.
It might also be a good idea to use the same model and cut it from a cube, which then is sliced up - that way you get a pattern to press against the outside of the model.