diff --git a/CMakeLists.txt b/CMakeLists.txt index ad960fc..7b9c7d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ set(EXTERNAL_DEP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external) include(DownloadExternalDeps) download_dep(numpyeigen GIT_REPOSITORY https://github.com/fwilliams/numpyeigen.git - GIT_TAG 70f3f100f23e9fc5888edcfd9ad38312b222c7ea + GIT_TAG master ) list(APPEND CMAKE_MODULE_PATH ${EXTERNAL_DEP_DIR}/numpyeigen/cmake) set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/src/closest_point_on_mesh.cpp b/src/closest_point_on_mesh.cpp index d61aba6..1e688e1 100644 --- a/src/closest_point_on_mesh.cpp +++ b/src/closest_point_on_mesh.cpp @@ -25,7 +25,7 @@ Compute distances from a set of points p to a triangle mesh (v, f) npe_function(closest_points_on_mesh) npe_arg(p, dense_float, dense_double) npe_arg(v, npe_matches(p)) -npe_arg(f, dense_int, dense_longlong, dense_uint, dense_ulonglong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_doc(closest_points_on_mesh_doc) npe_begin_code() { diff --git a/src/connected_components.cpp b/src/connected_components.cpp index 17a0e5a..a47f62a 100644 --- a/src/connected_components.cpp +++ b/src/connected_components.cpp @@ -82,7 +82,7 @@ Determine the connected components of a mesh npe_function(connected_components) npe_doc(connected_components_doc) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_long, dense_longlong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_begin_code() { Eigen::SparseMatrix A; diff --git a/src/curvature.cpp b/src/curvature.cpp index 3e05522..d889580 100644 --- a/src/curvature.cpp +++ b/src/curvature.cpp @@ -45,7 +45,7 @@ Estimate principal curvature directions and magnitudes for a mesh )Qu8mg5v7"; npe_function(mesh_principal_curvatures) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_long, dense_longlong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_default_arg(r, double, -1.0) npe_doc(mesh_principal_curvatures_doc) npe_begin_code() @@ -94,7 +94,7 @@ npe_end_code() //)Qu8mg5v7"; //npe_function(mesh_mean_and_gaussian_curvatures) //npe_arg(v, dense_float, dense_double) -//npe_arg(f, dense_int, dense_long, dense_longlong) +//npe_arg(f, dense_int32, dense_int64) //npe_doc(mesh_mean_and_gaussian_curvatures_doc) //npe_begin_code() //{ @@ -122,7 +122,7 @@ npe_end_code() //)Qu8mg5v7"; //npe_function(pointcloud_apss_curvature) //npe_arg(v, dense_float, dense_double) -//npe_arg(f, dense_int, dense_long, dense_longlong) +//npe_arg(f, dense_int32, dense_int64) //npe_doc(pointcloud_apss_curvature_doc) //npe_begin_code() //{ diff --git a/src/face_areas.cpp b/src/face_areas.cpp index fd66793..02ca3b1 100644 --- a/src/face_areas.cpp +++ b/src/face_areas.cpp @@ -16,7 +16,7 @@ Compute the areas of each face of a triangle mesh )Qu8mg5v7"; npe_function(mesh_face_areas) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_long, dense_longlong) +npe_arg(f, dense_int32, dense_int64) npe_default_arg(num_threads, int, -1) npe_doc(triangle_mesh_face_areas_doc) npe_begin_code() diff --git a/src/fast_winding_numbers.cpp b/src/fast_winding_numbers.cpp index 242e71e..ec2b257 100644 --- a/src/fast_winding_numbers.cpp +++ b/src/fast_winding_numbers.cpp @@ -19,7 +19,7 @@ at a set of query points )igl_Qu8mg5v7"; npe_function(triangle_soup_fast_winding_number) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_long, dense_longlong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(p, npe_matches(v)) npe_doc(triangle_soup_fast_winding_number_doc) npe_begin_code() diff --git a/src/flood_fill_3d.cpp b/src/flood_fill_3d.cpp index 627f047..0d2982f 100644 --- a/src/flood_fill_3d.cpp +++ b/src/flood_fill_3d.cpp @@ -53,7 +53,7 @@ void flood_fill(EigenMat& grid, npe_function(_flood_fill_3d_internal) -npe_arg(grid, dense_int, dense_long, dense_longlong, dense_float, dense_double) +npe_arg(grid, dense_int32, dense_int64, dense_float, dense_double) npe_arg(seed_x, int) npe_arg(seed_y, int) npe_arg(seed_z, int) diff --git a/src/lloyd.cpp b/src/lloyd.cpp index 047c689..9f54790 100644 --- a/src/lloyd.cpp +++ b/src/lloyd.cpp @@ -356,7 +356,7 @@ Lloyd's algorithm (https://en.wikipedia.org/wiki/Lloyd%27s_algorithm). npe_function(sample_mesh_lloyd) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_long, dense_longlong, dense_uint, dense_ulong, dense_ulonglong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(num_samples, int) npe_default_arg(num_lloyd, int, 10) npe_default_arg(num_newton, int, 10) diff --git a/src/manifold.cpp b/src/manifold.cpp index d9878ea..7a539cc 100644 --- a/src/manifold.cpp +++ b/src/manifold.cpp @@ -18,7 +18,7 @@ Convert a mesh into a watertight manifold using the [Manifold](https://arxiv.org )igl_Qu8mg5v7"; npe_function(make_mesh_watertight) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_long, dense_longlong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_default_arg(resolution, double, 20000) npe_default_arg(seed, int, -1) npe_doc(make_mesh_watertight_doc) diff --git a/src/marching_cubes.cpp b/src/marching_cubes.cpp index 79e8e59..74cd220 100644 --- a/src/marching_cubes.cpp +++ b/src/marching_cubes.cpp @@ -35,7 +35,7 @@ See Also: npe_function(marching_cubes_sparse_voxel_grid) npe_arg(grid_scalars, dense_float, dense_double) npe_arg(grid_coordinates, dense_float, dense_double) -npe_arg(cube_indices, dense_int, dense_long, dense_longlong) +npe_arg(cube_indices, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(isovalue, double) npe_doc(marching_cubes_sparse_voxel_grid_doc) npe_begin_code() diff --git a/src/mesh_decimate.cpp b/src/mesh_decimate.cpp index 598cf1f..2e2840b 100644 --- a/src/mesh_decimate.cpp +++ b/src/mesh_decimate.cpp @@ -22,7 +22,7 @@ Decimate a (manifold) triangle mesh by collapsing edges )Qu8mg5v7"; npe_function(decimate_triangle_mesh) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_long, dense_longlong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(max_faces, int) npe_default_arg(decimation_heuristic, std::string, "shortest_edge") npe_doc(decimate_triangle_mesh_doc) diff --git a/src/mesh_for_voxels.cpp b/src/mesh_for_voxels.cpp index 6338041..1d287ca 100644 --- a/src/mesh_for_voxels.cpp +++ b/src/mesh_for_voxels.cpp @@ -13,7 +13,6 @@ namespace { const MatrixIJK& in_ijk, Eigen::Matrix& out_v, Eigen::Matrix& out_f) { - std::array indices = { //Top 2, 7, 6, @@ -60,7 +59,7 @@ namespace { Eigen::Vector3d vertex(vertices[vi * 3 + 0] * (1.0 - gap_fraction) + 0.5 * gap_fraction, vertices[vi * 3 + 1] * (1.0 - gap_fraction) + 0.5 * gap_fraction, vertices[vi * 3 + 2] * (1.0 - gap_fraction) + 0.5 * gap_fraction); - Eigen::Vector3d voxel_translation(in_ijk(i, 0), in_ijk(i, 1), in_ijk(i, 2)); + Eigen::Vector3d voxel_translation((double) in_ijk(i, 0), (double) in_ijk(i, 1), (double) in_ijk(i, 2)); vertex += voxel_translation; vertex.array() *= vox_size.array(); vertex += vox_origin; @@ -82,10 +81,10 @@ namespace { npe_function(_voxel_mesh_internal) -npe_arg(ijk, dense_int, dense_long, dense_longlong) +npe_arg(ijk, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(gap_fraction, double) -npe_arg(vox_origin, dense_double) -npe_arg(vox_size, dense_double) +npe_arg(vox_origin, dense_float, dense_double) +npe_arg(vox_size, dense_float, dense_double) npe_begin_code() using MatrixI = Eigen::Matrix; using MatrixF = Eigen::Matrix; @@ -99,12 +98,12 @@ npe_begin_code() throw pybind11::value_error("Invalid shape"); } - Eigen::Vector3d vsize = vox_size; + Eigen::Vector3d vsize = vox_size.template cast(); if (vsize[0] <= 0.0 || vsize[1] <= 0.0 || vsize[2] <= 0.0) { throw pybind11::value_error("Voxel size must be positive"); } - Eigen::Vector3d vorgn = vox_origin; + Eigen::Vector3d vorgn = vox_origin.template cast(); MatrixF geom_vertices; MatrixI geom_faces; diff --git a/src/mesh_normals.cpp b/src/mesh_normals.cpp index 69cf29a..97f3c12 100644 --- a/src/mesh_normals.cpp +++ b/src/mesh_normals.cpp @@ -24,7 +24,7 @@ Compute vertex normals of a mesh from its vertices and faces using face area wei npe_function(estimate_mesh_vertex_normals) npe_doc(estimate_mesh_vertex_normals_doc) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_longlong, dense_uint, dense_ulonglong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_default_arg(weighting_type, std::string, std::string("uniform")) npe_begin_code() { @@ -65,7 +65,7 @@ Compute vertex normals of a mesh from its vertices and faces using face area wei npe_function(estimate_mesh_face_normals) npe_doc(estimate_mesh_face_normals_doc) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_longlong, dense_uint, dense_ulonglong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_begin_code() { validate_mesh(v, f); diff --git a/src/morton.cpp b/src/morton.cpp index 06852af..33e1ddc 100644 --- a/src/morton.cpp +++ b/src/morton.cpp @@ -24,8 +24,8 @@ Add morton codes together (corresponding to adding the vectors they encode) )Qu8mg5v7"; npe_function(morton_add) -npe_arg(codes_1, dense_uint, dense_ulong, dense_ulonglong) -npe_arg(codes_2, dense_uint, dense_ulong, dense_ulonglong) +npe_arg(codes_1, dense_uint32, dense_uint64) +npe_arg(codes_2, dense_uint32, dense_uint64) npe_default_arg(num_threads, int, -1) npe_doc(morton_add) npe_begin_code() @@ -104,8 +104,8 @@ Subtract morton codes from each other (corresponding to adding the vectors they )Qu8mg5v7"; npe_function(morton_subtract) -npe_arg(codes_1, dense_uint, dense_ulong, dense_ulonglong) -npe_arg(codes_2, dense_uint, dense_ulong, dense_ulonglong) +npe_arg(codes_1, dense_uint32, dense_uint64) +npe_arg(codes_2, dense_uint32, dense_uint64) npe_default_arg(num_threads, int, -1) npe_doc(morton_subtract) npe_begin_code() @@ -183,7 +183,7 @@ Encode n 3D points using Morton coding, possibly sorting them )Qu8mg5v7"; npe_function(morton_encode) -npe_arg(pts, dense_int, dense_long, dense_longlong) +npe_arg(pts, dense_int32, dense_int64) npe_default_arg(num_threads, int, -1) npe_doc(morton_encode) npe_begin_code() @@ -251,7 +251,7 @@ Decode n points along a Morton curve into 3D points )Qu8mg5v7"; npe_function(morton_decode) -npe_arg(codes, dense_uint, dense_ulong, dense_ulonglong) +npe_arg(codes, dense_uint32, dense_uint64) npe_doc(morton_decode) npe_default_arg(num_threads, int, -1) npe_begin_code() @@ -322,7 +322,7 @@ Queries a sorted array of morton encoded points to find the (approximate) k near )Qu8mg5v7"; npe_function(morton_knn) -npe_arg(codes, dense_uint, dense_ulong, dense_ulonglong) +npe_arg(codes, dense_uint32, dense_uint64) npe_arg(qcodes, npe_matches(codes)) npe_arg(k, int) npe_default_arg(sort_dist, bool, true) diff --git a/src/orient_mesh_faces.cpp b/src/orient_mesh_faces.cpp index e650ee5..5620f78 100644 --- a/src/orient_mesh_faces.cpp +++ b/src/orient_mesh_faces.cpp @@ -20,7 +20,7 @@ Consistently orient faces of a mesh within each connected component )igl_Qu8mg5v7"; npe_function(orient_mesh_faces) npe_doc(orient_mesh_faces_doc) -npe_arg(f, dense_int, dense_longlong, dense_uint, dense_ulonglong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_default_arg(weighting_type, std::string, std::string("uniform")) npe_begin_code() { diff --git a/src/point_areas.cpp b/src/point_areas.cpp index 463aa05..18deb14 100644 --- a/src/point_areas.cpp +++ b/src/point_areas.cpp @@ -15,7 +15,7 @@ at a set of query points )igl_Qu8mg5v7"; npe_function(estimate_point_cloud_areas) npe_arg(p, dense_float, dense_double) -npe_arg(i, dense_int, dense_long, dense_longlong) +npe_arg(i, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(n, npe_matches(v)) npe_doc(estimate_point_cloud_areas_doc) npe_begin_code() diff --git a/src/ray_mesh_intersection.cpp b/src/ray_mesh_intersection.cpp index 2f35b1c..dd48ce9 100644 --- a/src/ray_mesh_intersection.cpp +++ b/src/ray_mesh_intersection.cpp @@ -18,7 +18,7 @@ void hack_extra_ray_mesh_bindings(pybind11::module& m) { npe_function(_populate_ray_intersector_internal) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_longlong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(isector, std::shared_ptr) npe_begin_code() igl::embree::EmbreeIntersector::PointMatrixType v_copy = v.template cast(); @@ -106,7 +106,7 @@ Compute intersection between a set of rays and a triangle mesh )Qu8mg5v7"; npe_function(ray_mesh_intersection) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_longlong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(ray_o, npe_matches(v)) npe_arg(ray_d, npe_matches(v)) npe_default_arg(ray_near, double, 0.0) diff --git a/src/remove_duplicates.cpp b/src/remove_duplicates.cpp index 70161a9..5b63c21 100644 --- a/src/remove_duplicates.cpp +++ b/src/remove_duplicates.cpp @@ -69,7 +69,7 @@ See also: npe_function(deduplicate_mesh_vertices) npe_doc(remove_duplicate_mesh_vertices_doc) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_longlong, dense_uint, dense_ulonglong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(epsilon, double) npe_default_arg(return_index, bool, true) npe_begin_code() diff --git a/src/remove_unreferenced_mesh_vertices.cpp b/src/remove_unreferenced_mesh_vertices.cpp index e1efa6b..b4e298f 100644 --- a/src/remove_unreferenced_mesh_vertices.cpp +++ b/src/remove_unreferenced_mesh_vertices.cpp @@ -23,7 +23,7 @@ some threshold npe_function(remove_unreferenced_mesh_vertices) npe_doc(remove_unreferenced_mesh_vertices_doc) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_longlong, dense_uint, dense_ulonglong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_begin_code() { validate_mesh(v, f); diff --git a/src/sample_mesh.cpp b/src/sample_mesh.cpp index c36d9a1..4c21029 100644 --- a/src/sample_mesh.cpp +++ b/src/sample_mesh.cpp @@ -126,7 +126,7 @@ Downsample a point set (possibly on a mesh) so that samples are approximately ev )Qu8mg5v7"; npe_function(sample_mesh_poisson_disk) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_longlong, dense_uint, dense_ulonglong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(num_samples, int) npe_default_arg(radius, double, 0.0) npe_default_arg(use_geodesic_distance, bool, true) @@ -231,7 +231,7 @@ Generate uniformly distributed random point samples on a mesh )Qu8mg5v7"; npe_function(sample_mesh_random) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_longlong, dense_uint, dense_ulonglong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(num_samples, int) npe_default_arg(random_seed, unsigned int, 0) npe_doc(sample_mesh_random_doc) diff --git a/src/signed_distance.cpp b/src/signed_distance.cpp index d396dd3..9226398 100644 --- a/src/signed_distance.cpp +++ b/src/signed_distance.cpp @@ -22,7 +22,7 @@ Computes signed distances of a point cloud with respect to a Mesh using Fast Win npe_function(signed_distance_to_mesh) npe_arg(p, dense_float, dense_double) npe_arg(v, npe_matches(p)) -npe_arg(f, dense_int, dense_long, dense_longlong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_default_arg(lower_bound, float, -std::numeric_limits::infinity()) npe_default_arg(upper_bound, float, std::numeric_limits::infinity()) npe_doc(signed_distance_doc) diff --git a/src/smooth.cpp b/src/smooth.cpp index a9b4596..e520dd1 100644 --- a/src/smooth.cpp +++ b/src/smooth.cpp @@ -41,7 +41,7 @@ Smooth a mesh using Laplacian smoothing npe_function(laplacian_smooth_mesh) npe_doc(laplacian_smooth_mesh_doc) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_longlong, dense_uint, dense_ulonglong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(num_iters, int) npe_default_arg(use_cotan_weights, bool, false) npe_begin_code() diff --git a/src/sparse_voxel_grid.cpp b/src/sparse_voxel_grid.cpp index e57f267..909bf49 100644 --- a/src/sparse_voxel_grid.cpp +++ b/src/sparse_voxel_grid.cpp @@ -159,7 +159,7 @@ npe_end_code() npe_function(dilate_sparse_voxel_grid_internal) -npe_arg(grid_coordinates, dense_int, dense_long, dense_longlong) +npe_arg(grid_coordinates, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_begin_code() { validate_sparse_voxel_grid(grid_coordinates); @@ -244,7 +244,7 @@ npe_end_code() npe_function(erode_sparse_voxel_grid_internal) -npe_arg(grid_coordinates, dense_int, dense_long, dense_longlong) +npe_arg(grid_coordinates, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_begin_code() { validate_sparse_voxel_grid(grid_coordinates); @@ -327,7 +327,7 @@ npe_end_code() npe_function(subdivide_sparse_voxel_grid_internal) -npe_arg(grid_coordinates, dense_int, dense_long, dense_longlong) +npe_arg(grid_coordinates, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_begin_code() { validate_sparse_voxel_grid(grid_coordinates); @@ -383,7 +383,7 @@ npe_end_code() npe_function(sparse_voxel_grid_to_hex_mesh_internal) -npe_arg(grid_coordinates, dense_int, dense_long, dense_longlong) +npe_arg(grid_coordinates, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(gx, double) // voxel size along x npe_arg(gy, double) // voxel size along y npe_arg(gz, double) // voxel size along z @@ -471,7 +471,7 @@ Find the indices of the voxels which lie on the boundary of a sparse voxel grid )Qu8mg5v7"; npe_function(sparse_voxel_grid_boundary) -npe_arg(grid_coordinates, dense_int, dense_long, dense_longlong) +npe_arg(grid_coordinates, dense_int32, dense_int64, dense_uint32, dense_uint64) // npe_doc(sparse_voxel_grid_boundary_doc) npe_begin_code() { diff --git a/src/voxelize_triangle_mesh.cpp b/src/voxelize_triangle_mesh.cpp index 8476242..48152cc 100644 --- a/src/voxelize_triangle_mesh.cpp +++ b/src/voxelize_triangle_mesh.cpp @@ -67,7 +67,7 @@ void voxelize_triangle_mesh(const VertexMat& v, const FaceMat& f, npe_function(_voxelize_triangle_mesh_internal) npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_long, dense_longlong) +npe_arg(f, dense_int32, dense_int64, dense_uint32, dense_uint64) npe_arg(vox_origin, dense_double) npe_arg(vox_size, npe_matches(vox_origin)) npe_begin_code() diff --git a/tests/test_examples.py b/tests/test_examples.py index e58c87f..433ecc1 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -601,8 +601,8 @@ def test_ray_mesh_intersection(self): p22 = o2[mask2] + t2[mask2, np.newaxis] * d[mask2] self.assertTrue(np.allclose(p21, p22, atol=1e-5)) - self.assertTrue(np.alltrue(mask1 == mask2)) - self.assertTrue(np.alltrue(fid2 == fid1)) + self.assertTrue(np.all(mask1 == mask2)) + self.assertTrue(np.all(fid2 == fid1)) self.assertTrue(np.allclose(bc2, bc1)) self.assertTrue(np.allclose(t1, t2))