oursin.meshes
Primitive meshes
Functions
Create multiple meshes |
|
Deletes meshes |
|
Sets colors of mesh renderers |
|
Sets materials of mesh renderers |
|
Set the positions of mesh renderers |
|
Set scale of mesh renderers |
Classes
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
- 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])
- 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]])