oursin.meshes

Primitive meshes

Functions

clear

create

Create multiple meshes

delete

Deletes meshes

set_colors

Sets colors of mesh renderers

set_materials

Sets materials of mesh renderers

set_positions

Set the positions of mesh renderers

set_scales

Set scale of mesh renderers

Classes

Mesh

Mesh Object in Unity

class Mesh(position=[0.0, 0.0, 0.0], scale=[1, 1, 1], color=[1, 1, 1], material='default', interactive=False)[source]

Bases: object

Mesh Object in Unity

delete()[source]

Deletes meshes

Parameters

references object being deleted

>>> cube_obj.delete() 
set_position(position)[source]

Set the position of a mesh object. Position shoul dbe in AP/ML/DV coordinates in um

Parameters

positionlist of three floats

(ap, ml, dv) in um

Examples

>>> cube_obj.set_position([2,2,2])
set_scale(scale)[source]

Set the scale of mesh renderer

Parameters

scalelist of three floats

new scale of mesh

Examples

>>> cube_obj.set_scale([3,2,3])
set_color(color)[source]

Set the color of mesh renderer

Parameters

mesh_colorstring hex color

new hex color of mesh

Examples

>>> cube_obj.set_color("#000000")
set_material(material)[source]

Set the material of mesh renderer

Parameters

mesh_materialstring

name of new material

Examples

>>> cube_obj.set_material('opaque-lit')
clear()[source]
create(num_objects, position=[0.0, 0.0, 0.0], scale=[1, 1, 1], color=[1, 1, 1], material='default', interactive=False)[source]

Create multiple meshes

Parameters

num_objectsint

number of mesh objects to be created

positionlist, optional

default position nullspace (ap, ml, dv), by default [0.0,0.0,0.0]

scalelist, optional

default scale, by default [1,1,1]

colorlist, optional

default color, by default [1,1,1]

materialstr, optional

default material, by default ‘default’

interactivebool, optional

default interactive state, by default False

>>> meshes = urchin.meshes.create(2)
delete(meshes_list)[source]

Deletes meshes

Parameters

meshes_listlist of mesh objects

list of meshes being deleted

>>> urchin.meshes.delete(meshes)
set_positions(meshes_list, positions_list)[source]

Set the positions of mesh renderers

Parameters

meshes_listlist of mesh objects

list of meshes being set

positions_listlist of list of three floats

vertex positions of each mesh in um

>>> urchin.primitives.set_positions(cubes,[[3,3,3],[2,2,2]])
set_scales(meshes_list, scales_list)[source]

Set scale of mesh renderers

Parameters

meshes_listlist of mesh objects

list of meshes being scaled

scales_listlist of list of three floats

new scales of each mesh

>>> urchin.primitives.set_scales(cubes,[[3,3,3],[2,2,2]])
set_colors(meshes_list, colors_list)[source]

Sets colors of mesh renderers

Parameters

meshes_listlist of mesh objects

list of meshes undergoing color change

colors_listlist of string hex colors

new hex colors for each mesh

>>> urchin.primitives.set_colors(cubes,["#000000","#000000"])
set_materials(meshes_list, materials_list)[source]

Sets materials of mesh renderers

Parameters

meshes_listlist of mesh objects

list of meshes undergoing material change

materials_listlist of strings

name of new materials

>>> urchin.primitives.set_material(cubes,['opaque-lit','opaque-lit'])