Generate blocks from the robot's TCP

Hello,

Could you help me write a Python script that generates blocks from the TCP (Tool Center Point) of a robot? I would like the blocks to be created along the coordinates where the robot moves.

I want to simulate arc welding within the simulation. Could you assist me with this?

Thank you.

There is no need for such trouble, it can be directly generated weld.