Create 2D Grid On Screen By VTK
The post shows a way to create 2D grid on screen by VTK. Show it by vtkActor2D because we regard it as a 2D object. Its default coordinate system is viewport which is rendering. So we will have to know Read more…
The post shows a way to create 2D grid on screen by VTK. Show it by vtkActor2D because we regard it as a 2D object. Its default coordinate system is viewport which is rendering. So we will have to know Read more…
I created a 2D convex hull and wanted to check whether a point is inside it. If the point is inside the polygon, the neighbor cross product vectors have the same directions. If the point is outside, one vector is Read more…
The post shows how to find 2D convex hull and 3D convex hull from points cloud by VTK. Here are some points on screen, finally I add a specail point that z value is not 0 for test 3D convex Read more…
I export scene from ParaView to get a mesh like the following image. Let’s take edge lists from different parts and form two independent meshes. #include <iostream> #include <vtkSmartPointer.h> #include <vtkSphereSource.h> #include <vtkActor.h> #include <vtkConeSource.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include Read more…
The article discuss an issue about set position for vtkTextActor object. The class vtkTextActor provides interface SetPosition, its parameter controls object’s left-bottom coordinate. /** * Get the PositionCoordinate instance of vtkCoordinate. * This is used for for complicated or relative Read more…
If two numbers are equal and the relative positions are not changed after sorting, we think the sorting algorithm is stable. Stable sort algorithm: bubble sort, insert sort and merge sort. Unstable sort algorithm: quick sort, heap sort. Introduce an Read more…
We often subtract mesh by other object to get the result we want. The scene looks like the following image. #include <iostream> #include <vtkSmartPointer.h> #include <vtkSphereSource.h> #include <vtkActor.h> #include <vtkConeSource.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkPolyDataMapper.h> #include <vtkRenderWindowInteractor.h> #include <vtkClipPolyData.h> Read more…
I want to cut the cone by two planes to remove the right-top part just as the following image. Rewrite vtkClipPolyData We can add multible clip functions for vtkClipPolyData to make it works. The files about the class multiClipPolyData had Read more…
Let’s describe a 3D parametric curve by the form. The value s is in [0, 1]. It is a circle when s is zero, in the other situations it represents a spiral. #include <vtkPointData.h> #include <vtkSmartPointer.h> #include <vtkRenderWindow.h> #include <vtkRenderWindowInteractor.h> Read more…