Commit Graph
5 Commits
Author SHA1 Message Date
Ian Bassi 1a57ea3a13 Compare floats with a tolerance in the G-code reader and fan mover tests 2026-11-30 14:27:08 -03:00
Ian Bassiandlhx 021c6d6e22 Follow relative positioning in the G-code reader
GCodeReader read every X, Y and Z as absolute, also after G91. Custom
G-code that lifts the nozzle with "G91 / G1 Z2 / G90" left the reader
2 mm low, and the next absolute Z move looked like a move up. When the
fan mover then split that move to place a fan command earlier, it
wrote a Z between the wrong height and the target, so the nozzle dipped
into the print. Track G90 and G91, and make the distances and targets
of a line relative while G91 is in effect. The fan mover no longer
splits a move read in relative mode, since the split writes absolute
coordinates.

Ported from Snapmaker/OrcaSlicer@99d613e354

Co-authored-by: lhx <luohaoxuan@snapmaker.com>
2026-11-30 14:27:08 -03:00
Ian BassiandJoyx a14cfc290c Don't read a G-code file that could not be opened
GCodeReader went on to fread() from the FILE* even when opening the file
had failed. On Windows that null handle aborts the app through the CRT's
invalid parameter handler; elsewhere it is undefined behaviour. Return
false instead, as for a read error.

Ported from Snapmaker/OrcaSlicer@24593a3b77

Co-authored-by: Joyx <48636909+iesteem@users.noreply.github.com>
2026-11-30 14:27:08 -03:00
HanifKoh 5a95ba4bd5 Add Missing Includes to Code Merged Since the Include Cleanup (#16106)
* Add Missing Includes to Code Merged Since the Include Cleanup

* Add Missing Includes to Code Merged Since the Previous Sweep
2026-10-04 14:50:15 +08:00
Kris Austin 5be5c90e59 perf: speed up G-code export by up to 8% via cheaper G-code text building (#16108) 2026-10-03 20:29:54 -03:00