Create polyline draw commands grouped by material.