Пример #1
0
    def get_poly_pnt_map(self):
        """return poly_map as MPoints
			"""
        pnt_map = []
        for m in self.poly_map:
            tris = []
            for t in m[1]:
                tris.append([utils.pnt(x) for x in t])
            pnt_map.append([utils.pnt(m[0]), tris])
        return pnt_map
Пример #2
0
		def get_poly_pnt_map(self):
			"""return poly_map as MPoints
			"""
			pnt_map = []
			for m in self.poly_map:
				tris = []
				for t in m[1]:
					tris.append([utils.pnt(x) for x in t])
				pnt_map.append([utils.pnt(m[0]), tris])
			return pnt_map
Пример #3
0
    def calculate_bary_coords(self):
        pnt_map = self.cage.get_poly_pnt_map()
        #calculate ut
        ut_values = []
        for m in pnt_map:
            tris = list(m[1])
            tris.reverse()
            ut_values.append(ut(utils.pnt(self.loc), m[0], tris))

        #barycentric coordinates
        bary = []
        ut_sum = sum(ut_values)
        for u in ut_values:
            bary.append(u / ut_sum)

        self.bary = bary
Пример #4
0
	def calculate_bary_coords(self):
		pnt_map = self.cage.get_poly_pnt_map()
		#calculate ut
		ut_values = []
		for m in pnt_map:
			tris= list(m[1])
			tris.reverse()
			ut_values.append(ut(utils.pnt(self.loc), m[0], tris))

		#barycentric coordinates
		bary=[]
		ut_sum = sum(ut_values)
		for u in ut_values:
			bary.append(u/ut_sum)

		self.bary = bary
Пример #5
0
    def get_vert_pnts(self):
        """return list of verts pos as MPoints
			"""
        return [utils.pnt(x[0]) for x in self.poly_map]
Пример #6
0
		def get_vert_pnts(self):
			"""return list of verts pos as MPoints
			"""
			return [utils.pnt(x[0]) for x in self.poly_map]