How to set the fully dynamic plotting area? I am trying to combine CNC plotter with image processing. The goal is to detect the object and print on that object. My question is can we set the fully dynamic plotting area.
For example: I want to print something on hand or finger. How do I tell the machine that this is hand and you have to print only on this hand.
I plan to detect hand using camera and set the hand as printing area in CNC firmware and the place gcode image on finger. How to tell the cnc firmware that this is your printing area?
I hope you understand my question.
I am using GRBL firmware with Arduino and use pronterface as software.
Please help and thanks.
If the problem of &quot;dynamic area&quot;, or even &quot;how to avoid missing the surface and boundaries&quot; could be translated to &quot;where to start well-defined job&quot; - then it sounds to me like common task, with regards to philosophy of CNC machines. (Ok, until the surface is not moving around.)
Pronterface and GRBL work in Cartesain system. GRBL does not support mesh probing. So you must think about relatively flat, plane surfaces.
In my opinion, you need to fulfill following tasks to achieve the goal:

Define boundaries. Hard and soft boundaries of device are supported by GRBL. You should setup them for overall safety.
Plan the job. Recognize ranges of planned plot or print.
Secure the surface. It must be appropriately stabilized. If you want to draw, the pen mount with spring will equalize variations of the surface (hand, finger, egg). 3D printing is sensitive to roughness and obliquity, we add raft/supports to overcome these - could be of use, until it doesn't mean missing your goal? (Don't print with hot filaments on fingers.)
Establish point of reference. You need to home your plotting or printing head somewhere in space in relation to the driving hardware. This is needed for any further actions. I envsion homing Z to the top of the frame, rather then against the target.
Detect surface. Camera will help with horizontal borders (X,Y). You also need to measure the Z distance. The Z probe could be mechanical (then needs vertical movement) or some distance detector (like VL53L0X ?).
Validate fitting. Ensure that the surface will accommodate ranges of planned job. This is actually the key point in my opinion. You need to know scope at the first place.
Program. I see following options to pick and mix the final solution from them:

G-code is generated prior to the whole procedure. You need to synchronize the starting point between the generated file and the real job range. Homing is done &quot;manually&quot; prior to executing the file. After surface is detected, the real starting point could be calculated and applied.
G-code is generated after surface is detected. Job starts with homing, and first moves go from device's zero (home position) to selected starting point on the surface. All consecutive moves are planned within boundaries over the surface. So there is no risk to work outside the safe range.
G-code is generated with relative positioning (incremental distance mode), having G91 in preamble. Then you just travel to the starting point and then run the commands from file.
G-code is generated with absolute positioning (absolute distance mode). To run the job, you need to change coordinate system using commands like G10, G54-G59.
For printing, if there is a needed to match some flat shape to rought surface, then you may need to dynamically generate some supports/raft below the bottom of the printed part.