예제 #1
0
파일: Srf.py 프로젝트: uceearq/polymode-1
    def degelev(self, utimes, vtimes=None):
        """Degree elevate the surface.
	utimes - degree elevate utimes along u direction.
	vtimes - degree elevate vtimes along v direction."""
        if vtimes:
            if vtimes < 0:
                raise NURBSError, 'Degree must be positive'
            coefs = numerix.resize(
                self.cntrl, (4 * self.cntrl.shape[1], self.cntrl.shape[2]))
            coefs, vknots, nh = bspdegelev(self.degree[1], coefs, self.vknots,
                                           vtimes)
            coefs = coefs[:, :nh + 1]
            self.vknots = vknots[:nh + self.degree[1] + vtimes + 2]
            self.degree[1] += vtimes
            self.cntrl = numerix.resize(
                coefs, (4, self.cntrl.shape[1], coefs.shape[1]))
        if utimes:
            if utimes < 0:
                raise NURBSError, 'Degree must be positive'
            coefs = numerix.transpose(self.cntrl, (0, 2, 1))
            coefs = numerix.resize(
                coefs, (4 * self.cntrl.shape[2], self.cntrl.shape[1]))
            coefs, uknots, nh = bspdegelev(self.degree[0], coefs, self.uknots,
                                           utimes)
            coefs = coefs[:, :nh + 1]
            self.uknots = uknots[:nh + self.degree[0] + utimes + 2]
            self.degree[0] += utimes
            coefs = numerix.resize(coefs,
                                   (4, self.cntrl.shape[2], coefs.shape[1]))
            self.cntrl = numerix.transpose(coefs, (0, 2, 1))
예제 #2
0
파일: Crv.py 프로젝트: Germanc/supreme
 def degelev(self, degree):
     "Degree elevate the curve"
     if degree < 0:
         raise NURBSError, 'degree must be a positive number'
     if degree > 0:
         cntrl, uknots, nh = bspdegelev(self.degree, self.cntrl, self.uknots, degree)
         self.cntrl = cntrl[:,:nh + 1]
         self.uknots = uknots[:nh + self.degree + degree + 2]
         self.degree += degree
예제 #3
0
 def degelev(self, degree):
     "Degree elevate the curve"
     if degree < 0:
         raise NURBSError, 'degree must be a positive number'
     if degree > 0:
         cntrl, uknots, nh = bspdegelev(self.degree, self.cntrl, self.uknots, degree)
         self.cntrl = cntrl[:,:nh + 1]
         self.uknots = uknots[:nh + self.degree + degree + 2]
         self.degree += degree
예제 #4
0
파일: Srf.py 프로젝트: mtezzele/PyNURBS
    def degelev(self, utimes, vtimes = None):
        """Degree elevate the surface.
	utimes - degree elevate utimes along u direction.
	vtimes - degree elevate vtimes along v direction."""
        if vtimes != None:
            if vtimes < 0:
                raise NURBSError, 'Degree must be positive'
            coefs = np.resize(self.cntrl,(4*self.cntrl.shape[1], self.cntrl.shape[2]))
            coefs, vknots, nh = bspdegelev(self.degree[1], coefs, self.vknots, vtimes)
            coefs = coefs[:,:nh + 1]
            self.vknots = vknots[:nh + self.degree[1] + vtimes + 2]
            self.degree[1] += vtimes
            self.cntrl = np.resize(coefs, (4, self.cntrl.shape[1], coefs.shape[1]))
        if utimes != None:
            if utimes < 0:
                raise NURBSError, 'Degree must be positive'
            coefs = np.transpose(self.cntrl,(0, 2, 1))
            coefs = np.resize(coefs,(4*self.cntrl.shape[2], self.cntrl.shape[1]))
            coefs, uknots, nh = bspdegelev(self.degree[0], coefs, self.uknots, utimes)
            coefs = coefs[:,:nh + 1]
            self.uknots = uknots[:nh + self.degree[0] + utimes + 2]
            self.degree[0] += utimes
            coefs = np.resize(coefs, (4, self.cntrl.shape[2], coefs.shape[1]))
            self.cntrl = np.transpose(coefs,(0,2,1))