Subcanonical points on projective curves and triply periodic minimal surfaces in the Euclidean space