def normalVertex2D(vprev, v, vnext): vec1 = vec.subtract(v, vprev) vec1 = vec.unitize(vec1) vec2 = vec.subtract(vnext, v) vec2 = vec.unitize(vec2) n = vec.add(vec1, vec2) n = vec.scale(n, 0.5) n = vec.rot2D90(n) #t=n.x #n.x=-n.y #n.y=t return n
def normalEdge2D(vprev, v): vec1 = vec.subtract(v, vprev) vec1 = vec.unitize(vec1) return vec.rot2D90(vec1)
def normalEdge2DNonUnified(vprev, v): vec1 = vec.subtract(v, vprev) return vec.rot2D90(vec1)