def generate_dict(self, constant_map={}):
        """Returns a dictionary containing all the data associated with the
        Shape.

        Parameters
        ==========
        constant_map : dictionary
            If any of the shape's geometry are defined as SymPy expressions,
            then this dictionary should map all SymPy Symbol's found in the
            expressions to floats.

        """
        data_dict = {}
        data_dict['name'] = self.name
        data_dict['color'] = self.color
        data_dict['material'] = self.material
        data_dict['type'] = self.__repr__()
        for geom in self.geometry_attrs:
            atr = getattr(self, geom)
            try:
                data_dict[geom] = float(atr.subs(constant_map))
            except AttributeError:
                # not a SymPy expression
                data_dict[geom] = atr
            except __HOLE__:
                # can't convert expression to float
                raise TypeError('{} is an expression, you '.format(atr) +
                                'must provide a mapping to numerical values.')
        return data_dict
dataset/ETHPy150Open pydy/pydy/pydy/viz/shapes.py/Shape.generate_dict