Skip to content

Commit

Permalink
fix wrong copy flag inside helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminum committed Jul 12, 2024
1 parent 1c53f2d commit c5d6ea1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/open3d/t/geometry/VtkUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ OPEN3D_LOCAL vtkSmartPointer<vtkImageData> CreateVtkImageDataFromTensor(

// Create a flat tensor that can be converted to a vtkDataArray
auto tensor_flat = tensor.Reshape({tensor.NumElements(), 1});
copy = copy && tensor.GetDataPtr() == tensor_flat.GetDataPtr();
copy = copy || tensor.GetDataPtr() != tensor_flat.GetDataPtr();
auto data_array = CreateVtkDataArrayFromTensor(tensor_flat, copy);

vtkSmartPointer<vtkImageData> im = vtkSmartPointer<vtkImageData>::New();
Expand Down Expand Up @@ -240,7 +240,7 @@ static vtkSmartPointer<vtkCellArray> CreateVtkCellArrayFromTensor(
const int cell_size = tensor.GetShape()[1];

auto tensor_flat = tensor.Reshape({tensor.NumElements(), 1}).Contiguous();
copy = copy && tensor.GetDataPtr() == tensor_flat.GetDataPtr();
copy = copy || tensor.GetDataPtr() != tensor_flat.GetDataPtr();
auto connectivity = CreateVtkDataArrayFromTensor(tensor_flat, copy);

// vtk nightly build (9.1.20220520) has a function cells->SetData(cell_size,
Expand Down

0 comments on commit c5d6ea1

Please sign in to comment.