I've been looking at this again, and am working on an update which will add support for 3D printing à la fullcontrolgcode.
3D printing requires control of the extruder, and matching volumetric calculations (or, more accurately, volumetric calculations which then determine the rate of extrusion).
Previewing in 3D/programming for 3D extrusion will likely want previewing not just the extruded shape, but also tracking the volume of material extruded and how it relates to the volume of the object being filled/the intersection of a just-extruded region with previously extruded material, and how large a void is left (presumably those two volumes would match up).
One concern is that G2/G3 support apparently is not common/guaranteed in 3D printer firmwares:
>available if a gcode_arcs config section is enabled
While it is possible to separately control the feed rate of the extrusion, and the length of material extruded:
G1 F100 E5 ; Extrude 5 mm of filament at low speed to prime the nozzle
The normal usage is to move at a preset Feed rate in terms of motion, and while that movement is being made, extrude a given length of material:
; --- First layer adhesion test ---
G1 Z0.2 ; Move nozzle to first layer height
G1 X10 Y10 F3000 ; Move to starting position
G1 F1800 ; Set slower speed for first layer
G1 E0.8 ; Slight retraction before starting
G1 X100 E10 ; Draw a line along X to test bed adhesion
; Comment: This line helps verify that the first layer sticks properly
My understanding is, in theory, if one had a layer height equal to the diameter of the filament, and wanted to extrude a circular cross-section of filament, the value for E would be equal to the distance traveled.
Apparently, the firmware control is limited so that the extrusion rate cannot be varied relative to the feed rate so that one could for example, decrease the speed, resulting in a trapezoidal extrusion.
Given all that, the idealized (normalized?) shape and dimensions of the extrusion would be controlled by:
- layer height (for height along Z)
- extrusion rate (for width in X/Y)
which would be previewed as a rounded cross section, so it should work to create a preview by calculating the volume of material which is being extruded, then determining the volume of a circle of radius layer height/2, subtract that from the extruded volume, then determine what width of rectangle cross section would be necessary at the specified length to make up the difference.
which should be enough to sleep on....
William