Selaa lähdekoodia

cleanup: replace ==0 with <FLOAT_EPSILON

Joseph Brandenburg 6 kuukautta sitten
vanhempi
commit
49a73b4e91
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 3 2
      utilities.py

+ 3 - 2
utilities.py

@@ -767,15 +767,16 @@ def RibbonMeshEdgeLengths(m, ribbon):
     return lengths
 
 def EnsureCurveIsRibbon(crv, defaultRadius = 0.1):
+    from .base_definitions import FLOAT_EPSILON
     crvRadius = 0
     crv.data.offset = 0
-    if (crv.data.bevel_depth == 0):
+    if (crv.data.bevel_depth < FLOAT_EPSILON):
         crvRadius = crv.data.extrude
     else: #Set ribbon from bevel depth
         crvRadius = crv.data.bevel_depth
         crv.data.bevel_depth = 0
         crv.data.extrude = crvRadius
-    if (crvRadius == 0):
+    if (crvRadius < FLOAT_EPSILON):
         crv.data.extrude = defaultRadius
 
 def SetRibbonData(m, ribbon):