Finalized tutorial 704
This commit is contained in:
@@ -173,6 +173,7 @@ py::class_<Type> bind_eigen_2(py::module &m, const char *name,
|
||||
.def("cwiseQuotient", [](const Type &m1, const Type &m2) -> Type { return m1.cwiseQuotient(m2); })
|
||||
|
||||
/* Row and column-wise operations */
|
||||
.def("rowwiseSet", [](Type &m, const Type &m2) {return Type(m.rowwise() = Eigen::Matrix<Scalar, 1, Eigen::Dynamic>(m2));} )
|
||||
.def("rowwiseSum", [](const Type &m) {return Type(m.rowwise().sum());} )
|
||||
.def("rowwiseProd", [](const Type &m) {return Type(m.rowwise().prod());} )
|
||||
.def("rowwiseMean", [](const Type &m) {return Type(m.rowwise().mean());} )
|
||||
@@ -181,6 +182,7 @@ py::class_<Type> bind_eigen_2(py::module &m, const char *name,
|
||||
.def("rowwiseMinCoeff", [](const Type &m) {return Type(m.rowwise().minCoeff());} )
|
||||
.def("rowwiseMaxCoeff", [](const Type &m) {return Type(m.rowwise().maxCoeff());} )
|
||||
|
||||
.def("colwiseSet", [](Type &m, const Type &m2) {return Type(m.colwise() = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>(m2));} )
|
||||
.def("colwiseSum", [](const Type &m) {return Type(m.colwise().sum());} )
|
||||
.def("colwiseProd", [](const Type &m) {return Type(m.colwise().prod());} )
|
||||
.def("colwiseMean", [](const Type &m) {return Type(m.colwise().mean());} )
|
||||
|
||||
@@ -32,11 +32,13 @@ viewer = igl.viewer.Viewer()
|
||||
|
||||
def append_mesh(C_vis, F_vis, V_vis, V, F, color):
|
||||
F_vis.conservativeResize(F_vis.rows() + F.rows(), 3)
|
||||
# F_vis.setBottomRows(F.rows(), F + V_vis.rows())
|
||||
F_vis.setBottomRows(F.rows(), F + V_vis.rows())
|
||||
V_vis.conservativeResize(V_vis.rows() + V.rows(), 3)
|
||||
# V_vis.setBottomRows(V.rows(), V)
|
||||
V_vis.setBottomRows(V.rows(), V)
|
||||
C_vis.conservativeResize(C_vis.rows() + V.rows(), 3)
|
||||
# C_vis.setBottomRows(V.rows(), color)
|
||||
colorM = igl.eigen.MatrixXd(V.rows(), C_vis.cols())
|
||||
colorM.rowwiseSet(color)
|
||||
C_vis.setBottomRows(V.rows(), colorM)
|
||||
|
||||
|
||||
def update_visualization(viewer):
|
||||
|
||||
Reference in New Issue
Block a user