43 #include <pybind11/include/pybind11/pybind11.h> 44 #include <pybind11/include/pybind11/embed.h> 47 #include <DecimaterPlugin.hh> 49 #include <OpenFlipper/BasePlugin/PythonFunctions.hh> 50 #include <OpenFlipper/PythonInterpreter/PythonTypeConversions.hh> 56 PYBIND11_EMBEDDED_MODULE(Decimater, m) {
58 QObject* pluginPointer = getPluginPointer(
"Decimater");
61 std::cerr <<
"Error Getting plugin pointer for Plugin-Decimater" << std::endl;
68 std::cerr <<
"Error converting plugin pointer for Plugin-Decimater" << std::endl;
74 py::class_< DecimaterPlugin,std::unique_ptr<DecimaterPlugin, py::nodelete> > decimater(m,
"Decimater");
79 decimater.def(py::init([plugin]() {
return plugin; }));
83 QCoreApplication::translate(
"PythonDocDecimater",
"Decimate a mesh. You can use the following parameters:\n\n\ 84 decimater_type [0 (Incremental), 1 (MC), 2 (Mixed)] \n\ 85 random_samples [For MC/Mixed] \n\ 86 incremental_percentage [For Mixed] \n\ 87 decimation_order [0 (by distance), 1 (by normal deviation), 2 (by edge length)] \n\ 92 aspect_ratio,independent_sets \n\ 98 decimater.decimate(5,\"random_samples=2;decimater_type=2;distance=0.0000001;decimation_order=0\") " ).toLatin1().data(),
99 py::arg(QCoreApplication::translate(
"PythonDocDecimater",
"ID of the object").toLatin1().data()),
100 py::arg(QCoreApplication::translate(
"PythonDocDecimater",
"List of Decimation parameters as a list separated by ';'").toLatin1().data()) );
void decimate(int _objID, QVariantMap _constraints)
decimate an object