Rewrite File To Move 3D Model To Origin Point

The post shows a way to move 3D model to the original point in world coordinate system. The file CMakeLists.txt is similar to https://www.weiy.city/2021/12/find-closest-plane-between-points-in-3d-by-covariance-matrix/. The included file point.hpp can be found in https://www.weiy.city/2020/09/project-point-on-line-and-plane-by-special-direction/. #include <iostream> #include <vtkPolyData.h> #include <vtkActor.h> #include <vtkTransformFilter.h> #include “./point.hpp” #include <vtkTransform.h> #include <vtkSTLReader.h> #include <vtkSTLWriter.h> #define Read more…

Web – The Template About Sending File To Server

The post shows a template about how to send file to our remote server. We need to prepare html page, javascript and php script. HTML Page Write a web page and import front.js that contains submit event. front.html: <!DOCTYPE html> <html> <body> <div key=”uploadMeshContent” id=”content”> <input type=”file” id=”uploadMesh” name=”uploadMesh”/> <progress Read more…

File IO Between QFile And std fstream

The article show demoes about use ifstream to read file written by qfile and use qfile to read file written by ofstream. Use ifstream to read file written by QFile #include <QCoreApplication> #include <QString> #include <QFile> #include <iostream> #include <fstream> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QString Read more…

Open File By Browser & Set Mouse Position By VTK

Open File By Browser The FileReader object lets web applications asynchronously read the contents of file. You can feel the effect at: https://www.weiy.city/web-test/open-file/ <!doctype html> <html lang=”en”> <head> <title>Test</title> </head> <body> <input type=”file” id=”file-input” /> <h3>Contents of the file:</h3> <pre id=”file-content”></pre> <script> function displayContents(contents) { var element = document.getElementById(‘file-content’); element.textContent Read more…

VTK – Calculate Distance Between Two 3D Models

The post shows a way to calculate unsigned distance Between Two 3D Models. The models can’t have too low resolution because the result that vtkDistancePolyDataFilter computes will not be accurate. #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> Read more…

XML To JSON
: Input your strings, the tool can convert XML to JSON for you.

X