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…

VTK – Make Interpolation Spline Curve Smoother

Here are a few points like the following picture. The source code: #include <iostream> #include <vector> #include <iostream> #include <vtkPolyData.h> #include <vtkProperty.h> #include <vtkPolyDataMapper.h> #include <vtkActor.h> #include <vtkPlane.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkRenderWindowInteractor.h> #include <vtkPoints.h> #include <vtkInteractorStyleTrackballCamera.h> #include “./point.hpp” #include <vtkPlane.h> #include <vtkPlaneSource.h> #include <vtkTransform.h> #define vtkSPtr vtkSmartPointer #define Read more…

Generate Silhouette From 3d Mesh

Here is a 3D object lock from Create Lock By Blender. We can use vtkPolyDataSilhouette to extract a subset of a polygonal mesh edges to generate an outline (silhouette). #include <iostream> #include <vector> #include <iostream> #include <vtkPolyData.h> #include <vtkProperty.h> #include <vtkPolyDataMapper.h> #include <vtkActor.h> #include <vtkPlane.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include Read more…

Scale Image Displayed By vtkActor2D Object

The post shows a way to scale image which is displayed by vtkActor2D object. We used vtkImageResize that performs sinc interpolation on images to change their sizes. #include <vtkCamera.h> #include <vtkImageActor.h> #include <vtkImageCanvasSource2D.h> #include <vtkImageData.h> #include <vtkImageMapper3D.h> #include <vtkImageReader2.h> #include <vtkImageReader2Factory.h> #include <vtkImageResize.h> #include <vtkImageSincInterpolator.h> #include <vtkInteractorStyleImage.h> #include <vtkNamedColors.h> #include Read more…

Content Summary
: Input your strings, the tool can get a brief summary of the content for you.

X