<commit_before>"""
Solid bodies
============

"""
import math as _math

class Solid(object):

    def __init__(self, *, sdf, underlying=None):
        """
        """

        if underlying is None:
            underlying = []

        self._sdf = sdf
        self._underlying   = underlying

    @property
    def sdf(self):
        return self._sdf

    @property
    def underlying(self):
        return self._underlying

    def __and__(self, other):
        return intersection(self, other)

    def __or__(self, other):
        return union(self, other)

    def __add__(self, other):
        return union(self, other)

    def __sub__(self, other):
        return difference(self, other)

    def union(self, *others):
        return union(self, *others)

    def intersection(self, *others):
        return intersection(self, *others)

    def plus(self, other):
        return union(self, other)

    def minus(self, other):
        return difference(self, other)

    def mirror(self, **kwargs):
        return mirror(self, **kwargs)


class Cuboid(Solid):
    """
    """

    def __init__(self, x_edge, y_edge, z_edge, **kwargs):
        """
        """

        self._x_edge = x_edge
        self._y_edge = y_edge
        self._z_edge = z_edge

        bx = x_edge / 2
        by = y_edge / 2
        bz = z_edge / 2

        def sdf(x, y, z):
            qx = abs(x) - bx
            qy = abs(y) - by
            qz = abs(z) - bz

            ux = max(qx, 0.0)
            uy = max(qy, 0.0)
            uz = max(qz, 0.0)
            uMag = _math.sqrt(ux * ux + uy * uy + uz * uz)

            return uMag + min(max(qx, max(qy, qz)), 0.0)

        super().__init__(sdf=sdf, **kwargs)

    @property
    def x_edge(self):
        return self._x_edge

    @property
    def y_edge(self):
        return self._y_edge

    @property
    def z_edge(self):
        return self._z_edge


class Ellipsoid(Solid):
    """
    """

    def __init__(self, x_diameter, y_diameter, z_diameter, **kwargs):
        """
        """

        self._x_diameter = x_diameter
        self._y_diameter = y_diameter
        self._z_diameter = z_diameter

        rx = x_diameter / 2
        ry = y_diameter / 2
        rz = z_diameter / 2

        def sdf(x, y, z):
            vx = x / rx
            vy = y / ry<commit_msg>solid.py: remove empty docstrings<commit_after>"""
Solid bodies
============

"""
import math as _math

class Solid(object):

    def __init__(self, *, sdf, underlying=None):
        if underlying is None:
            underlying = []

        self._sdf = sdf
        self._underlying   = underlying

    @property
    def sdf(self):
        return self._sdf

    @property
    def underlying(self):
        return self._underlying

    def __and__(self, other):
        return intersection(self, other)

    def __or__(self, other):
        return union(self, other)

    def __add__(self, other):
        return union(self, other)

    def __sub__(self, other):
        return difference(self, other)

    def union(self, *others):
        return union(self, *others)

    def intersection(self, *others):
        return intersection(self, *others)

    def plus(self, other):
        return union(self, other)

    def minus(self, other):
        return difference(self, other)

    def mirror(self, **kwargs):
        return mirror(self, **kwargs)


class Cuboid(Solid):

    def __init__(self, x_edge, y_edge, z_edge, **kwargs):

        self._x_edge = x_edge
        self._y_edge = y_edge
        self._z_edge = z_edge

        bx = x_edge / 2
        by = y_edge / 2
        bz = z_edge / 2

        def sdf(x, y, z):
            qx = abs(x) - bx
            qy = abs(y) - by
            qz = abs(z) - bz

            ux = max(qx, 0.0)
            uy = max(qy, 0.0)
            uz = max(qz, 0.0)
            uMag = _math.sqrt(ux * ux + uy * uy + uz * uz)

            return uMag + min(max(qx, max(qy, qz)), 0.0)

        super().__init__(sdf=sdf, **kwargs)

    @property
    def x_edge(self):
        return self._x_edge

    @property
    def y_edge(self):
        return self._y_edge

    @property
    def z_edge(self):
        return self._z_edge


class Ellipsoid(Solid):

    def __init__(self, x_diameter, y_diameter, z_diameter, **kwargs):

        self._x_diameter = x_diameter
        self._y_diameter = y_diameter
        self._z_diameter = z_diameter

        rx = x_diameter / 2
        ry = y_diameter / 2
        rz = z_diameter / 2

        def sdf(x, y, z):
            vx = x / rx
            vy = y / ry
{'fraction_non_alphanumeric': 0.1188118811881188, 'fraction_numerical': 0.006160616061606161, 'mean_word_length': 1.7753357753357752, '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': '2730806', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1483, 'n_words': 390}