vtkActor GetCenter Return Center Of Bounding Box
The interface GetCenter gives us the center of bounding box rather than barycenter of model. Here is source code from VTK9.2.0.
The interface GetCenter gives us the center of bounding box rather than barycenter of model. Here is source code from VTK9.2.0.
In the mesh structure of 3D models, there is a kind of situation that can make many 3D algorithms useless or even break down. Because the default input model for many 3D algorithms is a manifold structure. But sometimes we get a data that is not manifold. The left side Read more…
There are two projection methods for camera setting, orthographic (paraller) projection and perspective projection, they have different view styles. The light of sight in orthographic (paraller) projection is just like the light of sun. So the segment length keeps same at far and near position. The model’s size is is Read more…
I had found a crash bug when use vtkContourWidget by webassembly in the post Crash Bug About vtkOpenGLPolyDataMapper::UpdateShaders In vtkAbstractWidget.As we know, SetResolveCoincidentTopologyToPolygonOffset for mapper can make web page crash, related post: The Interfaces In VTK Can’t Be Used With Webassembly. After reading the source code of vtkOrientedGlyphContourRepresentation::vtkOrientedGlyphContourRepresentation(), we know Read more…
The Interfaces In VTK Can’t Be Used With Webassembly Setting point size and line width doesn’t work vtkProperty.h Shift polygons, lines and points will fail in wasm. It will cause crash on web page. The new polydata generated by vtkFeatureEdge algorithm can’t be rendered in WebGL because something is wrong Read more…
I can’t display vtkContourWidget object on web page by wasm file.The following code snippet is very simple, create a circle and show it, we can modify it by vtkContourWidget object.The example works in CPlusCPlus program.VTK version: 9.0.2. But it will crash on our web page. Output: It seems something wrong Read more…
The post shows how to use VTK to display 3D model with shading.We need to make sure the version of VTK is equal to 9 or bigger than it.To avoid the faceted appearance, compute points’ normal to support to has shading at triangle vertices. Demo: Output: The faceted surface of Read more…
The post is related to The Example About vtkPolyDataNormals. If you want to use vtkPolyDataNormals to compute the normals of points, it’s better to set variable Splitting false. #include <vtkVersion.h> #include <vtkSmartPointer.h> #include <vtkSurfaceReconstructionFilter.h> #include <vtkProgrammableSource.h> #include <vtkContourFilter.h> #include <vtkReverseSense.h> #include <vtkPolyDataMapper.h> #include <vtkProperty.h> #include <vtkPolyData.h> #include <vtkCamera.h> #include <vtkRenderer.h> Read more…
We can use vtkTransform’s function concatenate to do matrix multiplication. There are three matrix which have the mathematical relationship. It’s equivalent to the following code. vtkSPtrNew( C, vtkTransform ); C->Concatenate(B); C->Concatenate(A); C->Update(); The experimental code: #include <iostream> #include <vtkSmartPointer.h> #include <vtkTransform.h> #define vtkSPtr vtkSmartPointer #define vtkSPtrNew(Var, Type) vtkSPtr<Type> Read more…