I would say "The petals resemble the shape of a star", as "mimic" suggests volition.
The distinction you make between "compare with" and "compare to" is interesting.
My own feeling is that ordinary speakers do not always stick to that distinction. For me, for instance, "compare with" puts two things side by side, whereas "compare to" compares this thing here and that thing there.
I also wonder whether there's a tendency for "compare with" to occur where two things are compared in several aspects, whereas "compare to" often occurs where two things are compared in one particular aspect.
But other members may have better information than me!
All the best,
Student or Learner