从vtkPolyData中选择一个标量数组以应用vtkThresholdPoints



我有一个vtkPolyData对象。它包含多个点数据阵列(压力、密度、速度等(。我想通过应用vtkThresholdPoints,在这个vtkPolyData中选择一些点,其中一个数据,比如压力,位于一个范围之间。

我的问题是,vtkThresholdPoints是否提供了一个属性来设置我要设置阈值的数据?据我所知,vtkThresholdPoints使用";默认";与vtkPolyData关联的标量,它不是我想要使用的数据数组。

我在上找到https://vtk.org/doc/nightly/html/classvtkThresholdPoints.html#details存在属性CCD_ 1。然而,Python解释器抱怨道:

AttributeError: 'vtkFiltersCorePython.vtkThresholdPoints' object has no attribute 'SetInputArrayComponent'

顺便说一句,当我用Python打印vtkPolyData时,它就是这样的:

vtkPolyData (0x2bc3bd0)
Debug: Off
Modified Time: 16991
Reference Count: 2
Registered Events: (none)
Information: 0x35776e0
Data Released: False
Global Release Data: Off
UpdateTime: 16992
Field Data:
Debug: Off
Modified Time: 16925
Reference Count: 1
Registered Events: (none)
Number Of Arrays: 0
Number Of Components: 0
Number Of Tuples: 0
Number Of Points: 401032
Number Of Cells: 401032
Cell Data:
Debug: Off
Modified Time: 16974
Reference Count: 1
Registered Events: 
Registered Observers:
vtkObserver (0x35780f0)
Event: 33
EventName: ModifiedEvent
Command: 0x3577690
Priority: 0
Tag: 1
Number Of Arrays: 0
Number Of Components: 0
Number Of Tuples: 0
Copy Tuple Flags: ( 1 1 1 1 1 1 1 1 )
Interpolate Flags: ( 1 1 1 1 1 1 0 1 )
Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
Scalars: (none)
Vectors: (none)
Normals: (none)
TCoords: (none)
Tensors: (none)
GlobalIds: (none)
PedigreeIds: (none)
EdgeFlag: (none)
Point Data:
Debug: Off
Modified Time: 16972
Reference Count: 1
Registered Events: 
Registered Observers:
vtkObserver (0x35775b0)
Event: 33
EventName: ModifiedEvent
Command: 0x3577690
Priority: 0
Tag: 1
Number Of Arrays: 25
Array 0 name = Pressure
Array 1 name = Density
Array 2 name = CFLNumber
Array 3 name = PhaseVolumeFraction
Array 4 name = SolidOriginalCoordinateX
Array 5 name = SolidOriginalCoordinateY
Array 6 name = SolidOriginalCoordinateZ
Array 7 name = HydrostaticPressure
Array 8 name = Time
Array 9 name = Velocity
Array 10 name = DiagnosticCoordinate
Array 11 name = GalerkinProjection
Array 12 name = GalerkinProjectionInterpolationErrorBound
Array 13 name = SolidOldCoordinate
Array 14 name = GridSolidVelocity
Array 15 name = SolidForce
Array 16 name = PastSolidForce
Array 17 name = GravityDirection
Array 18 name = Viscosity
Array 19 name = Viscosity_Solid
Array 20 name = spatial_coordinate
Array 21 name = vtkGhostLevels
Array 22 name = StressTenSolid
Array 23 name = Sigma_Solid
Array 24 name = Density_Solid
Number Of Components: 69
Number Of Tuples: 401032
Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
Scalars: 
Debug: Off
Modified Time: 16685
Reference Count: 2
Registered Events: (none)
Name: vtkGhostLevels
Data type: unsigned char
Size: 401032
MaxId: 401031
NumberOfComponents: 1
Information: 0
Name: vtkGhostLevels
Number Of Components: 1
Number Of Tuples: 401032
Size: 401032
MaxId: 401031
LookupTable: (none)
Vectors: 
Debug: Off
Modified Time: 16451
Reference Count: 3
Registered Events: (none)
Name: spatial_coordinate
Data type: double
Size: 1203096
MaxId: 1203095
NumberOfComponents: 3
Information: 0
Name: spatial_coordinate
Number Of Components: 3
Number Of Tuples: 401032
Size: 1203096
MaxId: 1203095
LookupTable: (none)
Normals: (none)
TCoords: (none)
Tensors: 
Debug: Off
Modified Time: 16692
Reference Count: 2
Registered Events: (none)
Name: StressTenSolid
Data type: double
Size: 3609288
MaxId: 3609287
NumberOfComponents: 9
Information: 0
Name: StressTenSolid
Number Of Components: 9
Number Of Tuples: 401032
Size: 3609288
MaxId: 3609287
LookupTable: (none)
GlobalIds: (none)
PedigreeIds: (none)
EdgeFlag: (none)
Bounds: 
Xmin,Xmax: (-0.0381, 0.0381)
Ymin,Ymax: (-0.038109, 0.0381058)
Zmin,Zmax: (-0.0295, 0.2595)
Compute Time: 17003
Number Of Points: 401032
Point Coordinates: 0x2eb37e0
Locator: 0
Number Of Vertices: 0
Number Of Lines: 0
Number Of Polygons: 401032
Number Of Triangle Strips: 0
Number Of Pieces: 1
Piece: 0
Ghost Level: 0

SetInputArrayToProcess将允许您选择要使用的数组。

SetInputArrayToProcess继承自vtkAlgorithm类(https://vtk.org/doc/nightly/html/classvtkAlgorithm.html#a42a55ca2c277aecc909ad592d12978aa)。

相关内容

最新更新