Пример #1
0
    def pointsAt(self,u=None):
        if u is None:
            u = self.knots[order:]

        ctrl = self.control.astype(double)
        knots = self.knots.astype(double)
        u = u.astype(double)

        try:
            print "U",u
            pts = nu.bspeval(self.order-1,ctrl.transpose(),knots,u)
            print pts.shape
            print pts
            return Coords(pts.transpose())
        except:
            print "SOME ERROR OCCURRED"
            return Coords()
Пример #2
0
    def pointsAt(self, u=None, n=10):
        if u is None:
            umin = self.knots[0]
            umax = self.knots[-1]
            u = umin + arange(n + 1) * (umax - umin) / n

        ctrl = self.control.astype(double)
        knots = self.knots.astype(double)
        u = asarray(u).astype(double)

        try:
            print "U", u
            pts = nu.bspeval(self.order() - 1, ctrl.transpose(), knots, u)
            print pts.shape
            print pts
            pts = pts[:3] / pts[3:]
            return Coords(pts[:3].transpose())
        except:
            print "SOME ERROR OCCURRED"
            return Coords()