extracted from CuraEngine