forked from marcomusy/vedo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glyphs.py
32 lines (24 loc) · 940 Bytes
/
glyphs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""Glyphs:
at each vertex of a mesh, another mesh
is shown with various orientation options"""
from vedo import *
import numpy as np
s = Sphere(res=12).c('white',0.1).wireframe()
randvs = np.random.rand(s.NPoints(), 3) # random orientation vectors
#######################################
gly1 = Ellipsoid().scale(0.04)
gsphere1 = Glyph(s, gly1,
orientationArray=randvs,
scaleByVectorSize=True,
colorByVectorSize=True,
c='jet',
)
#######################################
gly2 = Mesh(dataurl+"shuttle.obj").rotateY(180).scale(0.02)
gsphere2 = Glyph(s, gly2,
orientationArray="normals",
tol=0.1, # minimum seaparation of 10% of bounding box
c='lightblue',
)
# show two groups of objects on N=2 renderers:
show([(s, gsphere1, __doc__), (s, gsphere2)], N=2, bg='bb', zoom=1.4).close()