Why is the detcord on canopies wavy? We know that the wavy lines on the canopy are detcord, to shatter the glass in case of ejection.

Why are they wavy?
Possibly to shatter the canopy into smaller fragments.  Straight dets might just detach a large proportion, possibly leading to unwanted severe secondary strikes on ejecting aircrew.