F = igl.eigen.MatrixXi() G = igl.eigen.MatrixXi() slice_z = 0.5 overlay = 0 # Load mesh: (V,T) tet-mesh of convex hull, F contains facets of input # surface mesh _after_ self-intersection resolution igl.readMESH(TUTORIAL_SHARED_PATH + "big-sigcat.mesh", V, T, F) # Compute barycenters of all tets igl.barycenter(V, T, BC) # Compute generalized winding number at all barycenters print("Computing winding number over all %i tets..." % T.rows()) igl.winding_number(V, F, BC, W) # Extract interior tets Wt = sum(W > 0.5) CT = igl.eigen.MatrixXi(Wt, 4) k = 0 for t in range(T.rows()): if W[t] > 0.5: CT.setRow(k, T.row(t)) k += 1 # find bounary facets of interior tets igl.boundary_facets(CT, G) # boundary_facets seem to be reversed... G = G.rowwiseReverse()