Skip to content

Commit 6712218

Browse files
committed
add variation on drawTriangle/drawQuads
1 parent 1c253e4 commit 6712218

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_DrawTool.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ void moduleAddDrawTool(py::module &m)
125125
});
126126

127127
// Draw mesh
128+
dt.def("drawTriangles", [](DrawTool *self, py::array_t<double>& positions, sofa::type::RGBAColor& color){
129+
self->drawTriangles(getPoints(positions), color);
130+
});
128131
dt.def("drawTriangles", [](DrawTool *self, BaseData* dpositions, BaseData* dtriangles, sofa::type::RGBAColor& color){
129132
auto positions = dynamic_cast<Data<sofa::type::vector<sofa::type::Vec3d>>*>(dpositions);
130133
if(!positions)
@@ -151,6 +154,9 @@ void moduleAddDrawTool(py::module &m)
151154
});
152155

153156
// Draw mesh
157+
dt.def("drawQuads", [](DrawTool *self, py::array_t<double>& positions, sofa::type::RGBAColor& color){
158+
self->drawQuads(getPoints(positions), color);
159+
});
154160
dt.def("drawQuads", [](DrawTool *self, BaseData* dpositions, BaseData* dquads, sofa::type::RGBAColor& color){
155161
auto positions = dynamic_cast<Data<sofa::type::vector<sofa::type::Vec3d>>*>(dpositions);
156162
if(!positions)

0 commit comments

Comments
 (0)