Skip to content

Commit 00181fa

Browse files
committed
adjacency list
1 parent 47f760a commit 00181fa

File tree

5 files changed

+37
-4
lines changed

5 files changed

+37
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ set(PCU_BINDING_SOURCES
190190
${CMAKE_CURRENT_SOURCE_DIR}/src/flood_fill_3d.cpp
191191
${CMAKE_CURRENT_SOURCE_DIR}/src/voxelize_triangle_mesh.cpp
192192
${CMAKE_CURRENT_SOURCE_DIR}/src/remove_mesh_vertices.cpp
193+
${CMAKE_CURRENT_SOURCE_DIR}/src/adjacency_list.cpp
193194
)
194195

195196
set(PCU_BINDING_SOURCES ${PCU_BINDING_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src/lloyd.cpp)

point_cloud_utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
morton_add, morton_subtract, point_cloud_fast_winding_number, \
1414
sparse_voxel_grid_boundary, marching_cubes_sparse_voxel_grid, decimate_triangle_mesh, \
1515
remove_unreferenced_mesh_vertices, mesh_face_areas, triangle_soup_fast_winding_number, \
16-
_voxel_mesh_internal, remove_mesh_vertices
16+
_voxel_mesh_internal, remove_mesh_vertices, adjacency_list
1717
# mesh_principal_curvatures, \
1818

1919
from ._sinkhorn import *

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def main():
8888

8989
setuptools.setup(
9090
name="point-cloud-utils",
91-
version="0.30.3",
91+
version="0.30.4",
9292
author="Francis Williams",
9393
author_email="francis@fwilliams.info",
9494
description="A Python library for common tasks on 3D point clouds and meshes",

src/adjacency_list.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <npe.h>
2+
#include <pybind11/stl.h>
3+
4+
#include <igl/adjacency_list.h>
5+
6+
#include "common/common.h"
7+
8+
9+
10+
const char* adjacency_list_doc = R"igl_Qu8mg5v7(
11+
Compute the adjacency list given a set of mesh faces.
12+
13+
Args:
14+
f : \#f by 3 Matrix of face (triangle) indices
15+
16+
Returns:
17+
adj_list : a list of lists such that adj_list[i] contains the indexes of vertices adjacent to vertex i
18+
19+
)igl_Qu8mg5v7";
20+
npe_function(adjacency_list)
21+
npe_doc(adjacency_list_doc)
22+
npe_arg(f, dense_int32, dense_int64)
23+
npe_begin_code()
24+
{
25+
validate_mesh_faces(f);
26+
27+
std::vector<std::vector<int>> A;
28+
29+
igl::adjacency_list(f, A);
30+
31+
return A;
32+
}
33+
npe_end_code()

src/remove_mesh_vertices.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ Removes vertices specified by a mask from a triangle mesh and updates the face i
1717
Returns:
1818
v_out : (\#v, 3)-shaped array of mesh vertices with the mask applied
1919
f_out : (\#f, 3)-shaped array of mesh faces corresponding to mesh with removed vertices
20-
See also:
21-
deduplicate_point_cloud
20+
2221
)igl_Qu8mg5v7";
2322
npe_function(remove_mesh_vertices)
2423
npe_doc(remove_mesh_vertices_doc)

0 commit comments

Comments
 (0)