Skip to content

Commit aa09a61

Browse files
authored
Merge pull request #290 from Arktetra/main
add bindings for binding_box_diagonal
2 parents 6f39d40 + 0a19fcf commit aa09a61

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Wheels
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main

src/bounding_box_diagonal.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include "default_types.h"
2+
#include <igl/bounding_box_diagonal.h>
3+
#include <nanobind/nanobind.h>
4+
#include <nanobind/eigen/dense.h>
5+
6+
namespace nb = nanobind;
7+
using namespace nb::literals;
8+
9+
namespace pyigl {
10+
auto bounding_box_diagonal(
11+
const nb::DRef<const Eigen::MatrixXd>& V
12+
) {
13+
return igl::bounding_box_diagonal(V);
14+
}
15+
}
16+
17+
void bind_bounding_box_diagonal(nb::module_ &m) {
18+
m.def("bounding_box_diagonal", &pyigl::bounding_box_diagonal,
19+
"V"_a,
20+
R"(Compute the length of the diagonal of a given meshes axis-aligned bounding
21+
22+
@param[in] V #V by 3 list of vertex/point positions
23+
@return length of bounding box diagonal)"
24+
);
25+
}

tests/test_all.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ def test_triangle():
566566
def test_misc():
567567
V,F = igl.icosahedron()
568568
BV,BF = igl.bounding_box(V,pad=1.0)
569+
L = igl.bounding_box_diagonal(V)
569570
R,C,B = igl.circumradius(V,F)
570571
R = igl.inradius(V,F)
571572
K = igl.internal_angles(V,F)

0 commit comments

Comments
 (0)