@@ -21,7 +21,10 @@ namespace pyigl
2121
2222 Eigen::VectorXI b;
2323 Eigen::MatrixXN bc;
24- igl::boundary_conditions (V, Ele, C, P, BE, CE, CF, b, bc);
24+ if (!igl::boundary_conditions (V, Ele, C, P, BE, CE, CF, b, bc))
25+ {
26+ throw std::runtime_error (" boundary_conditions: failed to compute" );
27+ }
2528 return std::make_tuple (b, bc);
2629 }
2730}
@@ -38,6 +41,27 @@ void bind_boundary_conditions(nb::module_ &m)
3841 " BE" _a=Eigen::MatrixXI (),
3942 " CE" _a=Eigen::MatrixXI (),
4043 " CF" _a=Eigen::MatrixXI (),
41- R"(
42- Compute boundary conditions for automatic weights computation. WIP)" );
44+ R"( Compute boundary conditions for automatic weights computation. This
45+ function expects that the given mesh (V,Ele) has sufficient samples
46+ (vertices) exactly at point handle locations and exactly along bone and
47+ cage edges/faces.
48+ @param[in] V #V by dim list of domain vertices
49+ @param[in] Ele #Ele by simplex-size list of simplex indices
50+ @param[in] C #C by dim list of handle positions
51+ @param[in] P #P by 1 list of point handle indices into C
52+ @param[in] BE #BE by 2 list of bone edge indices into C
53+ @param[in] CE #CE by 2 list of cage edge indices into *P*
54+ @param[in] CF #CF by 3 list of (triangular) cage face indices into *P*
55+ @param[out] b #b list of boundary indices (indices into V of vertices which have
56+ known, fixed values)
57+ @param[out] bc #b by #weights list of known/fixed values for boundary vertices
58+ (notice the #b != #weights in general because #b will include all the
59+ intermediary samples along each bone, etc.. The ordering of the
60+ weights corresponds to [P;BE]
61+ throws error if boundary conditions are suspicious:
62+ P and BE are empty
63+ bc is empty
64+ some column of bc doesn't have a 0 (assuming bc has >1 columns)
65+ some column of bc doesn't have a 1 (assuming bc has >1 columns))"
66+ );
4367}
0 commit comments