Piping cream through a piping tip
Flip Fluid addon [$]

create star (you can use Extra Objects addon) and animate movement
under Physics Properties enable Flip Fluid &gt; type Inflow
add Cube object and scale it to Domain dimension
under Physics Properties enable Flip Fluid type Domain
under FLIP Fluid World enable Viscosity
Bake



Credits for Cup-Cake model goes to MrSorbias.

Mantaflow
in general same system (domain / inflow). I just wasnt able to setup enough viscosity without strange behaviour of particles. This area doesn't seems to be covered in Mantaflow solver. You can find a parameters in Physics Properties editor under Diffusion, but from what I saw on net, most thick liquid is still too far from cream with ability to keep a form.
For more details check this intro