Skip to content

Commit 3680cca

Browse files
author
Teseo Schneider
committed
fast_winding_number
1 parent d0caf0e commit 3680cca

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

src/fast_winding_number.cpp

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#include <common.h>
2+
#include <npe.h>
3+
#include <typedefs.h>
4+
#include <igl/fast_winding_number.h>
5+
6+
const char *ds_fast_winding_number_for_points = R"igl_Qu8mg5v7xxx1(
7+
Evaluate the fast winding number for point data, with default expansion
8+
order and beta (both are set to 2).
9+
10+
This function performes the precomputation and evaluation all in one.
11+
If you need to acess the precomuptation for repeated evaluations, use the
12+
two functions designed for exposed precomputation (described above).
13+
14+
Parameters
15+
----------
16+
P #P by 3 list of point locations
17+
N #P by 3 list of point normals
18+
A #P by 1 list of point areas
19+
Q #Q by 3 list of query points for the winding number
20+
21+
Returns
22+
-------
23+
WN #Q by 1 list of windinng number values at each query point
24+
25+
See also
26+
--------
27+
28+
29+
Notes
30+
-----
31+
32+
Examples
33+
--------
34+
35+
)igl_Qu8mg5v7xxx1";
36+
37+
npe_function(fast_winding_number_for_points)
38+
npe_doc(ds_fast_winding_number_for_points)
39+
npe_arg(p, dense_float, dense_double)
40+
npe_arg(n, npe_matches(p))
41+
npe_arg(a, npe_matches(p))
42+
43+
npe_arg(q, npe_matches(p))
44+
45+
npe_begin_code()
46+
assert_nonzero_rows(p, "p");
47+
assert_cols_equals(p, 3, "p");
48+
49+
assert_cols_equals(n, 3, "p");
50+
assert_rows_match(p, n, "p", "n");
51+
52+
assert_size_equals(a, p.rows(), "a");
53+
54+
assert_cols_equals(q, 3, "q");
55+
assert_nonzero_rows(q, "q");
56+
57+
EigenDenseLike<npe_Matrix_p> a_copy = a;
58+
59+
EigenDenseLike<npe_Matrix_p> wn;
60+
igl::fast_winding_number(p, n, a_copy, q, wn);
61+
return npe::move(wn);
62+
63+
npe_end_code()
64+
65+
66+
67+
68+
const char *ds_fast_winding_number_for_meshes = R"igl_Qu8mg5v7xxx2(
69+
Compute approximate winding number of a triangle soup mesh according to
70+
"Fast Winding Numbers for Soups and Clouds" [Barill et al. 2018].
71+
72+
Parameters
73+
----------
74+
V #V by 3 list of mesh vertex positions
75+
F #F by 3 list of triangle mesh indices into rows of V
76+
Q #Q by 3 list of query points for the winding number
77+
78+
Returns
79+
-------
80+
WN #Q by 1 list of windinng number values at each query point
81+
82+
See also
83+
--------
84+
85+
86+
Notes
87+
-----
88+
89+
Examples
90+
--------
91+
92+
)igl_Qu8mg5v7xxx2";
93+
94+
npe_function(fast_winding_number_for_meshes)
95+
npe_doc(ds_fast_winding_number_for_meshes)
96+
97+
npe_arg(v, dense_float, dense_double)
98+
npe_arg(f, dense_int, dense_long, dense_longlong)
99+
100+
npe_arg(q, npe_matches(v))
101+
102+
npe_begin_code()
103+
assert_valid_3d_tri_mesh(v, f);
104+
assert_cols_equals(q, 3, "q");
105+
assert_nonzero_rows(q, "q");
106+
107+
EigenDenseLike<npe_Matrix_v> wn;
108+
igl::fast_winding_number(v, f, q, wn);
109+
return npe::move(wn);
110+
111+
npe_end_code()

0 commit comments

Comments
 (0)