mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-13 03:01:47 +08:00
Merge branch 'vincentmarchetti-fix_x3dimport'
This commit is contained in:
commit
d99fdb5c23
@ -700,7 +700,11 @@ class X3DReader(MeshReader):
|
|||||||
if not c is None:
|
if not c is None:
|
||||||
pt = c.attrib.get("point")
|
pt = c.attrib.get("point")
|
||||||
if pt:
|
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
|
num_verts = len(co) // 3
|
||||||
self.verts = numpy.empty((4, num_verts), dtype=numpy.float32)
|
self.verts = numpy.empty((4, num_verts), dtype=numpy.float32)
|
||||||
self.verts[3,:] = numpy.ones((num_verts), dtype=numpy.float32)
|
self.verts[3,:] = numpy.ones((num_verts), dtype=numpy.float32)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user