diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f3290e..729384b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,6 +190,7 @@ set(PCU_BINDING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/flood_fill_3d.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/voxelize_triangle_mesh.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/remove_mesh_vertices.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/adjacency_list.cpp ) set(PCU_BINDING_SOURCES ${PCU_BINDING_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src/lloyd.cpp) diff --git a/point_cloud_utils/__init__.py b/point_cloud_utils/__init__.py index 0fc6a62..3838b4c 100644 --- a/point_cloud_utils/__init__.py +++ b/point_cloud_utils/__init__.py @@ -13,7 +13,7 @@ morton_add, morton_subtract, point_cloud_fast_winding_number, \ sparse_voxel_grid_boundary, marching_cubes_sparse_voxel_grid, decimate_triangle_mesh, \ remove_unreferenced_mesh_vertices, mesh_face_areas, triangle_soup_fast_winding_number, \ - _voxel_mesh_internal, remove_mesh_vertices + _voxel_mesh_internal, remove_mesh_vertices, adjacency_list # mesh_principal_curvatures, \ from ._sinkhorn import * diff --git a/setup.py b/setup.py index f7e044c..f093894 100644 --- a/setup.py +++ b/setup.py @@ -88,7 +88,7 @@ def main(): setuptools.setup( name="point-cloud-utils", - version="0.30.3", + version="0.30.4", author="Francis Williams", author_email="francis@fwilliams.info", description="A Python library for common tasks on 3D point clouds and meshes", diff --git a/src/adjacency_list.cpp b/src/adjacency_list.cpp new file mode 100644 index 0000000..72e6c60 --- /dev/null +++ b/src/adjacency_list.cpp @@ -0,0 +1,33 @@ +#include +#include + +#include + +#include "common/common.h" + + + +const char* adjacency_list_doc = R"igl_Qu8mg5v7( +Compute the adjacency list given a set of mesh faces. + +Args: + f : \#f by 3 Matrix of face (triangle) indices + +Returns: + adj_list : a list of lists such that adj_list[i] contains the indexes of vertices adjacent to vertex i + +)igl_Qu8mg5v7"; +npe_function(adjacency_list) +npe_doc(adjacency_list_doc) +npe_arg(f, dense_int32, dense_int64) +npe_begin_code() +{ + validate_mesh_faces(f); + + std::vector> A; + + igl::adjacency_list(f, A); + + return A; +} +npe_end_code() \ No newline at end of file diff --git a/src/remove_mesh_vertices.cpp b/src/remove_mesh_vertices.cpp index acc9695..afb7ed7 100644 --- a/src/remove_mesh_vertices.cpp +++ b/src/remove_mesh_vertices.cpp @@ -17,8 +17,7 @@ Removes vertices specified by a mask from a triangle mesh and updates the face i Returns: v_out : (\#v, 3)-shaped array of mesh vertices with the mask applied f_out : (\#f, 3)-shaped array of mesh faces corresponding to mesh with removed vertices -See also: - deduplicate_point_cloud + )igl_Qu8mg5v7"; npe_function(remove_mesh_vertices) npe_doc(remove_mesh_vertices_doc)