A
robot spraying control method and
system based on digital twins, including the following steps: constructing a three-dimensional model of a workpiece and a
robot to be sprayed, wherein the three-dimensional model of the workpiece is composed of a triangular mesh; meshing the triangular mesh of the three-dimensional model of the workpiece to obtain a refined first model; constructing a BVH
data structure, and storing the triangular mesh parameters in the first model through the BVH
data structure; setting the spray gun parameters and the thickness
color table of the workpiece, wherein the spray gun parameters are the spray flow rate and the
fog cone angle; after the workpiece collides with the
nozzle ray, the
dyeing thickness of each triangular mesh in the spraying is calculated, and the three-dimensional model of the workpiece is assigned color through the
dyeing thickness and the thickness
color table. By constructing a three-dimensional model of the workpiece and the
robot, encapsulating the robot parameters, and having precise point coordinates, the robot posture and parameters can be adjusted better and more conveniently. The problem of difficulty in debugging the spray robot is solved.