Esempio n. 1
0
 def errorBlend(self,bcs):           # Arg is baryCoords of an image point.
     sumVec = (0.0, 0.0)
     for bc,errVec in zip(bcs,self.error):
         sumVec = geom.ptOffset(sumVec, errVec, -bc) # Negate the error.
         pass
     return sumVec
Esempio n. 2
0
        lineHead = m1.group(1)
        data = [float(f) for f in m1.groups()[1:]]

        # XXX Horrid Hack Warning - We need right-handed coordinates,
        # but the image Y coordinate goes down from 0 at the top.
        # Negate it internally.
        pixLoc = geom.ptBlend((data[0], -data[1]), (data[2], -data[3]))
        wcLoc = (data[4], data[5])
        wAng = data[6]

        # Find the quadrant by looking at the center edges of the triangles.
        # We can actually blend linearly past the outer edges...
        for iTri in range(nPts-1):

            # Get the barycentric coords of the image point.
            bcs = triangles[iTri].baryCoords(pixLoc)
            if bcs[1] >= 0.0 and bcs[2]  >= 0.0:

                # This is the triangle containing this image point.
                newLoc = geom.ptOffset(wcLoc, triangles[iTri].errorBlend(bcs))
                ##print "pixLoc %s, iTri %d, bcs %s"%(pixLoc, iTri, bcs)
                ##print "triangles[%d] %s"%(iTri, triangles[iTri])
                print "%s(%f,%f,%f)"%(lineHead, newLoc[0], newLoc[1], wAng)

                break
            pass
        pass

    gridLine = gridData.readline()
    pass
Esempio n. 3
0
 def errorBlend(self, bcs):  # Arg is baryCoords of an image point.
     sumVec = (0.0, 0.0)
     for bc, errVec in zip(bcs, self.error):
         sumVec = geom.ptOffset(sumVec, errVec, -bc)  # Negate the error.
         pass
     return sumVec