Minor tweaks to some of the objects to make indexing them easier.

This commit is contained in:
2020-07-21 14:43:27 -05:00
parent 94e2603ab5
commit 228c5136d8
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -43,3 +43,9 @@ class Mesh:
row3 = self.vertices[int(tmp[3]) - 1]
self.triangles.append(Triangle(Matrix3x3(row1, row2, row3)))
def __getitem__(self, key):
return self.triangles[key]
def __len__(self):
return len(self.triangles)
+3
View File
@@ -5,3 +5,6 @@ class Triangle:
self.coords = coords # Matrix3x3
self.object_id = None
self.color = None
def __getitem__(self, key):
return self.coords[key]