booya-at / OpenGlider

python library to build paragliders
GNU General Public License v3.0
64 stars 25 forks source link

Unwrap error #68

Closed Mx74 closed 2 years ago

Mx74 commented 2 years ago

Unwrapping was working so far, but since the 2 last updates:

float() argument must be a string or a number, not 'NoneType'Running the Python command 'PatternCommand' failed: Traceback (most recent call last): File "/miniconda3/envs/freecad/lib/python3.9/site-packages/freecad/freecad_glider/tools/init.py", line 167, in Activated pat.unwrap(file_name, obj.Proxy.getGliderInstance()) File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/patterns.py", line 157, in unwrap super().unwrap(outdir) File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/patterns.py", line 112, in unwrap all_patterns = self._get_plotfile() File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/patterns.py", line 89, in _get_plotfile plots.unwrap() File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/glider/init.py", line 164, in unwrap self.get_ribs() File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/glider/init.py", line 84, in get_ribs rib_plot.flatten(self.glider_3d) File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/glider/ribs.py", line 228, in flatten return super(SingleSkinRibPlot, self).flatten(glider) File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/glider/ribs.py", line 83, in flatten self.draw_rib(glider) File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/glider/ribs.py", line 250, in draw_rib single_skin_cut = self.rib.profile_2d(singleskin_cut_left) File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/airfoil/profile_2d.py", line 49, in call xval = float(xval)

float() argument must be a string or a number, not 'NoneType'

Mx74 commented 2 years ago

I made a simple test:

looooo commented 2 years ago

I can't reproduce on linux/ubuntu.

looooo commented 2 years ago

btw. please use ```code``` for code blocks.

Mx74 commented 2 years ago

I'm also on Ubuntu. Made another test on Manjaro, same problem. Both are installed via Conda.

Mx74 commented 2 years ago

I just made the naming test again, the error message is a bit different:


Running the Python command 'PatternCommand' failed:
Traceback (most recent call last):
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/freecad/freecad_glider/tools/__init__.py", line 167, in Activated
    pat.unwrap(file_name, obj.Proxy.getGliderInstance())
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/patterns.py", line 157, in unwrap
    super().unwrap(outdir)
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/patterns.py", line 112, in unwrap
    all_patterns = self._get_plotfile()
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/patterns.py", line 89, in _get_plotfile
    plots.unwrap()
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/glider/__init__.py", line 164, in unwrap
    self.get_ribs()
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/glider/__init__.py", line 84, in get_ribs
    rib_plot.flatten(self.glider_3d)
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/plots/glider/ribs.py", line 43, in flatten
    self.outer = self.inner.copy().add_stuff(self.config.allowance_general)
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/vector/polyline.py", line 410, in add_stuff
    newlist.append(second + self.normvectors[i] * amount / cosphi)
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/utils/cache.py", line 62, in __get__
    res = self.function(parentclass)
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/vector/polyline.py", line 338, in normvectors
    rotate(self.data[j + 1] - self.data[j - 1]))
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/vector/polyline.py", line 333, in <lambda>
    rotate = lambda x: normalize(x).dot([[0, -1], [1, 0]])
  File "/miniconda3/envs/freecad/lib/python3.9/site-packages/openglider/vector/functions.py", line 26, in norma
Cannot normalize a vector of length 0.0```
Mx74 commented 2 years ago

These two different errors made me wonder...

I just copied all the openglider's files again over the existing ones, and now it runs smoothly. Don't know what has happen when I updated the last commit, but obviously something went wrong. Sorry for the hassle.