Constitutive modeling of photopolymerization and its application to 3D printing