Rotating a toolhead in grasshopper

Hello Everyone,

I am attempting to make a CNC machine with a directional toolhead - This head has a blade that always needs to be on the inside of the design for the design to work. For that to work, I need to rotate the toolhead (via a servo motor) based on how the design is angled based on the origin (90-degree turns to angular curves). I feel like this has been done before, but I am just not sure where to start. Any thoughts

For now, what you ask is quite generic.
Can you add more information? (or pictures or anything).

Also, usually CNC machines runs on code made with a CAM software.
You want to use grasshopper to generate the G-code?