Ejemplo n.º 1
0
cone.computeNormals()
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)

Ejemplo n.º 2
0
sphere.addPointArray(parr, 'parr')

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)