VTK
Smooth Model Suface To Plane
We have a model looks like in the following scene. It has been cut by a plane but the shape changed after that. So its surface become not flat. I got the cut plane information and planed to project all Read more…
We have a model looks like in the following scene. It has been cut by a plane but the shape changed after that. So its surface become not flat. I got the cut plane information and planed to project all Read more…
I find a old C plus plus project wrote all log to a local file, it didn’t truncate the local file but just append strings. Here is a simple file, I used the string “finished” to split it to different Read more…
The article is similar to my old post C++: Save Data To A Local File That Humans Can Read. I want to save a little data into a local file that human can’t read it. It is best done conveniently Read more…
The article describe a simple way to display point id list on the original model. We use VTK to draw and show all scenes. vtkSmartPointer<vtkPolyData> UShowData::ShowListByPoints(vtkSmartPointer<vtkPolyData> polyData, vtkSmartPointer<vtkIdList> list) { vSPNew( result, vtkPolyData ); vSPNew( resultPts, vtkPoints ); vSPNew( resultVerts, Read more…
Rotate Vector To Orthogonal Direction Just like in the picture, we will rotate vector to which is orthogonal to the neighbor . The vector is the cross product of and . #include <iostream> #include “point.hpp” int main() { Point m( Read more…
The article shows how to combine two mesh objects to one based on VTK. The code snippet is in the following part. #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> Read more…
I write a few file IO functions which are used in windows and mac os x. bool CopyAFile(const std::string inFile, const std::string outFile); bool RemoveFile(const std::string filePath); void RemoveDir(const std::string folderPath); void MoveAFile(const std::string oldFile, const std::string newFile); void CheckFolderExist(const Read more…
Add subdirectories and use VTK library and Qt in my projects. The file structure looks like the following image. projectB generates lib and dll files which will be used by projectA. projectA show a window and print message from Base Read more…
typeid.name The function typeid.name can give us the information about variable. Header file: typeinfo #include <typeinfo> int main() { vector<bool> vec{ false, true }; auto ans = vec[0]; cout << typeid(ans).name() << endl; bool tmp = false; cout << typeid(tmp).name() Read more…