<commit_before>from __future__ import print_function
from __future__ import absolute_import
from __future__ import division

__all__ = ['PrimitiveArtist']


class PrimitiveArtist(object):
    """Base class for all `Primitive` artists.

    Parameters
    ----------
    primitive : compas.geometry.primitives.Primitive
        The instnce of the primitive.
    settings : dict (optional)
        A dictionary with visualisation settings.
        Note that visualisation settings may also be provided
        one-by-one as keyword arguments.

    Attributes
    ----------
    settings : dict
        Visualisation settings.

    """

    def __init__(self, primitive, settings=None, **kwargs):
        self.primitive = primitive
        self.settings = settings or {}
        self.settings.update(kwargs)

    @staticmethod
    def draw_collection(collection):
        raise NotImplementedError

    def draw(self):
        raise NotImplementedError

    def draw_dynamic(self):
        raise NotImplementedError


# ==============================================================================
# Main
# ==============================================================================

if __name__ == '__main__':
    pass<commit_msg>add base primitive artist (from previous commit) add reference to rhinoscriptsyntax to compas_rhino<commit_after>from __future__ import print_function
from __future__ import absolute_import
from __future__ import division

import compas_rhino

__all__ = ['PrimitiveArtist']


class PrimitiveArtist(object):
    """Base class for all `Primitive` artists.

    Parameters
    ----------
    primitive : compas.geometry.primitives.Primitive
        The instnce of the primitive.
    settings : dict (optional)
        A dictionary with visualisation settings.
        Note that visualisation settings may also be provided
        one-by-one as keyword arguments.

    Attributes
    ----------
    settings : dict
        Visualisation settings.

    """

    def __init__(self, primitive, settings=None, **kwargs):
        self.primitive = primitive
        self.settings = settings or {}
        self.settings.update(kwargs)

    @staticmethod
    def draw_collection(collection):
        raise NotImplementedError

    def draw(self):
        raise NotImplementedError

    def redraw(self):
        raise NotImplementedError

    def draw_dynamic(self):
        raise NotImplementedError

    def clear_layer(self):
        """Clear the main layer of the artist."""
        if self.settings['layer']:
            compas_rhino.clear_layer(self.settings['layer'])
        else:
            compas_rhino.clear_current_layer()


# ==============================================================================
# Main
# ==============================================================================

if __name__ == '__main__':
    pass
{'fraction_non_alphanumeric': 0.1840726510653161, 'fraction_numerical': 0.0, 'mean_word_length': 3.132756132756133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5704029', 'n_tokens_mistral': 706, 'n_tokens_neox': 666, 'n_words': 199}