Digitizing molds and physical templates