From 9449d30d87a20cc56469ffe33a5195b8a0c88156 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Wed, 9 Nov 2016 07:18:14 -0500 Subject: [PATCH] Modify reading of Coordinate/@point attribute to allow comma separators --- plugins/X3DReader/X3DReader.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/X3DReader/X3DReader.py b/plugins/X3DReader/X3DReader.py index 4ce21f3f8c..ba31c9ea86 100644 --- a/plugins/X3DReader/X3DReader.py +++ b/plugins/X3DReader/X3DReader.py @@ -700,7 +700,11 @@ class X3DReader(MeshReader): if not c is None: pt = c.attrib.get("point") if pt: - co = [float(x) for x in pt.split()] + # allow the list of float values in 'point' attribute to + # be separated by commas or whitespace as per spec of + # XML encoding of X3D + # Ref ISO/IEC 19776-1:2015 : Section 5.1.2 + co = [float(x) for vec in pt.split(',') for x in vec.split()] num_verts = len(co) // 3 self.verts = numpy.empty((4, num_verts), dtype=numpy.float32) self.verts[3,:] = numpy.ones((num_verts), dtype=numpy.float32)