def format(self, vertices):
        """Format instance to dump
        vertices is dict of name to Vertex
        """
        buf = io.StringIO()

        buf.write(self.name + '\n')
        buf.write('{\n')
        buf.write('    type {};\n'.format(self.type_))
        buf.write('    faces\n')
        buf.write('    (\n')
        for f in self.faces:
            s = f.format(vertices)
            buf.write('        {}\n'.format(s))
        buf.write('    );\n')
        buf.write('}')
        return buf.getvalue()
def format ( self , vertices ) : buf = io . StringIO ( ) buf . write ( self . name + '\n' ) buf . write ( '{\n' ) buf . write ( '    type {};\n' . format ( self . type_ ) ) buf . write ( '    faces\n' ) buf . write ( '    (\n' ) for f in self . faces : s = f . format ( vertices ) buf . write ( '        {}\n' . format ( s ) ) buf . write ( '    );\n' ) buf . write ( '}' ) return buf . getvalue ( )
Format instance to dump
        vertices is dict of name to Vertex