Skip to content

Contour and Threshold take a vector field's component - #349

Open
berkgeveci wants to merge 3 commits into
Kitware:mainfrom
berkgeveci:vis/vtk-component
Open

berkgeveci wants to merge 3 commits into
Kitware:mainfrom
berkgeveci:vis/vtk-component

Conversation

@berkgeveci

Copy link
Copy Markdown
Collaborator

Stacked on #348 and #343 (their commits show here until they merge; this merges after them). Found by running VTK's own Python tests with Tack's algorithms in place of VTK's filters (multipleComponentContour.py, and thresholds by component).

Contour and Threshold refused a vector field. They now take its component, as VTK's filters do: the first by default (vtkContourFilter's ArrayComponent, vtkThreshold's selected component), and for Threshold also "magnitude" (VTK's selected component equal to the count of components). A component is a view of the vector's values (tack.arrays.ExtractComponent), nothing copied; Tack's contour and threshold take it as any field. A component of a scalar field other than 0 is refused. VTK's "all components" and "any component" threshold modes are not taken.

Tested against vtkContourFilter (each component of a gradient) and vtkThreshold (components 0 and 2 and the magnitude): the same cells. VTK tests 224 passed on the 9.7.1 wheel, 239 on a local VTK master; quick tier 3044 passed.

🤖 Generated with Claude Code

The algorithms that add fields wrote Tack's values straight into VTK's point
data. On VTK's higher-order cells that put an order-2 field's values in Tack's
node order, not VTK's (Elevation scrambled, its Gradients wrong), and values on
Tack's points, the corners, where VTK's points include the edge middles (a
1193-point grid got an array of 1193 tuples of 1227 components). The import
now records which node of its space each VTK point is, and the writers put a
point field into that space (project) and give each VTK point its node's value.
Found running VTK's quadraticQuadDeriv.py on Tack.
Tack keeps no roles, so the arrays the algorithms carried came back plain: mappers
colored by nothing, glyphs and lighting found no vectors or normals. An output
now keeps its input's active scalars, vectors, normals, texture coordinates and
tensors where it carries arrays of those names (Probe its source's), as VTK's
filters pass them; Elevation and ImplicitValues make their array the active
scalars, SurfaceNormals, PointNormals and Tubes theirs the active normals (a
tube took the lines' carried Normals, and was lit wrongly). Found running VTK's
Python tests on Tack.
As VTK's filters do (vtkContourFilter's ArrayComponent, vtkThreshold's selected
component, its count of components meaning the magnitude): a view of the
vector's values (ExtractComponent), nothing copied; the first by default. They
refused a vector field. Found running VTK's Python tests on Tack.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant