| 231 | "); |
| 232 | |
| 233 | static PyObject * |
| 234 | Geom_average_point(PyObject* self, PyObject* args) |
| 235 | { |
| 236 | auto api = PyUtilApiFunction("O", PyRunTimeErr, __func__); |
| 237 | PyObject* pdObj; |
| 238 | |
| 239 | if (!PyArg_ParseTuple(args, api.format, &pdObj)) { |
| 240 | return api.argsError(); |
| 241 | } |
| 242 | |
| 243 | // Get the vtkPolyData object from the Python object. |
| 244 | auto polydata = GetVtkPolyData(api, pdObj); |
| 245 | if (polydata == nullptr) { |
| 246 | return nullptr; |
| 247 | } |
| 248 | |
| 249 | double pt[3]; |
| 250 | cvPolyData cvPolydata(polydata); |
| 251 | if (sys_geom_AvgPt(&cvPolydata, pt) != SV_OK) { |
| 252 | api.error("Error calculating the average point for the polydata."); |
| 253 | return nullptr; |
| 254 | } |
| 255 | |
| 256 | return Py_BuildValue("[d,d,d]", pt[0], pt[1], pt[2]); |
| 257 | } |
| 258 | |
| 259 | //--------------------- |
| 260 | // Geom_classify_point |
nothing calls this directly
no test coverage detected