Get Normals Of Points By vtkPolyDataNormals

The post is related to The Example About vtkPolyDataNormals. If you want to use vtkPolyDataNormals to compute the normals of points, it’s better to set variable Splitting false. #include <vtkVersion.h> #include <vtkSmartPointer.h> #include <vtkSurfaceReconstructionFilter.h> #include <vtkProgrammableSource.h> #include <vtkContourFilter.h> #include <vtkReverseSense.h> #include <vtkPolyDataMapper.h> #include <vtkProperty.h> #include <vtkPolyData.h> #include <vtkCamera.h> #include <vtkRenderer.h> Read more…

Matrix Multiplication And vtkTransform Concatenate

We can use vtkTransform’s function concatenate to do matrix multiplication. There are three matrix which have the mathematical relationship.     It’s equivalent to the following code. vtkSPtrNew( C, vtkTransform ); C->Concatenate(B); C->Concatenate(A); C->Update(); The experimental code: #include <iostream> #include <vtkSmartPointer.h> #include <vtkTransform.h> #define vtkSPtr vtkSmartPointer #define vtkSPtrNew(Var, Type) vtkSPtr<Type> Read more…

Flip Item – Mirror Symmetry

As we know, we can create a linear transform to change model to the special orientation and position. Refer to The Releationship Between Local Transform And Pose Transform. Let’s define orientation and position by three axis and point. , , and origin = . The matrix for the linear transform Read more…

vtkAbstractTransform::DeepCopy May Fail

Here is a example that vtkTransform object failed to deep copy the other one. #include <iostream> #include <vtkSmartPointer.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkTransform.h> #define vtkSPtr vtkSmartPointer #define vtkSPtrNew(Var, Type) vtkSPtr<Type> Var = vtkSPtr<Type>::New(); int main() { setbuf( stdout, nullptr ); vtkSPtrNew( trans, vtkTransform ); auto matrix = trans->GetMatrix(); matrix->SetElement( Read more…

The Process Of Rotating Object Around Special Point

Original Status The initial scene looks like the following image. I will rotate cone around point (1, 0, 0) and direction (0, 0, 1). Code #include <vtkActor.h> #include <vtkCleanPolyData.h> #include <vtkDistancePolyDataFilter.h> #include <vtkNamedColors.h> #include <vtkNew.h> #include <vtkPointData.h> #include <vtkPolyDataMapper.h> #include <vtkPolyDataReader.h> #include <vtkProperty.h> #include <vtkRenderWindow.h> #include <vtkRenderWindowInteractor.h> #include <vtkRenderer.h> #include Read more…

Tex To PDF
: convert the Latex file which suffix is tex to a PDF file

X