Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program stuck at decimation step #22

Open
Shaokun-X opened this issue Feb 5, 2021 · 1 comment
Open

Program stuck at decimation step #22

Shaokun-X opened this issue Feb 5, 2021 · 1 comment

Comments

@Shaokun-X
Copy link
Contributor

The program stuck at line 174 in vtkutils.py:

def reduceMesh(mymesh, reductionFactor):
    """Reduce the number of triangles in a mesh using VTK's QuadricDecimation
    filter."""
    try:
        t = time.perf_counter()
        deci = vtk.vtkQuadricDecimation()
        deci.SetTargetReduction(reductionFactor)
        if vtk.vtkVersion.GetVTKMajorVersion() >= 6:
            deci.SetInputData(mymesh)
        else:
            deci.SetInput(mymesh)
        deci.Update()
        # ......

I checked the official documentation, in the given example it uses vtk.vtkDecimatePro() instead of vtk.vtkQuadricDecimation(), and this fixes the problem.

My environment:

OS: Windows 10
CPU: AMD
VTK: 9.0.2 installed via pip
Python: 3.8.3
@dave3d
Copy link
Owner

dave3d commented Feb 5, 2021

Interesting. I never had any problem with the quadric decimation filter. It probably depends on the particular data set. I could make it an option, which algorithm to use.

I always preferred the quadric decimation because I though it was a cool algorithm, and my friend wrote the VTK class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants