gcode-preview icon indicating copy to clipboard operation
gcode-preview copied to clipboard

Option to render (de)retractions

Open sophiedeziel opened this issue 1 year ago • 5 comments

I had that idea after investigating stringing issues that fused parts of a print-in-place flexible model.

Prusa Slicer has the option of rendering retractions. It's useful to be able to render that.

Screenshot 2024-10-13 at 11 07 59

For this feature to be as accurate as possible, we'd have to implement the G0/G1 with negative E case as well as introducing G10 support.

The API could be very similar to what we have right now with the other types of renders:

{
  ...,
  renderRetractions: true,
  retractionColor: '#FF0000',
}
  • [ ] detect retractions in g0/g1 movements: movements with E < 0
  • [ ] detect firmware retractions using G10/G11 (I think G22/G23 too and possibly other vendor-specific gcodes)

sophiedeziel avatar Oct 13 '24 15:10 sophiedeziel

Can I suggest we do this in v3.1+?

remcoder avatar Oct 18 '24 12:10 remcoder

Yes!

sophiedeziel avatar Oct 18 '24 13:10 sophiedeziel

I just realized PR #269 actually detects and counts retractions now.

atm, zero-length movements are removed from the scene because they would be invisible anyway. But they might as well be rendered and the interpreter at least detects them.

remcoder avatar Jan 14 '25 22:01 remcoder

There's also the native G10 gcode, but I think slicers mostly use g0/g1 for backward compatibility with older printer firmware.

sophiedeziel avatar Jan 15 '25 15:01 sophiedeziel

Good point. I updated the description

remcoder avatar Jan 16 '25 10:01 remcoder