Minor tweaks to some of the objects to make indexing them easier.
This commit is contained in:
@@ -43,3 +43,9 @@ class Mesh:
|
|||||||
row3 = self.vertices[int(tmp[3]) - 1]
|
row3 = self.vertices[int(tmp[3]) - 1]
|
||||||
|
|
||||||
self.triangles.append(Triangle(Matrix3x3(row1, row2, row3)))
|
self.triangles.append(Triangle(Matrix3x3(row1, row2, row3)))
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
return self.triangles[key]
|
||||||
|
|
||||||
|
def __len__(self):
|
||||||
|
return len(self.triangles)
|
||||||
|
|||||||
@@ -5,3 +5,6 @@ class Triangle:
|
|||||||
self.coords = coords # Matrix3x3
|
self.coords = coords # Matrix3x3
|
||||||
self.object_id = None
|
self.object_id = None
|
||||||
self.color = None
|
self.color = None
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
return self.coords[key]
|
||||||
|
|||||||
Reference in New Issue
Block a user