<commit_before><commit_msg>Initiate code to enable finite_strain_ellipsoid visualisation:<commit_after>#!/usr/bin/env python

"""Visualise finite strian ellipsoids"""

import numpy as np

from mayavi.api import Engine
from mayavi.sources.api import ParametricSurface
from mayavi.modules.api import Surface
from mayavi import mlab


def gen_ellipsoid(engine,position,shape,orientation):
    """given the existence of a scene generate ellipsoid"""
    
    source = ParametricSurface()
    source.function = 'ellipsoid'
    engine.add_source(source)
    
    surface = Surface()
    source.add_module(surface)
    
    actor = surface.actor
    actor.property.opacity = 0.5
    actor.property.color = tuple(np.random.rand(3))
    actor.mapper.scalar_visibility = False
    actor.property.backface_culling = True
    actor.actor.orientation = orientation
    actor.actor.origin = np.zeros(3)
    actor.actor.position = position
    actor.actor.scale = shape
    
    return surface
    

# if __main__ == name:
engine = Engine()
engine.start()
scene = engine.new_scene()
scene.scene.disable_render = True

surfaces = []

for ii in range(10):
    surfaces.append(gen_ellipsoid(engine,np.random.rand(3),np.random.rand(3),np.random.rand(3)*360))
    
scene.scene.disable_render = False

mlab.show()
{'fraction_non_alphanumeric': 0.10603715170278638, 'fraction_numerical': 0.009287925696594427, 'mean_word_length': 3.954022988505747, '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': '1521991', 'n_tokens_mistral': 420, 'n_tokens_neox': 407, 'n_words': 88}