- for polyhedron in self.polyhedra:
- for vertices in polyhedron.faces():
- if len(vertices) == 0:
- continue
- vertices = Polyhedron._sort_polygon_3d(vertices)
- vertices.append(vertices[0])
- face_xyzs = [tuple(vertex.values()) for vertex in vertices]
- xs, ys, zs = zip(*face_xyzs)
- xmin, xmax = min(xmin, float(min(xs))), max(xmax, float(max(xs)))
- ymin, ymax = min(ymin, float(min(ys))), max(ymax, float(max(ys)))
- zmin, zmax = min(zmin, float(min(zs))), max(zmax, float(max(zs)))
- poly_xyzs.append(face_xyzs)
- collection = Poly3DCollection(poly_xyzs, **kwargs)
- axes.add_collection3d(collection)
- axes.set_xlim(xmin, xmax)
- axes.set_ylim(ymin, ymax)
- axes.set_zlim(zmin, zmax)
+ for vertices in self.faces():
+ vertices = self._sort_polygon_3d(vertices)
+ vertices.append(vertices[0])
+ face_xyzs = [tuple(vertex.values()) for vertex in vertices]
+ xs, ys, zs = zip(*face_xyzs)
+ xmin, xmax = min(xmin, float(min(xs))), max(xmax, float(max(xs)))
+ ymin, ymax = min(ymin, float(min(ys))), max(ymax, float(max(ys)))
+ zmin, zmax = min(zmin, float(min(zs))), max(zmax, float(max(zs)))
+ poly_xyzs.append(face_xyzs)
+ collection = Poly3DCollection(poly_xyzs, **kwargs)
+ axes.add_collection3d(collection)
+ axes.set_xlim(xmin, xmax)
+ axes.set_ylim(ymin, ymax)
+ axes.set_zlim(zmin, zmax)