Esempio n. 1
0
def removeDuplangles(poly,vals,type): # /!\ does not work anymore

   found = True
   while found:
      i = 0; found = False
      while i < len(poly)-3:
         if 1 > 180*abs( getConeAngle( poly[i],poly[i+1],poly[i+2] ) )/np.pi:
            poly = np.delete(poly,i+1,0)
            found = True
         if 1 > 180*abs( getConeAngle( poly[i+1],poly[i+2],poly[i+3] ) )/np.pi:
            poly = np.delete(poly,i+2,0)
            found = True
         i += 2
   if len(poly) < 3: return [],0 #poly,0
   return poly,type
Esempio n. 2
0
def subsampleAngle(poly,vals,type,angle):

   found = True
   while found:
      i = 0; found = False
      while i < len(poly)-4:
         if angle > 180*abs( abs(getConeAngle( poly[i],poly[i+1],poly[i+2] )) - np.pi )/np.pi:
            poly = np.delete(poly,i+1,0)
            vals = vals.pop(i+1)
            found = True
         if angle > 180*abs( abs(getConeAngle( poly[i+1],poly[i+2],poly[i+3] )) - np.pi )/np.pi:
            poly = np.delete(poly,i+2,0)
            vals = vals.pop(i+2)
            found = True
         i += 2
   if len(poly) < 3: return [],[],0 #poly,vals,0
   return poly,vals,type
Esempio n. 3
0
def removeDuplangles(poly, vals, type):  # /!\ does not work anymore

    found = True
    while found:
        i = 0
        found = False
        while i < len(poly) - 3:
            if 1 > 180 * abs(getConeAngle(poly[i], poly[i + 1],
                                          poly[i + 2])) / np.pi:
                poly = np.delete(poly, i + 1, 0)
                found = True
            if 1 > 180 * abs(
                    getConeAngle(poly[i + 1], poly[i + 2],
                                 poly[i + 3])) / np.pi:
                poly = np.delete(poly, i + 2, 0)
                found = True
            i += 2
    if len(poly) < 3: return [], 0  #poly,0
    return poly, type
Esempio n. 4
0
def subsampleAngle(poly, vals, type, angle):

    found = True
    while found:
        i = 0
        found = False
        while i < len(poly) - 4:
            if angle > 180 * abs(
                    abs(getConeAngle(poly[i], poly[i + 1], poly[i + 2])) -
                    np.pi) / np.pi:
                poly = np.delete(poly, i + 1, 0)
                vals = vals.pop(i + 1)
                found = True
            if angle > 180 * abs(
                    abs(getConeAngle(poly[i + 1], poly[i + 2], poly[i + 3])) -
                    np.pi) / np.pi:
                poly = np.delete(poly, i + 2, 0)
                vals = vals.pop(i + 2)
                found = True
            i += 2
    if len(poly) < 3: return [], [], 0  #poly,vals,0
    return poly, vals, type