The invention discloses a virtual
assembly and anti-collision
simulation method for a double-swing-head five-axis
numerical control machine tool, and the method comprises the following steps: S1, building a geometric model of the double-swing-head five-axis
numerical control machine tool based on a
machine tool kinematic model, and the geometric model comprises parameterized three-dimensional models of a main shaft part, a swing head mechanism, a
workbench and a
machine tool body; s2, according to the
constraint relation of the kinematic chains of the
machine tool, an
assembly hierarchical relation is established in the virtual environment, and virtual
assembly of all parts is achieved through dynamic constraint driving; s3, on the basis of a
machine tool kinematics forward and inverse solution
algorithm, simulating the motion trail of the double swing heads in the five-axis linkage process; s4, through a real-time
collision detection algorithm, detecting interference conditions among the cutter, the swing head, the workpiece, the clamp and the machine tool body, and generating an anti-collision early warning
signal; and S5, optimizing a motion path of the machine tool in combination with a
simulation result, and outputting a collision-free
machining code. The assembly precision can be improved, and the physical debugging cost can be reduced.