[Python] Get indices of edge points computed with extract_feature_edges()

Discussão em 'Python' iniciado por Stack, Agosto 2, 2025.

  1. Stack

    Stack Membro Participativo

    I have a non-closed surface in STL. I read it as PolyData with PyVista and I want to get edge points indices. I go this way:

    bot_surf_file = r'bottom.stl'
    bot_surf_mesh = pv.PolyData(bot_surf_file)

    points = bot_surf_mesh.points
    triangles = bot_surf_mesh.faces.reshape((bot_surf_mesh.n_cells, 4))[:, 1:]

    edges = bot_surf_mesh.extract_feature_edges(boundary_edges=True)
    edge_points_indices = np.where(np.all(np.isin(bot_surf_mesh.points, edges.points), axis=1))


    But I dont really want to rely on numpy.where. I believe there must be a way to get indices right from pyvista PolyData object.

    Continue reading...

Compartilhe esta Página