This is similar to an optimization done in PhysicalModelLayer::Paint in the engine
Attach a file by drag & drop or click to upload