<div dir="ltr">Hello everyone, <br><br>I am new to using VTK and to this forum. I have tried searching for an answer for this issue for a while and wanted some help. <div><br></div><div>I am writing a code in c++ that generates an output of a cube and stores it in a .vtp file. The code is as follows: (The variables center, _widthOfBottomFace, _widthOfSideFace, _widthInZDirection are defined elsewhere) </div><div><br></div><div>vtkSmartPointer<vtkCubeSource> cubeSource =</div><div>      vtkSmartPointer<vtkCubeSource>::New();</div><div><br></div><div>    //set dimensions of cube</div><div>    cubeSource->SetCenter(center[0], center[1], center[2]);</div><div>    cubeSource->SetXLength(_widthOfBottomFace);</div><div>    cubeSource->SetYLength(_widthOfSideFace);</div><div>    cubeSource->SetZLength(_widthInZDirection);</div><div>    cubeSource->Update();</div><div><br></div><div>    //rotate the cube now</div><div>    vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();</div><div>    mapper->SetInputData(cubeSource->GetOutput());</div><div><br></div><div>    vtkActor* actor = vtkActor::New();</div><div>    actor->SetMapper(mapper);</div><div>    actor->SetOrigin(cubeSource->GetCenter());</div><div><br></div><div>    actor->RotateZ(1);</div><div><br></div><div><br></div><div>    //create the writer</div><div>    vtkSmartPointer<vtkXMLPolyDataWriter> writer =</div><div>      vtkSmartPointer<vtkXMLPolyDataWriter>::New();</div><div><br></div><div>    // Build the filename</div><div>    char buffer[500];</div><div>    sprintf(buffer, "%06u", fileIndex);</div><div>    string filename =string("CuboidalIndenter_") +</div><div>      string(buffer) + string(".vtp");</div><div><br></div><div>    //printf("writing file to %s\n", filename.c_str());</div><div>    writer->SetFileName(filename.c_str());</div><div>    writer->SetInputConnection(cubeSource->GetOutputPort());</div><div><br></div><div><br></div><div>    // write the vtk file</div><div>    writer->SetDataModeToBinary();</div><div>    int result = writer->Write();</div><div>    if (result != 1) {</div><div>      printf("Error writing cuboidal indenter vtk file\n");</div><div><br></div><div> </div><div>I want to have the rotated cube as the output and currently I am using the object cubeSource which does not give me the rotated cube. <br>Can someone tell me how I can write out the rotated cube ? </div><div><br></div><div>Thank you so much! </div><div><br></div><div>-Ishan</div></div>