Duet3D / RepRapFirmware

OO C++ RepRap Firmware
GNU General Public License v3.0
945 stars 535 forks source link

Add current job XY min max values to OM #941

Open droftarts opened 10 months ago

droftarts commented 10 months ago

Is your feature request related to a problem? Please describe.

Add current job XY min max values to OM. This would allow for easier definition of selective mesh probing, and for drawing boundary boxes for laser cutters. Could also be used as a check to see if the job fits on the bed.

Describe the solution you propose.

Lightburn has added XY min max to the comments in generated gcode files, to allow a bounding box to be drawn.

Lightburn example: from jay_s_uk on forum: https://forum.duet3d.com/topic/34581/frame-job-boundaries/6

; LightBurn 1.4.04
; GRBL device profile, absolute coords
; Bounds: X5 Y5 to X105 Y155

Slicers such as Prusaslicer, Ideamaker have variables for at least the first layer, but not automatically added to comments in generated Gcode files. Workarounds for other slicers, eg Cura, exist, but if added to 'start G-code', the format of the comment needs to be defined. Other slicers have not been checked.

Prusaslicer example: Prusaslicer 'placeholders' need to be added to custom 'start G-code', format needs to be defined. eg:

; Bounds: X{first_layer_print_min[0]} Y{first_layer_print_min[1]} to X{first_layer_print_max[0]} Y{first_layer_print_max[1]}

produces

; Bounds: X-18.1724 Y-40.2153 to X33.8542 Y18.1724

A script exists for selective bed mesh probing from Prusaslicer, Cura and Ideamaker, using the variables to call a macro, see https://forum.duet3d.com/topic/29576/only-probe-where-the-part-will-be-printed/47

If these can be extracted and added to the OM in variables called something like job.file.firstLayerMin{X,Y} and job.file.firstLayerMax{X,Y}

Describe alternatives you've considered

A script exists for selective bed mesh probing from Prusaslicer, Cura and Ideamaker, using the variables to call a macro, see https://forum.duet3d.com/topic/29576/only-probe-where-the-part-will-be-printed/47

A Gcode post-processor or plugin could be written that parses the whole Gcode file to find min and max X and Y.

Provide any additional context or information.

No response