[Paraview] Use existing texture map for 3D surface
Olumide
50295 at web.de
Mon Apr 19 15:14:40 EDT 2010
Eric,
I too am interested in texture mapping a 3d mesh object (having texture
coordinates). How to I use the script you provided?
In addition, I know the mesh can be in PVD format, but how do I specify
the texture coordinates as well as the texture?
Thanks,
- Olumide
# SCRIPT ....
# =============
pdi = self.GetPolyDataInput()
pdo = self.GetPolyDataOutput()
numPts = pdi.GetPoints().GetNumberOfPoints()
Uarray = pdi.GetPointData().GetArray('U')
Varray = pdi.GetPointData().GetArray('V')
tc = vtk.vtkDoubleArray()
tc.SetNumberOfComponents(2)
tc.SetNumberOfTuples(numPts)
tc.SetName('TCoords')
for ii in range(numPts):
Uval = Uarray.GetTuple1(ii)
Vval = Varray.GetTuple1(ii)
tc.SetTuple2(ii,Uval,Vval)
pdo.ShallowCopy(pdi)
pdo.GetPointData().AddArray(tc)
pdo.GetPointData().SetActiveTCoords('TCoords')
# =============
More information about the ParaView
mailing list