Sfoglia il codice sorgente

Do not silence DivisionByZero Error in data_from_mesh_ribbon

Joseph Brandenburg 6 mesi fa
parent
commit
fb2b6d065f
1 ha cambiato i file con 2 aggiunte e 8 eliminazioni
  1. 2 8
      utilities.py

+ 2 - 8
utilities.py

@@ -866,14 +866,8 @@ def data_from_ribbon_mesh(m, factorsList, mat, ribbons = None, fReport = None):
                 elif (targetLength == totalLength):
                     curFac = 1
                 else:
-                    try:
-                        curFac = 1 - (targetLengthAtEdge/ data[2]) #length
-                    except ZeroDivisionError:
-                        curFac = 0
-                        if (fReport):
-                            fReport(type = {'WARNING'}, message="Division by Zero.")
-                        else:  
-                            prRed ("Division by Zero Error in evaluating data from curve.")
+                    # NOTE: This can be Zero. That should throw an error.
+                    curFac = 1 - (targetLengthAtEdge/ data[2]) #length
             t1 = m.vertices[data[0][0]]; b1 = m.vertices[data[0][1]]
             t2 = m.vertices[data[1][0]]; b2 = m.vertices[data[1][1]]
             #location