Hello,
I’m very new to grasshopper so I’m still not completely comfortable with the paradyme. Please excuse stupid questions. I am playing around with 3d print slicing.
In gcode produced by 3d printing slicers, the E value is a function of the XYZ. We have to tell the printer how much goo to extrude between the two points.
G1 X34.726 Y33.117 E0.06435
G1 X35.29 Y32.806 E0.09648
G1 X35.889 Y32.568 E0.12864
G1 X36.513 Y32.405 E0.16082
G1 X37.462 Y32.3 E0.20845
G1 X86.793 Y32.3 E2.66958
G1 X87.565 Y32.311 E2.7081
G1 X88.208 Y32.36 E2.74028
I am struggling to work out how I can acheive the same thing in grasshopper.
G1 F1200 X25 Y0 Z0 E1
G1 F1200 X24.950668 Y1.569763 Z0 E1
G1 F1200 X24.802868 Y3.133331 Z0 E1
G1 F1200 X24.557181 Y4.684533 Z0 E1
G1 F1200 X24.214579 Y6.217247 Z0 E1
G1 F1200 X23.776413 Y7.725425 Z0 E1
G1 F1200 X23.244413 Y9.203113 Z0 E1
G1 F1200 X22.620677 Y10.644481 Z0 E1
I have
Cylinder → Contours → Divide Curve → Flatten Tree → Point deconstruct → concatenate.
If I were doing this in Python I would iterate over the output of Flatten tree, working out the distances between each XYZ and writing E as a function of that distance.
Please could I have some pointers of example of how to do this kind of list iteration or perhaps explain a nice, more grasshoppery way of calculating something from my list of XYZs.
Ta,
Andrew
unnamed.gh (14.9 KB)