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…

Blender: Create Rotate And Move Operators

The post shows how to create rotate and move operators by blender. Tutorial video has been uploaded to youtube and bilibili. youtube bilibili The STL file in the video can be downloaded by the link: https://www.jianguoyun.com/p/DYDF0IIQjNHfCRiqu54E https://www.jianguoyun.com/p/DUNDiDMQjNHfCRitu54E

Make Your WordPress Website Has The Ability To Check Network Connection.

The post introduce a way to make your wordpress website has the ability to check network connection. Install the plugin Insert Headers and Footers for wordpress. Add the following code in header part. <script> if (“serviceWorker” in navigator) { navigator.serviceWorker.register(“/serviceworker.js”) .then(function(registration) { console.log(“Service Worker registered with scope:”, registration.scope); }).catch(function(err) { Read more…

Use Singular Value Decomposition In VTK

Affine transformation can be decomposed to translation, rotation, and scale. As we know, the transformation can be represented by matrix.     Related post: https://www.weiy.city/2021/11/the-releationship-between-local-transform-and-pose-transform/ It can be computed by translate matrix and rotate & scale matrix.     Example: I try to do decomposition for a matrix.     Read more…

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

X