<commit_before>
from __future__ import division

from itertools import repeat
from random import uniform

from .component.shapes import (
    MultiShape, Cube, CubeCorners, CubeCross, CubeLattice, RgbCubeCluster,
    Tetrahedron,
)
from .component.slowmo import SlowMo
from .component.spinner import Spinner
from .component.wobblyorbit import WobblyOrbit
from .engine.gameitem import GameItem
from .geometry.koch_cube import KochCube
from .geometry.koch_tetra import KochTetra
from .geometry.sierpinski_tetra import SierpinskiTetra
from .geometry.orientation import Orientation
from .geometry.vec3 import Origin, Vec3, XAxis, ZAxis, NegZAxis


def color_invert(color):
    r, g, b, _ = color
    return (
        255 - r,
        255 - g,
        255 - b,
        255
    )


def populate(world, camera):
    camitem = GameItem(
        position=Origin,
        camera=camera,
        move=WobblyOrbit(80, 75, speed=0.5),
    )
    world.add(camitem)

    red = (255, 0, 0, 255)
    orange = (255, 127, 0, 255)
    yellow = (255, 255, 0, 255)
    green = (0, 255, 0, 255)
    blue = (0, 0, 255, 255)
    purple = (255, 0, 255, 255)
    white = (255, 255, 255, 255)

    world.add( GameItem(
        shape=SierpinskiTetra(
            Tetrahedron(4), 6, scale=0.52,
            face_colors=repeat(yellow),
        ),
        position=Vec3(0, 0, 5),
        orientation=Orientation(ZAxis),
        spin=Spinner(speed=0.75),
    ) )
<commit_msg>re-add trianglesquare to populate_world<commit_after>
from __future__ import division

from itertools import repeat
from random import uniform

from .component.shapes import (
    MultiShape, Cube, CubeCorners, CubeCross, CubeLattice, RgbCubeCluster,
    Tetrahedron, TriangleSquare
)
from .component.slowmo import SlowMo
from .component.spinner import Spinner
from .component.wobblyorbit import WobblyOrbit
from .engine.gameitem import GameItem
from .geometry.koch_cube import KochCube
from .geometry.koch_tetra import KochTetra
from .geometry.sierpinski_tetra import SierpinskiTetra
from .geometry.orientation import Orientation
from .geometry.vec3 import Origin, Vec3, XAxis, ZAxis, NegZAxis


def color_invert(color):
    r, g, b, _ = color
    return (
        255 - r,
        255 - g,
        255 - b,
        255
    )


def populate(world, camera):
    camitem = GameItem(
        position=Origin,
        camera=camera,
        move=WobblyOrbit(80, 75, speed=0.5),
    )
    world.add(camitem)

    red = (255, 0, 0, 255)
    orange = (255, 127, 0, 255)
    yellow = (255, 255, 0, 255)
    green = (0, 255, 0, 255)
    blue = (0, 0, 255, 255)
    purple = (255, 0, 255, 255)
    white = (255, 255, 255, 255)

    # world.add( GameItem(
        # shape=TriangleSquare(),
    # ) )

    world.add( GameItem(
        shape=SierpinskiTetra(
            Tetrahedron(4), 6, scale=0.52,
            face_colors=repeat(yellow),
        ),
        position=Vec3(0, 0, 5),
        orientation=Orientation(ZAxis),
        spin=Spinner(speed=0.75),
    ) )

{'fraction_non_alphanumeric': 0.10510510510510511, 'fraction_numerical': 0.06539873206539873, 'mean_word_length': 2.7853535353535355, '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': '2210419', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1009, 'n_words': 277}