SINTEF / Splipy

Spline modelling made easy.
GNU General Public License v3.0
100 stars 18 forks source link

G2 reader fails on multiple spaces in geometry file #61

Closed VikingScientist closed 6 years ago

VikingScientist commented 6 years ago

Trying to read the following geometry-file:

200 1 0 0
3 0
3 2
0 0 1 2 2
2 2
0 0 1 1
-1  0 0
 0  0 0
 0 -1 0
-1  1 0
 1  1 0
 1 -1 0

is going to crash since the controlpoints are separated by more than one space (for nice aligning).

from splipy.io import G2
with G2("lshape.g2") as myfile:
    surface = myfile.read()

gives the following error output

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/local/lib/python3.5/dist-packages/Splipy-1.2.0-py3.5-linux-x86_64.egg/splipy/io/g2.py", line 342, in read
    result.append(self.splines(pardim))
  File "/usr/local/lib/python3.5/dist-packages/Splipy-1.2.0-py3.5-linux-x86_64.egg/splipy/io/g2.py", line 196, in splines
    for _ in range(ncps)]
  File "/usr/local/lib/python3.5/dist-packages/Splipy-1.2.0-py3.5-linux-x86_64.egg/splipy/io/g2.py", line 196, in <listcomp>
    for _ in range(ncps)]
ValueError: could not convert string to float: