Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 732
    • Issues 732
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 202
    • Merge requests 202
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Issues
  • #18428

Closed
Open
Created Jan 05, 2022 by Tiffany Chhim@tiffany.chhimDeveloper

vtkExtractCellsByType does not copy cell data arrays on unstructured grids

Applying the vtkExtractCellsByType filter on an unstructured grid does not copy cell data arrays.

Python script to reproduce:

import vtk

# Create unstructured grid
cellSource = vtk.vtkCellTypeSource()
cellSource.SetCellType(vtk.VTK_TETRA)
cellSource.Update()

# Create cell data array
arrayGenerator = vtk.vtkRandomAttributeGenerator()
arrayGenerator.SetInputConnection(cellSource.GetOutputPort())
arrayGenerator.SetGenerateCellScalarsOn()
arrayGenerator.Update()

# Extract cells
extr = vtk.vtkExtractCellsByType()
extr.SetInputConnection(arrayGenerator.GetOutputPort())
extr.AddCellType(vtk.VTK_TETRA)
extr.Update()

# Cell data is missing
if extr.GetOutput().GetCellData().HasArray("RandomCellScalars") != 1:
    print("Cell data missing.")
Edited Jan 06, 2022 by Tiffany Chhim
Assignee
Assign to
Time tracking