Skip to content

Instantly share code, notes, and snippets.

@1f0
Created July 7, 2018 15:09
Show Gist options
  • Select an option

  • Save 1f0/afc39835ec1745e735d04e471f14ab98 to your computer and use it in GitHub Desktop.

Select an option

Save 1f0/afc39835ec1745e735d04e471f14ab98 to your computer and use it in GitHub Desktop.
judge if a mesh has boundary
from __future__ import print_function
import sys
import vtk
reader = vtk.vtkOBJReader()
reader.SetFileName(sys.argv[1])
reader.Update()
featureEdges = vtk.vtkFeatureEdges()
featureEdges.BoundaryEdgesOn();
featureEdges.FeatureEdgesOff();
featureEdges.ManifoldEdgesOff();
featureEdges.NonManifoldEdgesOff();
featureEdges.SetInputConnection(reader.GetOutputPort())
featureEdges.Update()
print(featureEdges.GetOutput().GetNumberOfPoints() > 0)
@1f0
Copy link
Author

1f0 commented Jul 17, 2018

When every point has normal, this code fails since it make every edge boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment