SVG output script

There is still a bug in the Script, the Order of the Objects is wrong when I open the SVG-File.

Correct Order:


Incorrect Order (I have to touch every Object manually in Inkscape to bring it into the correct Order):


Does anyone know how to correct this (Normals are all pointing outward)?

Kinde regards
Alain