How to use the desert.helpers.json_array function in desert

To help you get started, we’ve selected a few desert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inconvergent / desert / desert / primitives.py View on Github external
def json(self):
    return {
        '_type': 'circle',
        '_data': {
            'num': self.num,
            'rad': pfloat(self.rad),
            'mid': json_array(self.mid),
            'dens': pfloat(self.dens),
            'noise': self.noise,
            'rgba': _export_color(self.rgba) if self.rgba is not None else None
            }
github inconvergent / desert / desert / primitives.py View on Github external
def json(self):
    return {
        '_type': 'bzspl',
        '_data': {
            'num': self.num,
            'pts': [json_array(self.pts[:, :, i]) for i in range(self.num)],
            'closed': self.closed,
            'dens': pfloat(self.dens),
            'noise': self.noise,
            'rgba': _export_color(self.rgba) if self.rgba is not None else None
            }
github inconvergent / desert / desert / primitives.py View on Github external
def json(self):
    return {
        '_type': 'box',
        '_data': {
            'num': self.num,
            'mid': json_array(self.mid),
            's': json_array(self.s).pop(),
            'dens': pfloat(self.dens),
            'noise': self.noise,
            'rgba': _export_color(self.rgba) if self.rgba is not None else None
            }