A technique for calculating particle systems containing rigid and soft parts