echus / atomblend

Blender addon for atom probe data visualisation and analysis
4 stars 1 forks source link

analysis/isosurface.py: get_frac returns None for values outside isorange #15

Open echus opened 9 years ago

echus commented 9 years ago

Raise error instead if this should never happen, otherwise the following happens when the user enters an invalid isorange:

Calculating voxelisation
Calculating isosurface for isorange [0.0, 1.0]
Traceback (most recent call last):
  File "/home/varvara/Blender/2.72/scripts/addons/AtomBlend/operators.py", line 288, in execute
    return opexec.analysis_isosurface_gen(self, context)
  File "/home/varvara/Blender/2.72/scripts/addons/AtomBlend/operatorexec.py", line 34, in analysis_isosurface_gen
    verts, faces = analysis.isosurface.generate(voxarray, isorange)
  File "/home/varvara/Blender/2.72/scripts/addons/AtomBlend/analysis/isosurface.py", line 26, in generate
    verts, faces = get_Lists(voxelarray, isorange)
  File "/home/varvara/Blender/2.72/scripts/addons/AtomBlend/analysis/isosurface.py", line 942, in get_Lists
    raw_faces = march(voxelvolume, isorange)
  File "/home/varvara/Blender/2.72/scripts/addons/AtomBlend/analysis/isosurface.py", line 874, in march
    e6= r1, c0 + _get_frac(v_coord[5], v_coord[6], isorange), d1
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
tanosaur commented 9 years ago

Try the new isosurfaces I uploaded https://github.com/sojung21/atomblend/blob/master/analysis/isosurface.py (i will need to figure out this repo/github thing haha), needs testing so nothing freaky happens! I'll test it on Wed.