vtkSelectPolyData可能存在bug ?
单纯看“Can’t follow edge”的错误提示,我没能得到有价值的线索。不管怎么说,在使用该对象处理数据之前居然需要写读一遍信息本身就显得很诡异,或者,这就是VTK8.2上的一个bug?也许,当我升级VTK之后才能找到答案。
单纯看“Can’t follow edge”的错误提示,我没能得到有价值的线索。不管怎么说,在使用该对象处理数据之前居然需要写读一遍信息本身就显得很诡异,或者,这就是VTK8.2上的一个bug?也许,当我升级VTK之后才能找到答案。
The article introduces how to expand the sampling area from a cell. I marked the area red color, the center point is computed as the mass center of the original cell. Step 1, find all cells which are near to the center point within a distance. We can use the Read more…
I wanted to find the area in the black circle on the tooth surface, so the algorithm class vtkSelectPolyData was used in my project. The idealized result looks like the following picture. Unfortunately, I got the bad region as this scene. After reading the source code about vtkSelectPolyData, I found Read more…
We create a simple scene for the first time, cone and axes are in the point (0, 0, 0). #include <iostream> #include <vtkSmartPointer.h> #include <vtkSphereSource.h> #include <vtkActor.h> #include <vtkConeSource.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkPolyDataMapper.h> #include <vtkLineSource.h> #include <vtkRenderWindowInteractor.h> #include <vtkAxesActor.h> #include <vtkProperty.h> #include <vtkXMLPolyDataReader.h> #include <vtkCharArray.h> #include <vtkPointData.h> #include Read more…
This post introduces a way to find the biggest plane on the 3D model. We expand the initial cell by comparing its normal with neighbor’s normal. It indicates they are on a plane if the two normals of cells are approximately equal. I use vtkOBBTree to find the min axes Read more…
The article introduces two ways to calculate the distance from a point to a line. One use dot product by two vectors to get distance vector, and the other use cross product by vectors to achieve it. Let’s assume the point is P, two endpoints of the line are L1 Read more…
We can use vtkImplicitPolyDataDistance to calculate the distance from a point to the target polydata. It’s better than calculating the distance by iterating to the search point. The following example puts a sphere that radius is 1 and origin is (0, 0, 0) in the renderer. Our test point is Read more…
We define all edges in the boundary have no neighbor cells. It indicates that there is no boundary on the closed surface. In the following example, I read an STL file and get an arch. Step 1, clip the original arch with a plane that has normal (0, 1, 0) Read more…
We can find that vtkOrientedGlyphContourRepresentation supports to set 3D model always above other objects. // Create the contour widget vtkSmartPointer<vtkContourWidget> contourWidget = vtkSmartPointer<vtkContourWidget>::New(); // Override the default representation for the contour widget to customize its look vtkSmartPointer<vtkOrientedGlyphContourRepresentation> contourRepresentation = vtkSmartPointer<vtkOrientedGlyphContourRepresentation>::New(); // … contourWidget->SetRepresentation(contourRepresentation); contourRepresentation->SetAlwaysOnTop( true ); I readed the code Read more…