-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakePlanes.py
More file actions
36 lines (27 loc) · 1 KB
/
makePlanes.py
File metadata and controls
36 lines (27 loc) · 1 KB
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
33
34
35
36
from scipy import spatial
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
import pyqtgraph as pg
import itertools as itTl
import pyqtgraph.opengl as gl
def mkPlns(plnOr,org=[0,0,0],bxSdLen=1,scl=1,res=100,transp=0.5):
edge=True
smooth=True
shader='shaded'
glOpt='translucent'
plnClr=[1,0,1,transp]
# plnVert=np.array([list(itTl.product([0,1],repeat=3))])[0]
if np.array_equal(plnOr,np.array([1,1,1])):
plnVert=np.array([[1,0,0],[0,1,0],[0,0,1]])
# plnFc=
elif np.array_equal(plnOr,np.array([1,1,0])):
plnVert=np.array([[1,0,0],[1,1,0],[0,1,1],[0,0,1]])
elif np.array_equal(plnOr,np.array([1,0,0])):
plnVert=np.array([[1,0,0],[1,1,1],[1,1,0],[1,0,1]])
plnFc=spatial.Delaunay(plnVert)
plnDat=gl.MeshData(vertexes=plnVert,faces=plnFc.convex_hull)
plnObj=gl.GLSurfacePlotItem(plnVert, drawEdges=edge, smooth=smooth,
color=(plnClr[0], plnClr[1], plnClr[2], plnClr[3]),
shader=shader, glOptions=glOpt)
plnObj.translate(org[0]+bxSdLen/2,org[0]+bxSdLen/2,org[0]+bxSdLen/2)
return plnObj