예제 #1
0
sphere.computeNormals()


###################################### test clone()
c2 = cone.clone()
print('clone()', cone.N(), c2.N())
assert cone.N() == c2.N()
print('clone()', cone.NCells(), c2.NCells())
assert cone.NCells() == c2.NCells()


###################################### test merge()
m = merge(sphere, cone)
print('merge()', m.N(), cone.N() + sphere.N())
assert m.N() == cone.N() + sphere.N()
print('merge()', m.NCells(), cone.NCells() + sphere.NCells())
assert m.NCells() == cone.NCells() + sphere.NCells()


###################################### inputdata
print('inputdata', [cone.inputdata()], "vtk.vtkPolyData")
assert isinstance(cone.inputdata(), vtk.vtkPolyData)


###################################### mapper
print('mapper',[cone.mapper()], "vtk.vtkPolyDataMapper")
assert isinstance(cone.mapper(), vtk.vtkPolyDataMapper)


###################################### pickable
cone.pickable(False)
예제 #2
0
파일: test_actors.py 프로젝트: trasse/vedo
sphere.addPointArray(np.sin(sphere.points()), 'pvectors')
sphere.addElevationScalars()

cone.computeNormals()
sphere.computeNormals()

###################################### test clone()
c2 = cone.clone()
assert cone.N() == c2.N()
assert cone.NCells() == c2.NCells()

###################################### test merge()
m = merge(sphere, cone)
assert m.N() == cone.N() + sphere.N()
assert m.NCells() == cone.NCells() + sphere.NCells()

###################################### inputdata
assert isinstance(cone.inputdata(), vtk.vtkPolyData)

###################################### mapper
assert isinstance(cone.mapper(), vtk.vtkPolyDataMapper)

###################################### pickable
cone.pickable(False)
cone.pickable(True)
assert cone.pickable()

###################################### pos
cone.SetPosition(1, 2, 3)
assert np.allclose([1, 2, 3], cone.pos())